@font-face {
  font-family: Vividly;
  src: url("../fonts/Vividly-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: InterTight;
  src: url("../fonts/InterTight-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Bricolage;
  src: url("../fonts/BricolageGrotesque-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --pink: #fa7e80;
  --blue: #354d82;
  --yellow: #faee30;
  --paper: #fff8f4;
  --ink: #354d82;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--pink);
  color: var(--ink);
  font-family: InterTight, Arial, sans-serif;
  font-weight: 560;
  font-size: 1.02rem;
  line-height: 1.4;
}

button, input, textarea, select { font: inherit; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.6rem;
  top: -4rem;
  background: var(--blue);
  color: var(--yellow);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  z-index: 60;
  text-decoration: none;
  font-weight: 800;
}

.skip:focus { top: 0.6rem; }

.app {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app.guest {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: visible;
}

.pull-refresh {
  height: 0;
  overflow: hidden;
  display: grid;
  place-items: end center;
  color: var(--blue);
  font-weight: 800;
  pointer-events: none;
}

.pull-refresh span {
  background: var(--yellow);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 0.35rem;
}

.wrap {
  width: min(680px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem 1.4rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--blue) var(--pink);
}

html { scrollbar-width: thin; scrollbar-color: var(--blue) var(--pink); }

.wrap::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.wrap::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
  background: var(--pink);
}

.wrap::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
  background: var(--blue);
  border: 3px solid var(--pink);
  border-radius: 999px;
}

.wrap::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
  background: var(--yellow);
}
.app.guest .wrap {
  flex: 1 0 auto;
  min-height: auto;
  overflow: visible;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.7rem 1rem;
  background: var(--pink);
}

.brand { display: flex; align-items: center; gap: 0.55rem; min-width: 0; flex: 1; text-decoration: none; }

.mark-chip {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--blue);
  display: grid;
  place-items: center;
  flex: none;
}

.mark-chip img { width: 30px; height: 30px; }

.wordmark { height: 32px; width: auto; max-width: 100%; }

.hero-logo { width: min(100%, 440px); height: auto; display: block; margin: 0.2rem 0 0.4rem; }

.account-link,
.account-signout { display: none; }

.account-link {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--blue);
  color: var(--yellow);
  place-items: center;
  flex: none;
  text-decoration: none;
}

.account-link.is-active { background: var(--yellow); color: var(--blue); }

.account-signout { margin-top: 1.2rem; }

.text-button {
  background: var(--blue);
  color: var(--yellow);
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  font-weight: 800;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  flex: none;
  cursor: pointer;
}

h1, h2.display {
  font-family: Vividly, Bricolage, InterTight, sans-serif;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.84;
  color: var(--blue);
  margin: 0 0 0.55rem;
}

h1 { font-size: clamp(2.7rem, 13vw, 4.5rem); overflow-wrap: break-word; }
h1.greet {
  font-size: clamp(1.7rem, 7.6vw, 3.1rem);
  line-height: 1.05;
  white-space: nowrap;
}

h2 {
  font-family: Vividly, Bricolage, InterTight, sans-serif;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--blue);
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  margin: 1.3rem 0 0.55rem;
}

.lede { margin: 0 0 1rem; font-size: 1.08rem; }

.scribble { position: relative; display: inline-block; z-index: 0; }

.scribble::after {
  content: "";
  position: absolute;
  left: -0.05em;
  right: -0.04em;
  bottom: 0.05em;
  height: 0.16em;
  border-radius: 40% 60% 40% 70%;
  background: var(--yellow);
  z-index: -1;
  transform: rotate(-2deg);
}

.stack { display: grid; gap: 0.75rem; min-width: 0; max-width: 100%; }
.stack > *, .actions > *, label, .card, .panel { min-width: 0; max-width: 100%; }

.actions { display: grid; gap: 0.6rem; margin: 0.2rem 0 1.1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.btn-blue { background: var(--blue); color: var(--yellow); }
.btn-yellow { background: var(--yellow); color: var(--blue); }
.btn-ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }

form .btn, .actions .btn { width: 100%; }
.btn:disabled { opacity: 0.65; cursor: wait; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.55rem;
}

.page-head h1 {
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  font-size: clamp(2.2rem, 10vw, 3.2rem);
}

.page-head h2 { margin: 0; min-width: 0; }

.news-head { margin-top: 1.3rem; }

.heading-add {
  width: auto;
  flex: none;
  gap: 0.4rem;
  min-height: 2.7rem;
  padding: 0.4rem 0.95rem 0.4rem 0.75rem;
  font-size: 14.72px;
}

.heading-add svg { display: block; flex: none; }

.card {
  display: block;
  background: var(--blue);
  color: var(--paper);
  border-radius: 22px;
  padding: 0.95rem 1rem 1rem;
  text-decoration: none;
}

button.card {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.card h3, .panel h3 {
  font-family: Bricolage, InterTight, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
  line-height: 1.15;
  margin: 0.15rem 0 0.35rem;
}

.card form { margin-top: 0.75rem; }
.card h3 { color: var(--yellow); }

.news-banner {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(53, 77, 130, 0.12);
}

.card.has-banner,
.panel.has-banner { overflow: hidden; }

.card.has-banner > .news-banner,
.panel.has-banner > .news-banner {
  width: calc(100% + 2rem);
  max-width: none;
  margin: -0.95rem -1rem 0.85rem;
  border-radius: 19px 19px 0 0;
}


.file-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--blue);
  font-weight: 750;
}

.file-pick input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  cursor: pointer;
}

.file-pick-button,
.file-pick-name { position: relative; z-index: 1; pointer-events: none; }

.file-pick-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--blue);
  font-weight: 800;
}

.file-pick-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card p { margin: 0.2rem 0; color: var(--paper); }
.card.is-cancelled { box-shadow: inset 0 0 0 3px #b01220; }
.day-sheet .card.is-cancelled {
  background: #b01220;
  box-shadow: none;
}
.day-sheet .card.is-cancelled p,
.day-sheet .card.is-cancelled .meta { color: #fff; }
.day-sheet .card.is-cancelled h3,
.day-sheet .card.is-cancelled .absent-note,
.day-sheet .card.is-cancelled a.call-link { color: var(--yellow); }
.card.is-confirmed {
  background: #1c8c4e;
  box-shadow: none;
}
.card.is-confirmed h3,
.card.is-confirmed .confirm-note,
.card.is-confirmed a.call-link { color: var(--yellow); }
.card.is-confirmed p,
.card.is-confirmed .meta { color: #fff; }
.card .confirm-note { color: var(--yellow); font-weight: 800; }
.card .pending-note { color: #fff; font-weight: 800; }
.card .absent-note { color: #ffd0d4; font-weight: 800; }
.card .call-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin-top: 0.45rem;
}
.card a.call-link {
  color: var(--yellow);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
.card .meta, .meta { color: var(--pink); font-weight: 800; font-size: 0.92rem; margin: 0; }
.next-lesson > a:first-child {
  display: block;
  color: inherit;
  text-decoration: none;
}
.next-lesson a.meta {
  display: inline-block;
  margin-top: 0.45rem;
  text-decoration: none;
}
.next-lesson {
  background: var(--yellow);
  color: var(--blue);
  box-shadow: inset 0 0 0 3px var(--blue);
}
.next-lesson h3 { color: var(--blue); font-size: 1.65rem; }
.next-lesson p,
.next-lesson .next-when { color: var(--blue); }
.next-lesson .meta { color: var(--pink); }
.next-lesson .next-when {
  margin-top: 0.15rem;
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.panel .meta { color: var(--blue); }

.panel {
  background: var(--paper);
  color: var(--blue);
  border: 3px solid var(--blue);
  border-radius: 22px;
  padding: 0.95rem 1rem 1rem;
}

.panel h1, .panel h2 { margin-top: 0; }
.panel h2 { font-size: 1.9rem; }

.panel p { margin: 0.25rem 0; }

.prose, .lede, .card p, .card h3, .user-mail { overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; line-height: 1.45; }

label { display: grid; gap: 0.35rem; font-weight: 800; }

input, textarea, select, .combo-toggle {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: var(--paper);
  color: var(--blue);
  border-radius: 999px;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.combo-field { display: grid; gap: 0.35rem; font-weight: 800; }

.combo { position: relative; }

.combo-toggle {
  position: relative;
  display: block;
  padding-right: 2.4rem;
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.combo-toggle::after {
  content: "";
  position: absolute;
  right: 1.05rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: translateY(-70%) rotate(45deg);
}

.combo-panel {
  margin-top: 0.35rem;
  padding: 0.4rem;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--blue);
}

.combo-search { margin-bottom: 0.35rem; }

.combo-list {
  max-height: 12rem;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.combo-list button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 750;
  text-align: left;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.combo-list button:hover,
.combo-list button.is-active { background: var(--yellow); }

.combo-empty { margin: 0; padding: 0.55rem 0.7rem; font-weight: 750; }

.card input, .card textarea, .card select { background: var(--pink); }

textarea { border-radius: 18px; min-height: 130px; resize: vertical; }

input[type="date"],
input[type="time"] {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-right: 2.4rem;
  accent-color: var(--blue);
  font-variant-numeric: tabular-nums;
}

input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  transform: translateY(-50%);
  cursor: pointer;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  padding: 0;
}

@supports (-webkit-touch-callout: none) {
  input[type="date"],
  input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
  }
}

.check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 750;
}

.check input { width: 1.25rem; height: 1.25rem; min-height: 0; box-shadow: none; accent-color: var(--blue); }

fieldset.lesson-pick {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.45rem;
}

fieldset.lesson-pick legend {
  padding: 0;
  font-weight: 800;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }

.alert, .banner {
  border-radius: 16px;
  padding: 0.8rem 0.95rem;
  margin: 0 0 0.9rem;
  font-weight: 750;
}

.alert { background: var(--blue); color: var(--yellow); }
.banner { background: var(--yellow); color: var(--blue); }

.pill {
  display: inline-block;
  background: var(--yellow);
  color: var(--blue);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.pill-teacher {
  background: var(--blue);
  color: var(--yellow);
}

.pill-admin {
  background: var(--pink);
  color: var(--blue);
}

.pill-child {
  background: #fff;
  color: var(--blue);
  box-shadow: inset 0 0 0 2px var(--blue);
}

.pill.off {
  background: transparent;
  color: var(--blue);
  box-shadow: inset 0 0 0 2px var(--blue);
}

.directory-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin: 0 0 1rem;
}

.directory-tools .role-filter { margin: 0; }

.role-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.role-filter a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.holiday-catalog { margin-bottom: 1.2rem; }

dialog.form-dialog .holiday-catalog { margin-bottom: 0; }
.holiday-year { margin: 0.15rem 0 0.35rem; }
.holiday-year summary { font-weight: 800; cursor: pointer; }
.holiday-options { display: grid; gap: 0.45rem; margin: 0.55rem 0 0.35rem; }
.holiday-option small { font-weight: 650; color: var(--pink); }
.holiday-option input:disabled + span { opacity: 0.72; }

.role-filter a[aria-current="page"] {
  background: var(--blue);
  color: var(--yellow);
  box-shadow: none;
}

.user-card { padding: 0; overflow: hidden; }

.user-search { margin: 0 0 0.85rem; }

.user-count { margin: 0 0 0.85rem; font-weight: 800; }

.user-table-wrap {
  border: 3px solid var(--blue);
  border-radius: 22px;
  background: var(--paper);
  color: var(--blue);
  overflow: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.user-table th {
  padding: 0.65rem 0.8rem;
  border-bottom: 2px solid var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}

.user-table td {
  max-width: 16rem;
  padding: 0.45rem 0.8rem;
  border-top: 1px solid rgba(53, 77, 130, 0.16);
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.user-table td:first-child { font-weight: 800; }

.user-table a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.user-table tr.user-row { cursor: pointer; }

.user-table tr.user-row:hover,
.user-table tr.user-row:focus {
  background: rgba(53, 77, 130, 0.06);
  outline: none;
}

.user-table .pill { white-space: nowrap; }

.user-table .pill + .pill { margin-left: 0.3rem; }

.user-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}

.user-pager button {
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.user-pager button[aria-current="page"] {
  background: var(--blue);
  color: var(--yellow);
  box-shadow: none;
}

.user-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

dialog.form-dialog .user-tools { margin-top: 0.2rem; padding: 0; }

dialog.form-dialog .user-extra h3 { margin: 0; font-size: 1.05rem; }

.user-card > details > summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 58px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  list-style: none;
}

.user-card > details > summary::-webkit-details-marker { display: none; }

.user-card > details > summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.15rem;
  border-right: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
  transform: rotate(45deg) translateY(-2px);
  flex: none;
}

.user-card > details[open] > summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.user-card > details > summary:hover { background: rgba(53, 77, 130, 0.06); }

.user-card > details[open] > summary { box-shadow: inset 0 -2px 0 var(--blue); }

.permit {
  border: 2px solid rgba(53, 77, 130, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.permit summary {
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-weight: 800;
}

.permit-body { padding: 0 0.9rem 0.85rem; }

.permit-body p { margin-top: 0; }

dialog.call-hint {
  width: min(28rem, calc(100vw - 2rem));
  border: 0;
  border-radius: 22px;
  padding: 1.2rem 1.15rem 1.1rem;
  color: var(--blue);
  background: var(--paper);
}

dialog.call-hint::backdrop { background: rgba(53, 77, 130, 0.46); }

dialog.call-hint h2 { margin: 0 0 0.4rem; }

dialog.call-hint .call-person { margin: 0.8rem 0; }

dialog.call-hint a { font-size: 1.25rem; font-weight: 800; }

dialog.call-hint .btn { width: 100%; }

.user-main {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}

.user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Bricolage, InterTight, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.12rem;
}

.user-meta {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.user-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: none;
}

.user-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  padding: 0 1rem 1rem;
}

.user-tools button {
  background: none;
  border: 0;
  padding: 0.35rem 0;
  min-height: 44px;
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.user-body.user-extra { padding-top: 0; }

.plan-list { display: grid; gap: 0.65rem; }

.plan-person {
  border: 3px solid var(--blue);
  border-radius: 22px;
  background: var(--paper);
  color: var(--blue);
  overflow: hidden;
}

.plan-person summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.75rem 1rem;
  list-style: none;
  cursor: pointer;
  font-weight: 800;
}

.plan-person summary::-webkit-details-marker { display: none; }

.plan-person summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(45deg);
  flex: none;
}

.plan-person[open] summary::after { transform: translateY(-2px) rotate(225deg); }

.plan-person-name { display: grid; gap: 0.1rem; min-width: 0; }

.plan-person-name small,
.plan-person-meta { font-size: 0.78rem; font-weight: 750; }

.plan-person-meta { margin-left: auto; text-align: right; }

.plan-person-meta.is-cancelled { color: #b01220; }

.plan-person > .plan-board { border-top: 1px solid rgba(53, 77, 130, 0.16); }

.plan-person.is-open > .plan-board { border-top: 0; }

.plan-board { width: 100%; min-width: 0; }

.plan-scroll {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  padding: 0.7rem 0.75rem 0.85rem;
}

.plan-sheet {
  position: relative;
  width: 100%;
  max-width: 100%;
  --name: 2.6rem;
  --gap: 0.4rem;
  --hours: 12;
  --slots: 720;
}

.plan-grid {
  display: grid;
  grid-template-columns: var(--name) var(--gap) repeat(var(--slots), minmax(0, 1fr));
  row-gap: 0.28rem;
  width: 100%;
}

.plan-dayname {
  grid-column: 1;
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
}

.plan-dayname b { display: block; font-weight: 750; }

.plan-dayname.is-today { color: var(--pink); }

.plan-ruler {
  grid-column: 3 / -1;
  grid-row: 1;
  position: relative;
  width: auto;
  min-width: 0;
  height: 1.15rem;
}

.plan-ruler-span {
  display: block;
  width: 100%;
  height: 0;
}

.plan-hour {
  position: absolute;
  top: 0;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  transform: translateX(-50%);
}

.plan-hour.is-start { transform: none; }

.plan-hour.is-end { transform: translateX(-100%); }

.plan-track {
  grid-column: 3 / -1;
  min-width: 0;
  border-radius: 10px;
  background-color: rgba(53, 77, 130, 0.08);
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / var(--hours) - 1px),
    rgba(53, 77, 130, 0.22) calc(100% / var(--hours) - 1px),
    rgba(53, 77, 130, 0.22) calc(100% / var(--hours))
  );
}

button.plan-track {
  position: relative;
  justify-self: stretch;
  align-self: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

button.plan-track::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: var(--slot-left, 0);
  width: calc(100% * 30 / var(--slots));
  border-radius: 8px;
  background: rgba(53, 77, 130, 0.18);
  box-shadow: inset 0 0 0 2px var(--blue);
  opacity: 0;
  pointer-events: none;
}

button.plan-track.is-slot::after { opacity: 1; }

button.plan-track:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.plan-track.is-today { background-color: rgba(250, 238, 48, 0.55); }

.plan-track.is-closed {
  background-image: repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(53, 77, 130, 0.14) 5px, rgba(53, 77, 130, 0.14) 6px);
}

.plan-closed {
  margin: 0.35rem 0 0.8rem;
  font-weight: 750;
  color: var(--blue);
}

.plan-nowline,
.plan-nowline * { pointer-events: none; }

.plan-nowline {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #d01220;
  left: calc(var(--name) + var(--gap) + (100% - var(--name) - var(--gap)) * var(--at, 0));
}

.plan-nowlabel {
  position: absolute;
  top: 1.25rem;
  left: 0.4rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: #d01220;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1rem;
  white-space: nowrap;
}

.plan-nowline.is-late .plan-nowlabel { left: auto; right: 0.4rem; }

.plan-block {
  position: relative;
  z-index: 2;
  display: block;
  align-self: center;
  min-width: 0;
  max-width: 100%;
  height: 2.05rem;
  margin: 0;
  padding: 0.14rem 0.32rem;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.15;
}

.plan-block b,
.plan-block-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-block b { font-size: 0.62rem; }

.plan-sheet.is-staff .plan-block.is-unterricht {
  display: flex;
  align-items: center;
}

.plan-sheet.is-staff .plan-block.is-unterricht > b,
.plan-sheet.is-staff .plan-block.is-unterricht > .plan-from {
  display: none;
}

.plan-sheet.is-staff .plan-block.is-unterricht .plan-block-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
}

.plan-sheet.is-staff {
  --day: 2.6rem;
  --teacher: 7.6rem;
  --name: calc(var(--day) + var(--teacher));
}

.plan-daygap {
  grid-column: 1 / -1;
  height: 0.7rem;
  margin-top: 0.35rem;
  border-top: 2px solid rgba(53, 77, 130, 0.55);
}

.plan-sheet.is-staff .plan-dayname {
  border-left: 3px solid var(--blue);
  padding-left: 0.15rem;
}

.plan-sheet.is-staff .plan-dayname.is-today { border-left-color: var(--pink); }

.plan-sheet.is-staff .plan-grid {
  grid-template-columns: var(--day) var(--teacher) var(--gap) repeat(var(--slots), minmax(0, 1fr));
}

.plan-sheet.is-staff .plan-ruler,
.plan-sheet.is-staff .plan-track { grid-column: 4 / -1; }

.plan-sheet.is-staff .plan-nowline {
  left: calc(var(--day) + var(--teacher) + var(--gap) + (100% - var(--day) - var(--teacher) - var(--gap)) * var(--at, 0));
}

.plan-teacher {
  grid-column: 2;
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-right: 0.35rem;
  padding-left: 0.4rem;
  border-left: 3px solid transparent;
  background: var(--paper);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.15;
}

.plan-teacher-first,
.plan-teacher-last {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-teacher-first {
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.1;
}

.plan-teacher-last {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
}

.plan-teacher small {
  font-size: 0.62rem;
  font-weight: 750;
}

button.plan-teacher {
  width: 100%;
  margin: 0;
  padding: 0.15rem 0.35rem 0.15rem 0.4rem;
  border: 0;
  border-left: 3px solid transparent;
  background: var(--paper);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.plan-teacher.is-picked {
  border-left-color: var(--yellow);
}

.plan-sheet.is-staff .plan-idle {
  grid-column: 2 / -1;
  align-self: center;
  min-width: 0;
}

.plan-idle summary {
  width: fit-content;
  max-width: 100%;
  padding: 0.2rem 0.15rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.plan-idle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0 0.1rem;
}

.plan-idle-list button {
  min-height: 32px;
  padding: 0.2rem 0.55rem;
  border: 2px solid var(--blue);
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.plan-idle-list button:hover,
.plan-idle-list button:focus-visible {
  background: var(--yellow);
  outline: none;
}

.plan-off {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(176, 18, 32, 0.58);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.plan-block.is-unterricht { background: var(--blue); color: var(--yellow); }

.plan-block.is-klavier { background: var(--blue); color: var(--yellow); }

.plan-block.is-gitarre { background: var(--yellow); color: var(--blue); }

.plan-block.is-schlagzeug { background: var(--pink); color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }

.plan-block.is-querfloete { background: #b7e6c9; color: var(--blue); }

.plan-block.is-veranstaltung { background: var(--yellow); color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  font-weight: 750;
}

.plan-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.plan-legend span::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 3px;
  background: var(--blue);
}

.plan-legend .is-klavier::before { background: var(--blue); }

.plan-legend .is-gitarre::before { background: var(--yellow); }

.plan-legend .is-schlagzeug::before { background: var(--pink); box-shadow: inset 0 0 0 2px var(--blue); }

.plan-legend .is-querfloete::before { background: #b7e6c9; box-shadow: none; }

.instrument-label { margin: 0; font-weight: 800; }

.instrument-picks { display: grid; gap: 0.35rem; }

.plan-now { margin: 0.9rem 0 0; font-weight: 800; }

.month-nav + .plan-list,
.month-nav + .plan-person,
.plan-now + .plan-list,
.plan-now + .plan-person { margin-top: 1.15rem; }

.user-body { padding: 0.85rem 1rem 1rem; }

.user-mail { margin: 0; font-weight: 750; }

.user-link { margin: 0 0 0.75rem; font-weight: 750; }

.name-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .name-pair { grid-template-columns: 1fr; }
}

.card .pill { background: var(--pink); }

.office-group { margin-top: 1.25rem; }

.office-group h2 { margin-bottom: 0.55rem; }

.office-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.office-nav a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.office-nav a[aria-current="page"] {
  background: var(--blue);
  color: var(--yellow);
  box-shadow: none;
}

.office-compact h3 { margin-bottom: 0.2rem; }

.chart-body {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  column-gap: 0.4rem;
  align-items: start;
}

.chart-y {
  position: relative;
  height: 11.5rem;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 750;
  text-align: right;
}

.chart-y span {
  position: absolute;
  right: 0;
  line-height: 1;
  transform: translateY(-50%);
}

.chart-area { min-width: 0; }

.chart-plot {
  position: relative;
  height: 11.5rem;
  border-bottom: 2px solid var(--blue);
}

.chart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 11.5rem;
  display: block;
  overflow: visible;
}

.chart-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chart-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 0.35rem;
}

.chart-months span {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.95rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  font-weight: 750;
}

.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.swatch {
  width: 1.15rem;
  height: 0.35rem;
  border-radius: 99px;
}

.swatch.is-klavier { background: var(--blue); }

.swatch.is-gitarre { background: var(--yellow); }

.swatch.is-schlagzeug { background: var(--pink); }

.swatch.is-querfloete { background: #b7e6c9; }

.swatch.is-absences {
  width: 1.35rem;
  height: 0;
  border-radius: 0;
  background: none;
  border-top: 2.5px dashed var(--blue);
}

.chart-key {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.chart-key li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-weight: 700;
}

.chart-note { margin: 0.75rem 0 0; }

.office-account {
  margin: 1.3rem 0 0.3rem;
  text-align: center;
}

.office-account a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.back {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-weight: 800;
  text-decoration: none;
}

.cal-head, .month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}

.month-nav strong { min-width: 0; text-align: center; overflow-wrap: break-word; }

.month-nav a {
  background: var(--blue);
  color: var(--yellow);
  text-decoration: none;
  font-weight: 800;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 0.8rem;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
}

.month-nav.is-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.month-nav.is-tools > a { justify-self: start; }

.month-nav.is-tools > strong { justify-self: center; }

.month-nav-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.month-nav-end .btn {
  width: auto;
  min-height: 44px;
  padding: 0 0.95rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

.weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays span { text-align: center; font-size: 0.75rem; font-weight: 800; padding-top: 0.35rem; }

.cal-grid a, .cal-grid span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 800;
  position: relative;
  color: var(--blue);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.cal-grid a.has { background: rgba(255, 248, 244, 0.55); }
.cal-grid a.selected { background: var(--yellow); }
.cal-grid a.today {
  background: var(--pink);
  box-shadow: inset 0 0 0 2px var(--blue);
}

.cal-grid a.is-closed {
  background-image: repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(53, 77, 130, 0.18) 3px, rgba(53, 77, 130, 0.18) 4px);
}

.cal-grid a.today .dot-event,
.cal-grid a.today .dot-other {
  box-shadow: 0 0 0 1px var(--paper);
}

.cal-grid .cal-entries { display: none; }

.day-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.day-sheet-head h2 { margin: 0; }

.day-pop-close { display: none; }

.cal-grid .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: auto;
  height: 6px;
  aspect-ratio: auto;
  pointer-events: none;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--blue);
  flex: none;
}

.dot-event {
  background: var(--pink);
}

.dot-cancel {
  background: #b01220;
  box-shadow: 0 0 0 1px var(--paper);
}

.dot-other {
  width: 4px;
  height: 4px;
  background: var(--pink);
}

.legal {
  flex: none;
  margin: 0;
  padding: 0.35rem 1rem calc(0.4rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.84rem;
}
.legal a { font-weight: 800; }

.legal-bar {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.6rem 0.8rem 0.5rem;
  background: transparent;
  color: #ffd0d0;
  font-size: 0.82rem;
}
.legal-bar a {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.app:not(.guest) .legal-page { display: none; }

.notice h2 { font-size: 1.7rem; margin-top: 1.3rem; }
.notice p { margin: 0.3rem 0 0.75rem; }

.tabbar {
  position: relative;
  z-index: 20;
  flex: none;
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--blue);
  margin-top: 0;
  padding: 0.7rem 0.2rem 0;
}

.tabbar.tabs-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.tabbar.tabs-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 959px) {
  .app:not(.guest) .wrap { padding-bottom: calc(1.4rem + 18px); }
  .app:not(.guest) .wrap:has(.stage) { padding-bottom: calc(0.35rem + 18px); }
  .app:not(.guest) .wrap:has(.inbox) { padding-bottom: calc(0.6rem + 18px); }

  .tabbar { flex-shrink: 0; }

  .topbar .logout-form { display: none; }

  .account-link { display: grid; }

  .account-signout { display: block; }

  .tabbar > a[href="/lehrer/termine"],
  .tabbar > a[href="/konto"] { display: none; }

  .tabbar.tabs-4:has(> a[href="/konto"]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tabbar.tabs-5:has(> a[href="/konto"]):not(:has(> a[href="/lehrer/termine"])) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tabbar.tabs-6:has(> a[href="/lehrer/termine"]) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tabbar.tabs-6:not(:has(> a[href="/lehrer/termine"])) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tabbar.tabs-7:has(> a[href="/lehrer/termine"]) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.tab-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 1px);
  width: 100%;
  max-width: 100%;
  height: 18px;
  display: block;
  fill: var(--blue);
  pointer-events: none;
}

.tabbar > a {
  position: relative;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  text-decoration: none;
  color: #ffd0d0;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 14px;
}

.tabbar > a.active { background: var(--yellow); color: var(--blue); }

.tabbar > a > .tab-label {
  display: block;
  max-width: 100%;
  text-align: center;
  line-height: 1.05;
}

.tab-icon {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  flex: none;
}

.badge {
  position: absolute;
  z-index: 1;
  top: -0.38rem;
  right: -0.55rem;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  max-width: 1.15rem;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  background: var(--pink);
  color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.tabbar > a.active .badge {
  background: var(--blue);
  color: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow);
}

.push-toast {
  position: fixed;
  z-index: 40;
  left: 0.7rem;
  right: 0.7rem;
  bottom: calc(118px + env(safe-area-inset-bottom));
  width: auto;
  max-width: 640px;
  margin-inline: auto;
  background: var(--yellow);
  color: var(--blue);
  border-radius: 18px;
  padding: 0.8rem 1rem;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(53, 77, 130, 0.28);
  display: grid;
  gap: 0.15rem;
}

.push-toast strong { font-family: Bricolage, InterTight, sans-serif; font-size: 1.05rem; }

.user-card + .user-card, .stack > * + * { margin-top: 0; }

@media (max-width: 420px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .plan-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
  }

  .plan-sheet {
    width: calc(var(--name) + var(--gap) + var(--hours) * 4.6rem);
    max-width: none;
    min-width: calc(var(--name) + var(--gap) + var(--hours) * 4.6rem);
  }

  .plan-dayname {
    position: sticky;
    left: 0;
  }
}

@media (max-width: 640px) {
  .plan-hour.is-minor { display: none; }

  .month-nav.is-tools > strong { grid-column: 1 / -1; grid-row: 1; }

  .month-nav.is-tools > a { grid-column: 1; grid-row: 2; }

  .month-nav-end { grid-column: 2 / -1; grid-row: 2; }
}

@media (min-width: 960px) {
  .topbar,
  .wrap,
  .tabbar {
    width: min(1200px, calc(100% - 4rem));
    margin-left: auto;
    margin-right: auto;
  }

  .topbar { padding-left: 0; padding-right: 0; }

  .app.guest .topbar,
  .app.guest .wrap { width: min(560px, calc(100% - 2rem)); }

  h1 { font-size: 3.2rem; 
       margin-top: 10px; }

  .page-head { margin-top: 10px; }

  .tabbar {
    order: 2;
    display: flex;
    margin-top: 0;
    margin-bottom: 0.25rem;
    padding: 0.35rem 0.4rem 0.35rem;
    border-radius: 18px;
  }

  .tabbar > a { flex: 1 1 0; min-width: 0; }

  .legal-bar { display: none; }

  .app:not(.guest) .legal-page { display: block; }

  .legal {
    order: 4;
    width: min(1200px, calc(100% - 4rem));
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 0.85rem;
  }

  .app.guest .legal { width: min(560px, calc(100% - 2rem)); }

  .tab-wave { display: none; }

  .wrap { order: 3; }

  .tabbar > a {
    flex-direction: row;
    gap: 0.4rem;
    font-size: 0.84rem;
  }

  .tabbar.tabs-5 > a,
  .tabbar.tabs-6 > a { font-size: 0.74rem; }

  .cal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem);
    gap: 1.25rem;
    align-items: stretch;
  }

  .cal-layout > .panel,
  .cal-layout > .day-sheet { min-width: 0; }

  .cal-day h2 { margin-top: 0; }

  .cal-layout > .day-sheet {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: auto;
    height: 0;
    min-height: 100%;
    max-height: none;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--blue);
    border: 3px solid var(--blue);
    border-radius: 22px;
    padding: 0.95rem 1rem 1rem;
    box-shadow: none;
    animation: none;
    transform: none;
    visibility: visible;
  }

  .cal-layout .day-sheet-head { flex: none; }

  .cal-layout .day-sheet .stack {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    grid-template-columns: none;
    padding-right: 0.2rem;
  }

  .app:has(.cal-layout) .wrap { overflow: auto; }

  .sheet-grab,
  .cal-layout .day-pop-close,
  .cal-layout .sheet-backdrop { display: none; }

  .cal-grid { gap: 6px; }

  .cal-grid > a,
  .cal-grid > span {
    aspect-ratio: auto;
    height: auto;
    min-width: 0;
    min-height: 5.4rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.32rem 0.28rem 0.28rem;
    border-radius: 12px;
    text-align: left;
    background: #fff;
    box-shadow: inset 0 0 0 2px rgba(53, 77, 130, 0.18);
  }

  .cal-grid > a.has { background: #fff; }

  .cal-grid > a.selected {
    background: var(--yellow);
    box-shadow: inset 0 0 0 2px var(--blue);
  }

  .cal-grid > a.today {
    background: var(--pink);
    box-shadow: inset 0 0 0 2px var(--blue);
  }

  .cal-grid a span {
    aspect-ratio: auto;
    min-height: 0;
    height: auto;
    display: block;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .cal-num {
    font-size: 0.95rem;
    line-height: 1.1;
    text-align: center;
  }

  .cal-grid .cal-entries {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.4rem;
    min-width: 0;
  }

  .cal-entry {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1.25;
  }

  .cal-entry.is-event { color: #9d3040; }

  .cal-entry.is-cancelled,
  .cal-grid a.today .cal-entry.is-cancelled,
  .cal-grid a.selected .cal-entry.is-cancelled { color: #b01220; }

  .cal-entry.is-confirmed,
  .cal-grid a.today .cal-entry.is-confirmed,
  .cal-grid a.selected .cal-entry.is-confirmed { color: #137a3a; }

  .cal-grid a.today .cal-entry,
  .cal-grid a.today .cal-entry.is-event { color: var(--blue); }

  .cal-grid .dots { display: none; }

  .desk-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
    align-items: start;
  }

  .desk-split h2 { margin-top: 0.2rem; }

  .desk-cards { grid-template-columns: 1fr 1fr; }

  .actions { display: flex; flex-wrap: wrap; }
  .actions .btn, form .btn { width: auto; min-width: 11rem; }

  .push-toast { bottom: 3.2rem; }
}

.after { margin-top: 0.8rem; }
.later { margin-top: 1rem; }
dialog.delete-confirm {
  width: min(22rem, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  margin: auto;
  padding: 1.2rem 1.1rem 1.05rem;
  border: 3px solid var(--blue);
  border-radius: 22px;
  background: var(--paper);
  color: var(--blue);
  box-shadow: 0 18px 42px rgba(53, 77, 130, 0.28);
}

dialog.delete-confirm::backdrop {
  background: rgba(53, 77, 130, 0.46);
}

dialog.delete-confirm p {
  margin: 0 0 0.95rem;
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.28rem;
  font-weight: 720;
  line-height: 1.25;
  text-wrap: balance;
}

dialog.delete-confirm .btn {
  width: 100%;
  min-width: 0;
}

dialog.parent-note {
  width: min(24rem, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  margin: auto;
  padding: 1.2rem 1.1rem 1.05rem;
  border: 3px solid var(--blue);
  border-radius: 22px;
  background: var(--paper);
  color: var(--blue);
  box-shadow: 0 18px 42px rgba(53, 77, 130, 0.28);
}

dialog.parent-note::backdrop {
  background: rgba(53, 77, 130, 0.62);
}

dialog.parent-note .parent-note-from {
  margin: 0 0 0.45rem;
  color: var(--pink);
  font-weight: 800;
}

dialog.parent-note .parent-note-body {
  margin: 0 0 0.85rem;
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.2rem;
  font-weight: 720;
  line-height: 1.35;
  white-space: pre-wrap;
}

dialog.parent-note .parent-note-more {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 750;
}

dialog.parent-note .parent-note-error {
  margin: 0.55rem 0 0;
  font-weight: 800;
}

dialog.parent-note .parent-note-actions {
  display: grid;
  gap: 0.5rem;
}

dialog.parent-note .parent-note-reply {
  display: grid;
  gap: 0.55rem;
}

dialog.parent-note .parent-note-reply[hidden] { display: none !important; }

dialog.parent-note .parent-note-reply textarea {
  width: 100%;
  min-height: 5.5rem;
}

.team-log.is-reply { gap: 0.35rem; }

.team-msg.is-plain { padding: 0.4rem 0.6rem; }

.team-msg.is-plain .team-body { margin-top: 0.05rem; }

.team-msg.is-plain:hover,
.team-msg.is-plain:focus-within { padding-right: 0.6rem; }

.poll {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 2px solid rgba(53, 77, 130, 0.25);
}

.poll h2 { margin: 0; }

.poll-fields {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.poll-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: end;
}

.poll-results,
.poll-choices {
  display: grid;
  gap: 0.5rem;
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
}

.poll-results li,
.poll-choice {
  position: relative;
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  overflow: hidden;
  border: 2px solid var(--blue);
  border-radius: 16px;
  background: #fff;
  font-weight: 750;
}

.poll-choice { cursor: pointer; }

.poll-track {
  display: block;
  height: 0.72rem;
  margin-top: 0.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(53, 77, 130, 0.12);
}

.poll-fill {
  display: block;
  width: var(--share, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
}

.poll-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.2rem;
}

.poll-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  min-width: 0;
}

.poll-copy strong { font-size: 1.02rem; }

.poll-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.poll-score b {
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.2rem;
  font-weight: 750;
}

.poll-score small {
  margin-top: 0.18rem;
  font-size: 0.75rem;
  font-weight: 750;
}

.poll-names {
  font-size: 0.82rem;
  font-weight: 650;
}

.poll-total {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  font-weight: 750;
}

.poll-results li.is-mine,
.poll-choice:has(input:checked) {
  background: #fff;
  box-shadow: inset 0 0 0 3px var(--yellow);
}

.poll-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  box-shadow: none;
  pointer-events: none;
}

.poll-choice:has(input:focus-visible) { outline: 2px solid var(--pink); outline-offset: 2px; }

.poll-choice .poll-mine { display: none; font-weight: 650; }

.poll-choice:has(input:checked) .poll-mine { display: inline; }


.editor {
  position: relative;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.editor-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem;
  border-bottom: 2px solid var(--blue);
  border-radius: 16px 16px 0 0;
  background: var(--paper);
}

.editor-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.editor-bar button.editor-text {
  width: auto;
  padding: 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 750;
}

.editor-bar button.editor-text.is-on { padding-right: 1.7rem; }

.title-pick { position: relative; display: inline-flex; }

.editor-bar button.title-clear {
  position: absolute;
  top: 50%;
  right: 0.28rem;
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--blue);
  color: var(--yellow);
  transform: translateY(-50%);
}

.editor-bar button.title-clear:hover,
.editor-bar button.title-clear:focus-visible {
  background: var(--blue);
  color: var(--yellow);
}

.editor-bar button.title-clear svg {
  width: 0.72rem;
  height: 0.72rem;
  stroke-width: 2.6;
}

.editor-bar button:hover,
.editor-bar button:focus-visible { background: #fff; }

.editor-bar button.editor-text.is-on,
.editor-bar button.editor-text.is-on:hover,
.editor-bar button.editor-text.is-on:focus-visible { background: var(--yellow); }

.editor-bar svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-u { text-decoration: underline; }

.editor-a {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: currentColor;
}

.editor-color { position: relative; }

.editor-colors {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.25rem);
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 2.1rem);
  gap: 0.15rem;
  padding: 0.3rem;
  border: 2px solid var(--blue);
  border-radius: 12px;
  background: #fff;
}

.editor-colors[hidden] { display: none; }

.editor-colors button.is-on { box-shadow: inset 0 0 0 2px var(--blue); }

.editor-dot {
  display: block;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--blue);
  border: 1px solid var(--blue);
}

.editor-dot-green { background: #2f7d32; }
.editor-dot-lime { background: #5c7c10; }
.editor-dot-teal { background: #0f6f78; }
.editor-dot-blue { background: #1a4f9c; }
.editor-dot-accent { background: #7a4bb5; }
.editor-dot-pink { background: var(--pink); }
.editor-dot-red { background: #c0173a; }
.editor-dot-orange { background: #c45c00; }
.editor-dot-brown { background: #7a4b12; }

.editor-bar [data-color-open].news-c-green { color: #2f7d32; }
.editor-bar [data-color-open].news-c-lime { color: #5c7c10; }
.editor-bar [data-color-open].news-c-teal { color: #0f6f78; }
.editor-bar [data-color-open].news-c-blue { color: #1a4f9c; }
.editor-bar [data-color-open].news-c-accent { color: #7a4bb5; }
.editor-bar [data-color-open].news-c-pink { color: var(--pink); }
.editor-bar [data-color-open].news-c-red { color: #c0173a; }
.editor-bar [data-color-open].news-c-orange { color: #c45c00; }
.editor-bar [data-color-open].news-c-brown { color: #7a4b12; }

.editor-file {
  flex: 1 1 8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
}

.editor-area {
  min-height: 8rem;
  padding: 0.75rem 0.85rem 0.9rem;
  outline: none;
  white-space: pre-wrap;
}

.editor-area:empty::before {
  content: "Text";
  color: rgba(53, 77, 130, 0.55);
  font-weight: 700;
}

.editor-area::after,
.prose.is-rich::after { content: ""; display: block; clear: both; }

.editor-area img,
.prose.is-rich img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.editor-area .news-img,
.prose.is-rich .news-img { display: block; margin: 0.7rem auto; }

.editor-area .news-img-left,
.prose.is-rich .news-img-left { float: left; margin: 0.2rem 0.8rem 0.5rem 0; }

.editor-area .news-img-right,
.prose.is-rich .news-img-right { float: right; margin: 0.2rem 0 0.5rem 0.8rem; }

.news-w-15 { width: 15%; } .news-w-20 { width: 20%; } .news-w-25 { width: 25%; } .news-w-30 { width: 30%; }
.news-w-35 { width: 35%; } .news-w-40 { width: 40%; } .news-w-45 { width: 45%; } .news-w-50 { width: 50%; }
.news-w-55 { width: 55%; } .news-w-60 { width: 60%; } .news-w-65 { width: 65%; } .news-w-70 { width: 70%; }
.news-w-75 { width: 75%; } .news-w-80 { width: 80%; } .news-w-85 { width: 85%; } .news-w-90 { width: 90%; }
.news-w-95 { width: 95%; } .news-w-100 { width: 100%; }

.editor-area img.is-selected { outline: 3px solid var(--pink); }

.img-tools {
  position: absolute;
  z-index: 2;
  display: flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--blue);
  transform: translateX(-50%);
}

.img-tools[hidden],
.img-resize[hidden] { display: none; }

.img-tools button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--yellow);
  cursor: pointer;
}

.img-tools button.is-on,
.img-tools button:hover { background: rgba(255, 255, 255, 0.18); }

.img-tools button::after {
  content: attr(aria-label);
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.img-tools button:hover::after,
.img-tools button:focus-visible::after { opacity: 1; }

.img-tools svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.img-tools-gap {
  width: 1px;
  align-self: stretch;
  margin: 0.3rem 0.15rem;
  background: rgba(255, 255, 255, 0.35);
}

.img-resize {
  position: absolute;
  z-index: 3;
  width: 0.9rem;
  height: 0.9rem;
  min-height: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 3px;
  background: var(--pink);
  cursor: nwse-resize;
  touch-action: none;
}

.prose.is-rich { white-space: normal; }

.prose.is-rich p,
.editor-area p { margin: 0 0 0.6rem; }

.prose.is-rich ul,
.prose.is-rich ol,
.editor-area ul,
.editor-area ol { margin: 0.3rem 0 0.7rem; padding-left: 1.2rem; }

.prose.is-rich a,
.editor-area a { text-decoration: underline; }

.news-c-green { color: #2f7d32; }
.news-c-lime { color: #5c7c10; }
.news-c-teal { color: #0f6f78; }
.news-c-blue { color: #1a4f9c; }
.news-c-accent { color: #7a4bb5; }
.news-c-pink { color: var(--pink); }
.news-c-red { color: #c0173a; }
.news-c-orange { color: #c45c00; }
.news-c-brown { color: #7a4b12; }

dialog.parent-note .parent-note-actions[hidden] { display: none !important; }

dialog.parent-note .btn { width: 100%; }

.card .fill-empty {
  margin: 0.85rem 0 0;
  font-weight: 750;
}

.card .fill-offers {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.card .fill-offer {
  background: var(--paper);
  color: var(--blue);
  border-radius: 16px;
  padding: 0.75rem 0.8rem;
}

.card .fill-offer p {
  color: var(--blue);
  margin: 0.15rem 0;
}

.card .fill-offer .meta { color: var(--pink); }

.card .fill-offer form { margin: 0.55rem 0 0; }

.card .fill-offer .btn { width: 100%; }

.plan-block.is-draggable {
  cursor: grab;
  touch-action: none;
}

.plan-block.is-dragging {
  z-index: 4;
  cursor: grabbing;
}

.plan-block.is-moved {
  height: 2.2rem;
  padding: 0.06rem 0.32rem;
  line-height: 1.05;
  box-shadow: inset 0 0 0 2px var(--pink);
}

.plan-block.is-moved b,
.plan-block.is-moved .plan-block-name {
  font-size: 0.6rem;
  line-height: 1.05;
}

.plan-from {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.05;
}

.plan-block.is-origin {
  background: var(--paper);
  color: var(--blue);
  border: 2px dashed var(--pink);
  box-shadow: none;
}

dialog.plan-detail {
  width: min(26rem, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  margin: auto;
  padding: 1.15rem 1.15rem 1.1rem;
  border: 3px solid var(--blue);
  border-radius: 22px;
  background: var(--paper);
  color: var(--blue);
  box-shadow: 0 18px 42px rgba(53, 77, 130, 0.28);
}

dialog.plan-detail::backdrop { background: rgba(53, 77, 130, 0.46); }

.plan-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.plan-detail-head h2 {
  margin: 0;
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.45rem;
  line-height: 1.2;
}

.plan-detail-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}

.plan-detail-status {
  margin: 0.7rem 0 0;
  color: #b01220;
  font-weight: 800;
}

.plan-detail dl {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
}

.plan-detail dl div {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: baseline;
}

.plan-detail dt { font-weight: 800; }

.plan-detail dd { margin: 0; }

.plan-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.plan-detail-actions .btn {
  width: 100%;
  min-width: 0;
}

#plan-detail-delete { margin: 0; }
[hidden] { display: none !important; }

.wrap:has(.stage) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0.35rem;
}

.stage {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  container-type: size;
}

.stage-news { display: contents; }

.stage,
.stage-card { scrollbar-width: none; }

.stage::-webkit-scrollbar,
.stage-card::-webkit-scrollbar { display: none; }

.stage-card {
  height: 100cqh;
  min-height: 100cqh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  padding: 0.15rem 0 0.35rem;
}

.stage-card:has(> form) {
  justify-content: flex-start;
}

.stage-hint {
  margin: auto 0 0.15rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--blue);
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes sheet-down {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@media (max-width: 959px) {
  .day-pop-close { display: none; }

  .day-sheet {
    position: fixed;
    z-index: 15;
    left: 0;
    right: 0;
    top: calc(4.6rem + env(safe-area-inset-top));
    bottom: 0;
    width: 100%;
    max-height: none;
    margin: 0;
    overflow: auto;
    background: var(--paper);
    color: var(--blue);
    border: 3px solid var(--blue);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    padding: 0.2rem 1rem calc(8.4rem + env(safe-area-inset-bottom));
    box-shadow: 0 18px 42px rgba(53, 77, 130, 0.28);
    transform: translateY(100%);
    visibility: hidden;
  }

  .day-sheet.is-open {
    visibility: visible;
    transform: translateY(0);
    animation: sheet-up 0.42s cubic-bezier(.2, .8, .2, 1) both;
  }

  .day-sheet.is-closing {
    visibility: visible;
    animation: sheet-down 0.42s cubic-bezier(.2, .8, .2, 1) both;
  }

  .cal-layout:not(.is-day) .cal-grid a.selected:not(.today) {
    background: transparent;
  }

  .sheet-backdrop {
    position: fixed;
    z-index: 14;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: transparent;
  }

  .sheet-backdrop.is-closing { opacity: 0; transition: opacity 0.28s ease; }

  .sheet-grab {
    display: flex;
    justify-content: center;
    padding: 0.45rem 0 0.75rem;
    text-decoration: none;
  }

  .sheet-grab span {
    width: 3rem;
    height: 0.35rem;
    border-radius: 99px;
    background: var(--blue);
  }
}

.wrap:has(.inbox) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0.6rem;
}

.inbox {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr);
  border: 3px solid var(--blue);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid rgba(53, 77, 130, 0.16);
}

.inbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid rgba(53, 77, 130, 0.16);
}

.inbox-bar h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1;
}

.inbox-bar .btn {
  width: auto;
  min-height: 40px;
  padding: 0 0.85rem;
}

#inbox-items {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.inbox-empty {
  margin: 0;
  padding: 1rem 0.9rem;
  font-weight: 750;
}

.inbox-item {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(53, 77, 130, 0.1);
  color: var(--blue);
  text-decoration: none;
}

.inbox-item.is-active { background: rgba(250, 238, 48, 0.55); }

.inbox-avatar {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: var(--blue);
  color: var(--yellow);
  font-weight: 800;
}

.inbox-item.is-group .inbox-avatar { background: var(--pink); color: var(--blue); }

.inbox-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item time {
  font-size: 0.72rem;
  font-weight: 750;
}

.inbox-item > span:last-child {
  grid-column: 2 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 650;
}

.inbox-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}

.inbox-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(53, 77, 130, 0.16);
}

.inbox-head .inbox-hide {
  position: static;
  flex: none;
}

.inbox-head .inbox-trash {
  opacity: 1;
  pointer-events: auto;
}

.confirm-actions {
  display: grid;
  gap: 0.55rem;
}

.inbox-head > div {
  flex: 1;
  min-width: 0;
}

.inbox-head h2 {
  margin: 0;
  overflow: hidden;
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.25rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-head p {
  margin: 0.15rem 0 0;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-row { position: relative; }

.inbox-hide {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 1;
  margin: 0;
}

.inbox-trash {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--blue);
  box-shadow: inset 0 0 0 1.5px var(--blue);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.inbox-row:hover .inbox-trash,
.inbox-row:focus-within .inbox-trash {
  opacity: 1;
  pointer-events: auto;
}

.inbox-row:hover .inbox-item time,
.inbox-row:focus-within .inbox-item time { visibility: hidden; }

.inbox-trash:hover,
.inbox-trash:focus-visible {
  background: var(--pink);
  box-shadow: none;
}

.inbox-error {
  margin: 0;
  padding: 0 0.85rem 0.4rem;
  color: var(--blue);
  font-weight: 800;
}

.inbox-back {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  color: var(--blue);
  text-decoration: none;
  box-shadow: inset 0 0 0 1.5px var(--blue);
}

.inbox-back svg { display: block; }

.inbox-back:hover,
.inbox-back:focus-visible {
  background: var(--blue);
  color: var(--paper);
  box-shadow: none;
}

.page-head-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.file-head { flex-wrap: wrap; }

.file-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  font-weight: 750;
}

.file-crumb a { color: inherit; }

.inbox-placeholder {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  font-weight: 750;
}

.inbox-chat .team-log { padding: 0.75rem 0.85rem; }

.inbox-chat .team-form {
  padding: 0.65rem 0.8rem 0.75rem;
  border-top: 1px solid rgba(53, 77, 130, 0.16);
}

dialog.chat-new {
  width: min(26rem, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  margin: auto;
  padding: 1.15rem;
  border: 3px solid var(--blue);
  border-radius: 22px;
  background: var(--paper);
  color: var(--blue);
  box-shadow: 0 18px 42px rgba(53, 77, 130, 0.28);
}

dialog.chat-new::backdrop { background: rgba(53, 77, 130, 0.46); }

dialog.chat-new h2 {
  margin: 0;
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.4rem;
}

dialog.chat-new form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

dialog.chat-new [data-chat-mode] {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

dialog.chat-new [data-chat-mode][hidden] {
  display: none !important;
}

dialog.chat-new .chat-kind { margin-top: 0; }

.chat-kind {
  display: flex;
  gap: 1rem;
  margin-top: 0.9rem;
  font-weight: 800;
}

.chat-kind label,
.chat-people label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chat-kind input,
.chat-people input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0.2rem;
  box-shadow: none;
  accent-color: var(--blue);
  flex: none;
}

.chat-title,
.chat-body { display: grid; gap: 0.35rem; margin: 0; font-weight: 800; }

.chat-hint {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

dialog.chat-new textarea {
  display: block;
  box-sizing: border-box;
  min-height: 6.5rem;
  margin: 0;
  background: #fff;
}

dialog.chat-new button[type="submit"] {
  width: 100%;
  margin: 0.15rem 0 0;
}

.chat-people {
  display: grid;
  gap: 0.35rem;
  max-height: 16rem;
  margin: 0;
  overflow: auto;
}

.chat-people small { margin-left: auto; font-size: 0.75rem; font-weight: 750; }

.push-picker { position: relative; margin-top: 0.8rem; }

.push-picker-toggle {
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.8rem;
  border: 2px solid var(--blue);
  border-radius: 12px;
  background: var(--paper);
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.push-picker-panel {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: calc(100% + 0.3rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  padding: 0.55rem;
  overflow: auto;
  border: 2px solid var(--blue);
  border-radius: 12px;
  background: var(--paper);
}

.push-picker-panel label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 750;
}

.push-picker-panel input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0.2rem;
  box-shadow: none;
  accent-color: var(--blue);
  flex: none;
}

.push-picker-panel small { margin-left: auto; font-size: 0.75rem; font-weight: 750; }

dialog.chat-new .btn { width: 100%; }

dialog.form-dialog {
  width: min(26rem, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: min(40rem, calc(100dvh - 2rem));
  margin: auto;
  padding: 1.15rem;
  border: 3px solid var(--blue);
  background: var(--paper);
  color: var(--blue);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(53, 77, 130, 0.28);
  overflow: auto;
}

dialog.form-dialog::backdrop { background: rgba(53, 77, 130, 0.46); }

dialog.form-dialog h2 {
  margin: 0;
  font-family: Bricolage, InterTight, sans-serif;
  font-size: 1.4rem;
}

dialog.form-dialog form { display: grid; gap: 0.85rem; }

dialog.user-create [data-create] { display: grid; gap: 0.75rem; }

dialog.user-create:not(:has(#user-create-kind option[value="eltern"]:checked)):not(:has(#user-create-kind option[value="lehrer"]:checked)) [data-create="account"],
dialog.user-create:not(:has(#user-create-kind option[value="kind"]:checked)) [data-create="kind"],
dialog.user-create:not(:has(#user-create-kind option[value="eltern"]:checked)) [data-create="eltern"],
dialog.user-create:not(:has(#user-create-kind option[value="lehrer"]:checked)) [data-create="lehrer"] {
  display: none !important;
}

dialog.form-dialog .btn { width: 100%; }

dialog#login form + .chat-hint { margin-top: 1.25rem; }

@media (min-width: 800px) {
  dialog.form-dialog {
    width: min(48rem, calc(100vw - 3rem));
    max-height: calc(100dvh - 2rem);
  }

  dialog.user-create [data-create="account"],
  dialog.user-create [data-create="kind"] {
    grid-template-columns: 1fr 1fr;
  }

  dialog.user-create [data-create="account"] > label:first-child {
    grid-column: 1 / -1;
  }

  dialog.form-dialog .instrument-picks,
  dialog.user-create [data-create="lehrer"] .instrument-picks {
    grid-template-columns: 1fr 1fr;
  }
}

dialog.file-preview {
  width: min(48rem, calc(100vw - 1.2rem));
}

.file-preview-stage {
  display: grid;
  gap: 0.7rem;
}

.file-preview-image,
.file-preview-frame {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

.file-preview-image {
  max-height: min(70dvh, 36rem);
  object-fit: contain;
}

.file-preview-frame {
  height: min(70dvh, 36rem);
}

.file-menu {
  position: fixed;
  z-index: 30;
  min-width: 11.5rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.35rem;
  border: 3px solid var(--blue);
  border-radius: 16px;
  background: var(--paper);
  color: var(--blue);
  box-shadow: 0 18px 42px rgba(53, 77, 130, 0.28);
}

.file-menu[hidden] { display: none; }

.file-menu button {
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.file-menu button:hover,
.file-menu button:focus-visible {
  background: var(--yellow);
  outline: none;
}

dialog.form-dialog.rights-dialog { width: min(44rem, calc(100vw - 1.5rem)); }

.folder-rights { display: grid; gap: 0.65rem; }

.rights-role {
  margin: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.rights-role > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.rights-role > summary::-webkit-details-marker { display: none; }

.rights-role > summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2.5px solid var(--blue);
  border-bottom: 2.5px solid var(--blue);
  transform: rotate(45deg);
}

.rights-role[open] > summary::after { transform: rotate(-135deg); }

.rights-role > .rights-person { margin: 0 0.7rem 0.7rem; }

.rights-person {
  display: grid;
  gap: 0.15rem 0.7rem;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 0.7rem 0.75rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.rights-person small { color: var(--pink); font-weight: 750; }

.rights-grid {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.25rem;
}

.rights-grid .check { font-size: 0.86rem; }

.user-table tr.file-row,
.user-table tr.folder-row {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 800px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.is-open .inbox-list { display: none; }
  .inbox:not(.is-open) .inbox-chat { display: none; }
  .inbox-list { border-right: 0; }
  .inbox-back { display: inline-flex; }
}

.team-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.team-log::before {
  content: "";
  flex: 1 1 auto;
  min-height: 0;
}

.team-empty { margin: 0.4rem 0 0; }

.team-msg {
  position: relative;
  max-width: 92%;
  margin-right: auto;
  padding: 0.55rem 0.7rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(53, 77, 130, 0.14);
}

.team-msg.is-mine {
  margin-right: 0;
  margin-left: auto;
  background: var(--yellow);
  box-shadow: none;
}

.team-meta {
  margin: 0;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
}

.team-body {
  margin: 0.15rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.team-actions {
  position: absolute;
  z-index: 1;
  top: 0.28rem;
  right: 0.28rem;
  display: flex;
  gap: 0.18rem;
  padding: 0.12rem;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--blue);
  opacity: 0;
  pointer-events: none;
}

.team-msg.is-mine .team-actions { background: var(--yellow); }

.team-msg:hover,
.team-msg:focus-within { padding-right: 6.2rem; }

.team-msg:hover .team-actions,
.team-msg:focus-within .team-actions {
  opacity: 1;
  pointer-events: auto;
}

.team-icon {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--yellow);
  cursor: pointer;
}

.team-quote {
  margin: 0.35rem 0 0;
  padding: 0.25rem 0.45rem;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: rgba(53, 77, 130, 0.08);
  font-size: 0.78rem;
}

.team-quote strong { display: block; }

.team-msg.is-mine .team-quote { background: rgba(53, 77, 130, 0.12); }

.team-edit { display: grid; gap: 0.4rem; margin-top: 0.35rem; }

.team-edit textarea { min-height: 3.2rem; background: #fff; }

.team-edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.team-edit-actions .btn {
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 0.4rem 0.5rem;
}

.team-form { display: grid; gap: 0.45rem; }

.team-replybar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--blue);
  font-size: 0.82rem;
}

.team-replybar p { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }

.team-replybar button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
}

.team-compose { position: relative; }

.team-emoji-btn {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
}

.team-emojis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.2rem;
}

.team-emojis button {
  min-height: 2rem;
  border: 0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 1.15rem;
}

.team-emojis button:hover,
.team-emojis button:focus-visible { background: var(--yellow); }

@media (hover: none) {
  .team-actions { opacity: 1; pointer-events: auto; }
  .team-msg { padding-right: 6.2rem; }
  .team-msg.is-plain { padding-right: 0.6rem; }
  .inbox-trash { opacity: 1; pointer-events: auto; }
  .inbox-item { padding-right: 2.5rem; }
  .inbox-item time { visibility: hidden; }
}

.team-form textarea {
  min-height: 3.2rem;
  max-height: 7rem;
  border-radius: 16px;
  background: #fff;
  padding-right: 2.8rem;
  scrollbar-width: thin;
  scrollbar-color: var(--blue) transparent;
}

.team-form textarea::-webkit-scrollbar {
  width: 10px;
}

.team-form textarea::-webkit-scrollbar-track {
  background: transparent;
  margin: 12px 0;
}

.team-form textarea::-webkit-scrollbar-thumb {
  background: var(--blue);
  border: 3px solid #fff;
  border-radius: 999px;
}

.team-error {
  margin: 0;
  color: var(--blue);
  font-weight: 800;
}

html.is-pwa .app:not(.guest) .wrap > h1,
html.is-pwa .app:not(.guest) .page-head > h1,
html.is-pwa .app:not(.guest) .inbox-bar > h1,
html.is-pwa .app:not(.guest) .news-head > h2,
html.is-pwa .app:not(.guest) .wrap > .lede {
  display: none;
}

html.is-pwa .app:not(.guest) .wrap > h1.keep-title,
html.is-pwa .app:not(.guest) .wrap > .lede.keep-title,
html.is-pwa .app:not(.guest) .wrap > .back + h1,
html.is-pwa .app:not(.guest) .wrap > .back + h1 + .lede,
html.is-pwa .app:not(.guest) .wrap > .lede.empty-note {
  display: block;
}

html.is-pwa .app:not(.guest) .page-head { justify-content: flex-end; }

html.is-pwa .app:not(.guest) .news-head { margin-top: 0; }

html.is-pwa .app:not(.guest) .next-lesson,
html.is-pwa .app:not(.guest) .wrap > .empty-note {
  margin-bottom: 1.2rem;
}

html.is-pwa .card.has-banner,
html.is-pwa .panel.has-banner {
  padding: 0 0 1rem;
  max-width: 100%;
  overflow: hidden;
}

html.is-pwa .card.has-banner > .news-banner,
html.is-pwa .panel.has-banner > .news-banner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  object-fit: contain;
  margin: 0 0 0.85rem;
  border-radius: 0;
}

html.is-pwa .card.has-banner > :not(.news-banner),
html.is-pwa .panel.has-banner > :not(.news-banner) {
  margin-left: 1rem;
  margin-right: 1rem;
}

html.is-pwa .app:not(.guest) .page-head:not(:has(.heading-add, .page-head-actions)),
html.is-pwa .app:not(.guest) .news-head:not(:has(.heading-add)) {
  display: none;
}

html.is-pwa #inhalt.is-slide-next,
html.is-pwa #inhalt.is-slide-prev,
html.is-pwa #inhalt.is-leave-next,
html.is-pwa #inhalt.is-leave-prev {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
  animation-fill-mode: both;
}

html.is-pwa #inhalt.is-slide-next { animation-name: app-slide-next; }
html.is-pwa #inhalt.is-slide-prev { animation-name: app-slide-prev; }
html.is-pwa #inhalt.is-leave-next { animation-name: app-leave-next; pointer-events: none; }
html.is-pwa #inhalt.is-leave-prev { animation-name: app-leave-prev; pointer-events: none; }

@keyframes app-slide-next {
  from { transform: translate3d(100%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes app-slide-prev {
  from { transform: translate3d(-100%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes app-leave-next {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-100%, 0, 0); }
}

@keyframes app-leave-prev {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(100%, 0, 0); }
}

@media (max-width: 959px) {
  html.is-pwa .wrap:has(.cal-layout),
  html.is-pwa .cal-layout,
  html.is-pwa .sheet-backdrop,
  html.is-pwa .day-sheet {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }

  html.is-pwa .day-sheet .stack,
  html.is-pwa .day-sheet .card,
  html.is-pwa .day-sheet p,
  html.is-pwa .day-sheet h2,
  html.is-pwa .day-sheet h3 {
    -webkit-user-select: text;
    user-select: text;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage { scroll-behavior: auto; }
  .day-sheet.is-open { animation: none; transform: none; }
  .day-sheet.is-closing { animation: none; transition: none; }
  .team, .team-toggle svg { transition: none; }
  html.is-pwa #inhalt.is-slide-next,
  html.is-pwa #inhalt.is-slide-prev,
  html.is-pwa #inhalt.is-leave-next,
  html.is-pwa #inhalt.is-leave-prev { animation: none; }
}

.archive {
  background: var(--paper);
  color: var(--blue);
  border: 3px solid var(--blue);
  border-radius: 22px;
}

.archive > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 800;
  padding: 0.9rem 1rem;
  list-style: none;
}

.archive > summary::-webkit-details-marker { display: none; }

.archive > summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2.5px solid var(--blue);
  border-bottom: 2.5px solid var(--blue);
  transform: rotate(45deg);
}

.archive[open] > summary::after {
  transform: rotate(-135deg);
}

.archive > .stack { padding: 0 0.85rem 0.85rem; }
