:root {
  color-scheme: light dark;
  --shironeri: light-dark(#fcfaf2, #f2eee6);
  --ake: light-dark(#cc543a, #ff806b);
  --ake-deep: light-dark(#9f3f2f, #ffad9f);
  --ake-soft: light-dark(#f2ded6, #43261f);
  --tetsu: light-dark(#255359, #8fb2bd);
  --tetsu-deep: light-dark(#183f44, #b8d3da);
  --tetsu-soft: light-dark(#dce5e2, #253b39);
  --page: light-dark(#f3f0e8, #151a17);
  --surface: light-dark(#fffefa, #202622);
  --elevated: light-dark(#f8f4ea, #292f2b);
  --ink: light-dark(#181816, #f4f1e8);
  --body: light-dark(#34332f, #dedad1);
  --muted: light-dark(#6d6b63, #aaa89f);
  --line: light-dark(rgb(24 24 22 / .14), rgb(244 241 232 / .13));
  --line-strong: light-dark(rgb(24 24 22 / .5), rgb(244 241 232 / .42));
  --shadow: 0 16px 50px rgb(35 31 22 / .09);
  --serif: "Songti SC", "Hiragino Mincho ProN", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--page); font-family: var(--sans); }
button, input, select { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--ake); outline-offset: 3px; }
a { color: inherit; }
[hidden] { display: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, .86fr) minmax(520px, 1.14fr);
  background: var(--shironeri);
}
.login-panel { display: flex; flex-direction: column; min-height: 100vh; padding: clamp(28px, 5vw, 72px); }
.brand { display: flex; align-items: center; gap: 13px; width: fit-content; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: #fffdf7; background: var(--ake); font-family: var(--serif); font-size: 19px; font-weight: 700; }
.brand-word { font-size: 15px; font-weight: 820; letter-spacing: .18em; }
.brand-word small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.login-copy { width: min(430px, 100%); margin: auto 0; padding: 72px 0; }
.eyebrow { color: var(--ake-deep); font-size: 11px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.login-copy h1 { max-width: 8em; margin: 18px 0 20px; font-family: var(--serif); font-size: clamp(44px, 5vw, 72px); line-height: 1.08; letter-spacing: -.055em; }
.login-copy > p { max-width: 32em; margin: 0 0 42px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.auth-form { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 12px; font-weight: 760; }
.field input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 7%, transparent); }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.primary-button, .secondary-button, .ghost-button { min-height: 46px; border-radius: 9px; cursor: pointer; font-weight: 760; }
.primary-button { border: 1px solid var(--ake-deep); color: #fffdf7; background: var(--ake); box-shadow: 3px 3px 0 color-mix(in srgb, var(--ake-deep) 40%, transparent); }
.secondary-button { padding: 0 18px; border: 1px solid var(--tetsu); color: #fff; background: var(--tetsu); }
.ghost-button { border: 1px solid var(--line); background: transparent; }
.primary-button:disabled, .secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.auth-note { min-height: 22px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.demo-button { margin-top: 22px; border: 0; color: var(--tetsu-deep); background: transparent; cursor: pointer; font-size: 13px; font-weight: 760; text-decoration: underline; text-underline-offset: 5px; }
.login-art { position: relative; overflow: hidden; min-height: 100vh; background: var(--tetsu); }
.login-art::before { content: ""; position: absolute; width: min(42vw, 610px); aspect-ratio: 1; top: 13%; right: -7%; border-radius: 50%; background: var(--ake); }
.login-art::after { content: ""; position: absolute; inset: 9% 11%; border: 1px solid rgb(255 255 255 / .52); }
.art-lines { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(16.66% - 1px), rgb(255 255 255 / .12) calc(16.66% - 1px) 16.66%); }
.art-caption { position: absolute; z-index: 1; right: 11%; bottom: 10%; width: min(360px, 70%); color: #fffdf7; }
.art-caption strong { display: block; font-family: var(--serif); font-size: clamp(28px, 3vw, 48px); line-height: 1.28; }
.art-caption span { display: block; margin-top: 20px; font-size: 11px; font-weight: 750; letter-spacing: .16em; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 20px 24px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent); }
.nav { display: grid; gap: 8px; margin-top: 62px; }
.nav-button { position: relative; min-height: 48px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.nav-button::before { content: attr(data-index); width: 23px; font-family: var(--serif); font-size: 12px; }
.nav-button[aria-current="page"] { color: var(--tetsu-deep); background: var(--tetsu-soft); font-weight: 800; }
.nav-button[aria-current="page"]::after { content: ""; position: absolute; right: -21px; width: 3px; height: 24px; background: var(--ake); }
.sidebar-foot { display: grid; gap: 12px; margin-top: auto; }
.profile-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fffdf7; background: var(--tetsu); font-family: var(--serif); }
.profile-chip div { min-width: 0; }
.profile-chip strong, .profile-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip strong { font-size: 12px; }
.profile-chip small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.signout { width: fit-content; padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
.login-real-button { min-height: 42px; width: 100%; border: 1px solid var(--ake-deep); border-radius: 8px; color: #fffdf7; background: var(--ake); cursor: pointer; font-size: 12px; font-weight: 800; box-shadow: 3px 3px 0 var(--ake-soft); }

.main { min-width: 0; padding: 44px clamp(24px, 5vw, 76px) 80px; }
.demo-banner { max-width: 1260px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 auto 28px; padding: 10px 12px 10px 17px; border: 1px solid color-mix(in srgb, var(--ake) 45%, var(--line)); border-radius: 10px; color: var(--body); background: var(--ake-soft); font-size: 12px; }
.demo-banner strong { margin-right: 7px; color: var(--ake-deep); }
.demo-banner button { min-height: 34px; flex: 0 0 auto; padding: 0 13px; border: 1px solid var(--ake-deep); border-radius: 7px; color: #fffdf7; background: var(--ake); cursor: pointer; font-size: 11px; font-weight: 800; }
.page { max-width: 1260px; margin: 0 auto; animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.page-title h1 { margin: 8px 0 0; font-family: var(--serif); font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.06em; }
.page-title p { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.search { width: min(280px, 30vw); height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.select { height: 44px; padding: 0 35px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.readonly-stamp { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .12em; }
.readonly-stamp::before { content: ""; width: 7px; height: 7px; border: 1px solid var(--ake); background: var(--ake-soft); }

.reading-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.reading-card { position: relative; overflow: hidden; display: grid; grid-template-rows: 180px auto; min-height: 365px; padding: 0; border: 1px solid var(--line); border-radius: 13px; color: inherit; background: var(--surface); box-shadow: 0 7px 18px rgb(49 43 30 / .055); cursor: pointer; text-align: left; transition: transform .18s ease, box-shadow .18s ease; }
.reading-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-cover { position: relative; overflow: hidden; background: var(--tetsu); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover.no-image::before { content: ""; position: absolute; width: 118px; height: 118px; top: 28px; right: -12px; border-radius: 50%; background: var(--ake); }
.card-cover.no-image::after { content: ""; position: absolute; left: 28px; top: 28px; width: 58px; height: 98px; border: 1px solid rgb(255 255 255 / .76); }
.reading-card[data-cover="sand"] .card-cover { background: #d8c49d; }
.reading-card[data-cover="sand"] .card-cover.no-image::before { background: var(--tetsu); }
.reading-card[data-cover="sky"] .card-cover { background: #7995a0; }
.reading-card[data-cover="plum"] .card-cover { background: #6f4b57; }
.cover-kind { position: absolute; left: 14px; bottom: 13px; padding: 5px 8px; color: #fff; background: rgb(18 18 16 / .7); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.card-body { display: flex; flex-direction: column; padding: 20px 19px 18px; }
.card-meta { color: var(--ake-deep); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.card-body h2 { margin: 11px 0 8px; font-family: var(--serif); font-size: 21px; line-height: 1.42; letter-spacing: -.025em; }
.card-body p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; }

.material-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.material-card { min-height: 230px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: var(--surface); cursor: pointer; text-align: left; transition: transform .18s ease, box-shadow .18s ease; }
.material-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.material-card[data-kind="image"] { min-height: 330px; color: #fffdf7; background: var(--tetsu); }
.material-card[data-kind="text"] { background: var(--elevated); }
.material-kind { display: flex; align-items: center; justify-content: space-between; color: var(--ake-deep); font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.material-card[data-kind="image"] .material-kind { color: #fffdf7; }
.material-mark { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid currentColor; font-family: var(--serif); font-size: 13px; }
.material-card h2 { margin: auto 0 10px; font-family: var(--serif); font-size: 20px; line-height: 1.45; }
.material-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.material-card[data-kind="image"] p { color: rgb(255 255 255 / .7); }

.dashboard { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.metric-card, .chart-card, .account-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.metric-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
.metric { padding: 24px 26px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .1em; }
.metric strong { display: block; margin-top: 13px; font-family: var(--serif); font-size: 38px; font-weight: 700; }
.metric small { color: var(--muted); font-size: 10px; }
.chart-card { min-height: 370px; padding: 26px; }
.section-title { margin: 0; font-family: var(--serif); font-size: 22px; }
.week-list { display: grid; gap: 17px; margin-top: 30px; }
.week-row { display: grid; grid-template-columns: 32px 1fr 38px 30px; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; }
.week-row progress { width: 100%; height: 9px; border: 0; accent-color: var(--tetsu); background: var(--tetsu-soft); }
.week-row progress::-webkit-progress-bar { background: var(--tetsu-soft); }
.week-row progress::-webkit-progress-value { background: var(--tetsu); }
.week-row progress::-moz-progress-bar { background: var(--tetsu); }
.week-row strong { color: var(--ink); text-align: right; }
.week-row i { color: var(--ake-deep); font-style: normal; font-weight: 800; }
.account-card { padding: 26px; }
.account-list { display: grid; gap: 0; margin: 25px 0 0; }
.account-row { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.account-row span { color: var(--muted); }

.empty { min-height: 320px; display: grid; place-items: center; grid-column: 1 / -1; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 8px; color: var(--ink); font-family: var(--serif); font-size: 20px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skeleton { height: 360px; border-radius: 13px; background: linear-gradient(100deg, var(--elevated) 20%, var(--surface) 38%, var(--elevated) 58%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

.drawer-backdrop { position: fixed; z-index: 40; inset: 0; display: flex; justify-content: flex-end; background: rgb(13 15 13 / .38); backdrop-filter: blur(3px); animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; } }
.drawer { width: min(580px, 94vw); height: 100%; overflow-y: auto; padding: 30px clamp(24px, 4vw, 48px) 60px; border-left: 1px solid var(--line); background: var(--shironeri); box-shadow: -18px 0 60px rgb(0 0 0 / .12); animation: drawer-in .24s ease; }
@keyframes drawer-in { from { transform: translateX(35px); opacity: .4; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 22px; }
.drawer-cover { position: relative; height: 240px; overflow: hidden; margin: 26px 0 32px; background: var(--tetsu); }
.drawer-cover img { width: 100%; height: 100%; object-fit: cover; }
.drawer-cover::after { content: ""; position: absolute; right: -20px; top: 45px; width: 160px; height: 160px; border-radius: 50%; background: var(--ake); mix-blend-mode: screen; opacity: .75; }
.drawer h1 { margin: 12px 0 12px; font-family: var(--serif); font-size: clamp(32px, 4vw, 48px); line-height: 1.2; letter-spacing: -.045em; }
.drawer-summary { color: var(--body); font-family: var(--serif); font-size: 17px; line-height: 1.9; }
.drawer-details { display: grid; grid-template-columns: 1fr 1fr; margin: 30px 0; border-top: 1px solid var(--line); }
.drawer-detail { padding: 14px 0; border-bottom: 1px solid var(--line); }
.drawer-detail span, .drawer-detail strong { display: block; }
.drawer-detail span { color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.drawer-detail strong { margin-top: 5px; font-size: 12px; }
.drawer-paragraphs { display: grid; gap: 16px; margin: 28px 0; color: var(--body); font-family: var(--serif); font-size: 16px; line-height: 1.9; }
.cloud-reader { margin: 32px -4px 12px; padding: 26px clamp(18px, 4vw, 34px); border: 1px solid var(--line); background: var(--surface); box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 5%, transparent); }
.cloud-reader-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.cloud-reader-head span { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.cloud-reader-head small { color: var(--muted); font-size: 9px; }
.content-loading { margin: 24px 0; padding: 18px; border: 1px dashed var(--line-strong); color: var(--muted); background: var(--elevated); font-size: 12px; text-align: center; }
.cache-inspector { margin: 32px -4px 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 5%, transparent); }
.cache-inspector-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.cache-inspector-head > div { display: grid; gap: 4px; }
.cache-inspector-head span { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.cache-inspector-head small { color: var(--muted); font-size: 9px; }
.cache-inspector-head .raw-badge { padding: 5px 7px; color: #fff; background: var(--ake-deep); font-family: var(--sans); font-size: 8px; letter-spacing: .14em; }
.cache-package-list { display: grid; }
.cache-package { min-width: 0; padding: 22px; border-bottom: 1px solid var(--line); }
.cache-package:last-child { border-bottom: 0; }
.cache-package-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cache-package-title > div { display: grid; gap: 4px; min-width: 0; }
.cache-package-title strong { font-family: var(--serif); font-size: 17px; }
.cache-package-title small, .cache-package-title > span { color: var(--muted); font-size: 9px; }
.cache-metadata { margin-top: 16px; border: 1px solid var(--line); background: var(--elevated); }
.cache-metadata summary { padding: 11px 13px; cursor: pointer; color: var(--body); font-size: 10px; font-weight: 700; }
.cache-metadata pre, .raw-viewer pre { overflow: auto; margin: 0; color: #e7e5dc; background: #202421; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 11px; line-height: 1.65; tab-size: 2; white-space: pre; }
.cache-metadata pre { max-height: 240px; padding: 15px; border-top: 1px solid var(--line); }
.cache-files { display: flex; overflow-x: auto; gap: 7px; margin-top: 16px; padding-bottom: 4px; }
.cache-files button { flex: 0 0 auto; display: grid; gap: 3px; max-width: 230px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--body); background: transparent; cursor: pointer; text-align: left; }
.cache-files button span { overflow: hidden; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cache-files button small { color: var(--muted); font-size: 8px; }
.cache-files button[aria-selected="true"] { border-color: var(--tetsu); color: #fff; background: var(--tetsu); }
.cache-files button[aria-selected="true"] small { color: rgb(255 255 255 / .68); }
.cache-files button:disabled { cursor: default; opacity: .46; }
.raw-viewer { overflow: hidden; margin-top: 12px; border: 1px solid #313733; background: #202421; }
.raw-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; color: #e7e5dc; border-bottom: 1px solid #3a403b; }
.raw-viewer-head strong { overflow: hidden; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.raw-viewer-head span { flex: 0 0 auto; color: #9ea79f; font-size: 8px; }
.raw-viewer pre { max-height: 520px; padding: 16px; }
.cache-error, .cache-empty { margin-top: 14px; padding: 14px; color: var(--muted); border: 1px dashed var(--line-strong); font-size: 10px; line-height: 1.6; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.drawer-actions a, .drawer-actions button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 9px; text-decoration: none; }
.asset-preview { overflow: hidden; margin: 26px 0; border: 1px solid var(--line); background: var(--elevated); }
.asset-preview img { display: block; width: 100%; max-height: 440px; object-fit: contain; }
.asset-loading { min-height: 220px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.mobile-nav { display: none; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease; }
.toast.error { border-color: var(--ake); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1020px) {
  .reading-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .login-page { display: block; }
  .login-panel { min-height: 100svh; padding: 26px 22px; }
  .login-copy { padding: 56px 0 28px; }
  .login-copy h1 { font-size: 48px; }
  .login-art { display: none; }
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 30px 18px 104px; }
  .demo-banner { align-items: flex-start; margin-bottom: 22px; }
  .demo-banner span { line-height: 1.6; }
  .demo-banner button { min-height: 42px; }
  .page-head { display: grid; margin-bottom: 24px; }
  .page-title h1 { font-size: 42px; }
  .page-actions { display: grid; grid-template-columns: 1fr auto; }
  .search { width: 100%; }
  .readonly-stamp { display: none; }
  .reading-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .reading-card { grid-template-columns: 1fr; grid-template-rows: 150px auto; min-height: 340px; }
  .card-body { padding: 16px; }
  .card-body h2 { font-size: 18px; }
  .card-body p { -webkit-line-clamp: 2; }
  .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-card { min-height: 210px; }
  .material-card[data-kind="image"] { min-height: 260px; }
  .metric-strip { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .mobile-nav { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 93%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
  .mobile-nav button { min-height: 50px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 11px; }
  .mobile-nav button[aria-current="page"] { color: #fff; background: var(--tetsu); font-weight: 800; }
  .drawer { width: 100vw; }
  .cache-inspector { margin-right: 0; margin-left: 0; }
}
@media (max-width: 520px) {
  .demo-banner { display: grid; }
  .demo-banner button { width: 100%; }
  .reading-grid { grid-template-columns: 1fr; }
  .reading-card { grid-template-rows: 180px auto; min-height: 380px; }
}
@media (max-width: 450px) {
  .material-grid { grid-template-columns: 1fr; }
  .code-row { grid-template-columns: 1fr; }
  .secondary-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
