/* DESIGN.md v3 (2026-11-11) tokens. Colors, type, radii, gaps, shadows, glass and motion are defined only here. */
:root {
  color-scheme: light;

  /* 2. Color palette & roles */
  --color-file-green: #00AD50;
  --color-file-yellow: #FFDC00;
  --color-on-file: #111827;
  --color-action: #007B30;
  --color-action-hover: #006627;
  --color-action-tint: #F0F7F2;
  --color-on-action: #FFFFFF;
  --color-ink: #111827;
  --color-muted: #49515E;
  --color-placeholder: #67717F;
  --color-line: #D4D8DF;
  --color-input-border: #7D858F;
  --color-surface: #FFFFFF;
  --color-subtle: #F4F6F5;
  --color-danger: #C92319;
  --color-danger-hover: #A81D14;
  --color-success: #007B30;
  --color-caution: #735300;
  --color-amazon: #FF9900;
  --color-amazon-hover: #E68A00;
  --color-on-amazon: #111827;
  --color-goods-water: #0057FF;
  --color-goods-food: #FF5A00;
  --color-goods-toilet: #00A541;
  --color-focus: #111827;
  --color-backdrop: rgb(17 24 39 / 40%);

  /* 3. Typography (16px = 1rem; "小" is the default) */
  --font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --font-page: 1.75rem;
  --font-page-sp: 1.5rem;
  --font-file: 1.5rem;
  --font-file-sp: 1.25rem;
  --font-card: 1rem;
  --font-body: .875rem;
  --font-input: 1rem;
  --font-number: 1.75rem;
  --font-number-compact: 1.375rem;
  --font-note: .75rem;
  --font-nav: .875rem;
  --font-symbol: 1.375rem;
  --leading-heading: 1.4;
  --leading-body: 1.65;
  --leading-control: 1.5;
  --leading-number: 1.15;
  --leading-nav: 1.3;

  /* 4.0 Radii and gaps */
  --radius-file: 12px;
  --radius-card: 8px;
  --radius-control: 6px;
  --radius-badge: 4px;
  --radius-chip: 22px; /* 状態の絞り込みチップ（44px の操作面の半分で丸くする） */
  --gap-card: 12px;
  --gap-field: 16px;
  --gap-stage: 8px;

  /* 4.1 File box geometry */
  --file-rise: 40px;
  --file-shoulder-w: 48px;
  --file-heading-h: 80px;
  --file-reserve: 96px;
  --file-end-padding: 20px;
  --file-overlap: 64px;
  --file-tab-padding: 24px;
  --file-inset: 20px;
  --file-surface-padding: 14px;

  /* 5. Layout */
  --page-padding: 40px;
  --sidebar-w: 208px;
  /* The floating bottom navigation: its height plus the gap below it (layout.js mirrors the real value). */
  --bottom-nav-gap: 12px;
  --bottom-nav-h: calc(64px + var(--bottom-nav-gap) + env(safe-area-inset-bottom));

  /* 6. Depth */
  --shadow-file: drop-shadow(0 3px 5px rgb(12 48 32 / 12%));
  --shadow-card: 0 3px 8px rgb(12 48 32 / 9%);
  --shadow-sticky: 0 -2px 12px rgb(12 48 32 / 12%);
  --shadow-dialog: 0 10px 32px rgb(17 24 39 / 18%);
  --shadow-float: 0 8px 28px rgb(12 48 32 / 20%);

  /* 6.2 Glass layers (fixed bars only) */
  --glass-surface: rgb(255 255 255 / 76%);
  --glass-filter: blur(20px) saturate(180%);
  --glass-edge: rgb(255 255 255 / 70%);
  --glass-dark: rgb(17 24 39 / 80%);
  --glass-backdrop: rgb(17 24 39 / 30%);
  --color-action-on-glass: #006627;

  /* 11. Motion */
  --motion-fast: 120ms;
  --motion-press: 160ms;
  --motion-base: 260ms;
  --motion-pop: 420ms;
  --motion-slow: 460ms;
  --motion-count: 700ms;
  --motion-reveal: 560ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.5, 0, .9, .4);
  --ease-bounce: cubic-bezier(.3, 1.6, .5, 1);
  --ease-pop: cubic-bezier(.3, 1.4, .5, 1);
  --ease-smooth: cubic-bezier(.22, 1, .36, 1);
  --ease-smooth-close: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --motion-shift-s: 12px;
  --motion-shift-m: 28px;
  --motion-shift-l: 56px;
  --motion-stagger: 50ms;
}
/* A damped spring (about 16% overshoot); browsers without linear() keep the cubic-bezier above. */
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, 0.084 3.6%, 0.281 7.1%, 0.52 10.7%, 0.749 14.3%, 0.935 17.9%, 1.064 21.4%, 1.137 25%, 1.163 28.6%, 1.153 32.1%, 1.123 35.7%, 1.085 39.3%, 1.047 42.9%, 1.015 46.4%, 0.992 50%, 0.979 53.6%, 0.974 57.1%, 0.974 60.7%, 0.979 64.3%, 0.985 67.9%, 0.991 71.4%, 0.997 75%, 1.001 78.6%, 1.003 82.1%, 1.004 89.3%, 1); }
}
:root[data-text-size="large"] {
  --font-page: 2rem;
  --font-page-sp: 1.75rem;
  --font-file: 1.625rem;
  --font-file-sp: 1.375rem;
  --font-card: 1.125rem;
  --font-body: 1rem;
  --font-input: 1.125rem;
  --font-number: 2rem;
  --font-number-compact: 1.5rem;
  --font-note: .875rem;
  --font-nav: 1rem;
}
@media (max-width: 1100px) {
  :root { --page-padding: 16px; --file-inset: 8px; --sidebar-w: 184px; }
}
@media (max-width: 920px) {
  :root { --sidebar-w: 0px; }
}
@media (max-width: 700px) {
  :root {
    --gap-card: 8px;
    --page-padding: 10px;
    --file-inset: 6px;
    --file-tab-padding: 20px;
    --file-surface-padding: 10px;
  }
}
