/* Local Mini App redesign inspired by the supplied schedule screenshots. */
:root[data-theme="dark-violet"] {
  color-scheme: dark;
  --bg: #0e0f14;
  --surface: #1a1b21;
  --surface-soft: #22232b;
  --line: #30313b;
  --text: #f6f5fa;
  --muted: #a6a5b1;
  --accent: #ab8bf4;
  --accent-deep: #c0a7ff;
  --accent-soft: #2d2840;
  --accent-line: #625585;
  --positive: #9ed5bc;
  --positive-soft: #273d37;
  --nav-muted: #91919f;
  --nav-bg: rgba(25,26,33,.97);
  --day-active-bg: #a88af2;
  --day-active-text: #16131f;
  --button-bg: #ab8bf4;
  --button-text: #17131f;
  --toast-bg: #ddd2fa;
  --toast-text: #1a1427;
}
html { background: var(--bg); }
body { background: radial-gradient(ellipse 58% 28% at 100% 0%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 75%), var(--bg); }
body { font-size: 15px; line-height: 1.45; }
.app-shell { width: min(100%, 600px); padding: max(28px, env(safe-area-inset-top)) 22px calc(112px + env(safe-area-inset-bottom)); }
.app-header { display: flex; align-items: center; gap: 8px; min-height: 66px; margin-bottom: 18px; }
.app-header-title { min-width: 0; margin-right: auto; }
.app-kicker { display: block; margin-bottom: 3px; color: var(--accent-deep); font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.app-header h1 { font-size: clamp(23px, 5.4vw, 29px); letter-spacing: -.04em; }
.info-button { align-self: center; display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--accent-deep); font-size: 22px; line-height: 1; }
.context-line { display: flex; align-items: center; flex: 0 1 auto; gap: 7px; width: fit-content; max-width: 150px; min-height: 48px; margin: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.context-icon { color: var(--accent-deep); font-size: 21px; line-height: 1; }
.context-icon svg { display: block; width: 18px; height: 18px; }
.context-text { display: grid; min-width: 0; }
.context-label { color: var(--muted); font-size: 8px; line-height: 1.2; letter-spacing: .06em; }
.context-line strong { overflow: hidden; color: var(--accent-deep); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.view { animation: view-rise .25s cubic-bezier(.2,.7,.2,1) both; }
@keyframes view-rise { from { opacity: .45; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card { border-radius: 21px; box-shadow: 0 3px 12px rgba(0,0,0,.04); }
.setting-card, .profile-card, .about-card, .week-summary, .reminder-preview, .rhythm-card { background: var(--surface); }
.live-card { margin: 0 0 18px; padding: 16px 18px 15px; border-color: var(--line); border-radius: 21px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); box-shadow: 0 4px 13px rgba(0,0,0,.05); }
.live-card::after { display: none; }
.live-topline { margin-bottom: 9px; }
.live-state { color: var(--accent-deep); font-size: 10px; }
.live-state::before { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.live-subject { margin-bottom: 7px; font-size: clamp(18px, 4.5vw, 22px); letter-spacing: -.03em; }
.live-details { gap: 3px 9px; margin-bottom: 11px; font-size: 11px; }
.live-timer-wrap { padding-top: 10px; border-color: var(--line); }
.live-timer { font-size: clamp(20px, 5vw, 27px); letter-spacing: -.025em; }
.live-timer-caption { font-size: 10px; }
.week-nav { min-height: 92px; margin: 0; padding: 15px 15px 9px; border: 1px solid var(--line); border-bottom: 0; border-radius: 21px 21px 0 0; background: var(--surface); }
.week-nav-center { display: grid; justify-items: center; min-width: 0; gap: 3px; }
.week-nav-center > strong { font-size: 16px; font-weight: 760; }
.week-nav-center small { color: var(--muted); font-size: 9px; }
.week-meta { display: flex; align-items: center; justify-content: center; gap: 7px; }
.day-parity { margin: 4px 0 0; color: var(--accent-deep); font-size: 12px; font-weight: 750; letter-spacing: .01em; }
.week-actions { display: flex; align-items: center; gap: 6px; }
.today-button { margin: 0; padding: 3px 9px; border: 0; border-radius: 99px; background: var(--accent-soft); color: var(--accent-deep); font-size: 10px; }
.calendar-button { border: 0; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; }
.calendar-button svg { display: block; width: 18px; height: 18px; }
.round-button { flex: 0 0 35px; width: 35px; height: 35px; border-radius: 50%; background: var(--surface-soft); font-size: 25px; }
.day-tabs { gap: 2px; margin: 0 0 25px; padding: 10px 11px 13px; border-top: 0; border-radius: 0 0 21px 21px; background: var(--surface); }
.day-tab { min-height: 62px; border-radius: 11px; }
.day-tab .short { font-size: 11px; }
.day-tab .number { font-size: 18px; }
.day-load { font-size: 9px; }
.day-tab.active { box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 25%, transparent); }
.day-heading { align-items: center; margin-bottom: 13px; }
.eyebrow { color: var(--accent-deep); font-size: 10px; letter-spacing: 0; text-transform: none; }
.day-heading h2 { font-size: clamp(21px, 4.9vw, 24px); letter-spacing: -.03em; }
.pill { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--accent-deep); }
.lesson-list { gap: 10px; }
.lesson-card { position: relative; display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; padding: 16px 17px 17px 20px; overflow: hidden; border-radius: 17px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 60%), color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: blur(16px) saturate(145%); box-shadow: 0 12px 26px rgba(0,0,0,.09), inset 0 1px 0 rgba(255,255,255,.06); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.lesson-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: color-mix(in srgb, var(--accent) 45%, var(--text)); }
.lesson-card:hover { border-color: var(--accent-line); box-shadow: 0 16px 32px rgba(0,0,0,.14); transform: translateY(-2px); }
.lesson-card:active { transform: scale(.99); }
.lesson-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.subgroup-card { gap: 0; cursor: default; }
.subgroup-row { display: grid; gap: 5px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.subgroup-row:first-of-type { margin-top: 8px; }
.subgroup-label { color: var(--accent-deep); font-size: 12px; font-weight: 700; }
.subgroup-subject { font-size: 15px; line-height: 1.35; }
.subgroup-details { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 12px; }
.subgroup-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lesson-card.current::before { background: var(--positive); }
.lesson-card.next::before { background: var(--accent); }
.lesson-top { display: flex; flex-direction: row; align-items: center; grid-column: 1; grid-row: 1; gap: 4px; min-height: 25px; padding: 0 77px 0 0; border: 0; }
.lesson-time { margin: 0; font-size: 14px; }
.lesson-end { margin: 0; font-size: 14px; font-weight: 750; color: var(--text); }
.lesson-end::before { content: "– "; }
.lesson-number { position: absolute; top: 14px; right: 13px; order: initial; min-width: 27px; margin: 0; padding: 4px 6px; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-soft); color: var(--accent-deep); text-align: center; font-size: 10px; letter-spacing: 0; }
.lesson-status { position: relative; grid-column: 1; grid-row: 3; justify-self: start; margin: 0; padding: 3px 8px; border-radius: 8px; font-size: 9px; }
.lesson-subject { grid-column: 1; grid-row: 2; margin: 0; font-size: 17px; letter-spacing: -.02em; }
.lesson-meta { grid-column: 1; grid-row: 4; gap: 4px 0; color: var(--muted); font-size: 12px; }
.lesson-meta .meta-room { color: var(--accent-deep); }
.lesson-meta span + span::before { color: var(--muted); }
.empty-card { padding: 31px; }
.week-summary { margin-top: 18px; padding: 17px 20px; }
.setting-card, .profile-card, .about-card { margin-bottom: 12px; padding: 20px; }
.setting-symbol, .reminder-preview-icon { border-radius: 12px; }
.setting-title h3, .about-card h3, .theme-card h3 { font-size: 15px; }
.setting-symbol svg { display: block; width: 20px; height: 20px; }
.option-button { min-height: 43px; border-radius: 11px; font-size: 11px; transition: transform .2s cubic-bezier(.16,1,.3,1), background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.option-button:not(:disabled):active { transform: scale(.94); }
.option-button.selected, .option-button.off.selected { border-color: var(--accent); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 74%, #6bbbdc)); color: var(--button-text); box-shadow: 0 7px 22px color-mix(in srgb, var(--accent) 29%, transparent), inset 0 1px 0 rgba(255,255,255,.23); font-weight: 800; }
.wide-button { min-height: 49px; border-radius: 13px; font-size: 12px; }
.reminder-preview { border-color: var(--line); background: var(--surface); }
.profile-card label { font-size: 10px; }
.profile-card select { min-height: 49px; border-radius: 12px; background: var(--surface-soft); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.profile-hero { position: relative; overflow: hidden; margin-bottom: 12px; padding: 23px 21px 19px; border-color: var(--accent-line); background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 21%, transparent), transparent 53%), color-mix(in srgb, var(--surface) 82%, transparent); }
.profile-eyebrow { color: var(--accent-deep); font-size: 10px; font-weight: 750; letter-spacing: .09em; }
.profile-hero h3 { margin: 7px 0 6px; font-size: 25px; line-height: 1.2; }
.profile-hero .profile-stats { margin-top: 18px; }
.profile-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding-top: 15px; border-top: 1px solid var(--line); }
.profile-stats > div { display: grid; }
.profile-stats strong { color: var(--accent-deep); font-size: 20px; line-height: 1.1; }
.profile-stats span { color: var(--muted); font-size: 10px; }
.rhythm-card { margin-bottom: 12px; padding: 20px; }
.rhythm-card .week-summary-head { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.rhythm-heading h3 { margin: 4px 0 2px; font-size: 17px; }
.rhythm-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.profile-rhythm { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; margin-top: 19px; }
.rhythm-day { display: grid; justify-items: center; gap: 6px; min-width: 0; padding: 8px 3px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--muted); transition: transform .24s cubic-bezier(.16,1,.3,1), background .24s ease, border-color .24s ease; }
.rhythm-day:hover, .rhythm-day.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-deep); transform: translateY(-3px); }
.rhythm-day:active { transform: scale(.93); }
.rhythm-label { font-size: 10px; font-weight: 750; }
.rhythm-track { display: flex; align-items: end; width: 100%; height: 42px; padding: 3px; border-radius: 7px; background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft)); }
.rhythm-fill { display: block; width: 100%; min-height: 3px; border-radius: 5px; background: linear-gradient(0deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #70d0d0)); transition: height .35s ease; }
.rhythm-day strong { font-size: 11px; }
.group-chooser { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 49px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--text); text-align: left; font-size: 12px; font-weight: 720; }
.group-chooser > span:last-child { color: var(--accent-deep); font-size: 20px; }
.theme-intro { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.dark-mode-toggle { display: flex; align-items: center; width: 100%; min-height: 66px; gap: 12px; margin-top: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); color: var(--text); text-align: left; }
.dark-mode-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); font-size: 22px; }
.dark-mode-toggle > span:nth-child(2) { display: grid; flex: 1; gap: 2px; }
.dark-mode-toggle strong { font-size: 12px; }
.dark-mode-toggle small { color: var(--muted); font-size: 10px; }
.mode-switch { position: relative; flex: 0 0 37px; width: 37px; height: 21px; border: 1px solid var(--accent-line); border-radius: 20px; background: var(--accent-soft); }
.mode-switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); transition: transform .18s ease; }
.dark-mode-toggle[aria-pressed="false"] .mode-switch { border-color: var(--line); background: var(--surface); }
.dark-mode-toggle[aria-pressed="false"] .mode-switch::after { transform: translateX(-15px); background: var(--muted); }
.theme-group { margin-top: 19px; }
.theme-group-label { font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.theme-options { grid-template-columns: 1fr; gap: 7px; }
.theme-button { display: flex; align-items: center; justify-items: initial; gap: 13px; min-height: 63px; padding: 8px 12px; border-radius: 13px; text-align: left; }
.theme-button.selected { background: var(--accent-soft); }
.theme-swatch { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; }
.theme-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.theme-copy strong { font-size: 12px; }
.theme-copy small { color: var(--muted); font-size: 10px; font-weight: 500; }
.theme-check { display: grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; color: transparent; }
.theme-button.selected .theme-check { border-color: var(--accent); background: var(--accent); color: var(--button-text); }
.group-search { width: 100%; min-height: 47px; margin-bottom: 13px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: var(--surface-soft); color: var(--text); font: inherit; }
.group-search:focus { border-color: var(--accent); }
.group-list { display: grid; gap: 6px; max-height: min(56dvh,440px); overflow-y: auto; }
.group-option { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 13px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); text-align: left; font-size: 12px; font-weight: 660; }
.group-option:hover { background: var(--surface-soft); }
.group-option.selected { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-deep); }
.group-option-check { color: var(--accent-deep); font-size: 18px; }
.group-list-empty { padding: 14px; color: var(--muted); text-align: center; }
.about-card p { font-size: 11px; line-height: 1.6; }
.bottom-nav { width: min(calc(100% - 20px), 580px); bottom: max(9px, env(safe-area-inset-bottom)); min-height: 68px; padding: 5px; border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--nav-bg) 86%, transparent); backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 12px 34px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08); }
.nav-button { border: 1px solid transparent; border-radius: 15px; }
.nav-button svg { width: 21px; height: 21px; }
.nav-button small { font-size: 10px; }
.nav-button.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-deep); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 13%, transparent); }
.nav-button.active::after { display: none; }
.toast { bottom: calc(92px + env(safe-area-inset-bottom)); border-radius: 13px; }
.sheet { position: fixed; inset: auto 0 0; width: min(100%,600px); max-width: 600px; max-height: min(88dvh,760px); margin: 0 auto; padding: 12px 22px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 30px 30px 0 0; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 48%), color-mix(in srgb, var(--surface) 93%, transparent); backdrop-filter: blur(28px) saturate(160%); color: var(--text); box-shadow: 0 -16px 54px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08); }
.sheet[open] { animation: sheet-rise .25s cubic-bezier(.2,.7,.2,1) both; }
.sheet::backdrop { background: rgba(0,0,0,.68); animation: backdrop-in .18s ease both; }
@keyframes sheet-rise { from { opacity: .4; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 19px; border-radius: 999px; background: var(--accent-line); }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.sheet-heading h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.035em; }
.sheet-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.sheet-close { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--accent-deep); font-size: 28px; line-height: 1; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.calendar-toolbar strong { font-size: 15px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; text-align: center; }
.calendar-weekdays { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.calendar-grid button { aspect-ratio: 1; min-width: 0; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); font-size: 13px; font-weight: 700; }
.calendar-grid button.other-month { color: var(--muted); opacity: .45; }
.calendar-grid button.selected { background: var(--day-active-bg); color: var(--day-active-text); box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 23%, transparent); }
.calendar-grid button.today:not(.selected) { border-color: var(--accent-line); color: var(--accent-deep); }
.calendar-today { width: 100%; min-height: 46px; margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); color: var(--text); font-weight: 730; }
.lesson-dialog-type { display: inline-block; padding: 6px 10px; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-soft); color: var(--accent-deep); font-size: 10px; font-weight: 750; }
.lesson-dialog-fields { margin-top: 20px; border: 1px solid var(--line); border-radius: 19px; padding: 3px 16px; }
.lesson-dialog-row { display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: start; gap: 12px; padding: 15px 0; font-size: 12px; }
.lesson-dialog-row + .lesson-dialog-row { border-top: 1px solid var(--line); }
.lesson-dialog-row span { color: var(--muted); }
.lesson-dialog-row strong { overflow-wrap: anywhere; text-align: right; }
.about-sheet-card { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(circle at 100% 100%, var(--accent-soft), var(--surface-soft) 52%); }
.about-sheet-card span { color: var(--accent-deep); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.about-sheet-card strong { display: block; margin-top: 10px; font-size: 19px; line-height: 1.25; }
.about-sheet-card p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.about-detail { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
@media (max-width: 500px) {
  .app-shell { padding: max(22px, env(safe-area-inset-top)) 15px calc(105px + env(safe-area-inset-bottom)); }
  .app-header { margin-bottom: 16px; }
  .context-line { max-width: 145px; padding: 6px; }
  .context-icon { font-size: 18px; }
  .week-nav { padding: 13px 11px 8px; }
  .day-tabs { padding: 8px 8px 12px; }
  .day-tab { min-height: 59px; }
  .day-tab .number { font-size: 17px; }
  .lesson-card { padding-left: 17px; }
  .sheet { padding-left: 19px; padding-right: 19px; }
}
@media (max-width: 355px) {
  .app-header h1 { font-size: 21px; }
  .app-kicker { font-size: 8px; }
  .context-line { max-width: 128px; }
  .context-line strong { font-size: 11px; }
  .lesson-dialog-row { grid-template-columns: 90px minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .view, .sheet[open], .sheet::backdrop, .lesson-card, .option-button, .rhythm-day, .rhythm-fill { animation: none; transition: none; }
}
