/* Homepage and navigation. Design adapted from naplesblue/apple-design-skill.
   License notices are retained at the end of this file. */
:root {
  --surface: var(--card);
  --r-panel: 22px;
  --glass: rgba(255, 255, 255, .78);
  --sh-glass: 0 2px 6px rgba(0, 0, 0, .04), 0 12px 34px rgba(0, 0, 0, .10);
}
:where(a, button, summary, input, select):focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
#app { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
.ui-icon { display: block; width: 24px; height: 24px; flex: none; }
.home-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 12px 2px 26px; }
.home-date { color: var(--text-2); font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.home-heading h1 { font-size: clamp(34px, 5vw, 42px); line-height: 1.22; font-weight: 700; letter-spacing: -.045em; }
.home-settings-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font: 500 13px var(--font); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.home-settings-trigger .ui-icon { width: 20px; height: 20px; }
.home-layout { display: grid; gap: 20px; }
.home-panel { background: var(--surface); border-radius: var(--r-panel); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.home-panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.home-panel-heading h2 { font-size: 18px; line-height: 1.4; font-weight: 600; letter-spacing: -.025em; }
.home-eyebrow { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.home-focus { border-radius: var(--r-hero); padding: 28px; }
.home-due { display: flex; align-items: baseline; gap: 10px; margin-top: 25px; }
.home-due strong { font-size: clamp(54px, 8vw, 68px); font-weight: 650; letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.home-due > span { color: var(--text-2); font-size: 15px; }
.home-focus-note { margin: 14px 0 22px; color: var(--text-2); font-size: 13px; line-height: 1.85; }
.home-start { text-decoration: none; min-height: 48px; width: 100%; justify-content: space-between; padding-inline: 22px; }
.home-start .ui-icon { width: 20px; height: 20px; }
.home-word-progress { margin-top: 25px; }
.home-word-progress > div:first-child { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.home-word-progress .bar { height: 5px; }
.home-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; padding-top: 21px; border-top: 1px solid var(--hairline); }
.home-metrics > div + div { border-left: 1px solid var(--hairline); padding-left: 18px; }
.home-metrics dt { color: var(--text-2); font-size: 12px; margin-bottom: 4px; }
.home-metrics dd { font-size: 23px; font-weight: 600; line-height: 1.3; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.home-metrics small { font-size: 12px; font-weight: 400; color: var(--text-2); margin-left: 4px; }
.home-practice { padding-bottom: 12px; }
.home-practice-list { margin-top: 17px; }
.home-practice-row { display: flex; align-items: center; gap: 15px; min-height: 82px; text-decoration: none; color: var(--text); border-radius: var(--r-thumb); position: relative; }
.home-practice-row + .home-practice-row::before { content: ''; position: absolute; top: 0; left: 39px; right: 0; height: 1px; background: var(--hairline); }
.home-practice-icon { color: var(--text-2); flex: none; }
.home-row-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.home-row-copy strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.home-row-copy > span { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.home-row-arrow { color: var(--text-3); }
.home-row-arrow .ui-icon { width: 16px; height: 16px; }
.home-trend-empty { min-height: 200px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; text-align: center; }
.home-trend-empty > .ui-icon { width: 32px; height: 32px; margin-bottom: 5px; color: var(--text-3); }
.home-trend-empty p { font-size: 14px; color: var(--text-2); }
.home-trend-empty > span { font-size: 12px; color: var(--text-2); max-width: 260px; line-height: 1.85; }
.home-trend .chart-wrap { margin-top: 26px; }
.home-trend .chart-wrap svg { display: block; width: 100%; min-height: 140px; overflow: visible; }
.home-trend svg text { font: 12px var(--font); fill: var(--text-2); }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.trend-axis { stroke: var(--hairline); }
.trend-guide { stroke: var(--hairline); stroke-dasharray: 3 6; }
.home-trend-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 12px; border-top: 1px solid var(--hairline); padding-top: 15px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.home-trend-caption strong { color: var(--text); font-weight: 600; }
.home-calendar .cal { margin-top: 20px; gap: 3px; }
.home-calendar .cal .day { border-radius: var(--r-pill); background: transparent; max-width: 32px; width: 100%; margin-inline: auto; font-size: 12px; }
.home-calendar .cal .day.active { background: var(--accent-weak); color: var(--accent-deep); }
.home-calendar .cal .day.today { outline: 1px solid var(--accent); outline-offset: -1px; }
.home-calendar .cal .wd { color: var(--text-2); margin-bottom: 5px; }
.home-calendar-note { display: flex; align-items: center; gap: 5px; margin-top: 18px; font-size: 11px; color: var(--text-2); }
.home-calendar-note i { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent); }
.home-calendar-note > span { margin-left: auto; }
.home-exam { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; gap: 16px; }
.home-exam p { font-size: 14px; font-weight: 500; }
.home-exam > div > span { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.home-exam-days { display: flex; align-items: baseline; gap: 6px; }
.home-exam-days strong { font-size: 32px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.home-settings { padding: 0 24px; scroll-margin: 60px; align-self: start; }
.home-settings summary { list-style: none; min-height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 15px; font-weight: 600; }
.home-settings summary::-webkit-details-marker { display: none; }
.home-settings summary small { display: block; color: var(--text-2); font-size: 12px; font-weight: 400; margin-top: 2px; }
.home-settings summary > .ui-icon { width: 16px; height: 16px; color: var(--text-3); transition: transform .2s var(--ease-out); }
.home-settings[open] summary > .ui-icon { transform: rotate(90deg); }
.home-settings form { border-top: 1px solid var(--hairline); padding: 6px 0 24px; }
.home-settings .set-row { justify-content: space-between; }
.home-settings .set-row input, .home-settings .set-row select { min-width: 0; min-height: 44px; font-size: 16px; }
.home-settings-note { color: var(--text-2); font-size: 12px; line-height: 1.85; margin-top: 16px; }
.home-settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.home-settings-actions .btn { min-height: 44px; }
#settings-message { color: var(--text-2); font-size: 12px; flex: 1; min-width: 120px; }
.home-footer { margin: 30px 4px 8px; display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 11px; }
.account-link { display: inline-flex; align-items: center; min-height: 44px; top: max(4px, env(safe-area-inset-top)); color: var(--text-2); }
#tabbar { bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 480px; padding: 6px; gap: 3px; border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--sh-glass); }
#tabbar button { min-width: 0; min-height: 56px; border-radius: var(--r-pill); padding: 7px 2px; color: var(--text-2); transition: background .18s var(--ease-out), transform .15s var(--ease-out); }
#tabbar button .tab-ic { width: 23px; height: 23px; color: inherit; }
#tabbar button.active { background: var(--accent-weak); color: var(--accent-deep); }
#tabbar button.active .tab-ic { color: inherit; }
#tabbar button:active, .home-settings-trigger:active { transform: scale(.96); }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  #tabbar { background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
}
@media (hover: hover) {
  .home-practice-row:hover { background: var(--hover); }
  .home-start:hover { background: var(--accent-deep); }
  .home-settings-trigger:hover { color: var(--text); }
  #tabbar button:not(.active):hover { background: var(--hover); }
}
@media (min-width: 700px) {
  .home-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; }
  .home-heading { margin-bottom: 32px; }
  .home-exam { grid-column: 1 / -1; padding: 8px; }
  .home-settings { grid-column: 1 / -1; }
  .home-practice-list { margin-top: 20px; }
  .home-practice-row { min-height: 85px; }
}
@media (min-width: 900px) {
  #app { max-width: 1288px; padding: 46px clamp(28px, 4vw, 64px) 48px; margin-left: 208px; }
  .home-view { max-width: 1080px; margin-inline: auto; }
  #tabbar { top: 0; bottom: 0; left: 0; width: 208px; max-width: none; padding: 24px 12px; gap: 4px; border: 0; border-right: 1px solid var(--hairline); border-radius: 0; box-shadow: none; transform: none; }
  #tabbar .brand { padding: 12px 12px 30px; font-size: 17px; }
  #tabbar button { min-height: 48px; padding: 12px 14px; margin: 0; border-radius: var(--r-thumb); }
  #tabbar button .tab-ic { width: 21px; height: 21px; }
  .account-link { top: 12px; right: 22px; }
  .home-heading { margin-top: 8px; }
  .home-focus { padding: 30px; }
  .home-practice { padding: 28px 28px 12px; }
}
@media (max-width: 380px) {
  .home-panel { padding: 20px; }
  .home-settings { padding-block: 0; }
  .home-eyebrow { font-size: 11px; }
  .home-settings-trigger > span { display: none; }
  .home-settings-trigger { width: 44px; padding: 0; }
  .home-metrics > div + div { padding-left: 12px; }
  .home-row-copy > span { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
  #tabbar button:active, .home-settings-trigger:active, .btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  #tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --text-2: #424245; --text-3: #515154; --hairline: rgba(0, 0, 0, .25); }
  .home-panel { outline: 1px solid var(--hairline); }
  #tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-color: var(--hairline); }
}

/*
MIT License

Copyright (c) 2026 naplesblue

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

Portions of this work — specifically `motion.md` — are adapted from
emilkowalski/skills (`apple-design`), MIT License, Copyright (c) 2026 Emil Kowalski.
https://github.com/emilkowalski/skills

The original MIT permission notice above applies to those portions as well.

---

The line-icon SVG paths in `icons.md` (and the inline tab-bar icons in
`app.md` / `examples/wallet.html`) are from Lucide, ISC License,
Copyright (c) for Lucide are held by Lucide Contributors 2022.
https://github.com/lucide-icons/lucide

  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.

  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

*/
