:root {
  color-scheme: light;
  --ink: #14233a;
  --ink-soft: #55627a;
  --ink-faint: #8791a4;
  --navy: #10182b;
  --navy-raised: #1a2540;
  --canvas: #f5f6fb;
  --paper: #fff;
  --line: #e8eaf1;
  --line-strong: #d9dce7;
  --lime: #c9f36f;
  --lime-deep: #a9dc45;
  --violet: #6558e8;
  --violet-soft: #f0efff;
  --cyan-soft: #e9f8f6;
  --coral: #ed816f;
  --amber-soft: #fff5df;
  --shadow: 0 12px 34px rgba(24, 35, 58, .055);
  --shadow-dialog: 0 28px 90px rgba(12, 20, 39, .26);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body { position: relative; isolation: isolate; min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(101, 88, 232, .58); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
::selection { color: var(--ink); background: rgba(201, 243, 111, .62); }

.app-background-layer { position: fixed; inset: 0; z-index: 0; display: none; overflow: hidden; pointer-events: none; background: var(--canvas); }
.app-background-layer img { position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; object-position: center; transform: scale(1); transition: filter .24s ease, object-position .24s ease, object-fit .24s ease; }
.app-background-layer > div { position: absolute; inset: 0; background: #000; opacity: .32; transition: opacity .2s ease; }
.app-shell { position: relative; z-index: 1; min-height: 100vh; background: transparent; }
body.has-custom-background .app-background-layer { display: block; }
body.has-custom-background .sidebar { background: rgba(16,24,43,.91); }
body.has-custom-background .topbar { background: rgba(249,250,253,.82); }
body.has-custom-background .card,
body.has-custom-background .metric-card,
body.has-custom-background .session-row,
body.has-custom-background .planner-item,
body.has-custom-background .filter-bar,
body.has-custom-background .exam-card,
body.has-custom-background .week-day,
body.has-custom-background .backup-panel,
body.has-custom-background .study-tip,
body.has-custom-background .quick-action,
body.has-custom-background .empty-state { background-color: rgba(255,255,255,.92); }
body.has-custom-background .exam-card { background-image: linear-gradient(135deg, rgba(247,246,255,.94), rgba(255,255,255,.94)); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: 248px; flex-direction: column; padding: 28px 18px 22px; color: #e9edfa; background: var(--navy); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; color: var(--ink); background: var(--lime); font-size: 20px; font-weight: 850; letter-spacing: -.06em; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 17px; font-weight: 760; letter-spacing: -.055em; }
.brand-copy small { color: #9ba6bf; font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.nav-caption { margin: 42px 10px 11px; color: #7f8aa3; font-size: 9px; font-weight: 750; letter-spacing: .17em; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; min-height: 45px; align-items: center; gap: 12px; padding: 0 11px; border: 1px solid transparent; border-radius: 12px; color: #aeb8cc; background: transparent; cursor: pointer; text-align: left; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item:active { transform: scale(.985); }
.nav-item.is-active { border-color: rgba(201,243,111,.11); color: var(--lime); background: rgba(201,243,111,.10); font-weight: 690; }
.nav-icon { display: inline-grid; width: 22px; place-items: center; color: currentColor; font-size: 19px; line-height: 1; }
.sidebar-bottom { margin-top: auto; }
.sidebar-note { display: flex; gap: 10px; padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; color: #bac4d6; background: rgba(255,255,255,.035); font-size: 11px; line-height: 1.7; }
.sidebar-note strong { color: #f4f7ff; font-weight: 620; }
.note-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 7px; border-radius: 99px; background: var(--lime); box-shadow: 0 0 0 4px rgba(201,243,111,.10); }
.sidebar-meta { margin: 18px 8px 0; color: #7f8aa3; font-size: 10px; line-height: 1.65; }
.sidebar-meta span { color: #aeb8cc; }
.main-column { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; height: 70px; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 56px); border-bottom: 1px solid rgba(220,223,233,.8); background: rgba(249,250,253,.87); backdrop-filter: blur(18px); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: #626e82; font-size: 9px; font-weight: 740; letter-spacing: .15em; }
.breadcrumb strong { color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: -.01em; }
.breadcrumb-slash { color: #c2c7d3; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.local-pill { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #e1e7d2; border-radius: 99px; color: #536b28; background: #f4fae9; font-size: 9px; font-weight: 790; letter-spacing: .1em; }
.local-pill span { color: #81b632; font-size: 7px; }
.avatar-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: var(--violet); cursor: pointer; font-size: 12px; font-weight: 730; }
#main-content { max-width: 1440px; margin: 0 auto; padding: 30px clamp(20px, 4vw, 56px) 70px; outline: none; }
#view-root { animation: appear .24s ease both; }
@keyframes appear { from { opacity: .45; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 3px 0 25px; }
.eyebrow { margin: 0 0 7px; color: var(--violet); font-size: 9px; font-weight: 790; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; color: var(--ink); font-size: clamp(26px, 3vw, 36px); font-weight: 690; letter-spacing: -.06em; line-height: 1.11; }
h2 { color: var(--ink); font-size: 18px; font-weight: 690; letter-spacing: -.04em; line-height: 1.25; }
h3 { color: var(--ink); font-size: 14px; font-weight: 680; letter-spacing: -.025em; }
.view-subtitle { max-width: 560px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.date-stamp { color: #626e82; font-size: 11px; font-weight: 650; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 9px; padding: 0 14px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 12px; font-weight: 680; text-decoration: none; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: #1c2a13; background: var(--lime); box-shadow: 0 5px 12px rgba(115,150,40,.12); }
.button-primary:hover { background: #d8fa9b; box-shadow: 0 8px 16px rgba(115,150,40,.18); }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.button-secondary:hover { background: #f8f8fb; }
.button-quiet { border-color: transparent; color: var(--ink-soft); background: transparent; }
.button-quiet:hover { color: var(--ink); background: #f0f1f7; }
.button-small { min-height: 31px; padding: 0 10px; border-radius: 9px; font-size: 10px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: #fff; cursor: pointer; font-size: 22px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: #f4f5fa; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .8fr); gap: 17px; }
.dashboard-main { display: grid; gap: 17px; min-width: 0; }
.dashboard-side { display: grid; align-content: start; gap: 17px; min-width: 0; }
.card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.card-header h2, .card-header h3 { margin: 0; }
.card-kicker { margin: 0 0 4px; color: #626e82; font-size: 9px; font-weight: 760; letter-spacing: .14em; text-transform: uppercase; }
.text-link { padding: 4px 0; border: 0; color: var(--violet); background: none; cursor: pointer; font-size: 11px; font-weight: 680; text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero-card { position: relative; overflow: hidden; min-height: 222px; padding: 25px 27px; border: 0; border-radius: 19px; color: #f3f5ff; background: radial-gradient(circle at 82% 18%, rgba(117,101,236,.45), transparent 32%), linear-gradient(128deg, #192646, #11192d 67%); box-shadow: 0 18px 36px rgba(18,28,54,.13); }
.hero-card::before { position: absolute; top: -85px; right: 54px; width: 250px; height: 250px; border: 1px solid rgba(211,216,255,.12); border-radius: 50%; content: ""; }
.hero-card::after { position: absolute; top: -30px; right: 14px; width: 250px; height: 250px; border: 1px solid rgba(211,216,255,.10); border-radius: 50%; content: ""; }
.hero-content { position: relative; z-index: 1; max-width: 540px; }
.hero-card .eyebrow { color: var(--lime); }
.hero-card h1, .hero-card h2 { max-width: 500px; margin: 0 0 10px; color: #fff; font-size: clamp(26px, 3vw, 34px); font-weight: 690; letter-spacing: -.06em; line-height: 1.11; }
.hero-card p { max-width: 470px; margin: 0 0 18px; color: #b9c2d6; font-size: 12px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.hero-card .button-secondary { border-color: rgba(255,255,255,.18); color: #f5f6ff; background: rgba(255,255,255,.07); }
.hero-card .button-secondary:hover { background: rgba(255,255,255,.13); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.metric-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.metric-label { display: flex; align-items: center; gap: 7px; color: #626e82; font-size: 10px; font-weight: 620; }
.metric-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; color: var(--violet); background: var(--violet-soft); font-size: 12px; }
.metric-number { margin: 10px 0 0; color: var(--ink); font-size: 26px; font-weight: 720; letter-spacing: -.055em; line-height: 1.1; }
.metric-foot { margin: 4px 0 0; color: #626e82; font-size: 10px; }
.progress-track { overflow: hidden; height: 7px; border-radius: 9px; background: #eff0f6; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), #9187ff); transition: width .35s ease; }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 11px 0 7px; color: var(--ink-soft); font-size: 11px; }
.progress-row strong { color: var(--ink); font-weight: 700; }
.session-list, .exam-list, .task-list { display: grid; gap: 9px; }
.session-row { display: grid; grid-template-columns: 54px 3px minmax(0,1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid #edf0f5; border-radius: 12px; background: #fff; transition: border-color .16s ease, transform .16s ease; }
.session-row:hover { border-color: #d8d7fb; transform: translateY(-1px); }
.session-row.is-complete { background: #fafcf6; }
.session-time { color: #626e82; font-size: 10px; font-weight: 690; font-variant-numeric: tabular-nums; }
.session-accent { align-self: stretch; min-height: 34px; border-radius: 99px; background: var(--violet); }
.session-accent.priority-high { background: var(--coral); }
.session-accent.priority-low { background: #85c8bc; }
.session-info { min-width: 0; }
.session-info strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.session-info span { display: block; overflow: hidden; margin-top: 2px; color: #626e82; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.session-state { padding: 5px 8px; border: 0; border-radius: 8px; color: #5e54cc; background: #f0efff; cursor: pointer; font-size: 9px; font-weight: 680; }
.session-state:hover { background: #e7e5ff; }
.is-complete .session-state { color: #4f6c20; background: #eef7de; }
.exam-card { position: relative; overflow: hidden; padding: 18px; border: 1px solid #e4e2fb; border-radius: 15px; background: linear-gradient(135deg, #f7f6ff, #fff); }
.exam-card::after { position: absolute; right: -24px; bottom: -42px; width: 104px; height: 104px; border: 1px solid rgba(101,88,232,.12); border-radius: 50%; content: ""; }
.exam-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exam-date-chip { padding: 5px 8px; border-radius: 8px; color: #5d54c8; background: #ebe9ff; font-size: 9px; font-weight: 730; }
.exam-countdown { position: relative; z-index: 1; margin: 14px 0 2px; color: var(--ink); font-size: 32px; font-weight: 740; letter-spacing: -.07em; line-height: 1; }
.exam-countdown span { margin-left: 4px; color: #626e82; font-size: 10px; font-weight: 580; letter-spacing: .01em; }
.exam-title { position: relative; z-index: 1; margin: 10px 0 2px; color: var(--ink); font-size: 12px; font-weight: 700; }
.exam-subject { position: relative; z-index: 1; margin: 0; color: #626e82; font-size: 10px; }
.exam-actions { position: relative; z-index: 1; display: flex; gap: 6px; margin-top: 11px; }
.empty-state { padding: 24px 16px; border: 1px dashed #dfe3ed; border-radius: 13px; color: #626e82; background: #fcfcfe; text-align: center; }
.empty-icon { display: grid; width: 38px; height: 38px; place-items: center; margin: 0 auto 9px; border-radius: 13px; color: #6057d0; background: var(--violet-soft); font-size: 16px; }
.empty-state strong { display: block; color: var(--ink); font-size: 12px; }
.empty-state p { max-width: 290px; margin: 5px auto 12px; font-size: 10px; line-height: 1.65; }
.empty-state .button { min-height: 34px; }
.quick-actions { display: grid; gap: 8px; }
.quick-action { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid #edf0f5; border-radius: 11px; color: var(--ink); background: #fff; cursor: pointer; text-align: left; transition: background .16s ease, border-color .16s ease; }
.quick-action:hover { border-color: #dcdbfa; background: #faf9ff; }
.quick-action-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #5f56ce; background: var(--violet-soft); font-size: 14px; }
.quick-action strong { display: block; font-size: 10px; font-weight: 700; }
.quick-action small { display: block; margin-top: 2px; color: #626e82; font-size: 9px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.list-heading h2 { margin: 0; }
.count-pill { padding: 4px 8px; border-radius: 999px; color: #626e82; background: #f2f3f8; font-size: 9px; font-weight: 710; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.filter-control { display: grid; gap: 4px; min-width: 145px; }
.filter-control span { color: #626e82; font-size: 9px; font-weight: 690; }
.filter-control select, .filter-control input { min-height: 35px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: #fff; font-size: 10px; }
.planner-layout { display: grid; grid-template-columns: minmax(0, 1fr) 275px; align-items: start; gap: 16px; }
.planner-list { display: grid; gap: 9px; }
.planner-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 5px 16px rgba(24,35,58,.025); }
.priority-mark { width: 8px; height: 8px; justify-self: center; border-radius: 99px; background: #a2a8b6; }
.priority-mark.high { background: var(--coral); box-shadow: 0 0 0 4px rgba(237,129,111,.11); }
.priority-mark.medium { background: var(--violet); box-shadow: 0 0 0 4px rgba(101,88,232,.10); }
.priority-mark.low { background: #7bb9a8; box-shadow: 0 0 0 4px rgba(123,185,168,.12); }
.planner-item.completed { background: #fafcf6; }
.planner-item.completed .planner-title { color: #53652d; text-decoration: line-through; text-decoration-color: #b7c492; }
.planner-main { min-width: 0; }
.planner-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #626e82; font-size: 9px; }
.planner-title { display: block; overflow: hidden; margin: 1px 0 3px; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.planner-subject { color: #6558d8; font-weight: 700; }
.planner-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; }
.row-action { min-height: 30px; padding: 0 8px; border: 0; border-radius: 8px; color: #626e82; background: transparent; cursor: pointer; font-size: 9px; font-weight: 650; }
.row-action:hover { color: var(--ink); background: #f0f1f7; }
.row-action.danger:hover { color: #b84d3f; background: #fff0ed; }
.side-stack { display: grid; gap: 13px; }
.side-stack .card { padding: 16px; }
.subject-list { display: grid; gap: 8px; }
.subject-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #5c6880; font-size: 10px; }
.subject-count { color: #626e82; font-size: 9px; }
.study-tip { padding: 15px; border-radius: 13px; color: #394255; background: #eff8df; }
.study-tip .eyebrow { margin-bottom: 5px; color: #486b1b; }
.study-tip p { margin: 0; font-size: 10px; line-height: 1.65; }
.study-tip strong { color: #31451a; }

.week-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.week-label { color: var(--ink); font-size: 12px; font-weight: 710; }
.week-nav { display: flex; gap: 6px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; }
.week-day { min-width: 0; min-height: 205px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.78); }
.week-day.is-today { border-color: #bab5ff; background: #fbfaff; box-shadow: inset 0 3px 0 var(--violet); }
.week-day.is-outside { background: #f0f1f6; }
.week-day-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 9px; }
.week-day-name { color: #626e82; font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.week-day-number { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: #526079; font-size: 10px; font-weight: 680; }
.week-day.is-today .week-day-number { color: white; background: var(--violet); }
.week-session { display: grid; gap: 2px; width: 100%; margin: 0 0 6px; padding: 7px; border: 0; border-left: 2px solid var(--violet); border-radius: 0 7px 7px 0; color: #414c63; background: #f0efff; cursor: pointer; text-align: left; }
.week-session.priority-high { border-left-color: var(--coral); background: #fff1ee; }
.week-session.priority-low { border-left-color: #73b29f; background: #edf8f5; }
.week-session:hover { filter: brightness(.98); }
.week-session.completed { opacity: .6; }
.week-session time { color: #626e82; font-size: 10px; font-variant-numeric: tabular-nums; }
.week-session strong { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 700; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.week-empty { color: #626e82; font-size: 10px; text-align: center; }

.exam-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.exam-management-card { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.exam-management-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.exam-management-title { margin: 0; color: var(--ink); font-size: 13px; font-weight: 710; }
.exam-management-sub { margin: 4px 0 0; color: #626e82; font-size: 10px; }
.exam-big-count { margin: 17px 0 0; color: #5147bd; font-size: 29px; font-weight: 750; letter-spacing: -.07em; line-height: 1.1; }
.exam-big-count span { color: #626e82; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.exam-note { margin: 8px 0 0; color: #626e82; font-size: 10px; }
.exam-related { margin: 13px 0 0; padding-top: 11px; border-top: 1px solid #f0f1f5; color: #626e82; font-size: 9px; }

.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(270px,.7fr); align-items: start; gap: 16px; }
.settings-copy { max-width: 660px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.appearance-card { overflow: hidden; }
.appearance-live-preview { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 14px; border: 1px solid rgba(116,126,150,.2); border-radius: 13px; color: #f6f7ff; background: linear-gradient(120deg, rgba(25,38,70,.96), rgba(35,47,78,.82)); font-size: 12px; }
.preview-live-pill { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 99px; color: var(--lime); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.preview-live-pill span { font-size: 7px; }
.background-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.background-upload { position: relative; overflow: hidden; }
.background-upload input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.background-upload:focus-within { outline: 3px solid rgba(101,88,232,.58); outline-offset: 3px; }
.appearance-status { min-height: 22px; margin: 10px 0 12px; color: #52627b; font-size: 12px; line-height: 1.55; }
.appearance-status[data-kind="warning"] { color: #8b5b12; }
.appearance-status[data-kind="success"] { color: #446a20; }
.appearance-controls { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px 18px; }
.appearance-control { display: grid; min-width: 0; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px 10px; color: #4f5b71; font-size: 12px; font-weight: 650; }
.appearance-control output { color: #5d54c8; font-variant-numeric: tabular-nums; font-weight: 720; }
.appearance-control select { min-width: 0; min-height: 40px; grid-column: 1 / -1; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: #fff; font-size: 14px; }
.appearance-control input[type="range"] { width: 100%; min-height: 34px; grid-column: 1 / -1; margin: 0; accent-color: var(--violet); cursor: pointer; }
.appearance-footnote { margin: 13px 0 0; color: #626e82; font-size: 11px; line-height: 1.6; }
.backup-panel { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.backup-panel .button { width: 100%; }
.notice-box { display: flex; align-items: start; gap: 10px; padding: 13px; border: 1px solid #e8e0bb; border-radius: 12px; color: #665b35; background: #fffbec; font-size: 10px; line-height: 1.65; }
.notice-box strong { color: #493f23; }
.notice-box-icon { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #877332; background: #f7eec9; font-size: 12px; }
.settings-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.settings-list li { display: flex; align-items: start; gap: 9px; color: #647086; font-size: 10px; line-height: 1.6; }
.check-mark { display: grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; margin-top: 1px; border-radius: 50%; color: #5c7628; background: #eef7de; font-size: 10px; font-weight: 800; }

.storage-notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #efdba7; border-radius: 12px; color: #5e512c; background: #fff9e8; font-size: 11px; line-height: 1.55; }
.storage-notice[hidden], .toast[hidden] { display: none; }
.toast { position: fixed; right: 24px; bottom: 22px; z-index: 30; max-width: min(380px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid #303a52; border-radius: 12px; color: #f4f6fc; background: #17213a; box-shadow: var(--shadow-dialog); font-size: 11px; animation: appear .2s ease both; }
.toast[data-kind="warning"] { border-color: #d7b54e; color: #4e421f; background: #fff5d8; }
.form-dialog { width: min(540px, calc(100vw - 28px)); max-height: min(90vh, 820px); padding: 22px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; box-shadow: var(--shadow-dialog); }
.form-dialog::backdrop { background: rgba(12,18,34,.62); backdrop-filter: blur(4px); }
.compact-dialog { width: min(460px, calc(100vw - 28px)); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.dialog-heading .eyebrow { margin-bottom: 4px; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.dialog-copy { color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.field { display: grid; align-content: start; gap: 5px; color: #4f5b71; font-size: 10px; font-weight: 680; }
.field-wide { grid-column: 1 / -1; }
.field-optional { color: #626e82; font-weight: 450; }
.field input, .field select { width: 100%; min-width: 0; min-height: 39px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 500; }
.field textarea { width: 100%; min-height: 110px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: #fff; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.field input::placeholder { color: #626e82; }
.field textarea::placeholder { color: #626e82; }
.field input[type="file"] { height: auto; padding: 10px; }
.form-error { margin: 12px 0 0; color: #b44539; font-size: 10px; }
.form-error[hidden] { display: none; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }

body[data-fallback-modal="true"]::before { position: fixed; inset: 0; z-index: 100; background: rgba(12,18,34,.68); backdrop-filter: blur(4px); content: ""; }
dialog.form-dialog[data-fallback-modal="true"] { position: fixed; z-index: 101; top: 50%; left: 50%; overflow: auto; max-height: calc(100dvh - 28px); margin: 0; transform: translate(-50%,-50%); }

@media (max-width: 1100px) {
  .sidebar { width: 214px; }
  .main-column { margin-left: 214px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.2fr) minmax(250px,.8fr); }
  .planner-layout { grid-template-columns: minmax(0,1fr) 235px; }
  .week-grid { gap: 5px; }
  .week-day { padding: 8px 5px; }
}
@media (max-width: 820px) {
  .sidebar { inset: auto 0 0; width: auto; height: 66px; flex-direction: row; justify-content: center; padding: 5px 12px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1); }
  .brand, .nav-caption, .sidebar-bottom { display: none; }
  .nav-list { display: grid; width: min(520px,100%); grid-template-columns: repeat(4,1fr); gap: 3px; }
  .nav-item { min-height: 56px; flex-direction: column; justify-content: center; gap: 1px; padding: 3px; border-radius: 10px; font-size: 10px; }
  .nav-icon { height: 20px; font-size: 16px; }
  .main-column { margin-left: 0; }
  .topbar { height: 59px; padding: 0 17px; }
  #main-content { padding: 23px 17px calc(88px + env(safe-area-inset-bottom)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .planner-layout { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .week-grid { grid-template-columns: repeat(7,minmax(100px,1fr)); overflow-x: auto; padding-bottom: 6px; }
  .week-day { min-height: 175px; }
}
@media (max-width: 560px) {
  body { font-size: 13px; }
  .local-pill { padding: 6px 8px; font-size: 9px; }
  .topbar-actions { gap: 8px; }
  .nav-item { font-size: 10px; }
  .view-heading { align-items: start; flex-direction: column; margin-bottom: 18px; }
  .view-heading > .button { width: 100%; }
  .hero-card { min-height: auto; padding: 21px; }
  .hero-card::before { right: -90px; }
  .hero-card::after { right: -130px; }
  .metric-grid { gap: 7px; }
  .metric-card { padding: 12px 10px; }
  .metric-label { align-items: start; gap: 5px; font-size: 9px; }
  .metric-icon { width: 19px; height: 19px; flex: 0 0 auto; border-radius: 6px; font-size: 10px; }
  .metric-number { font-size: 22px; }
  .metric-foot { font-size: 9px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .card { padding: 15px; }
  .session-row { grid-template-columns: 43px 3px minmax(0,1fr); gap: 8px; padding: 10px; }
  .session-state { grid-column: 3; justify-self: start; }
  .planner-item { grid-template-columns: 19px minmax(0,1fr); gap: 9px; padding: 12px 10px; }
  .planner-actions { grid-column: 2; justify-content: start; }
  .exam-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; gap: 11px; }
  .field-wide { grid-column: auto; }
  .appearance-controls { grid-template-columns: 1fr; gap: 11px; }
  .appearance-live-preview { align-items: start; flex-direction: column; }
  .background-actions { display: grid; grid-template-columns: 1fr; }
  .background-actions .button, .background-upload { width: 100%; min-height: 44px; }
  .appearance-control input[type="range"] { min-height: 44px; }
  .appearance-control select { min-height: 44px; }
  .filter-control { flex: 1 1 125px; min-width: 110px; }
  .filter-bar > .button { flex: 1 1 100%; }
  .week-toolbar { align-items: start; flex-direction: column; }
  .week-nav { width: 100%; justify-content: space-between; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .toast { right: 12px; bottom: 78px; }
  .field { font-size: 12px; }
  .field input, .field select, .field textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
