/* Ink & paper: presentation only. Keep Study metrics and interaction state intact. */
:root {
  --paper: #f4f5f7;
  --surface: #fffefa;
  --surface-muted: #ebedf2;
  --ink: #252e40;
  --muted: #626b7c;
  --muted-text: var(--muted);
  --line: #d9dde5;
  --accent: #3e527e;
  --accent-soft: #e7ecf6;
  --error: #a34440;
  --radius-control: 8px;
  --radius-surface: 14px;
  --font-ui: var(--ui-font);
  --color-primary: var(--accent);
  --color-primary-hover: #32456e;
  --color-primary-active: #28395d;
  --color-primary-shadow: #28395d;
  --color-secondary: var(--surface);
  --color-on-secondary: var(--accent);
  --color-secondary-hover: #eef1f7;
  --color-secondary-active: var(--accent-soft);
  --color-secondary-border: #c5cbd7;
  --color-secondary-shadow: var(--line);
  --color-neutral: var(--surface-muted);
  --color-on-neutral: var(--ink);
  --color-neutral-hover: #e4e8ef;
  --color-neutral-active: #dbe1ec;
  --color-neutral-border: var(--line);
  --color-neutral-shadow: var(--line);
  --color-danger: var(--error);
  --color-info: var(--accent);
  --color-button-disabled-bg: #e9ebef;
  --color-button-disabled-border: var(--line);
  --color-button-disabled-text: #727b8b;
}

/* Compact shell: no hero, duplicate title or new return-button row. */
.product-identity { color: var(--ink); font-weight: 700; letter-spacing: -.025em; }
.product-identity::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 18px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -3px;
}
.product-navigation button { font-size: .9rem; }
.product-navigation button[aria-current="page"] {
  background: var(--accent-soft);
  border-radius: 6px 6px 0 0;
  font-weight: 600;
}
.view-back { color: var(--accent); }

/* Actions are solid/outlined; metadata never receives a control treatment. */
.btn-secondary,
.playback-panel #reset-speech,
.app-shell:has(.shadowing-panel:not([hidden])) .actions #start-learning {
  --button-background-hover: var(--color-secondary-hover);
  --button-background-active: var(--accent-soft);
  --button-border: #c5cbd7;
}
.btn-neutral {
  --button-background-hover: var(--color-neutral-hover);
  --button-background-active: var(--color-neutral-active);
}
button { font-variant-numeric: tabular-nums; }
input, select, textarea { accent-color: var(--accent); }
textarea, select, #recent-search { border-color: #c5cbd7; color: var(--ink); }
textarea:focus-visible, select:focus-visible, #recent-search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Catalogue: light editorial cards with a clear, consistent action footer. */
.material-row {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgb(37 46 64 / 6%);
  gap: 10px;
  padding: 22px;
  transition: background-color 140ms, box-shadow 140ms;
}
.material-row:hover {
  background: #f9fafc;
  box-shadow: 0 0 0 1px #aab6ce, 0 4px 14px rgb(37 46 64 / 6%);
  transform: none;
}
.material-row:active { transform: none; background: var(--accent-soft); }
.material-row-title { color: var(--ink); font-weight: 700; }
.material-row-description { font-size: .86rem; }
.material-level { font-weight: 600; letter-spacing: .035em; }
.material-tag { background: #f0f1f4; color: #60697a; font-size: .75rem; border-radius: 3px; }
.material-tag[data-tag-id="keigo"] { background: var(--accent-soft); color: var(--accent); }
.material-row-action {
  align-self: stretch;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: .85rem;
  font-weight: 600;
}
.material-quick-filter[aria-pressed="true"], .material-page[aria-current="page"] { color: #fff; }
.materials-filter-panel { box-shadow: 0 12px 32px rgb(37 46 64 / 13%); }
.materials-filter-panel legend { letter-spacing: .015em; }
.material-preview-info { border-radius: 14px; background: var(--surface-muted); }
.material-preview-text { border-radius: 14px; }

/* Creation is a workbench, not a marketing page. Preserve existing positions. */
.creation-workspace .article-panel, .study-sidebar .article-panel {
  border-radius: 14px;
  background: var(--surface-muted);
}
.creation-columns .ocr-drop-zone { border-color: #a2acc0; background: var(--surface); }
.creation-columns .ocr-drop-zone small { color: var(--muted); }
.ocr-mode-option:has(input:checked) { background: var(--accent-soft); border-color: #aab6ce; }
.ocr-input-tools { background: transparent; }

/* The library shares catalogue surfaces, but keeps its explicit icon actions. */
#view-my-learning .recent-learning-open {
  border-radius: 12px;
  box-shadow: 0 1px 3px rgb(37 46 64 / 6%);
}
#view-my-learning .recent-learning-open:hover {
  background: #f9fafc;
  box-shadow: 0 0 0 1px #aab6ce;
}
.recent-learning-time, .recent-learning-status { color: var(--muted); }
#view-my-learning .recent-learning-action { font-weight: 600; }
.recent-learning-favorite[aria-pressed="true"] svg { fill: var(--accent-soft); stroke: var(--accent); }

/* No metric, placement or animation overrides on Japanese or translation nodes. */
.subtitle-sentence:hover { background: #eef1f7; }
.subtitle-sentence.is-selected { background: var(--accent-soft); }
ruby rt { color: #697489; }
.playback-panel .control-disclosure-toggle { background: #f0f2f6; }
.playback-panel .control-disclosure-toggle:hover { background: var(--accent-soft); border-color: #aab6ce; }
.playback-panel .control-disclosure-toggle:active { background: #dbe1ec; }
.playback-panel .speed-button { --button-background-hover: var(--accent-soft); }

@media (max-width: 700px) {
  .product-identity { font-size: .9rem; }
  .product-navigation button { font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) {
  .material-row { transition: none; }
}
