/* ==========================================================================
   GSC Monthly Triage — design tokens ("Quiet Ledger")
   Decision-workflow tool, not an analytics dashboard. Judgment is carried by
   typography/spacing/surface hierarchy, not by red=bad/green=good coding —
   PROTECT is a positive outcome, not "nothing to see here", so it gets a
   calm desaturated navy/green pair, not green vs red. Ledger register:
   monospace labels/numerals, hairline rules, flat (mostly square) surfaces.
   ========================================================================== */
:root {
  /* canvas / surface / rule */
  --canvas: #edece8;
  --surface: #ffffff;
  --surface-inset: #fcfcfb;
  --surface-warm: #fbfaf8;
  --border: #dcdbd5;
  --hairline: #e8e7e2;
  --hairline-2: #ebeae6;

  /* ink */
  --ink: #15181d;
  --ink-muted: #4a5058;
  --ink-soft: #6e747d;
  --ink-faint: #71767e;

  /* status accents — deep navy(ACT) / deep desaturated green(PROTECT) /
     pale warm gray(WATCH) / palest gray(HOLD). No red/green judgment pair. */
  --act: #23405e;
  --act-bg: #eef2f7;
  --act-border: #dbe3ec;

  --protect: #3f5d52;
  --protect-ink: #2f463d;
  --protect-bg: #eaefeb;
  --protect-border: #d7dcd8;
  --protect-surface: #fbfaf7;
  --protect-surface-border: #e6e6e0;

  --watch: #cfcec9;
  --watch-ink: #3a4048;
  --watch-bg: #f1f0ec;

  --hold: #e3e2de;
  --hold-ink: #6e747d;
  --hold-bg: #f4f3f0;

  --danger: #8a3a24;
  --danger-bg: #f7ece7;
  --danger-border: #ecd4c6;

  --radius-btn: 4px;
  --radius-badge: 3px;
  --shadow-card: 0 1px 2px rgba(21, 24, 29, 0.04);

  --font-jp: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", "Meiryo", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html { -webkit-font-smoothing: antialiased; background: var(--canvas); }

body {
  margin: 0;
  font-family: var(--font-jp);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.65;
  font-size: 15px;
}

:focus-visible {
  outline: 2px solid var(--act);
  outline-offset: 2px;
}

/* ==========================================================================
   App shell — a single bordered "ledger" surface the screens live inside
   ========================================================================== */
.app-shell {
  max-width: 900px;
  margin: 32px auto 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
/* input screen needs the full-width hero composition; other screens keep the
   narrower reading width so result cards don't stretch unreadably wide */
.app-shell:has(#input-screen:not([hidden])) {
  max-width: min(1320px, calc(100vw - 48px));
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 56px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.96);
}
.app-topbar-name { font-size: 13.5px; font-weight: 640; color: var(--ink); letter-spacing: 0.01em; }
.app-topbar-version { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.02em; }
.app-topbar-privacy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-soft);
  min-width: 0;
  white-space: normal;
}
.app-topbar-privacy .privacy-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--protect); flex-shrink: 0;
}
.language-select {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 3px 6px;
  cursor: pointer;
}
.language-select:hover { border-color: var(--ink); color: var(--ink); }
.language-select:focus-visible { outline: 2px solid var(--act); outline-offset: 1px; }

#app-root {
  padding: 40px 32px 64px;
}
/* results screen: trim top padding so the 4-status summary sits higher
   in the first viewport (headline/memo hierarchy unchanged) */
#app-root:has(#results-screen:not([hidden])) {
  padding-top: 22px;
}

/* eyebrow: small tracked-out monospace/uppercase label above headings */
.eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

/* ==========================================================================
   Upload screen
   ========================================================================== */

/* #input-screen bleeds edge-to-edge inside .app-shell (cancelling #app-root's
   padding) so .input-main / .input-side can each carry their own generous
   padding, and the sidebar can reach the shell's right edge like a true
   column rather than an inset card. .input-below returns to a padded,
   reading-width block for secondary/help content. */
/* :not([hidden]) guard matters: an unqualified #input-screen{display:block}
   is an author rule and outranks the UA [hidden]{display:none} default
   regardless of specificity, so it would keep this section visible even
   after JS sets the hidden attribute to switch to progress/results */
#input-screen:not([hidden]) { display: block; }

.input-intro { padding: 0; max-width: 560px; }
.input-intro-title {
  margin: 0 0 10px;
  font-size: 33px;
  line-height: 1.28;
  font-weight: 640;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.input-intro-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.input-intro-desc strong { font-weight: 620; color: var(--ink); }

/* two-column upload layout: main workflow + persistent answer sidebar */
.input-layout {
  display: grid;
  grid-template-columns: 7fr 3fr;
  align-items: stretch;
}
.input-main { min-width: 0; }

.input-side {
  min-width: 0;
  background: var(--surface-inset);
  display: flex;
  flex-direction: column;
}
.input-side-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline-2);
}
.input-side-item { padding: 12px 0 11px; border-bottom: 1px solid var(--hairline-2); }
.input-side-item-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.input-side-bar { display: inline-block; width: 3px; height: 12px; flex-shrink: 0; }
.input-side-act .input-side-bar { background: var(--act); }
.input-side-protect .input-side-bar { background: var(--protect); }
.input-side-watch .input-side-bar { background: var(--watch); }
.input-side-hold .input-side-bar { background: var(--hold); }
.input-side-item-title { font-size: 13px; font-weight: 640; color: var(--ink); }
.input-side-item-code {
  margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--ink-faint); font-family: var(--font-mono);
}
.input-side-item-desc { margin: 0 0 0 10px; font-size: 12px; line-height: 1.7; color: var(--ink-soft); }

/* privacy/link notes relocated below the fold so the sidebar stays to the
   four decision states only (see .below-fold-notice) */
.below-fold-notice {
  margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--hairline);
  font-size: 11.5px; line-height: 1.8; color: var(--ink-soft);
}
.below-fold-notice-privacy { margin: 0 0 6px; }
.below-fold-notice-link { margin: 0; }
.below-fold-notice-link a { color: var(--act); }

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  margin-top: 18px;
  border: 1px solid var(--border);
  background: var(--surface-warm);
}

/* desktop: bleed #input-screen to the shell's edges so the sidebar column can
   reach the right border and the divider between columns reads as a single
   hairline rather than two padded boxes side by side */
@media (min-width: 861px) {
  #input-screen { margin: -40px -32px -64px; }
  .input-main {
    padding: 28px 56px 32px;
    border-right: 1px solid var(--hairline);
  }
  .input-side { padding: 28px 40px 32px; }
  .input-below { padding: 28px 56px 64px; border-top: 1px solid var(--hairline); }
}
@media (max-width: 860px) {
  .input-layout { grid-template-columns: 1fr; }
  .input-main { padding-bottom: 24px; border-bottom: 1px solid var(--hairline); }
  .input-side { padding-top: 24px; }
}

.input-column {
  padding: 16px 22px;
  border-right: 1px solid var(--hairline);
}
.input-column:last-child { border-right: 0; }
.input-column-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.input-column h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 620;
  color: var(--ink);
}
.input-column .period-hint {
  margin: 0;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  white-space: nowrap;
}
.input-column-num {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--act);
  margin-right: 6px;
}
.input-column-desc {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.why-two-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.why-two-note strong { color: var(--ink-muted); font-weight: 620; }

.flow-explainer {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 22px;
}
.flow-explainer-title { margin: 0 0 14px; font-size: 0.92rem; font-weight: 700; }
.flow-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.flow-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 4px 0;
}
.flow-steps li.flow-arrow {
  padding: 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
  line-height: 1;
}
.flow-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--act-bg); color: var(--act);
  font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem; flex-shrink: 0;
}
.first-time-details { margin-top: 0; margin-bottom: 26px; }
.first-time-details .first-time-lead { font-weight: 700; color: var(--ink); margin: 10px 0 6px; }
.first-time-details p { font-size: 0.85rem; color: var(--ink-muted); margin: 6px 0; }

.drop-zone {
  border: 1px dashed #c8c7c1;
  background: var(--surface);
  text-align: center;
  padding: 15px 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.drop-zone:hover,
.drop-zone.drag-over {
  background: var(--act-bg);
  border-color: var(--act);
}
.drop-zone.filled {
  border-style: solid;
  border-color: var(--border);
  background: var(--surface);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.drop-zone-icon { display: none; }
.drop-zone-text { font-size: 12.5px; font-weight: 600; margin: 0 0 4px; color: var(--act); }
.drop-zone-sub { color: var(--ink-faint); margin: 0; font-size: 11px; }
/* filled state shows only the filename/status line — the "drop here" prompt
   text has no reason to keep claiming flex space once a file is loaded, and
   left in place it starved .drop-zone-filename's flex:1 down to a sliver,
   forcing break-all onto a near-zero-width column (one CJK char per line) */
.drop-zone.filled .drop-zone-text,
.drop-zone.filled .drop-zone-sub { display: none; }
.drop-zone-filename {
  margin: 0; font-size: 11.5px; color: var(--ink); overflow-wrap: anywhere; font-family: var(--font-mono);
  flex: 1; min-width: 0;
}
.drop-zone-status {
  display: block;
  margin-top: 3px;
  font-family: var(--font-jp);
  font-size: 11px;
  font-weight: 600;
  color: var(--protect);
}

.privacy-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.privacy-banner .privacy-icon { font-size: 0.95rem; flex-shrink: 0; }

.input-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 18px;
}
.sample-data-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.help-details {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 4px 18px 14px;
}
.help-details summary {
  cursor: pointer;
  padding: 14px 0 4px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}
.help-details ol { margin: 8px 0; padding-left: 18px; font-size: 0.85rem; color: var(--ink-muted); }
.help-details ol li { margin-bottom: 4px; }
.help-notes {
  margin: 10px 0 0; padding-left: 18px; font-size: 0.8rem; color: var(--ink-faint);
  border-top: 1px solid var(--hairline); padding-top: 12px;
}
.help-notes li { margin-bottom: 4px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin-top: 16px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.info-card { background: var(--surface); padding: 16px 18px; }
.info-card h3 { margin: 0 0 8px; font-size: 0.85rem; font-weight: 700; }
.info-card ul, .info-card ol { margin: 0; padding-left: 18px; font-size: 0.84rem; color: var(--ink-muted); }
.info-card li { margin-bottom: 4px; }

.error-message {
  margin-top: 16px; padding: 12px 16px; background: var(--danger-bg); border: 1px solid var(--danger-border);
  color: var(--danger); font-size: 0.88rem;
}
.warning-message {
  padding: 10px 14px; background: var(--act-bg); border: 1px solid var(--act-border);
  color: var(--act); font-size: 0.84rem; margin-top: 14px;
}

.primary-button, .secondary-button, .tertiary-button {
  border-radius: var(--radius-btn); padding: 12px 20px; font-size: 0.88rem; cursor: pointer;
  font-family: inherit; font-weight: 620; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.primary-button { background: var(--ink); color: #fff; border: 0; }
.primary-button:hover { background: var(--act); }
.primary-button:disabled { background: var(--hairline); color: var(--ink-faint); cursor: not-allowed; }

.secondary-button { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); font-weight: 600; }
.secondary-button:hover { background: var(--ink); color: #fff; }
.secondary-button:disabled { background: var(--surface); color: var(--ink-faint); border-color: var(--hairline); cursor: not-allowed; }

.tertiary-button { background: var(--surface); color: var(--ink-muted); border: 1px solid var(--border); font-weight: 500; }
.tertiary-button:hover { border-color: var(--ink); color: var(--ink); }
.tertiary-button:disabled { background: #f7f6f3; color: #b0b0aa; border-color: var(--hairline); cursor: not-allowed; }

/* ==========================================================================
   Progress screen
   ========================================================================== */
#progress-screen {
  padding: 60px 0 40px;
}
#progress-screen .eyebrow { margin-bottom: 8px; }
.progress-title {
  font-size: 19px;
  font-weight: 620;
  color: var(--ink);
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}
.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 380px;
  border-top: 1px solid var(--hairline);
}
.progress-privacy {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}
.progress-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9rem;
  color: var(--ink-faint);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.progress-steps li.step-active,
.progress-steps li.step-done {
  opacity: 1;
  transform: translateY(0);
}
.progress-steps li.step-done { color: var(--ink); }
.progress-steps .step-mark {
  font-family: var(--font-mono);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  color: var(--border);
}
.progress-steps li.step-done .step-mark { color: var(--protect); }
.progress-steps li.step-active .step-mark { color: var(--act); }

/* ==========================================================================
   Results screen — common
   ========================================================================== */
.results-header { margin-top: 0; padding-top: 0; }
.results-decision {
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1.25;
  font-weight: 640;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.results-actions { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; justify-content: space-between; align-items: center; }

.monthly-memo {
  background: var(--surface-inset);
  border: 1px solid var(--hairline-2);
  padding: 14px 20px;
  margin: 0 0 18px;
  max-width: 720px;
}
.monthly-memo .eyebrow { font-size: 9.5px; margin-bottom: 8px; }
.monthly-memo-line-1 { margin: 0 0 8px; font-size: 14.5px; line-height: 1.55; color: #22262c; }
.monthly-memo-line-1 strong { font-weight: 640; color: var(--ink); }
.monthly-memo-line-2 { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-muted); }
.monthly-memo-line-2 strong { font-weight: 620; color: var(--protect-ink); }

.results-summary {
  display: grid;
  grid-template-columns: 1.35fr 1.1fr 1fr 1fr;
  gap: 1px;
  margin: 0 0 6px;
  background: var(--hairline-2);
  border: 1px solid var(--hairline-2);
}
.results-summary-item {
  display: block;
  background: var(--surface);
  padding: 16px 20px 14px;
  border-top: 3px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.results-summary-act { border-top-color: var(--act); }
.results-summary-protect { border-top-color: var(--protect); background: var(--surface-warm); }
.results-summary-watch { border-top-color: var(--watch); }
.results-summary-hold { border-top-color: var(--hold); }
.results-summary-label { margin: 0 0 8px; font-size: 12.5px; font-weight: 640; color: var(--ink); }
.results-summary-value {
  margin: 0; font-weight: 640; font-family: var(--font-mono);
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1;
}
.results-summary-act .results-summary-value { font-size: 42px; }
.results-summary-protect .results-summary-value { font-size: 32px; font-weight: 620; }
.results-summary-watch .results-summary-value,
.results-summary-hold .results-summary-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.results-summary-watch .results-summary-value { color: var(--watch-ink); }
.results-summary-hold .results-summary-value { color: var(--ink-soft); }
.results-summary-watch .results-summary-label,
.results-summary-hold .results-summary-label { font-size: 12px; font-weight: 600; }
.results-summary-watch .results-summary-label { color: var(--watch-ink); }
.results-summary-hold .results-summary-label { color: var(--ink-soft); }
.results-summary-unit { font-size: 13px; color: var(--ink-soft); font-family: var(--font-jp); margin-left: 3px; }
.results-summary-arrow {
  margin: 10px 0 0; font-size: 11px; letter-spacing: 0.1em; font-weight: 600; color: var(--ink-faint);
}
.results-summary-act .results-summary-arrow { color: var(--act); }
.results-summary-protect .results-summary-arrow { color: var(--protect); }
a.results-summary-item:hover { background: var(--surface-inset); }

.status-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.06em; padding: 3px 7px; border-radius: var(--radius-badge); vertical-align: middle;
  margin-left: 2px;
}
.status-badge-act { background: var(--act-bg); color: var(--act); border: 1px solid var(--act-border); }
.status-badge-watch { background: var(--watch-bg); color: var(--watch-ink); border: 1px solid var(--hairline-2); }
.status-badge-protect { background: var(--protect-bg); color: var(--protect); border: 1px solid var(--protect-border); }
.status-badge-hold { background: var(--hold-bg); color: var(--hold-ink); border: 1px solid var(--hairline-2); }
.trial-badge {
  display: inline-block; font-family: var(--font-mono); background: #f6f0e0; color: #7a5c1f; font-size: 0.68rem;
  font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; border-radius: var(--radius-badge); margin-left: 8px;
  vertical-align: middle; border: 1px solid #e6dcc0;
}
.trial-badge[hidden] { display: none; }
.trial-notice {
  margin: 16px 0 0; padding: 12px 16px; background: var(--surface-inset); border: 1px solid var(--hairline-2);
  color: var(--ink-muted); font-size: 0.84rem;
}

.triage-section { margin-top: 44px; }
.triage-section-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.triage-section-header h3 {
  margin: 0; font-size: 19px; font-weight: 640; letter-spacing: -0.01em; color: var(--ink); font-family: var(--font-jp);
}
.triage-section-count { margin-left: auto; font-size: 12px; color: var(--ink-faint); font-family: var(--font-mono); }
.triage-section-desc { margin: 8px 0 24px 16px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); max-width: 640px; }
.triage-empty {
  margin: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--hairline);
  font-size: 0.88rem; color: var(--ink-muted);
}

/* section-specific header accent bar */
.section-dot { display: inline-block; width: 4px; height: 16px; }
#act-heading .section-dot { background: var(--act); }
#watch-heading .section-dot { background: var(--watch); }
#protect-heading .section-dot { background: var(--protect); }
#hold-heading .section-dot { background: var(--hold); }
#watch-heading h3 { font-size: 16.5px; font-weight: 620; }
#hold-heading h3 { font-size: 15px; font-weight: 620; color: var(--ink-muted); }

/* scroll offset so the sticky topbar never covers the anchored section */
#act, #watch, #protect, #hold { scroll-margin-top: 68px; }

/* ==========================================================================
   ACT
   ========================================================================== */
.act-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--act);
  margin-bottom: 20px;
}
.act-card-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px; flex-wrap: wrap;
  background: var(--surface-inset); border-bottom: 1px solid var(--hairline-2);
}
.act-rank-badge {
  font-family: var(--font-mono); color: var(--act); font-weight: 700;
  font-size: 11px; letter-spacing: 0.05em; font-variant-numeric: tabular-nums;
}
.act-reason-tag { font-size: 12.5px; font-weight: 620; color: var(--ink); }
.act-card-head-note { margin-left: auto; font-size: 11px; color: var(--ink-faint); }
.act-url { padding: 20px 24px 0; font-size: 13px; word-break: break-all; margin: 0; color: var(--ink); font-family: var(--font-mono); }

.act-rows { display: grid; grid-template-columns: 104px 1fr; border-top: 1px solid var(--hairline-2); margin: 20px 24px 0; }
.act-rows > * { padding: 18px 0; border-bottom: 1px solid var(--hairline-2); }
.act-row-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-faint); }
.act-row-value { font-size: 13.5px; line-height: 1.85; color: #22262c; }
.act-rows > .act-row-value:last-child,
.act-rows > .act-row-label:nth-last-child(2) { border-bottom: 0; padding-bottom: 24px; }

.act-checklist { list-style: none; margin: 0; padding: 0; }
.act-checklist li {
  font-size: 0.88rem; color: var(--ink); padding: 4px 0 4px 24px; position: relative;
}
.act-checklist li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px;
  border: 1px solid var(--border); border-radius: 2px; background: var(--surface);
}

.act-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  margin: 0 0 12px; background: var(--hairline-2); border: 1px solid var(--hairline-2);
}
.act-metrics > div { background: var(--surface-inset); padding: 12px 14px; }
.act-metric-label { font-size: 0.7rem; color: var(--ink-faint); }
.act-metric-value { font-size: 1rem; font-weight: 640; font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -0.01em; }
.act-metric-delta { font-size: 0.72rem; font-family: var(--font-mono); color: var(--ink-faint); margin-top: 4px; }
.act-metric-delta.up { color: var(--protect); }
.act-metric-delta.down { color: var(--act); }

.act-refclick { font-size: 0.82rem; margin: 0 0 20px; color: var(--ink-soft); }
.act-refclick strong { color: var(--ink); font-family: var(--font-mono); }
.act-refclick .detail-note { margin: 4px 0 0; font-size: 0.74rem; color: var(--ink-faint); }

.act-card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.copy-feedback { font-size: 0.78rem; color: var(--protect); }
.ai-copy-note { margin: 8px 0 0; font-size: 0.76rem; color: var(--ink-faint); }

.act-locked {
  background: var(--surface-warm); border: 1px solid var(--hairline-2);
  padding: 24px 26px; color: var(--ink-muted); margin-bottom: 16px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.act-locked .lock-icon { font-size: 1.1rem; }

/* ==========================================================================
   WATCH
   ========================================================================== */
.watch-list { border: 1px solid var(--hairline-2); }
.watch-table-head {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(160px, 1fr) minmax(140px, 1fr);
  gap: 8px 24px;
  padding: 10px 20px;
  background: var(--surface-inset);
  border-bottom: 1px solid var(--hairline-2);
}
.watch-table-head span {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-faint);
}
.watch-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(160px, 1fr) minmax(140px, 1fr);
  gap: 4px 24px;
  align-items: baseline;
  background: var(--surface);
  padding: 13px 20px;
  border-bottom: 1px solid var(--hairline-2);
}
.watch-row:last-child { border-bottom: 0; }
.watch-row:hover { background: var(--surface-inset); }
.watch-cell { min-width: 0; }
.watch-cell-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.watch-row-url { display: block; font-size: 12px; font-family: var(--font-mono); color: #22262c; word-break: break-all; }
.watch-row-reason,
.watch-row-metric { display: block; font-size: 12px; line-height: 1.7; color: var(--ink-soft); }
.watch-row-metric { color: var(--ink-muted); }

/* ==========================================================================
   PROTECT
   ========================================================================== */
.protect-panel {
  background: var(--protect-surface); border: 1px solid var(--protect-surface-border);
  padding: 24px 26px; margin-bottom: 0;
}
.protect-panel-eyebrow { margin: 0 0 14px; font-weight: 620; font-size: 15px; line-height: 1.7; color: var(--ink); }
.protect-panel p { margin: 6px 0; font-size: 13px; line-height: 1.85; color: var(--ink-muted); max-width: 700px; }
.protect-panel-note { color: var(--ink-soft); }

.protect-list { margin-top: 0; border-left: 1px solid var(--protect-surface-border); border-right: 1px solid var(--protect-surface-border); }
.protect-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(220px, 2.2fr) minmax(160px, 1.1fr);
  gap: 6px 24px;
  align-items: start;
  background: var(--protect-surface);
  border-bottom: 1px solid var(--protect-surface-border);
  padding: 16px 26px;
}
.protect-row:last-child { border-bottom: 0; }
.protect-cell { min-width: 0; }
.protect-cell-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.protect-item-tag {
  display: inline-block; font-size: 0.68rem; font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.03em;
  color: var(--protect-ink); word-break: break-word;
}
.protect-item-url { font-size: 0.84rem; font-family: var(--font-mono); word-break: break-all; margin: 0 0 6px; color: var(--ink); }
.protect-item-reason { font-size: 0.84rem; color: var(--ink-muted); margin: 0; line-height: 1.8; }
.ai-locked-note {
  margin: 0; font-size: 0.8rem; color: var(--ink-faint);
}
.ai-locked-note .lock-icon { margin-right: 4px; }
.protect-cell-actions .ai-copy-note { margin: 0; }

.reveal-more-wrap { padding: 16px 26px 20px; background: var(--protect-surface); border: 1px solid var(--protect-surface-border); border-top: 0; }
.reveal-more-button {
  background: none; border: 0; color: var(--protect-ink); font-weight: 600;
  padding: 6px 0; font-size: 0.82rem; cursor: pointer; font-family: inherit;
}
.reveal-more-button:hover { color: var(--ink); }

/* ==========================================================================
   HOLD
   ========================================================================== */
.hold-intro {
  margin: 0 0 16px 16px; font-size: 12.5px; line-height: 1.8; color: var(--ink-soft); max-width: 700px;
}
.hold-intro strong { font-weight: 620; color: var(--ink-muted); }
.hold-reason-counts { list-style: none; margin: 0 0 0 16px; padding-top: 14px; border-top: 1px solid var(--hairline-2); display: flex; flex-direction: column; gap: 0; }
.hold-reason-counts li {
  display: flex; align-items: baseline; gap: 16px;
  font-size: 12.5px; font-family: var(--font-jp); color: var(--ink-soft); padding: 6px 0;
}

.hold-list { border: 1px solid var(--hairline-2); }
.hold-row { background: var(--surface); padding: 11px 16px; border-bottom: 1px solid var(--hairline-2); }
.hold-row:last-child { border-bottom: 0; }
.hold-row-main { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; }
.hold-row-url { font-size: 0.84rem; font-family: var(--font-mono); color: var(--ink); word-break: break-all; flex: 1 1 240px; min-width: 0; }
.hold-row-reason { font-size: 0.78rem; color: var(--ink-faint); flex: 1 1 200px; min-width: 0; white-space: normal; text-align: right; }

details.collapsible-toggle { margin-top: 8px; }
details.collapsible-toggle summary {
  cursor: pointer; font-size: 0.82rem; color: var(--ink-muted); font-weight: 600;
  padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 6px;
}
details.collapsible-toggle summary::-webkit-details-marker { display: none; }
details.collapsible-toggle summary::before { content: "▸"; font-size: 0.7rem; }
details.collapsible-toggle[open] summary::before { content: "▾"; }
details.collapsible-toggle summary:hover { color: var(--ink); }

/* ==========================================================================
   Completion / disclaimer / footer
   ========================================================================== */
.completion-banner {
  margin-top: 48px; padding: 26px 0; border-top: 1px solid var(--hairline); text-align: left;
}
.completion-banner .completion-headline { font-size: 14.5px; font-weight: 620; margin: 0 0 6px; color: var(--ink); }
.completion-banner .completion-sub { margin: 0; font-size: 12.5px; color: var(--ink-soft); }

.disclaimer-text {
  margin-top: 20px; font-size: 10.5px; line-height: 1.85; color: var(--ink-soft);
}

.app-footer { text-align: center; padding: 24px; color: var(--ink-faint); font-size: 0.76rem; }

/* ==========================================================================
   AI相談プロンプト プレビューモーダル
   専門ツールの一機能として扱う。チャットUI/AIキャラクター的表現は避ける。
   ========================================================================== */
body.modal-open { overflow: hidden; }

.ai-modal[hidden] { display: none; }
.ai-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.ai-modal-backdrop { position: absolute; inset: 0; background: rgba(21, 24, 29, 0.45); }
.ai-modal-panel {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 20px 48px rgba(21, 24, 29, 0.18);
  width: 100%; max-width: 640px; max-height: 86vh;
  display: flex; flex-direction: column; padding: 22px 24px;
}
.ai-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-modal-head h3 { margin: 0; font-size: 1.02rem; }
.ai-modal-kind-badge {
  display: inline-block; margin-left: 8px; font-size: 0.68rem; font-weight: 700;
  padding: 3px 7px; border-radius: var(--radius-badge); vertical-align: middle;
  background: var(--surface-inset); color: var(--ink-muted); border: 1px solid var(--hairline-2);
}
.ai-modal-kind-badge.kind-act { color: var(--act); background: var(--act-bg); border-color: var(--act-border); }
.ai-modal-kind-badge.kind-protect { color: var(--protect); background: var(--protect-bg); border-color: var(--protect-border); }
.ai-modal-close {
  background: none; border: none; font-size: 1.05rem; line-height: 1; color: var(--ink-muted);
  cursor: pointer; padding: 4px 8px; flex-shrink: 0;
}
.ai-modal-close:hover { background: var(--surface-inset); color: var(--ink); }
.ai-modal-purpose {
  margin: 12px 0 0; padding: 9px 12px; font-size: 0.84rem; color: var(--ink);
  background: var(--surface-inset); border: 1px solid var(--hairline-2);
}
.ai-modal-desc { margin: 8px 0 0; font-size: 0.8rem; color: var(--ink-muted); }
.ai-modal-notice {
  margin: 8px 0 0; padding: 6px 0 6px 10px; font-size: 0.76rem; color: var(--ink-muted);
  border-left: 3px solid var(--border);
}
.ai-modal-prompt {
  margin: 14px 0 0; padding: 14px; background: var(--surface-inset); border: 1px solid var(--hairline-2);
  font-family: var(--font-mono); font-size: 0.76rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; overflow-y: auto; flex: 1 1 auto; min-height: 120px;
}
.ai-modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ai-modal-privacy { margin: 10px 0 0; font-size: 0.72rem; color: var(--ink-faint); }
.copy-feedback-error { color: var(--danger); }

@media (max-width: 480px) {
  .ai-modal { padding: 12px; }
  .ai-modal-panel { padding: 18px 16px; max-height: 92vh; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
  .app-shell { margin: 0; border-left: 0; border-right: 0; }
  .app-topbar { padding: 10px 20px; }
  #app-root { padding: 28px 20px 48px; }
  .input-intro-title { font-size: 22px; }
  .results-decision { font-size: 30px; }
  .results-summary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .results-summary-act .results-summary-value { font-size: 32px; }
  .act-rows { grid-template-columns: 1fr; }
  .act-row-label { padding-bottom: 4px; border-bottom: 0 !important; }
  .act-rows > .act-row-value { padding-top: 0; }
  .act-metrics { grid-template-columns: repeat(2, 1fr); }
  .hold-row-main { flex-direction: column; align-items: stretch; gap: 4px; }
  .hold-row-reason { text-align: left; flex-basis: auto; }
  .protect-row { grid-template-columns: 1fr; gap: 10px; }
  .watch-table-head { display: none; }
  .watch-row { grid-template-columns: 1fr; gap: 8px; }
  .watch-cell-label {
    position: static; width: auto; height: auto; margin: 0 0 2px; overflow: visible; clip: auto; white-space: normal;
    display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-faint);
  }
  .results-actions { flex-direction: column; align-items: stretch; }
  .results-actions > div { display: flex; flex-direction: column; gap: 8px; }
  .triage-section-desc { margin-left: 0; }
}

@media (max-width: 480px) {
  .act-metrics { grid-template-columns: repeat(2, 1fr); }
  .input-grid { grid-template-columns: 1fr; }
}
