/* Yomi Focus pages shared by the Chrome dashboard and the portal (extension/app, copied to web/portal/app): the same
   look as the iPhone and iPad app. Uses the theme's tokens (--bg, --surface, --accent...). */

.app-page { display: grid; gap: 16px; container-type: inline-size; }
.app-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.app-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.app-head p { margin: 2px 0 0; color: var(--text-2); font-size: 15px; }
.app-head .grow { flex: 1 1 260px; min-width: 0; }
.app-head-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); flex: none; }
.app-head-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.app-cols { display: grid; gap: 16px; align-items: start; }
.app-cols > * { min-width: 0; display: grid; gap: 16px; }
@container (min-width: 900px) {
  .app-cols.c2 { grid-template-columns: 1fr 1fr; }
  .app-cols.c21 { grid-template-columns: 1.7fr 1fr; }
  .app-cols.c3 { grid-template-columns: 1fr 1fr 1fr; }
  .app-cols.with-side { grid-template-columns: minmax(0, 1fr) 360px; }
  .app-cols.left { grid-template-columns: 280px minmax(0, 1fr); }
}

.app-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 20px); padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); min-width: 0; align-content: start; }
.app-panel-head { display: flex; align-items: center; gap: 10px; }
.app-panel-head .grow { flex: 1; min-width: 0; }
.app-panel-head h2 { font-size: 18px; font-weight: 800; }
.app-panel-head p { margin: 1px 0 0; color: var(--text-2); font-size: 13px; }
.accent { color: var(--accent); }
.app-link { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px; white-space: nowrap; }

.app-stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.app-stat { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font: inherit; color: inherit; }
button.app-stat { cursor: pointer; }
button.app-stat:hover { border-color: var(--accent); }
.app-stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.app-stat .grow { display: grid; min-width: 0; }
.app-stat b { font-size: 24px; font-weight: 800; line-height: 1.15; }
.app-stat span { color: var(--text-2); font-size: 13px; }
.app-stat em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.app-stat em.good { color: var(--good); }
.app-stat em.bad { color: var(--bad, #dc2626); }

.app-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.app-pill.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.app-pill.bad { background: color-mix(in srgb, var(--bad, #dc2626) 14%, transparent); color: var(--bad, #dc2626); }
.app-pill.warn { background: var(--warm-soft); color: var(--warm); }
.app-pill.accent { background: var(--accent-soft); color: var(--accent); }
.app-pill.blue { background: color-mix(in srgb, #2563eb 14%, transparent); color: #2563eb; }

.app-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.app-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 13px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; }
.app-chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #fff); }
.app-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); gap: 2px; }
.app-seg button { border: 0; background: transparent; color: var(--text); border-radius: 9px; padding: 7px 14px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.app-seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-text, #fff); }

.app-meter { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 40px; }
.app-meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.app-empty { color: var(--text-2); margin: 0; font-size: 14px; }

.app-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.app-tile { display: grid; justify-items: center; gap: 6px; padding: 16px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-align: center; font: inherit; color: inherit; text-decoration: none; }
.app-tile:hover { border-color: var(--accent); }
.app-tile .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.app-tile b { font-size: 16px; }
.app-tile span { color: var(--text-2); font-size: 12.5px; }

.app-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; }
.app-row.line { border-bottom: 1px solid var(--border); border-radius: 0; padding: 10px 4px; }
.app-row.box { border: 1px solid var(--border); }
.app-row.click { cursor: pointer; }
.app-row.click:hover, .app-row[aria-selected="true"] { background: var(--accent-soft); }
.app-row .grow { flex: 1; min-width: 0; }
.app-row .t { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .s { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-icon-box { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }

.app-table { width: 100%; border-collapse: collapse; }
.app-table th { text-align: left; font-size: 13px; color: var(--text-2); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); }
.app-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.app-table tr.click { cursor: pointer; }
.app-table tr.click:hover td, .app-table tr[aria-selected="true"] td { background: var(--accent-soft); }

.app-bars { display: grid; gap: 6px; }
.app-bars-plot { position: relative; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); }
.app-bar-col { flex: 1; display: flex; justify-content: center; align-items: flex-end; height: 100%; }
.app-bar-col i { width: min(28px, 60%); border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.app-bar-col i.on { background: var(--accent); }
.app-bar-col i.zero { background: var(--surface-2); }
.app-bars-line { position: absolute; inset: 0; width: 100%; height: 100%; color: color-mix(in srgb, var(--text) 70%, transparent); pointer-events: none; overflow: visible; }
.app-bars-dots i { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--text) 75%, transparent); background: var(--surface); }
.app-bars-labels { display: flex; }
.app-bars-labels span { flex: 1; text-align: center; color: var(--text-2); font-size: 11.5px; }
.app-bars-labels span.on { color: var(--accent); font-weight: 700; }
.app-legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; color: var(--text-2); font-size: 12px; }
.app-legend span { display: inline-flex; gap: 6px; align-items: center; }
.app-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.app-legend i.line { height: 3px; width: 18px; }

.app-hero { position: relative; border-radius: 24px; overflow: hidden; min-height: 230px; padding: 24px; color: #fff;
  background: linear-gradient(180deg, #6d5bd0 0%, #c084fc 58%, #fdba74 100%); }
@media (prefers-color-scheme: dark) { .app-hero { background: linear-gradient(180deg, #1e1b4b 0%, #4c1d95 58%, #7c2d12 100%); } }
.app-hero svg.land { position: absolute; inset: auto 0 0 0; width: 100%; height: 60%; }
.app-hero > div { position: relative; display: grid; gap: 4px; }
.app-hero small { font-weight: 700; letter-spacing: 0.06em; opacity: 0.88; }
.app-hero h1 { font-size: 34px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.app-hero p { margin: 0; font-size: 17px; text-shadow: 0 2px 6px rgba(0,0,0,.25); }
.app-overlap { margin-top: -64px; position: relative; padding: 0 12px; }

.app-sheet-back { position: fixed; inset: 0; background: rgba(10, 10, 30, 0.42); z-index: 50; display: grid; place-items: center; padding: 16px; }
.app-sheet { width: min(640px, 100%); max-height: calc(100vh - 32px); background: var(--bg); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.3); display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.app-sheet.wide { width: min(980px, 100%); }
.app-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.app-sheet-head h2 { font-size: 17px; font-weight: 700; }
.app-sheet-body { overflow: auto; padding: 18px; display: grid; gap: 14px; align-content: start; }
.app-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 11px 16px; border-radius: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.app-menu { position: absolute; z-index: 70; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 6px; display: grid; }
.app-menu button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 9px; font: inherit; color: var(--text); cursor: pointer; }
.app-menu button:hover, .app-menu button:focus-visible { background: var(--surface-2); }
.app-menu button.danger { color: var(--bad, #dc2626); }

.app-form { display: grid; gap: 12px; }
.app-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.app-ring { flex: none; }
.app-icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.app-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.app-note-card { border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.app-note-card blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--accent); font-family: Georgia, serif; font-size: 15px; }
.app-note-card img { max-width: 100%; border-radius: 10px; }
.app-tl-row { display: flex; gap: 10px; align-items: center; }
.app-tl-time { width: 72px; color: var(--text-2); font-size: 12.5px; flex: none; }
.app-tl-block { flex: 1; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border-left: 3px solid; min-width: 0; }
.app-day-pill { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.app-day-pill button { border: 0; background: none; padding: 8px; cursor: pointer; color: var(--text); display: grid; }
.app-day-pill b { font-size: 14px; min-width: 150px; text-align: center; }
.app-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.app-week > div { border: 1px solid var(--border); border-radius: 12px; padding: 8px; min-height: 120px; display: grid; gap: 4px; align-content: start; font-size: 12px; }
.app-week > div.today { border-color: var(--accent); }
.app-week .blk { border-radius: 8px; padding: 4px 6px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-canvas { border: 1px solid var(--border); border-radius: 14px; background: #fff; touch-action: none; width: 100%; cursor: crosshair; }

/* The tab bar along the bottom, as on iPhone and iPad. */
.app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.app-tabbar .tabs { display: flex; width: min(1100px, 100%); }
body.has-tabbar { padding-bottom: 76px; }
.app-tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 9px 2px 8px; color: var(--text-3); text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative; }
.app-tabbar a[aria-current="page"] { color: var(--accent); }
.app-tabbar a:hover { color: var(--text); }
.app-tabbar a .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad, #dc2626); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ---- More of the shared pages: Home's focus session, Assignments, Planner, Notes and Research ---- */
main.app-wide { max-width: 1280px; }
.app-title { font-size: 20px; font-weight: 800; margin: 0; }
.app-icon-box.big { width: 52px; height: 52px; border-radius: 14px; }
.app-list { display: grid; gap: 4px; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.app-chips-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.app-pill.soft { background: transparent; border: 1px solid var(--border); }
button.app-pill { border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; gap: 4px; }
button.app-pill:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.app-pct { font-size: 13px; }
.app-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.app-filters .field[type="search"] { flex: 1 1 200px; width: auto; }
.app-select { width: auto; max-width: 340px; }
.app-ask { display: flex; gap: 8px; align-items: center; }
.app-ask .field { flex: 1; min-width: 0; }
.app-check { display: flex; gap: 9px; align-items: center; padding: 6px 2px; cursor: pointer; font-size: 14px; }
.app-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.app-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.done { text-decoration: line-through; color: var(--text-3); }
/* The research map's round checkboxes. */
.app-check.circle input { appearance: none; -webkit-appearance: none; margin: 0; border-radius: 50%; border: 2px solid var(--text-3); background: transparent; display: grid; place-items: center; cursor: pointer; }
.app-check.circle input:checked { border-color: var(--good); background: var(--good); }
.app-check.circle input:checked::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.app-check.circle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-check-row { display: flex; align-items: center; gap: 6px; }
.app-check-row.sub { padding-left: 26px; }
.app-check-row .app-check { padding: 3px 2px; }
.app-check .grow, .app-check-row .grow { flex: 1; min-width: 0; }
.good { color: var(--good); }
.bad { color: var(--bad, #dc2626); }
.center { text-align: center; justify-items: center; }
.app-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.app-kv-item { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.app-kv-item > div { display: grid; }
.app-kv-item span { font-size: 12px; color: var(--text-2); }
.app-kv-item b { font-size: 16px; }

/* Home: the next focus session, Focus AI, statistics */
.app-fs { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.app-fs-head { display: flex; gap: 12px; align-items: center; }
.app-fs-body { display: grid; gap: 12px; }
.app-fs-steps { display: flex; gap: 12px; align-items: flex-start; }
.app-fs-steps .grow { flex: 1; display: grid; gap: 2px; min-width: 0; }
.app-fs-step { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.app-fs-step input { accent-color: var(--accent); }
.app-fs-min { display: inline-flex; gap: 4px; align-items: center; color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.app-ai-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.app-ai-chip:hover { border-color: var(--accent); color: var(--accent); }
.app-ai-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.app-minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.app-mini { display: grid; gap: 2px; padding: 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.app-mini-v { display: flex; gap: 5px; align-items: center; }
.app-mini-v b { font-size: 17px; }
.app-mini span { font-size: 12px; color: var(--text-2); }
.app-mini em { font-style: normal; font-size: 11.5px; font-weight: 600; }
.app-mini em.good { color: var(--good); }
.app-mini em.bad { color: var(--bad, #dc2626); }

/* Assignments */
.app-class-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.app-class { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.app-class[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.app-asg-table td:first-child { max-width: 360px; }
@media (max-width: 760px) { .app-asg-table th:nth-child(n+4), .app-asg-table td:nth-child(n+4) { display: none; } }

/* Planner */
@container (min-width: 900px) {
  .app-cols.app-planner-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 360px; }
  .app-cols .span2 { grid-column: span 2; }
  .app-cols.trio { grid-template-columns: 260px minmax(0, 1fr) 340px; }
}
@container (min-width: 900px) and (max-width: 1080px) { .app-cols.trio { grid-template-columns: 220px minmax(0, 1fr); } .app-cols.trio > :last-child { grid-column: 1 / -1; } }
.app-plan-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.app-note-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.app-note-bar.warn { background: var(--warm-soft); }
.app-block { display: flex; gap: 10px; align-items: stretch; }
.app-block.done .app-tl-block { opacity: 0.55; }
.app-block.done .t { text-decoration: line-through; }
.app-tl-block .grow { flex: 1; min-width: 0; }
.app-tl-block .t { font-weight: 700; font-size: 14.5px; }
.app-tl-block .s { color: var(--text-2); font-size: 12.5px; }
.app-block-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.app-block-actions .app-icon-btn[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.rot90 { transform: rotate(90deg); }
.app-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.app-month > span { text-align: center; }
.app-month-day { min-height: 74px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 6px; display: grid; gap: 2px; align-content: start; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.app-month-day.out { opacity: 0.4; }
.app-month-day.today { border-color: var(--accent); }
.app-month-day .due { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.app-mini-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.app-mini-month button { position: relative; border: 0; background: none; padding: 7px 0; border-radius: 9px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.app-mini-month button:disabled { color: var(--text-3); cursor: default; }
.app-mini-month button.out { opacity: 0.4; }
.app-mini-month button.today { font-weight: 800; color: var(--accent); }
.app-mini-month button.sel { background: var(--accent); color: #fff; }
.app-mini-month button i { position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--warm, #ea580c); }

/* Notes */
.app-add-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.app-note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; align-items: start; }
.app-note-card header { display: flex; gap: 6px; align-items: center; }
.app-note-card header .faint { flex: 1; }
.app-note-card h3 { font-size: 15px; font-weight: 700; margin: 0; }
.app-note-card audio { width: 100%; }
.app-note-card .app-icon-btn { width: 28px; height: 28px; border-color: transparent; }
.app-note-body { font-size: 14px; display: grid; gap: 4px; }
.app-note-body p, .app-note-body h4 { margin: 0; }
.app-note-body mark { background: color-mix(in srgb, #facc15 55%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.app-note-body li { margin-left: 18px; }
.app-link.small { font-size: 12.5px; padding: 0; }
.app-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.app-big-time { font-size: 40px; font-variant-numeric: tabular-nums; }
.app-transcript { min-height: 48px; font-size: 15px; margin: 0; }
.app-claim { border: 1px solid var(--border); border-radius: 14px; padding: 10px; display: grid; gap: 6px; }
.app-claim ul { margin: 0; padding-left: 20px; font-size: 13.5px; display: grid; gap: 3px; }
.app-claim li { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.app-claim .app-icon-btn { width: 26px; height: 26px; border-color: transparent; }
.app-outline-node .app-icon-btn { width: 28px; height: 28px; }
.app-chat { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.app-bubble { padding: 10px 12px; border-radius: 14px; font-size: 14px; display: grid; gap: 6px; max-width: 92%; }
.app-bubble p { margin: 0; }
.app-bubble.user { background: var(--accent); color: #fff; justify-self: end; }
.app-bubble.assistant { background: var(--surface-2); justify-self: start; }

/* Research */
.app-area { display: grid; gap: 6px; }
.app-result { border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: grid; gap: 6px; }
.app-result p { margin: 0; font-size: 14px; }
.app-result a.t { font-weight: 700; color: var(--accent); text-decoration: none; }
.app-result a.t:hover { text-decoration: underline; }
button.app-row { border: 0; background: none; font: inherit; color: inherit; text-align: left; width: 100%; }
a.app-row { color: inherit; text-decoration: none; }
.app-row > .btn { flex: none; }
.app-tiles { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.app-scroll { overflow-x: auto; min-width: 0; }
.app-asg-table td:not(:first-child) { white-space: nowrap; }
.app-filters select.field { width: auto; }
.app-page *, .app-sheet *, .app-tabbar * { box-sizing: border-box; }
.app-panel-head { flex-wrap: wrap; }
.app-seg { max-width: 100%; overflow-x: auto; }
.app-seg button { white-space: nowrap; }
@media (max-width: 600px) {
  .app-head h1 { font-size: 24px; }
  .app-head-icon { width: 46px; height: 46px; }
  .app-minis { grid-template-columns: 1fr 1fr; }
  .app-day-pill b { min-width: 0; }
  .app-week { grid-template-columns: 1fr; }
  .app-block { flex-direction: column; gap: 4px; }
  .app-tabbar a span { font-size: 10px; }
}
.app-panel { grid-template-columns: minmax(0, 1fr); }
.app-list, .app-cols > *, .app-page, .app-form, .app-chat { grid-template-columns: minmax(0, 1fr); }

/* Columns inside a column (Home's schedule beside its assignments) follow the space they have, not the window. */
.app-cols.with-side > * { container-type: inline-size; }
.app-cols.c12 { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 780px) { .app-cols.c12 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); } }
.app-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.btn[aria-busy="true"]::after { content: ''; width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: app-spin .8s linear infinite; flex: none; }
@keyframes app-spin { to { transform: rotate(360deg); } }
.due-hint { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.due-hint:empty { display: none; }
.due-hint.warn { color: var(--warm, #b45309); }
.email-hint { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--bad, #dc2626); }
.email-hint:empty { display: none; }
input[aria-invalid="true"] { border-color: var(--bad, #dc2626); }
.offline-bar { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 80; max-width: calc(100vw - 24px); padding: 10px 16px; border-radius: 12px;
  background: var(--warm-soft, #fff6e6); color: var(--text); border: 1px solid var(--warm, #b45309); font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.offline-bar[hidden] { display: none; }

/* Phones: tables become a card per row, each value labeled by its column. */
@media (max-width: 600px) {
  table.stacks, table.stacks tbody, table.stacks tr, table.stacks td { display: block; width: 100%; }
  table.stacks thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stacks tr { border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; margin-bottom: 10px; background: var(--surface); }
  table.stacks td { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 0 !important; padding: 6px 0 !important; white-space: normal !important; }
  table.stacks td[data-label]::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
  table.stacks td:not([data-label]) { justify-content: flex-end; }
  table.stacks td > * { min-width: 0; }
  .app-asg-table th:nth-child(n+4), .app-asg-table td:nth-child(n+4) { display: flex; }
}
/* Touch screens: everything you tap is at least 44 points tall. */
@media (pointer: coarse) {
  .btn, .app-chip, .app-seg button, .app-icon-btn, .app-link, .app-row.click, select.field, input.field { min-height: 44px; }
  .app-icon-btn { min-width: 44px; }
  .app-check input, input[type=checkbox] { width: 22px; height: 22px; }
}
/* Keyboard focus: a clear ring on everything focusable. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.app-tile:focus-visible, .app-row:focus-visible, .app-stat:focus-visible, .pa-kid:focus-visible { outline-offset: 3px; }
