.timer-range, .timer-concept-settings {
  display: none;
}

/* Emerald Day. Loaded after concepts.css; other design families keep their layout. */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

html:not([data-design="emerald"]) :is(.emerald-portrait, .emerald-header-art, .emerald-settings) {
  display: none !important;
}

html[data-design="emerald"] {
  color-scheme: light;
  --bg: #eef3ef;
  --paper: #fff;
  --ink: #223c33;
  --muted: #5d7469;
  --accent: #185c48;
  --accent-ink: #fff;
  --soft: #e0ece4;
  --line: #d5e0d8;
  --green: #185c48;
  --amber: #89591d;
  --amber-bg: #fff4df;
  --radius: 20px;
  --shadow: 0 9px 22px #1c5b4814;
  --emerald-current: #185c48;
  --emerald-current-ink: #fff;
  --emerald-current-muted: #dae9df;
  --emerald-current-line: #ffffff38;
  --emerald-heading-paper: #e0e9e1;
  --emerald-heading-ink: #223c33;
  --emerald-heading-muted: #4d695a;
  --emerald-art-paper: #e1eae1;
  --emerald-art-line: #b9cbbd;
  --emerald-art-ink: #406653;
  --emerald-header-art: none;
  --emerald-timer-art: none;
  --emerald-corner-art: none;
}

html[data-design="emerald"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #101d18;
  --paper: #1b2c24;
  --ink: #edf4ef;
  --muted: #b1c5b8;
  --accent: #a0d6b6;
  --accent-ink: #152c21;
  --soft: #2b4939;
  --line: #385445;
  --green: #a0d6b6;
  --amber: #f2ca85;
  --amber-bg: #473a24;
  --shadow: 0 9px 22px #0003;
  --emerald-current: #285e48;
  --emerald-current-ink: #f1f8f2;
  --emerald-current-muted: #d0e3d6;
  --emerald-heading-paper: #dbe6dc;
  --emerald-art-line: #9cb4a3;
  --emerald-art-ink: #355a44;
}

/* The pale illustration paper is deliberate in both colour modes. */
html[data-design="emerald"] :is(.wordmark em, .brand, .footer-brand > span) {
  color: var(--accent);
}
html[data-design="emerald"] .brand-logo img {
  filter: hue-rotate(-65deg) saturate(.75);
}
html[data-design="emerald"] :is(.footer-brand img, .info-dialog .brand-logo img) {
  filter: hue-rotate(-65deg) saturate(.75);
}
html[data-design="emerald"] .main-content {
  max-width: 1360px;
}
html[data-design="emerald"] #group-view {
  position: relative;
}
html[data-design="emerald"] :is(.emerald-portrait, .emerald-header-art) {
  display: none;
}
html[data-design="emerald"] [hidden] {
  display: none !important;
}
html[data-design="emerald"] :is(.day-button, .group-result, .teacher-row) {
  transition: background-color .16s ease, border-color .16s ease;
}
html[data-design="emerald"] .day-button.active {
  background: var(--accent);
  color: var(--accent-ink);
}
html[data-design="emerald"] .view-toggle {
  border-radius: 13px;
}
html[data-design="emerald"] .view-toggle .active {
  background: var(--soft);
  color: var(--accent);
}
html[data-design="emerald"] :is(.lesson-time-rail, .room, #timer-room-value, #timer-value, .teacher-timer-value, .teacher-bell span) {
  font-family: 'IBM Plex Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
html[data-design="emerald"] .schedule-status {
  position: relative;
  min-width: 0;
}

/* 1. A tall illustration sits beside the complete timetable. */
html[data-design="emerald"][data-emerald-variant="portrait"] #group-view:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0 27px;
  align-items: start;
}

/* Shared timers retain their real live content. Decoration never accepts input. */
html[data-design="emerald"] .teacher-timer {
  --timer-accent: var(--emerald-current-ink);
  position: relative;
  overflow: visible;
  min-width: 0;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--emerald-current);
  color: var(--emerald-current-ink);
  box-shadow: var(--shadow);
}
html[data-design="emerald"] .teacher-timer::after {
  display: none;
}
html[data-design="emerald"] .teacher-timer :is(.timer-kicker, #timer-title, #timer-room-value, #timer-value, .teacher-timer-value, .teacher-timer-context strong) {
  color: var(--emerald-current-ink);
}
html[data-design="emerald"] .teacher-timer :is(#timer-detail, #timer-label, #timer-source, .timer-room small, .teacher-timer-label, .teacher-timer-source, .teacher-timer-context span) {
  color: var(--emerald-current-muted);
}
html[data-design="emerald"] .teacher-timer .timer-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
html[data-design="emerald"] .teacher-timer .timer-settings-button {
  background: transparent;
  color: var(--emerald-current-ink);
  flex-shrink: 0;
}
html[data-design="emerald"] .teacher-timer .timer-settings-button:hover {
  background: var(--emerald-current-line);
}
html[data-design="emerald"] .teacher-timer .timer-progress {
  background: var(--emerald-current-line);
}
html[data-design="emerald"] .teacher-timer .timer-progress > span {
  background: var(--emerald-current-ink);
}
html[data-design="emerald"] .teacher-timer .timer-warning {
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--amber-bg);
  color: var(--amber);
}
html[data-design="emerald"][data-emerald-timer="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) .teacher-timer {
  margin-top: 160px;
  padding-top: 64px;
}
html[data-design="emerald"][data-emerald-timer="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) .teacher-timer::before {
  content: '';
  display: block;
  position: absolute;
  top: -160px;
  right: 16px;
  width: 175px;
  height: 215px;
  background: var(--emerald-timer-art) center bottom / contain no-repeat;
  pointer-events: none;
  user-select: none;
}
html[data-design="emerald"] .schedule-status > span {
  min-width: 0;
  max-width: 100%;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* 5. Diary presents one continuous chronological rail. */
html[data-design="emerald"][data-emerald-variant="diary"] {
  --emerald-current: var(--paper);
  --emerald-current-ink: var(--ink);
  --emerald-current-muted: var(--muted);
  --emerald-current-line: var(--line);
}
html[data-design="emerald"][data-emerald-variant="diary"] .teacher-timer {
  border-color: var(--line);
  border-left: 4px solid var(--accent);
  box-shadow: none;
}
html[data-design="emerald"][data-emerald-variant="diary"] .teacher-timer .timer-progress > span {
  background: var(--accent);
}
html[data-design="emerald"][data-emerald-variant="diary"] .timer-dot {
  background: var(--accent);
}

/* Teacher routes use their own component structure, independently of group mode. */
html[data-design="emerald"] :is(.teacher-picker-intro, .teacher-detail-head) {
  position: relative;
  min-height: 235px;
  padding-right: calc(31% + 24px);
  background: var(--paper);
  border-radius: var(--radius);
}
html[data-design="emerald"] :is(.teacher-picker-intro, .teacher-detail-head)::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 10px;
  width: calc(31% - 8px);
  height: calc(100% - 28px);
  max-height: 280px;
  background: var(--emerald-header-art) right bottom / contain no-repeat;
  pointer-events: none;
  user-select: none;
}
html[data-design="emerald"] :is(.teacher-picker-intro, .teacher-detail-head) :is(p, h2, a, button, .teacher-group-badges) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
html[data-design="emerald"] :is(.teacher-picker-intro, .teacher-detail-head) h2 {
  font: 500 36px/1.12 'Cormorant Garamond', Georgia, serif;
  letter-spacing: -.4px;
}
html[data-design="emerald"] .teacher-overview {
  align-items: start;
  gap: 24px;
}
html[data-design="emerald"] .teacher-timer .timer-body {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px;
}
html[data-design="emerald"] .teacher-timer-context {
  flex: 1 1 170px;
}
html[data-design="emerald"] .teacher-timer-context strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}
html[data-design="emerald"] .teacher-timer-value {
  white-space: normal;
  overflow-wrap: anywhere;
}
html[data-design="emerald"] .teacher-list {
  background: var(--paper);
}
html[data-design="emerald"] .teacher-week-subject > strong {
  font-size: 15px;
}
html[data-design="emerald"] .teacher-calendar .calendar-toolbar {
  flex-wrap: wrap;
}
html[data-design="emerald"] .teacher-calendar .calendar-actions {
  flex-wrap: wrap;
  margin-left: auto;
}
html[data-design="emerald"] .teacher-view-toggle {
  min-width: 210px;
}
html[data-design="emerald"][data-emerald-corner="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) #teachers-view:not([hidden]) {
  position: relative;
  padding-bottom: 165px;
}
html[data-design="emerald"][data-emerald-corner="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) #teachers-view:not([hidden])::after {
  content: '';
  display: block;
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 126px;
  height: 145px;
  background: var(--emerald-corner-art) right bottom / contain no-repeat;
  pointer-events: none;
  user-select: none;
}

/* Dialogs inherit the same jade palette, including source and timer controls. */
html[data-design="emerald"] dialog {
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - var(--safe-bottom));
  border-color: var(--line);
  border-radius: 21px;
  background: var(--paper);
  box-shadow: 0 24px 100px #152c2133;
}
html[data-design="emerald"] dialog::backdrop {
  background: #142d237a;
}
html[data-design="emerald"][data-theme="dark"] dialog::backdrop {
  background: #050e0ab8;
}
html[data-design="emerald"] .dialog-header h2 {
  font: 500 30px/1.18 'Cormorant Garamond', Georgia, serif;
  letter-spacing: -.35px;
}
html[data-design="emerald"] :is(.sheet-action, .sheet-download, .sheet-preview-hint) {
  color: var(--accent);
  background: var(--soft);
  border-color: var(--line);
}
html[data-design="emerald"] .sheet-viewport {
  background: var(--bg);
  border-color: var(--line);
}
html[data-design="emerald"] .sheet-loading .spinner {
  border-color: var(--line);
  border-top-color: var(--accent);
}
html[data-design="emerald"] .sheet-error {
  background: var(--amber-bg);
  color: var(--amber);
}
html[data-design="emerald"] .emerald-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
html[data-design="emerald"] .emerald-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--accent);
  font-size: 13px;
}
html[data-design="emerald"] :is(.emerald-tabs, .emerald-slot-tabs) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
html[data-design="emerald"] :is(.emerald-tabs, .emerald-slot-tabs) > button {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}
html[data-design="emerald"] :is(.emerald-tabs, .emerald-slot-tabs) > button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 1px 4px #153b2814;
}
html[data-design="emerald"] .emerald-variants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
html[data-design="emerald"] .emerald-variant-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  text-align: left;
}
html[data-design="emerald"] :is(.emerald-variant-card, .emerald-art-card):hover {
  border-color: var(--accent);
}
html[data-design="emerald"] :is(.emerald-variant-card, .emerald-art-card)[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
html[data-design="emerald"] .emerald-variant-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
html[data-design="emerald"] .emerald-variant-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
html[data-design="emerald"] .emerald-variant-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 94px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--emerald-heading-paper);
  pointer-events: none;
}
html[data-design="emerald"] .emerald-variant-preview::before {
  content: '';
  position: absolute;
  top: 32%;
  left: 8%;
  width: 48%;
  height: 31%;
  border-radius: 5px;
  background: #185c48;
  box-shadow: 0 20px 0 -8px #fff;
}
html[data-design="emerald"] .emerald-variant-preview::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 6%;
  width: 30%;
  height: 83%;
  border-radius: 40px 40px 3px 3px;
  background: #b6cbbb;
}
html[data-design="emerald"] .emerald-variant-preview[data-variant="banner"]::before {
  top: 48%;
  width: 84%;
  height: 23%;
}
html[data-design="emerald"] .emerald-variant-preview[data-variant="banner"]::after {
  top: 3%;
  right: 9%;
  width: 24%;
  height: 38%;
}
html[data-design="emerald"] .emerald-variant-preview[data-variant="planner"]::before {
  top: 38%;
  width: 39%;
  height: 49%;
  box-shadow: 112px -10px 0 -10px #fff, 112px 18px 0 -10px #fff;
}
html[data-design="emerald"] .emerald-variant-preview[data-variant="planner"]::after,
html[data-design="emerald"] .emerald-variant-preview[data-variant="focus"]::after,
html[data-design="emerald"] .emerald-variant-preview[data-variant="diary"]::after {
  top: 3%;
  right: 10%;
  width: 22%;
  height: 30%;
}
html[data-design="emerald"] .emerald-variant-preview[data-variant="focus"]::before {
  top: 37%;
  width: 84%;
  height: 35%;
  box-shadow: 0 26px 0 -10px #fff;
}
html[data-design="emerald"] .emerald-variant-preview[data-variant="diary"]::before {
  top: 38%;
  width: 84%;
  height: 26%;
  border-left: 3px solid #185c48;
  background: #fff;
  box-shadow: 0 22px 0 -8px #fff;
}
html[data-design="emerald"] .emerald-variant-preview img {
  position: absolute;
  z-index: 1;
  right: 3%;
  bottom: 0;
  width: 38%;
  height: 92%;
  object-fit: contain;
  object-position: right bottom;
}
html[data-design="emerald"] .emerald-variant-preview:not([data-variant="portrait"]) img {
  top: 0;
  right: 7%;
  bottom: auto;
  width: 24%;
  height: 37%;
}
html[data-design="emerald"] .emerald-selection-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 14px;
}
html[data-design="emerald"] .emerald-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  max-height: min(48dvh, 430px);
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
html[data-design="emerald"] .emerald-art-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  text-align: left;
}
html[data-design="emerald"] .emerald-art-preview {
  display: block;
  width: 100%;
  height: 170px;
  min-width: 0;
  margin: 0 0 9px;
  border-radius: 7px;
  background: var(--emerald-art-paper);
  object-fit: contain;
  object-position: center bottom;
}
html[data-design="emerald"] .emerald-art-name {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
html[data-design="emerald"] .emerald-decor-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 16px;
}
html[data-design="emerald"] .emerald-decor-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
html[data-design="emerald"] .emerald-decor-toggle input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* The fourth family is offered from every theme, so its tile is always jade. */
html[data-design] .appearance-options:has([data-design-choice="emerald"]) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
html[data-design] .appearance-preview[data-preview="emerald"] {
  --preview-bg: #eef3ef;
  --preview-paper: #fff;
  --preview-soft: #e0ece4;
  --preview-blue: #185c48;
  background: var(--preview-bg);
  border-color: #d5e0d8;
}
html[data-design] .appearance-preview[data-preview="emerald"]::before {
  inset: 8% 7% auto;
  height: 27%;
  border-radius: 5px;
  background: linear-gradient(#185c48, #185c48) 9% 35% / 44% 3px no-repeat, #e0e9e1;
}
html[data-design] .appearance-preview[data-preview="emerald"]::after {
  top: 46%;
  left: 7%;
  width: 50%;
  height: 37%;
  border-radius: 6px;
  background: linear-gradient(#fff, #fff) 17% 30% / 61% 3px no-repeat,
    linear-gradient(#dae9df, #dae9df) 17% 65% / 39% 2px no-repeat, #185c48;
}
html[data-design] .appearance-preview[data-preview="emerald"] > i {
  position: absolute;
  display: block;
  right: 8%;
  width: 29%;
  height: 12%;
  border-radius: 4px;
  background: #fff;
}
html[data-design] .appearance-preview[data-preview="emerald"] > i:first-child {
  top: 45%;
}
html[data-design] .appearance-preview[data-preview="emerald"] > i:nth-child(2) {
  top: 68%;
}
html[data-design] .appearance-preview[data-preview="emerald"] > i:nth-child(3) {
  top: 8%;
  right: 10%;
  width: 18%;
  height: 27%;
  border-radius: 20px 20px 3px 3px;
  background: #8fae9a;
}

@media (min-width: 1201px) {
  html[data-design="emerald"] .teacher-overview {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  html[data-design="emerald"] .teacher-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  html[data-design="emerald"][data-emerald-variant="portrait"] #group-view:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) 225px;
    column-gap: 20px;
  }
}

@media (max-width: 620px) {
  html[data-design="emerald"][data-emerald-variant="portrait"] #group-view:not([hidden]) {
    display: block;
  }
  html[data-design="emerald"] .main-content {
    padding-bottom: calc(105px + var(--safe-bottom));
  }
  html[data-design="emerald"] .topbar {
    gap: 8px;
  }
  html[data-design="emerald"] .header-actions {
    flex-shrink: 0;
  }
  html[data-design="emerald"] .appearance-button {
    gap: 5px;
    padding-inline: 8px;
  }
  html[data-design="emerald"] .appearance-label {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-design="emerald"] .teacher-timer {
    margin-bottom: 22px;
    padding: 20px 18px;
  }
  html[data-design="emerald"][data-emerald-timer="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) .teacher-timer {
    margin-top: 121px;
    padding-top: 55px;
  }
  html[data-design="emerald"][data-emerald-timer="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) .teacher-timer::before {
    top: -121px;
    right: 8px;
    width: 140px;
    height: 170px;
  }
  html[data-design="emerald"] .agenda-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  html[data-design="emerald"] .agenda-title h2 {
    font-size: 17px;
  }
  html[data-design="emerald"] .schedule-status {
    font-size: 12px;
  }
  html[data-design="emerald"] .mobile-nav {
    background: var(--paper);
    border-color: var(--line);
    padding-bottom: calc(7px + var(--safe-bottom));
  }
  html[data-design="emerald"] :is(.teacher-picker-intro, .teacher-detail-head) h2 {
    font-size: 31px;
  }
  html[data-design="emerald"] :is(.teacher-picker-intro, .teacher-detail-head) {
    min-height: 220px;
    padding: 20px 120px 20px 18px;
  }
  html[data-design="emerald"] :is(.teacher-picker-intro, .teacher-detail-head)::after {
    top: 12px;
    right: 4px;
    width: 108px;
    height: calc(100% - 24px);
    max-height: 240px;
  }
  html[data-design="emerald"] .teacher-head-actions {
    justify-content: flex-start;
    gap: 6px;
  }
  html[data-design="emerald"] .teacher-head-actions .text-link {
    white-space: normal;
    text-align: left;
    line-height: 1.6;
  }
  html[data-design="emerald"] .teacher-timer-context strong {
    font-size: 15px;
  }
  html[data-design="emerald"] .teacher-row-main strong {
    font-size: 15px;
  }
  html[data-design="emerald"] .teacher-week-subject > strong {
    font-size: 15px;
  }
  html[data-design="emerald"] .teacher-calendar .calendar-actions {
    width: 100%;
  }
  html[data-design="emerald"] .teacher-view-toggle {
    width: 100%;
  }
  html[data-design="emerald"][data-emerald-corner="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) #teachers-view:not([hidden]) {
    padding-bottom: 145px;
  }
  html[data-design="emerald"][data-emerald-corner="on"]:not([data-emerald-variant="portrait"]):not([data-emerald-variant="banner"]) #teachers-view:not([hidden])::after {
    width: 100px;
    height: 126px;
  }
  html[data-design="emerald"] dialog {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - var(--safe-bottom));
    padding: 21px 18px;
  }
  html[data-design="emerald"] :is(.group-dialog, .timer-dialog, .appearance-dialog) {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 12px - env(safe-area-inset-top, 0px));
    margin: 0;
    padding: 24px 19px calc(22px + var(--safe-bottom));
    border-radius: 24px 24px 0 0;
  }
  html[data-design="emerald"] .dialog-header h2 {
    font-size: 28px;
  }
  html[data-design="emerald"] .emerald-variants {
    gap: 8px;
  }
  html[data-design="emerald"] .emerald-variant-card {
    gap: 6px;
    padding: 7px;
  }
  html[data-design="emerald"] .emerald-variant-preview {
    height: 72px;
  }
  html[data-design="emerald"] .emerald-variant-name {
    font-size: 13px;
  }
  html[data-design="emerald"] .emerald-variant-description {
    font-size: 11px;
  }
  html[data-design="emerald"] .emerald-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  html[data-design="emerald"] .emerald-art-preview {
    height: 155px;
  }
  html[data-design="emerald"] .emerald-slot-tabs > button {
    flex-basis: calc(50% - 6px);
  }
}

@media (max-width: 360px) {
  html[data-design] .appearance-options:has([data-design-choice="emerald"]) {
    grid-template-columns: minmax(0, 1fr);
  }
  html[data-design="emerald"] .main-content {
    padding-inline: 13px;
  }
  html[data-design="emerald"] .appearance-label {
    display: none;
  }
  html[data-design="emerald"] .appearance-button {
    min-width: 42px;
    padding-inline: 10px;
  }
  html[data-design="emerald"] .emerald-variant-description {
    display: none;
  }
  html[data-design="emerald"] .emerald-art-preview {
    height: 135px;
  }
}

/* Component values transcribed from the approved Emerald concept. */
html[data-design="emerald"] body {
  font: 400 14px/1.5 'Onest', 'Segoe UI', sans-serif;
}
html[data-design="emerald"] #group-view .calendar-toolbar {
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
}
html[data-design="emerald"] #group-view .calendar-toolbar h2 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}
html[data-design="emerald"] #group-view #week-subtitle {
  display: none;
}
html[data-design="emerald"] #group-view .week-arrows {
  gap: 3px;
}
html[data-design="emerald"] #group-view .week-arrows .icon-button {
  width: 29px;
  height: 30px;
  min-width: 29px;
  min-height: 30px;
  padding: 5px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent);
}
html[data-design="emerald"] #group-view .week-arrows svg {
  width: 14px;
  height: 14px;
}
html[data-design="emerald"] #group-view .today-button {
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
}
html[data-design="emerald"] #group-view .week-strip {
  gap: 6px;
  margin-bottom: 19px;
}
html[data-design="emerald"] #group-view .day-button {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 62px;
  gap: 2px;
  padding: 9px 3px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted);
}
html[data-design="emerald"] #group-view .day-button .weekday {
  font-size: 10px;
}
html[data-design="emerald"] #group-view .day-button .day-number {
  font-size: 18px;
  font-weight: 500;
}
html[data-design="emerald"] #group-view .day-button.active {
  background: var(--accent);
  color: var(--accent-ink);
}
html[data-design="emerald"] #group-view .day-button.active::after {
  content: '';
  position: absolute;
  inset: auto -2px 0;
  height: 4px;
  background: repeating-linear-gradient(125deg, #a6b8ac 0px, #a6b8ac 8px, #ffffff00 8px, #ffffff00 20px);
}
html[data-design="emerald"] #group-view .view-toggle {
  display: inline-flex;
  width: auto;
  gap: 3px;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
}
html[data-design="emerald"] #group-view .view-toggle button {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
html[data-design="emerald"] #group-view .view-toggle button.active {
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
html[data-design="emerald"] #group-view .schedule-panel {
  margin-bottom: 15px;
}
@media (max-width: 620px) {
  html[data-design="emerald"] #group-view .week-strip { gap: 5px; margin-bottom: 14px; }
  html[data-design="emerald"] #group-view .day-button { min-height: 57px; border-radius: 12px; padding: 7px 0; }
  html[data-design="emerald"] #group-view .day-button .day-number { font-size: 17px; }
  html[data-design="emerald"] #group-view .view-toggle { gap: 1px; padding: 3px; }
  html[data-design="emerald"] #group-view .view-toggle button { padding: 7px 12px; font-size: 11px; }
  html[data-design="emerald"] #group-view .schedule-panel { margin-bottom: 13px; }
}
/* Extra live-timer hooks stay invisible outside the concept's two hero variants. */
html[data-design="emerald"] :is(.brand, .mobile-brand) .wordmark {
  font: 800 23px/1 'Manrope', 'Onest', sans-serif;
  letter-spacing: -1.2px;
  color: #174e3e;
}
html[data-design="emerald"] :is(.brand, .mobile-brand) .wordmark em {
  color: #257a5b;
}
html[data-design="emerald"][data-theme="dark"] :is(.brand, .mobile-brand) .wordmark {
  color: #c5e8d2;
}
html[data-design="emerald"][data-theme="dark"] :is(.brand, .mobile-brand) .wordmark em {
  color: #a0d6b6;
}
/* The reference shell: header precedes the padded schedule and footer. */
html:not([data-reference-ui="true"]) :is(.em-header, .em-mini-nav, .em-clock) {
  display: none !important;
}
html[data-reference-ui="true"] .main-content {
  --emerald-shell-top: 29px;
  --emerald-shell-inline: 30px;
  --emerald-shell-bottom: 18px;
  --emerald-brand-ink: #174e3e;
  --emerald-brand-accent: #257a5b;
}
html[data-reference-ui="true"][data-theme="dark"] .main-content {
  --emerald-brand-ink: #c5e8d2;
  --emerald-brand-accent: #a0d6b6;
}
html[data-reference-ui="true"] :is(.sidebar, .topbar, .mobile-nav) {
  display: none !important;
}
html[data-reference-ui="true"] .app-layout {
  display: block;
  max-width: none;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg);
}
html[data-reference-ui="true"] .main-content {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
}
html[data-reference-ui="true"] .main-content > :is(#group-view, #teachers-view) {
  margin: var(--emerald-shell-top) var(--emerald-shell-inline) 0;
}
html[data-reference-ui="true"] .em-header {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  margin: 0;
  padding: 19px 25px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
html[data-reference-ui="true"] .em-header svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
  flex-shrink: 0;
}
html[data-reference-ui="true"] .em-header :is(button, a):focus-visible,
html[data-reference-ui="true"] .em-mini-nav button:focus-visible {
  outline: 3px solid #337d63;
  outline-offset: 3px;
}
html[data-reference-ui="true"] .em-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
}
html[data-reference-ui="true"] .em-brand :is(img, .em-logo) {
  display: block;
  width: 33px;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
}
html[data-reference-ui="true"] .em-wordmark {
  font: 800 23px/1 'Manrope', 'Onest', sans-serif;
  letter-spacing: -1.2px;
  color: var(--emerald-brand-ink);
}
html[data-reference-ui="true"] .em-wordmark em {
  color: var(--emerald-brand-accent);
  font-style: normal;
}
html[data-reference-ui="true"] .em-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: auto;
}
html[data-reference-ui="true"] .em-nav button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font: 400 12px/1.5 'Onest', 'Segoe UI', sans-serif;
  white-space: nowrap;
}
html[data-reference-ui="true"] .em-nav button:is([aria-pressed="true"], .selected) {
  color: var(--accent);
  background: var(--soft);
  font-weight: 600;
}
html[data-reference-ui="true"] .em-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
html[data-reference-ui="true"] .em-header .em-theme {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 400 11px/1.5 'Onest', 'Segoe UI', sans-serif;
  white-space: nowrap;
}
html[data-reference-ui="true"] .em-header .em-theme span {
  display: inline;
}
html[data-reference-ui="true"] .em-header .em-theme svg {
  width: 15px;
  height: 15px;
}
html[data-reference-ui="true"] .em-icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--accent);
}
html[data-reference-ui="true"] .em-mini-nav {
  display: none;
}
html[data-reference-ui="true"][data-emerald-variant="portrait"] #group-view > .schedule-status {
  grid-column: 1 / -1;
}
html[data-reference-ui="true"] .schedule-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 13px 1px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
html[data-reference-ui="true"] .schedule-status .text-link {
  font-size: 10px;
}
html[data-reference-ui="true"] .schedule-status svg {
  width: 13px;
  height: 13px;
}
html[data-reference-ui="true"] .page-footer {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 0 10px;
  margin: 0 var(--emerald-shell-inline) var(--emerald-shell-bottom);
  padding: 18px 0 3px;
  border: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
html[data-reference-ui="true"] .page-footer .footer-brand {
  display: contents;
}
html[data-reference-ui="true"] .page-footer .footer-brand img {
  width: 35px;
  height: 35px;
  border-radius: 9px;
}
html[data-reference-ui="true"] .page-footer .footer-brand > span {
  color: var(--ink);
  font: 500 10px/1.6 'Onest', 'Segoe UI', sans-serif;
}
html[data-reference-ui="true"] .page-footer p {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}
@container (max-width: 880px) {
  html[data-reference-ui="true"] .main-content {
    --emerald-shell-top: 24px;
    --emerald-shell-inline: 22px;
    --emerald-shell-bottom: 17px;
  }
  html[data-reference-ui="true"] .em-header {
    gap: 10px;
    padding: 18px;
  }
  html[data-reference-ui="true"] .em-header .em-theme span {
    display: none;
  }
  html[data-reference-ui="true"] .em-nav button {
    padding: 8px;
    font-size: 11px;
  }
}
/* Keep all navigation controls visible between the desktop and phone layouts. */
@media (min-width: 621px) and (max-width: 760px) {
  html[data-reference-ui="true"] .em-header {
    flex-wrap: wrap;
  }
  html[data-reference-ui="true"] .em-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
    margin: 0;
  }
  html[data-reference-ui="true"] .em-header-actions {
    margin-left: auto;
  }
}
@container (max-width: 620px) {
  html[data-reference-ui="true"] .main-content {
    --emerald-shell-top: 0px;
    --emerald-shell-inline: 13px;
    --emerald-shell-bottom: 15px;
  }
  html[data-reference-ui="true"] .em-header {
    justify-content: space-between;
    gap: 9px;
    padding: 15px 16px;
    border-bottom: 0;
    background: var(--bg);
  }
  html[data-reference-ui="true"] .em-header-actions {
    gap: 5px;
  }
  html[data-reference-ui="true"] .em-header .em-theme {
    justify-content: center;
    width: 35px;
    padding: 8px;
  }
  html[data-reference-ui="true"] .em-brand :is(img, .em-logo) {
    width: 30px;
    height: 24px;
  }
  html[data-reference-ui="true"] .em-wordmark {
    font-size: 22px;
  }
  html[data-reference-ui="true"] .schedule-status {
    gap: 6px;
    margin-top: 15px;
  }
  html[data-reference-ui="true"] .page-footer {
    padding-top: 16px;
    align-items: start;
  }
}
/* The phone navigation belongs to the viewport, outside the query container.
   The source showcase used a static footer; the live app must stay reachable
   while a day, week or teacher schedule is scrolled. */
@media (max-width: 620px) {
  html[data-reference-ui="true"] body {
    padding-bottom: calc(63px + var(--safe-bottom));
  }
  html[data-reference-ui="true"] .app-layout {
    border-radius: 20px;
  }
  html[data-reference-ui="true"] .em-nav {
    display: none;
  }
  html[data-reference-ui="true"] .em-mini-nav {
    position: fixed;
    z-index: 20;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: 1fr 1.3fr .8fr .85fr;
    gap: 2px;
    padding: 10px 6px calc(9px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: var(--paper);
  }
  html[data-reference-ui="true"] .em-mini-nav button {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-height: 43px;
    padding: 3px 0;
    color: var(--muted);
    font: 400 9px/1.5 'Onest', 'Segoe UI', sans-serif;
  }
  html[data-reference-ui="true"] .em-mini-nav button:is([aria-pressed="true"], .selected) {
    color: var(--accent);
    font-weight: 600;
  }
  html[data-reference-ui="true"] .em-mini-nav svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.6;
  }
}
@container (max-width: 330px) {
  html[data-reference-ui="true"] .main-content {
    --emerald-shell-inline: 11px;
    --emerald-shell-bottom: 12px;
  }
  html[data-reference-ui="true"] .em-header {
    padding: 14px 12px;
  }
  html[data-reference-ui="true"] .em-wordmark {
    font-size: 20px;
  }
  html[data-reference-ui="true"] .em-brand :is(img, .em-logo) {
    width: 25px;
  }
}
html[data-reference-ui="true"] .em-logo {
  background: var(--emerald-brand-accent);
  -webkit-mask: var(--em-logo-url) center / contain no-repeat;
  mask: var(--em-logo-url) center / contain no-repeat;
}
html[data-reference-ui="true"] #group-view .em-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
html[data-reference-ui="true"] #group-view .schedule-panel {
  margin-bottom: 0;
}
html[data-reference-ui="true"] .em-clock {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
html[data-reference-ui="true"] .em-clock strong {
  color: var(--accent);
  font: 500 11px/1.5 'IBM Plex Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
}
@container (max-width: 880px) {
  html[data-reference-ui="true"] .em-clock span {
    display: none;
  }
}
@container (max-width: 620px) {
  html[data-reference-ui="true"] #group-view .em-viewbar {
    gap: 5px;
    margin-bottom: 13px;
  }
  html[data-reference-ui="true"] .em-clock,
  html[data-reference-ui="true"] .em-clock strong {
    font-size: 10px;
  }
}
@container (max-width: 330px) {
  html[data-reference-ui="true"] #group-view .em-viewbar {
    flex-wrap: wrap;
  }
}
/* Reset legacy card defaults that conflict with the reference component flow. */
html[data-reference-ui="true"] #group-view .em-viewbar {
  flex-direction: row;
}
html[data-reference-ui="true"] #group-view .em-viewbar > .view-toggle {
  order: 0;
  flex: 0 0 auto;
}
html[data-reference-ui="true"] #group-view .em-viewbar > .em-clock {
  order: 1;
  flex: 0 0 auto;
}
@media (prefers-reduced-motion: reduce) {
  html[data-reference-ui="true"] *,
  html[data-reference-ui="true"] *::before,
  html[data-reference-ui="true"] *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Shared headings outside the copied schedule components retain Onest. */
html[data-reference-ui="true"] :is(h1,h2,h3,.teacher-detail-name) { font-family:'Onest','Segoe UI',sans-serif; }
