:root {
  color-scheme: light;
  --ink: #17131f;
  --muted: #6f6978;
  --line: #e8e3ec;
  --surface: #ffffff;
  --surface-soft: #f8f6fa;
  --yellow: #ffd400;
  --yellow-soft: #fff8cc;
  --purple: #6d28d9;
  --purple-dark: #4c1d95;
  --purple-soft: #f1eafe;
  --green: #169c5b;
  --green-soft: #e4f7ec;
  --red: #d9485f;
  --shadow: 0 18px 45px rgba(35, 23, 48, 0.09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--surface-soft); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(109, 40, 217, 0.09), transparent 28rem),
    var(--surface-soft);
}

body:not(.is-authenticated) .app-shell,
body:not(.is-authenticated) .bottom-nav { display: none; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 15%, #efe5ff 0, transparent 38%), linear-gradient(145deg, #faf8fd, #f2edf8); }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 27px; background: #fff; box-shadow: 0 30px 80px rgba(47, 26, 68, .14); }
.auth-brand { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 17px; color: var(--yellow); background: var(--ink); font-size: 25px; font-weight: 900; }
.auth-card h1 { margin: 5px 0 0; font-size: 34px; letter-spacing: -.045em; }
.auth-copy { margin: 13px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { font-size: 12px; font-weight: 900; }
.auth-form input { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 13px; outline: 0; font-size: 16px; }
.auth-form input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }
.auth-form .button { width: 100%; margin-top: 4px; }
.auth-error { min-height: 18px; margin: 2px 0 0; color: var(--red); font-size: 12px; }
.auth-card > small { display: block; margin-top: 18px; color: var(--muted); text-align: center; font-size: 11px; }
.sync-status { color: var(--muted); font-size: 11px; font-weight: 800; }
.logout-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }

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

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  color: #fff;
  background: linear-gradient(180deg, #17131f 0%, #21172d 100%);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
  transform: rotate(-4deg);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; line-height: 1.15; }
.brand small { margin-top: 3px; color: #c9c2d0; font-size: 11px; letter-spacing: .04em; }

.side-nav { display: grid; gap: 8px; margin-top: 48px; }

.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.side-nav .nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #cfc7d7;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.side-nav .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav .nav-item.is-active { background: var(--yellow); color: var(--ink); font-weight: 800; }
.nav-icon { width: 24px; text-align: center; font-size: 20px; }

.sidebar-progress {
  margin-top: auto;
  padding: 17px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.05);
}

.progress-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.sidebar-progress small { display: block; margin-top: 10px; color: #a79eaf; }
.progress-track { height: 7px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.13); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--yellow); transition: width .35s ease; }

.main-content { min-width: 0; padding: 0 38px 60px; }

.topbar {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar h1 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--purple); font-size: 11px; font-weight: 900; letter-spacing: .11em; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.today-pill { padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.76); color: var(--muted); font-size: 13px; font-weight: 700; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; font-size: 21px; }
.icon-button:hover { border-color: #cfc4dc; background: var(--purple-soft); }

.view-root { max-width: 1280px; margin: 0 auto; }
.view-enter { animation: enter .24s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(290px, .82fr); gap: 22px; align-items: start; }
.main-column, .side-column { display: grid; gap: 20px; }

.card { border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255,255,255,.9); box-shadow: var(--shadow); }

.day-hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  color: #fff;
  background: linear-gradient(128deg, #20162c 0%, #4c1d95 68%, #6d28d9 100%);
}

.day-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -75px;
  top: -105px;
  border-radius: 50%;
  background: var(--yellow);
  opacity: .95;
}

.date-navigation { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.date-navigation h2 { margin: 5px 0 0; max-width: 590px; font-size: clamp(25px, 4vw, 39px); line-height: 1.05; letter-spacing: -.045em; }
.date-navigation .eyebrow { color: var(--yellow); }
.day-nav-buttons { display: flex; gap: 7px; margin-right: 52px; }
.day-nav-buttons button { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; }
.day-nav-buttons button:disabled { opacity: .3; cursor: not-allowed; }

.day-summary { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin-top: 28px; }
.summary-number { font-size: 34px; font-weight: 900; letter-spacing: -.04em; }
.summary-copy { max-width: 370px; color: #ded7e7; line-height: 1.45; }
.summary-copy strong { color: #fff; }
.hero-progress { flex: 1; min-width: 180px; }
.hero-progress .progress-track { background: rgba(255,255,255,.18); }
.hero-progress .progress-track span { background: var(--yellow); }
.hero-progress small { display: flex; justify-content: space-between; margin-top: 8px; color: #d8cee4; }

.section-card { padding: 23px; }
.section-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.section-header h2, .section-header h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.section-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.section-action { color: var(--purple); font-size: 13px; font-weight: 800; }

.next-card { padding: 23px; border: 0; color: var(--ink); background: linear-gradient(135deg, var(--yellow) 0%, #ffe870 100%); box-shadow: 0 18px 35px rgba(255, 212, 0, .2); }
.next-card.is-complete { background: linear-gradient(135deg, var(--green-soft), #f3fff7); }
.next-card-label { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.next-card h2 { margin: 18px 0 8px; font-size: 24px; line-height: 1.1; letter-spacing: -.035em; }
.next-card p { margin: 0; color: #4a414e; line-height: 1.5; }
.next-card .button { margin-top: 20px; }

.task-list { display: grid; gap: 12px; }
.task-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: border .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.task-card:hover { border-color: #d5c8e5; box-shadow: 0 10px 26px rgba(53, 35, 70, .07); }
.task-card.is-done { opacity: .62; background: #fbfbfb; }
.task-card.is-done h3 { text-decoration: line-through; }

.check-button { width: 29px; height: 29px; display: grid; place-items: center; border: 2px solid #cfc7d5; border-radius: 10px; background: #fff; cursor: pointer; font-weight: 900; }
.task-card.is-done .check-button { border-color: var(--green); color: #fff; background: var(--green); }
.task-content { min-width: 0; }
.task-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 7px; }
.time { font-weight: 900; font-size: 13px; }
.chip { padding: 4px 8px; border-radius: 999px; background: var(--purple-soft); color: var(--purple-dark); font-size: 10px; font-weight: 900; letter-spacing: .035em; text-transform: uppercase; }
.chip.story { background: #e8f3ff; color: #135d9d; }
.chip.prep { background: var(--yellow-soft); color: #735e00; }
.chip.live { background: #ffe7ed; color: #a52645; }
.task-card h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.task-card p { display: -webkit-box; overflow: hidden; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-actions { display: flex; gap: 7px; }
.mini-button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--purple); font-size: 12px; font-weight: 800; white-space: nowrap; }
.mini-button:hover { border-color: var(--purple); background: var(--purple-soft); }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 11px 16px; border: 0; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 900; }
.button-primary { color: #fff; background: var(--purple); }
.button-primary:hover { background: var(--purple-dark); }
.button-dark { color: #fff; background: var(--ink); }
.button-dark:hover { background: #30263a; }
.button-secondary { border: 1px solid var(--line); color: var(--purple); background: #fff; }
.button-secondary:hover { border-color: var(--purple); background: var(--purple-soft); }
.button-danger { color: #a2253f; background: #fff0f3; }

.focus-card { padding: 21px; }
.focus-card h3 { margin: 0; font-size: 16px; }
.focus-card p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.focus-list { display: grid; gap: 10px; margin-top: 16px; }
.focus-item { padding: 12px; border-radius: 13px; background: var(--surface-soft); }
.focus-item strong { display: block; margin-bottom: 4px; font-size: 12px; }
.focus-item span { color: var(--muted); font-size: 12px; line-height: 1.35; }

.quote-card { position: relative; overflow: hidden; padding: 24px; background: var(--ink); color: #fff; }
.quote-card::before { content: "“"; position: absolute; right: 18px; top: -18px; color: rgba(255,212,0,.16); font: 900 110px Georgia, serif; }
.quote-card p { position: relative; margin: 0; font-size: 18px; font-weight: 800; line-height: 1.4; }
.quote-card small { display: block; margin-top: 14px; color: var(--yellow); font-weight: 800; }

.empty-state { padding: 48px 24px; text-align: center; }
.empty-state .empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 28px; }
.empty-state h2 { margin: 0; }
.empty-state p { max-width: 470px; margin: 10px auto 0; color: var(--muted); line-height: 1.5; }

.calendar-toolbar, .bank-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 18px; }
.calendar-toolbar h2, .bank-toolbar h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.search-input { width: min(360px, 100%); padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #fff; }
.search-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }

.calendar-list { display: grid; gap: 10px; }
.calendar-day {
  width: 100%;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 110px 32px;
  gap: 16px;
  align-items: center;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.calendar-day:hover { border-color: #cabade; box-shadow: 0 8px 24px rgba(56,38,74,.06); }
.calendar-date strong, .calendar-date span { display: block; }
.calendar-date strong { font-size: 15px; }
.calendar-date span { margin-top: 3px; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.calendar-subject strong { display: block; font-size: 14px; }
.calendar-subject span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-progress { color: var(--muted); font-size: 12px; text-align: right; }
.day-progress strong { color: var(--ink); }
.progress-dot { width: 12px; height: 12px; border-radius: 50%; background: #dcd6e1; }
.progress-dot.partial { background: var(--yellow); }
.progress-dot.done { background: var(--green); }

.bank-tabs { display: flex; gap: 8px; margin-bottom: 17px; }
.tab-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.tab-button.is-active { border-color: var(--purple); color: #fff; background: var(--purple); }
.bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.text-card { padding: 19px; border: 1px solid var(--line); border-radius: 19px; background: #fff; }
.text-card h3 { margin: 9px 0 0; font-size: 17px; }
.text-card p { margin: 11px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.text-card .card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.keyword { display: inline-block; padding: 5px 9px; border-radius: 8px; color: var(--purple-dark); background: var(--purple-soft); font-size: 11px; font-weight: 900; }
.highlight-bank-card { background: linear-gradient(145deg, #fff 55%, var(--purple-soft)); }

.metric-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-stat { padding: 19px; }
.metric-stat span, .metric-stat strong, .metric-stat small { display: block; }
.metric-stat span { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.metric-stat strong { margin-top: 9px; font-size: 28px; letter-spacing: -.045em; }
.metric-stat small { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.metric-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.metrics-layout { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(0, 1.45fr); gap: 18px; align-items: start; }
.metrics-form-card { grid-row: span 2; padding: 22px; }
.metrics-form-card form { display: grid; gap: 14px; }
.metric-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-field { display: grid; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 800; }
.form-field small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.3; }
.metric-input, .metric-textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fff; }
.metric-input:focus, .metric-textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }
.metric-textarea { min-height: 82px; resize: vertical; }
.data-rule { margin-top: 15px; padding: 13px; border-radius: 12px; color: #604d00; background: var(--yellow-soft); font-size: 11px; line-height: 1.45; }
.metrics-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart-card, .ranking-card, .metrics-history { padding: 20px; }
.metric-chart { display: block; width: 100%; height: auto; overflow: visible; }
.metric-chart text { fill: var(--muted); font-size: 11px; }
.metric-chart .chart-value { fill: var(--ink); font-weight: 800; }
.chart-grid-line { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--purple); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--yellow); stroke: var(--purple); stroke-width: 2; }
.chart-bar { fill: var(--purple); }
.chart-empty { display: grid; min-height: 140px; place-items: center; padding: 20px; border-radius: 14px; color: var(--muted); background: var(--surface-soft); text-align: center; font-size: 13px; line-height: 1.45; }
.metrics-history { grid-column: 1 / -1; }
.metrics-table-wrap { overflow-x: auto; }
.metrics-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.metrics-table th, .metrics-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: right; }
.metrics-table th { color: var(--muted); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.metrics-table th:first-child, .metrics-table td:first-child { text-align: left; font-weight: 800; }
.table-action { width: 27px; height: 27px; border: 0; border-radius: 8px; color: var(--red); background: #fff0f3; cursor: pointer; font-weight: 900; }
.ranking-card { min-height: 290px; }
.ranking-list { display: grid; gap: 9px; }
.ranking-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ranking-position { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--purple-dark); background: var(--purple-soft); font-size: 12px; font-weight: 900; }
.ranking-copy { min-width: 0; }
.ranking-copy strong, .ranking-copy small { display: block; }
.ranking-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.ranking-rate { font-size: 15px; font-weight: 900; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.setting-card { padding: 22px; }
.setting-card h3 { margin: 0; }
.setting-card p { min-height: 59px; margin: 8px 0 17px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.setting-card .button { width: 100%; }
.privacy-note { margin-top: 16px; padding: 15px; border-radius: 14px; background: var(--green-soft); color: #19613e; font-size: 12px; line-height: 1.45; }

.task-dialog { width: min(790px, calc(100vw - 28px)); max-height: min(870px, calc(100vh - 28px)); padding: 0; border: 0; border-radius: 25px; box-shadow: 0 30px 90px rgba(20,12,28,.32); }
.task-dialog::backdrop { background: rgba(18,12,24,.64); backdrop-filter: blur(3px); }
.dialog-shell { display: flex; flex-direction: column; max-height: min(870px, calc(100vh - 28px)); }
.dialog-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding: 23px 24px 18px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 4px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -.03em; }
.dialog-body { overflow-y: auto; padding: 22px 24px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px; border-top: 1px solid var(--line); background: #fff; }
.dialog-footer [hidden] { display: none !important; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-block { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.detail-block.is-wide { grid-column: 1 / -1; }
.detail-block h3 { margin: 0 0 8px; color: var(--purple); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.detail-block p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.56; }
.detail-block .copy-inline { margin-top: 11px; }
.highlight-index > p { color: var(--muted); }
.highlight-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.highlight-shortcut { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; cursor: pointer; text-align: left; }
.highlight-shortcut:hover { border-color: var(--purple); background: var(--purple-soft); }
.highlight-shortcut strong { font-size: 13px; }
.highlight-shortcut span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.highlight-dialog-intro { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 17px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--purple-dark), var(--purple)); }
.highlight-dialog-intro p { margin: 0; max-width: 510px; font-size: 13px; line-height: 1.5; }
.highlight-dialog-intro .mini-button { flex: 0 0 auto; border-color: rgba(255,255,255,.25); color: var(--purple-dark); background: #fff; }
.highlight-story-list { display: grid; gap: 15px; margin-top: 16px; }
.highlight-story { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.highlight-story-heading { display: flex; gap: 11px; align-items: center; margin-bottom: 14px; }
.highlight-story-heading > span { width: 36px; height: 36px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: var(--purple); font-size: 15px; font-weight: 900; }
.highlight-story-heading small { display: block; color: var(--purple); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.highlight-story-heading h3 { margin: 2px 0 0; font-size: 17px; }
.highlight-story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.highlight-story-grid section { padding: 13px; border-radius: 12px; background: var(--surface-soft); }
.highlight-story-grid .is-script { grid-column: 1 / -1; border: 1px solid #dfd1ff; background: var(--purple-soft); }
.highlight-story-grid h4 { margin: 0 0 7px; color: var(--purple); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.highlight-story-grid p { margin: 0; white-space: pre-wrap; font-size: 13px; line-height: 1.5; }
.task-note { width: 100%; min-height: 92px; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: #fff; }
.task-note:focus { border-color: var(--purple); }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(390px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 13px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; font-size: 13px; }
.toast.is-visible { opacity: 1; transform: none; }

.bottom-nav { display: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 88px 1fr; }
  .sidebar { padding: 24px 14px; align-items: center; }
  .brand span:last-child, .side-nav .nav-item span:last-child, .sidebar-progress { display: none; }
  .brand { padding: 0; }
  .side-nav .nav-item { justify-content: center; padding: 12px; }
  .nav-icon { width: auto; }
  .main-content { padding-inline: 25px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-layout { grid-template-columns: 1fr; }
  .metrics-form-card { grid-row: auto; }
  .metrics-history { grid-column: auto; }
}

@media (max-width: 680px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 0 14px 24px; }
  .topbar { min-height: 86px; }
  .topbar .eyebrow, .today-pill { display: none; }
  .topbar h1 { font-size: 24px; }
  .bottom-nav {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    box-shadow: 0 -12px 35px rgba(35,23,48,.08);
    backdrop-filter: blur(14px);
  }
  .bottom-nav .nav-item { display: grid; gap: 2px; place-items: center; padding: 6px 2px; color: var(--muted); }
  .bottom-nav .nav-item span { font-size: 20px; line-height: 1; }
  .bottom-nav .nav-item small { font-size: 10px; }
  .bottom-nav .nav-item.is-active { color: var(--purple); font-weight: 900; }
  .card { border-radius: 21px; }
  .day-hero { padding: 21px; }
  .day-hero::after { width: 145px; height: 145px; right: -62px; top: -74px; }
  .date-navigation h2 { max-width: 72%; font-size: 28px; }
  .day-nav-buttons { margin-right: 16px; }
  .day-summary { margin-top: 22px; gap: 13px; }
  .summary-number { font-size: 28px; }
  .summary-copy { font-size: 13px; }
  .hero-progress { flex-basis: 100%; }
  .section-card, .next-card { padding: 18px; }
  .task-card { grid-template-columns: auto minmax(0,1fr); }
  .task-actions { grid-column: 2; }
  .side-column, .bank-grid, .settings-grid { grid-template-columns: 1fr; }
  .metric-summary-grid, .metrics-charts { grid-template-columns: 1fr; }
  .metric-form-grid { grid-template-columns: 1fr; }
  .metric-stat { padding: 16px; }
  .metric-stat strong { font-size: 25px; }
  .calendar-day { grid-template-columns: 72px minmax(0,1fr) 16px; gap: 10px; padding: 13px; }
  .day-progress { display: none; }
  .calendar-subject span { max-width: 190px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-block.is-wide { grid-column: auto; }
  .bank-tabs { overflow-x: auto; padding-bottom: 3px; }
  .bank-tabs .tab-button { flex: 0 0 auto; }
  .highlight-shortcuts, .highlight-story-grid { grid-template-columns: 1fr; }
  .highlight-story-grid .is-script { grid-column: auto; }
  .highlight-dialog-intro { display: grid; }
  .dialog-footer { display: grid; grid-template-columns: 1fr; }
  .dialog-footer .button { width: 100%; }
  .toast { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
