:root {
  color-scheme: light dark;
  --bg: #f2f3f8;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --text: #12152b;
  --muted: #5a5f78;
  --line: #e1e3ee;
  --brand: #0d1028;
  --brand-2: #1c2256;
  --accent: #fcbf31;
  --accent-soft: #fff3d1;
  --accent-ink: #5c4200;
  --practice-soft: #e2f5e8;
  --practice-line: #2f9e5b;
  --practice-ink: #1c5e37;
  --danger-soft: #fde7e4;
  --danger-ink: #a3261b;
  --focus: #3a67ff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(13 16 40 / 5%), 0 6px 20px rgb(13 16 40 / 6%);
  --tone-bg-s: 75%;
  --tone-bg-l: 96%;
  --tone-line-s: 62%;
  --tone-line-l: 47%;
  --tone-ink-l: 30%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090b18;
    --surface: #13162b;
    --surface-2: #191d36;
    --text: #eceef8;
    --muted: #a0a5bf;
    --line: #262a47;
    --accent-soft: #3a2e0c;
    --accent-ink: #ffd772;
    --practice-soft: #10301f;
    --practice-ink: #86ddab;
    --danger-soft: #3d1714;
    --danger-ink: #ff9d92;
    --shadow: none;
    --tone-bg-s: 35%;
    --tone-bg-l: 17%;
    --tone-line-s: 65%;
    --tone-line-l: 62%;
    --tone-ink-l: 80%;
  }
}
.tone-0 {
  --h: 200;
}

.tone-1 {
  --h: 222.5;
}

.tone-2 {
  --h: 245;
}

.tone-3 {
  --h: 267.5;
}

.tone-4 {
  --h: 290;
}

.tone-5 {
  --h: 312.5;
}

.tone-6 {
  --h: 335;
}

.tone-7 {
  --h: 357.5;
}

.tone-8 {
  --h: 20;
}

.tone-9 {
  --h: 42.5;
}

.tone-10 {
  --h: 65;
}

.tone-11 {
  --h: 87.5;
}

.tone-12 {
  --h: 110;
}

.tone-13 {
  --h: 132.5;
}

.tone-14 {
  --h: 155;
}

.tone-15 {
  --h: 177.5;
}

.profession-hairdresser {
  --h: 330;
}

.profession-plasterer {
  --h: 28;
}

.profession-plumber {
  --h: 212;
}

.profession-drywall {
  --h: 165;
}

.profession-mason {
  --h: 262;
}

.profession-painter {
  --h: 190;
}

.profession-tiler {
  --h: 140;
}

.profession-welder {
  --h: 5;
}

.profession-makeup {
  --h: 295;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 Rubik, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: var(--brand);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  height: 34px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong {
  font-size: 16px;
  font-weight: 500;
}
.brand-text small {
  font-size: 12px;
  opacity: 0.7;
}

.switch {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.switch-item {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
}
.switch-item.is-active {
  background: var(--accent);
  color: var(--brand);
}

@media (max-width: 380px) {
  .brand-text small {
    display: none;
  }
  .switch-item {
    padding: 7px 10px;
  }
}
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 28px);
  color: var(--muted);
  font-size: 14px;
}
.footer a {
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

.notice {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.notice p {
  margin: 0;
}
.notice p + p {
  margin-top: 6px;
}

.notice-week {
  padding: 28px 20px;
  text-align: center;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.subject {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.subject-group {
  border-top: 6px solid hsl(var(--h, 220), var(--tone-line-s), var(--tone-line-l));
}

.subject-text {
  min-width: 0;
}

.subject-eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subject-name {
  margin: 0;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 700;
  line-height: 1.1;
}

.subject-sub {
  margin: 4px 0 0;
  color: var(--muted);
}

.subject-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.dot-production {
  background: var(--accent);
}

.subject-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.action:hover {
  border-color: var(--muted);
}

.action-save[aria-pressed=true] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.action-save[aria-pressed=true] .icon-star {
  fill: var(--accent);
  stroke: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  transform: translateX(-50%);
}

.week {
  margin-top: 16px;
}

.week-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.week-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
}

.week-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.week-caption {
  color: var(--muted);
  font-size: 13px;
}

.week-title {
  font-size: 17px;
  font-weight: 500;
}

.week-back {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
}
.week-back a {
  color: var(--focus);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 12px -16px 0;
  padding: 10px 16px;
  overflow-x: auto;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: flex;
  flex: 1 0 58px;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 6px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
}
.tab[aria-selected=true] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.tab[aria-selected=true] .tab-note {
  color: rgba(255, 255, 255, 0.75);
}
.tab[aria-selected=true] .tab-note-production {
  background: var(--accent);
  color: var(--brand);
}
.tab.is-empty:not([aria-selected=true]) {
  color: var(--muted);
}
.tab.is-today::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .tab[aria-selected=true] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--brand);
  }
  .tab[aria-selected=true] .tab-note {
    color: rgba(13, 16, 40, 0.7);
  }
  .tab[aria-selected=true] .tab-note-production {
    background: var(--brand);
    color: var(--accent);
  }
  .tab.is-today[aria-selected=true]::after {
    background: var(--brand);
  }
}
.tab-name {
  font-size: 13px;
  font-weight: 500;
}

.tab-date {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.tab-note {
  min-width: 26px;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.tab-note-production {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 500;
}

.days {
  margin-top: 4px;
}

.day-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 10px;
  font-size: 17px;
  font-weight: 500;
}

.today-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
}

.day-empty {
  margin: 0;
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
}

.entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid hsl(var(--h, 220), var(--tone-line-s), var(--tone-line-l));
  border-radius: var(--radius-sm);
  background: hsl(var(--h, 220), var(--tone-bg-s), var(--tone-bg-l));
  transition: opacity 0.2s;
}

.entry-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2px;
  color: hsl(var(--h, 220), 45%, var(--tone-ink-l));
}

.entry-number {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.entry-unit {
  font-size: 11px;
}

.entry-body {
  min-width: 0;
}

.entry-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.entry-title {
  margin: 1px 0 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.entry-meta:empty {
  display: none;
}

.entry-person {
  overflow-wrap: anywhere;
}

.entry-group-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.badge-substitution {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.group-chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: hsl(var(--h, 220), var(--tone-line-s), var(--tone-line-l));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.entry.kind-production_training {
  border-color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.entry.kind-production_training .entry-when {
  color: var(--accent-ink);
}

.entry.kind-practice {
  border-left-color: var(--practice-line);
  background: var(--practice-soft);
}
.entry.kind-practice .entry-when {
  color: var(--practice-ink);
}

.entry-status:empty {
  display: none;
}

.entry-status {
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.entry.is-now {
  box-shadow: 0 0 0 2px var(--accent);
}
.entry.is-now .entry-status {
  background: var(--accent);
  color: var(--brand);
}

.entry.is-next .entry-status {
  background: var(--surface-2);
  color: var(--text);
}

.entry.is-past {
  opacity: 0.55;
}

.gap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.gap::before, .gap::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--line);
}

.updated {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.picker-title {
  margin: 4px 0 4px;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.1;
}

.picker-lead {
  margin: 0 0 14px;
  color: var(--muted);
}

.courses {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 14px;
}

.course-btn {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.course-btn[aria-current=true] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.course-btn.is-disabled {
  color: var(--muted);
  opacity: 0.5;
}

@media (prefers-color-scheme: dark) {
  .course-btn[aria-current=true] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--brand);
  }
}
.mine-card {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-left: 6px solid hsl(var(--h, 220), var(--tone-line-s), var(--tone-line-l));
  border-radius: var(--radius);
  background: hsl(var(--h, 220), var(--tone-bg-s), var(--tone-bg-l));
  box-shadow: var(--shadow);
  text-decoration: none;
}
.mine-card .icon-star {
  fill: var(--accent);
  stroke: var(--accent);
}

.mine-card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--h, 220), 45%, var(--tone-ink-l));
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mine-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mine-card-number {
  color: hsl(var(--h, 220), 45%, var(--tone-ink-l));
  font-size: 52px;
  font-weight: 700;
  line-height: 0.9;
}

.mine-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mine-card-title {
  font-weight: 500;
  line-height: 1.3;
}

.mine-card-course {
  color: var(--muted);
  font-size: 14px;
}

.mine-card-name {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.mine-card-today {
  font-size: 15px;
}

.mine-card-go {
  justify-self: start;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .mine-card-go {
    background: var(--accent);
    color: var(--brand);
  }
}
.search {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -16px 8px;
  padding: 10px 16px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--muted);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.picker-heading {
  margin: 14px 2px 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 5px solid hsl(var(--h, 220), var(--tone-line-s), var(--tone-line-l));
  border-radius: var(--radius-sm);
  background: hsl(var(--h, 220), var(--tone-bg-s), var(--tone-bg-l));
  text-decoration: none;
}
.group-card:hover {
  border-color: hsl(var(--h, 220), var(--tone-line-s), var(--tone-line-l));
}
.group-card.is-mine {
  box-shadow: 0 0 0 2px var(--accent);
}
.group-card .icon-star {
  width: 18px;
  height: 18px;
  fill: var(--accent);
  stroke: var(--accent);
}

.group-number {
  display: flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--h, 220), 45%, var(--tone-ink-l));
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.group-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.teacher-list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  list-style: none;
}
.teacher-list li + li {
  border-top: 1px solid var(--line);
}

.teacher-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  text-decoration: none;
}
.teacher-row:hover {
  background: var(--surface-2);
}

.teacher-initial {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: hsl(var(--h, 220), var(--tone-bg-s), var(--tone-bg-l));
  color: hsl(var(--h, 220), 45%, var(--tone-ink-l));
  font-weight: 700;
}

.teacher-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}
.teacher-name .icon-star {
  width: 16px;
  height: 16px;
  margin-left: 6px;
  vertical-align: -2px;
  fill: var(--accent);
  stroke: var(--accent);
}

.teacher-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 960px) {
  .page {
    padding-top: 24px;
  }
  .subject {
    padding: 22px 26px;
  }
  .tabs {
    display: none;
  }
  .days {
    display: grid;
    grid-template-columns: repeat(var(--days, 5), minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }
  .day[hidden] {
    display: block !important;
  }
  .day {
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .day-title {
    margin-top: 2px;
    font-size: 16px;
  }
  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 12px;
  }
  .entry-when {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    padding: 0;
  }
  .entry-number {
    font-size: 16px;
  }
  .entry-title {
    font-size: 15px;
  }
  .search {
    margin: 0 0 8px;
    padding: 10px 0;
  }
}
@media print {
  :root {
    color-scheme: light;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 12px;
  }
  .topbar, .footer, .subject-actions, .week-nav, .week-back, .tabs, .picker .search, .courses, .toast {
    display: none !important;
  }
  .page {
    max-width: none;
    padding: 0;
  }
  .subject, .day {
    box-shadow: none;
  }
  .days {
    display: grid;
    grid-template-columns: repeat(var(--days, 5), 1fr);
    gap: 6px;
  }
  .day[hidden] {
    display: block !important;
  }
  .entry {
    break-inside: avoid;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px 8px;
    opacity: 1 !important;
  }
  .entry-number {
    font-size: 13px;
  }
  .entry-title {
    font-size: 12px;
  }
}
