/* ===== RISO 4色印刷マニュアル ===== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Riso ink palette — fluorescent print feel */
  --ink-pink:    #ff5294;   /* Fluorescent Pink */
  --ink-pink-2:  #ff3982;
  --ink-blue:    #2c5fff;   /* Federal Blue */
  --ink-yellow:  #ffe600;   /* Sunflower */
  --ink-yellow-2:#fff04a;
  --ink-black:   #1a1a1a;
  --ink-teal:    #00a8a0;
  --ink-flo-orange: #ff7a32;

  /* Paper */
  --paper:       #f3eee2;   /* warm off-white */
  --paper-edge:  #e8e0cc;
  --paper-grid:  rgba(0,0,0,0.04);

  /* UI */
  --ui-bg:       #f3eee2;
  --ui-card:     #fbf7ec;
  --ui-card-2:   #efe8d6;
  --ui-line:     #2a2520;
  --ui-text:     #1a1612;
  --ui-text-dim: #6b6358;
  --ui-text-mut: #8a8170;

  --accent:      var(--ink-pink);
  --accent-2:    var(--ink-blue);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --font-ui:   'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

[data-theme="dark"] {
  --paper: #15141a;
  --paper-edge: #20202a;
  --paper-grid: rgba(255,255,255,0.04);
  --ui-bg: #15141a;
  --ui-card: #1d1c25;
  --ui-card-2: #262532;
  --ui-line: #d8d3c8;
  --ui-text: #ece6d8;
  --ui-text-dim: #9a92a8;
  --ui-text-mut: #6f6878;
}

[data-theme="light"] {
  --paper: #ffffff;
  --paper-edge: #eeeeee;
  --paper-grid: rgba(0,0,0,0.03);
  --ui-bg: #ffffff;
  --ui-card: #fafafa;
  --ui-card-2: #f0f0f0;
  --ui-line: #1a1a1a;
  --ui-text: #1a1a1a;
  --ui-text-dim: #555;
  --ui-text-mut: #999;
}

html, body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
}

/* Paper-grain background overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.025) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.02) 0%, transparent 40%);
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::before { display: none; }

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--ui-card);
  border-right: 1px solid var(--ui-line);
  padding: 28px 22px 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-mark {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-mark .dot-y { color: var(--ink-yellow); -webkit-text-stroke: 1px var(--ui-line); }
.brand-mark .dot-p { color: var(--ink-pink); }
.brand-mark .dot-b { color: var(--ink-blue); }
.brand-mark .dot-k { color: var(--ui-line); }
.brand-jp { font-size: 11px; color: var(--ui-text-dim); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--ui-text-mut); margin-top: 2px; }

.progress-card {
  background: var(--ui-card-2);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ui-text-dim);
  font-weight: 700;
}
.progress-row .pct {
  font-family: var(--font-mono);
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 700;
}
.progress-bar {
  margin-top: 8px;
  height: 6px;
  background: var(--paper-edge);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  background: var(--ink-pink);
  transition: width .25s;
  /* riso-y double layer offset */
  box-shadow: 1px 0 0 var(--ink-blue);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ui-text-mut);
  margin: 8px 0 6px;
}
.nav-item {
  display: grid;
  grid-template-columns: 26px 1fr 18px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: var(--ui-text);
  width: 100%;
  transition: background .12s, border-color .12s;
}
.nav-item:hover { background: var(--paper-edge); }
.nav-item.active {
  background: var(--ui-line);
  color: var(--paper);
  border-color: var(--ui-line);
}
[data-theme="dark"] .nav-item.active { color: #15141a; }
.nav-item .num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
/* Sidebar bilingual labels — primary lang is bigger/bolder, secondary is dim subtitle */
.nav-item .label-jp { font-weight: 700; line-height: 1.2; font-size: 13px; letter-spacing: 0; }
.nav-item .label-en { font-size: 10px; opacity: 0.7; line-height: 1.2; letter-spacing: 0.04em; font-weight: 600; }
[data-lang="en"] .nav-item .label-en { font-size: 13px; font-weight: 700; opacity: 1; letter-spacing: 0; order: 0; }
[data-lang="en"] .nav-item .label-jp { font-size: 10px; font-weight: 500; opacity: 0.55; letter-spacing: 0; order: 1; }
.nav-item > div { display: flex; flex-direction: column; }
.nav-item .check {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--ui-text-mut);
  display: flex; align-items: center; justify-content: center;
}
.nav-item .check.done {
  background: var(--ink-pink);
  border-color: var(--ink-pink);
}
.nav-item .check.done svg { display: block; }
.nav-item .check svg { display: none; color: #fff; }

/* ===== Main ===== */
.main {
  padding: 0;
  position: relative;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ui-bg);
  border-bottom: 1px solid var(--ui-line);
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ui-text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.crumb .crumb-num {
  font-family: var(--font-mono);
  background: var(--ui-line);
  color: var(--paper);
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
[data-theme="dark"] .crumb .crumb-num { color: #15141a; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.lang-switch button {
  background: transparent;
  border: none;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ui-text-dim);
}
.lang-switch button.on {
  background: var(--ui-line);
  color: var(--paper);
}
[data-theme="dark"] .lang-switch button.on { color: #15141a; }

.content-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}

/* Phase header */
.phase-head {
  position: relative;
  border-bottom: 2px solid var(--ui-line);
  padding-bottom: 28px;
  margin-bottom: 36px;
}
.phase-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ui-text-dim);
}
.phase-tag .swatch {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-pink);
  box-shadow: 4px 0 0 var(--ink-blue);
  margin-right: 6px;
}
.phase-title {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 12px;
  position: relative;
  display: inline-block;
}
/* Misregistration title */
.phase-title .layer {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.phase-title .layer::before {
  content: attr(data-text);
  position: absolute;
  left: 3px; top: -2px;
  width: 100%;
  white-space: nowrap;
  color: var(--ink-pink);
  mix-blend-mode: multiply;
  z-index: -1;
  opacity: 0.85;
}
.phase-title .layer::after {
  content: attr(data-text);
  position: absolute;
  left: -2px; top: 2px;
  width: 100%;
  white-space: nowrap;
  color: var(--ink-blue);
  mix-blend-mode: multiply;
  z-index: -1;
  opacity: 0.85;
}
[data-theme="dark"] .phase-title .layer::before,
[data-theme="dark"] .phase-title .layer::after { mix-blend-mode: screen; }

.phase-title-en {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ui-text-dim);
  margin-top: 14px;
  text-transform: uppercase;
}
.phase-lead {
  margin-top: 18px;
  font-size: 16px;
  color: var(--ui-text-dim);
  line-height: 1.75;
  max-width: 680px;
}

/* Step block */
.step {
  position: relative;
  padding: 24px 0 28px 56px;
  border-bottom: 1px dashed var(--ui-line);
}
.step:last-of-type { border-bottom: none; }
.step-num {
  position: absolute;
  left: 0; top: 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
  background: var(--ui-line);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .step-num { color: #15141a; }
.step-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.step-title-en {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ui-text-mut);
  text-transform: uppercase;
  margin-top: 4px;
}
.step-body {
  margin-top: 12px;
  color: var(--ui-text);
}
.step-body p { margin: 8px 0; }
.step-body ul { margin: 8px 0; padding-left: 20px; }
.step-body li { margin: 4px 0; }
.step-body code, .inline-code {
  font-family: var(--font-mono);
  background: var(--ui-card-2);
  border: 1px solid var(--ui-line);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Checkbox */
.check-list {
  margin-top: 16px;
  background: var(--ui-card);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check-list-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-pink);
  margin-bottom: 4px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  font-size: 14px;
  user-select: none;
}
.check-row .box {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border: 1.5px solid var(--ui-line);
  border-radius: 4px;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  transition: background .1s;
}
.check-row.done .box {
  background: var(--ink-pink);
  border-color: var(--ink-pink);
}
.check-row .box svg { display: none; color: #fff; }
.check-row.done .box svg { display: block; }
.check-row.done .label-text {
  text-decoration: line-through;
  color: var(--ui-text-mut);
}

/* Tip / Warning callouts */
.callout {
  margin: 18px 0;
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--ui-card);
  position: relative;
  overflow: hidden;
}
.callout::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--ink-pink);
}
.callout.warn::before { background: var(--ink-flo-orange); }
.callout.tip::before { background: var(--ink-blue); }
.callout-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink-pink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  font-family: var(--font-mono);
}
.callout.warn .callout-icon { background: var(--ink-flo-orange); }
.callout.tip .callout-icon { background: var(--ink-blue); }
.callout-body { flex: 1; min-width: 0; }
.callout-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ui-text-dim);
  margin-bottom: 4px;
}
.callout-text { font-size: 14px; line-height: 1.7; }

/* Diagram frame */
.diagram {
  margin: 22px 0;
  background: var(--paper);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
}
.diagram-bg {
  background-image:
    linear-gradient(0deg, var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: 16px 16px;
}
.diagram-cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 16px;
}
.diagram-cap .ttl {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ui-text-dim);
}
.diagram-cap .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ui-text-mut);
}

/* Separator chunk title (English+Japanese) */
.bilingual { display: inline; }
.lang-en, .lang-ja { display: none; }
[data-lang="ja"] .lang-ja { display: inline; }
[data-lang="en"] .lang-en { display: inline; }
[data-lang="ja"] .lang-ja-block { display: block; }
[data-lang="en"] .lang-en-block { display: block; }
.lang-ja-block, .lang-en-block { display: none; }

/* In EN mode, the giant phase title becomes lighter weight to feel less shouty in roman type */
[data-lang="en"] .phase-title { letter-spacing: -0.025em; }
[data-lang="en"] .phase-title .layer { font-feature-settings: "ss01"; }

/* Toggle group (segmented) */
.seg {
  display: inline-flex;
  border: 1px solid var(--ui-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 12px;
}
.seg button {
  background: transparent;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ui-text-dim);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.seg button.on {
  background: var(--ui-line);
  color: var(--paper);
}
[data-theme="dark"] .seg button.on { color: #15141a; }

/* Color separation simulator */
.sim {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
}
.sim-canvas {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  overflow: hidden;
  isolation: isolate;
}
.sim-layer {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity .2s;
}
[data-theme="dark"] .sim-layer { mix-blend-mode: screen; }
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sim-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ui-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--ui-card);
  transition: background .12s;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.sim-toggle:hover { background: var(--ui-card-2); }
.sim-toggle.off { opacity: 0.45; }
.sim-toggle .chip {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ui-line);
  flex-shrink: 0;
}
.sim-toggle .name {
  font-weight: 700;
  font-size: 13px;
  flex: 1;
}
.sim-toggle .pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ui-text-mut);
}
.sim-toggle .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ui-text-mut);
}
.sim-toggle:not(.off) .dot { background: var(--ink-pink); }

/* Pass timeline */
.pass-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 8px 0;
}
.pass-card {
  background: var(--ui-card);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}
.pass-card .pass-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ui-text-mut);
  margin-bottom: 6px;
}
.pass-card.active { border-color: var(--ink-pink); box-shadow: 0 0 0 2px rgba(255,82,148,0.15); }
.pass-card.active .pass-tag { color: var(--ink-pink); }
.pass-card .pass-title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 6px;
}
.pass-card .pass-desc {
  font-size: 12px;
  color: var(--ui-text-dim);
  line-height: 1.5;
}
.pass-controls {
  display: flex;
  gap: 8px;
  margin: 14px 0 8px;
  align-items: center;
}
.pass-btn {
  background: var(--ink-pink);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pass-btn:hover { background: var(--ink-pink-2); }
.pass-btn.ghost {
  background: transparent;
  border: 1px solid var(--ui-line);
  color: var(--ui-text);
}

/* Drum diagram */
.drum-diagram {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

/* Footer */
.phase-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--ui-line);
  gap: 14px;
}
.foot-btn {
  background: transparent;
  border: 1px solid var(--ui-line);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ui-text);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  min-width: 0;
}
.foot-btn:hover { background: var(--ui-card-2); }
.foot-btn.primary {
  background: var(--ink-pink);
  border-color: var(--ink-pink);
  color: #fff;
}
.foot-btn.primary:hover { background: var(--ink-pink-2); }
.foot-btn .small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
}
.foot-btn .big { font-size: 14px; font-weight: 800; }

/* Tips index (appendix) */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.tip-card {
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--ui-card);
}
.tip-card .num-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--ink-blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.tip-card h4 { font-size: 15px; margin: 8px 0 6px; }
.tip-card p { font-size: 13px; color: var(--ui-text-dim); }

/* Phase intro grid (for phase 1) */
.phase-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0 28px;
}
.meta-card {
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--ui-card);
}
.meta-card .k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ui-text-mut);
}
.meta-card .v {
  font-size: 18px;
  font-weight: 800;
  margin-top: 4px;
  font-family: var(--font-mono);
}
.meta-card .vsub { font-size: 11px; color: var(--ui-text-dim); }

/* Cover (phase 0) */
.cover {
  position: relative;
  padding: 80px 0 0;
  border-bottom: 2px solid var(--ui-line);
  margin-bottom: 40px;
}
.cover h1 {
  font-size: 84px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.04em;
  position: relative;
  margin-bottom: 24px;
}
.cover h1 .ja { display: block; font-size: 38px; letter-spacing: 0.02em; line-height: 1.1; margin-top: 14px; }
.cover h1 .stamp {
  position: absolute;
  top: -20px;
  right: -10px;
  background: var(--ink-pink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 6px 14px;
  border-radius: 999px;
  transform: rotate(4deg);
}
.cover-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 32px;
  padding: 18px 0;
  border-top: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
}
.cover-meta .cell .k { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ui-text-mut); font-weight: 700; }
.cover-meta .cell .v { font-size: 14px; font-weight: 700; margin-top: 4px; }

/* Color chip rendering for sim toggles when off */
.sim-toggle.off .chip { filter: grayscale(0.9) opacity(0.4); }

/* Glossary table */
.glossary {
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.gloss-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-line);
  font-size: 14px;
}
.gloss-row:last-child { border-bottom: none; }
.gloss-row .term {
  font-weight: 700;
}
.gloss-row .term .en {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--ui-text-mut);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
  font-family: var(--font-mono);
}
.gloss-row .def { color: var(--ui-text-dim); }

/* Animations */
@keyframes paperSlide {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(110%); }
}
@keyframes drumSpin {
  to { transform: rotate(360deg); }
}
@keyframes inkDrop {
  0% { opacity: 0; transform: translateY(-10px); }
  60% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; }
}

/* Dry timer visual */
.dry-strip {
  height: 70px;
  background: var(--ui-card);
  border: 1px solid var(--ui-line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
}
.dry-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(255,82,148,0.08), rgba(44,95,255,0.06));
  transition: width .3s;
}
.dry-strip .lbl {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ui-text-dim);
  font-weight: 700;
}
.dry-strip .v {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--ui-text);
  margin-left: auto;
}

/* Ink combo grid */
.combo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.combo-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--ui-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  color: var(--ui-text);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--ui-line); border-radius: 4px; opacity: 0.4; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .content-wrap { padding: 24px 20px 60px; }
  .topbar { padding: 14px 20px; }
  .cover h1 { font-size: 48px; }
  .cover h1 .ja { font-size: 22px; }
  .phase-title { font-size: 30px; }
  .pass-timeline { grid-template-columns: 1fr; }
  .sim { grid-template-columns: 1fr; }
  .drum-diagram { grid-template-columns: 1fr; }
  .phase-meta-row, .cover-meta { grid-template-columns: 1fr 1fr; }
}
