:root {
  color-scheme: light;

  /* ---- Brand-derived palette (oklch, harmonised) ---- */
  --ink: oklch(0.26 0.03 255);
  --ink-soft: oklch(0.38 0.025 255);
  --muted: oklch(0.54 0.02 255);
  --faint: oklch(0.66 0.015 255);

  --page: oklch(0.975 0.005 250);
  --panel: #ffffff;
  --panel-2: oklch(0.985 0.004 250);
  --field-bg: #ffffff;
  --line: oklch(0.92 0.008 255);
  --line-strong: oklch(0.86 0.012 255);

  --accent: oklch(0.55 0.15 250);
  --accent-strong: oklch(0.46 0.16 256);
  --accent-soft: oklch(0.955 0.02 250);
  --accent-ring: oklch(0.7 0.12 250);

  --secure: oklch(0.6 0.12 165);

  /* Priority semantics */
  --high: oklch(0.55 0.18 25);
  --high-bg: oklch(0.96 0.025 25);
  --medium: oklch(0.58 0.12 75);
  --medium-bg: oklch(0.96 0.04 85);
  --low: oklch(0.56 0.11 160);
  --low-bg: oklch(0.96 0.03 160);

  /* Dark hero surface */
  --hero-bg: oklch(0.24 0.04 260);
  --hero-bg-2: oklch(0.19 0.045 262);
  --hero-line: oklch(1 0 0 / 0.09);
  --hero-text: oklch(0.97 0.01 255);
  --hero-muted: oklch(0.78 0.02 255);

  --focus: oklch(0.72 0.13 250);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow-xs: 0 1px 2px oklch(0.4 0.05 255 / 0.06);
  --shadow-sm: 0 1px 3px oklch(0.4 0.05 255 / 0.07), 0 6px 16px oklch(0.4 0.05 255 / 0.06);
  --shadow-md: 0 6px 24px oklch(0.35 0.05 255 / 0.1), 0 16px 40px oklch(0.35 0.05 255 / 0.08);
  --shadow-hero: 0 24px 60px oklch(0.15 0.06 262 / 0.5);

  --font-sans: "Hanken Grotesk", "Noto Sans JP", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  font-family: var(--font-sans);
}

/* ============================ Dark theme ============================ */
[data-theme="dark"] {
  color-scheme: dark;

  --ink: oklch(0.95 0.01 255);
  --ink-soft: oklch(0.84 0.015 255);
  --muted: oklch(0.68 0.02 255);
  --faint: oklch(0.56 0.02 255);

  --page: oklch(0.17 0.018 262);
  --panel: oklch(0.215 0.022 262);
  --panel-2: oklch(0.25 0.022 262);
  --field-bg: oklch(0.235 0.022 262);
  --line: oklch(0.32 0.02 262);
  --line-strong: oklch(0.42 0.022 262);

  --accent: oklch(0.72 0.12 248);
  --accent-strong: oklch(0.82 0.1 246);
  --accent-soft: oklch(0.3 0.05 255);
  --accent-ring: oklch(0.6 0.13 250);

  --secure: oklch(0.72 0.11 165);

  --high: oklch(0.74 0.14 25);
  --high-bg: oklch(0.32 0.07 25);
  --medium: oklch(0.82 0.1 80);
  --medium-bg: oklch(0.33 0.05 70);
  --low: oklch(0.76 0.1 162);
  --low-bg: oklch(0.31 0.05 162);

  --hero-bg: oklch(0.2 0.035 262);
  --hero-bg-2: oklch(0.15 0.04 264);

  --focus: oklch(0.7 0.13 250);

  --shadow-xs: 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.4), 0 6px 16px oklch(0 0 0 / 0.35);
  --shadow-md: 0 6px 24px oklch(0 0 0 / 0.5), 0 16px 40px oklch(0 0 0 / 0.4);
  --shadow-hero: 0 24px 60px oklch(0 0 0 / 0.55);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: var(--accent-ring);
  color: #fff;
}

/* ============================ Buttons ============================ */
button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  word-break: keep-all;
  transition: background 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, color 0.16s ease, transform 0.06s ease;
}

button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.dropzone:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.secondary-button {
  background: var(--panel);
  color: var(--ink-soft);
  border-color: var(--line-strong);
  font-weight: 600;
}

.secondary-button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
}

.ghost-button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.full-button {
  width: 100%;
  justify-content: center;
}

.link-button {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 4px;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: auto;
}

.link-button:hover {
  background: none;
  color: var(--accent-strong);
}

/* ============================ Top bar ============================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: color-mix(in oklch, var(--panel) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.sbon-logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 2px 8px oklch(0.55 0.15 250 / 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-reading {
  margin-left: 6px;
  font-size: 0.55em;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topnav-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}

.trial-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--medium-bg);
  color: var(--medium);
  border: 1px solid color-mix(in oklch, var(--medium) 35%, transparent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.theme-toggle {
  min-height: 38px;
  width: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-soft);
  display: inline-grid;
  place-items: center;
  position: relative;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.theme-icon {
  grid-area: 1 / 1;
  font-size: 17px;
  line-height: 1;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.theme-icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.theme-icon-sun {
  opacity: 1;
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: none;
}

main {
  padding: clamp(20px, 3vw, 32px) clamp(16px, 4vw, 44px) 48px;
  max-width: 1340px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--secure);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--secure) 22%, transparent);
}

h1,
h2,
p {
  margin-top: 0;
}

/* ============================ Hero ============================ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: clamp(28px, 4vw, 56px);
  color: var(--hero-text);
  background:
    radial-gradient(120% 130% at 88% -10%, oklch(0.5 0.16 250 / 0.55), transparent 55%),
    radial-gradient(90% 120% at 0% 110%, oklch(0.55 0.13 195 / 0.32), transparent 60%),
    linear-gradient(150deg, var(--hero-bg), var(--hero-bg-2));
  box-shadow: var(--shadow-hero);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hero-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 90% at 70% 10%, #000 35%, transparent 80%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.hero-copy .eyebrow {
  color: oklch(0.82 0.08 220);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero-lede {
  margin: 0 0 28px;
  max-width: 46ch;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.85;
  color: var(--hero-muted);
}

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 22px;
}

.cta-button {
  min-height: 52px;
  padding: 0 26px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 10px;
  background: #fff;
  color: var(--accent-strong);
  border-color: #fff;
  box-shadow: 0 10px 28px oklch(0.15 0.06 262 / 0.45);
}

.cta-button:hover {
  background: oklch(0.97 0.02 250);
  border-color: oklch(0.97 0.02 250);
  color: var(--accent-strong);
}

.cta-button span {
  font-size: 12px;
}

.cta-link {
  min-height: 52px;
  border: none;
  background: none;
  color: var(--hero-text);
  font-weight: 600;
  padding: 0 4px;
}

.cta-link:hover {
  background: none;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 32px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--hero-line);
  list-style: none;
}

.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--hero-muted);
}

.trust-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: oklch(0.6 0.12 195 / 0.18);
  color: oklch(0.82 0.1 195);
  font-size: 12px;
  font-weight: 700;
}

/* ---- Hero product preview ---- */
.hero-preview {
  perspective: 1400px;
}

.preview-card {
  background: var(--panel);
  border: 1px solid oklch(1 0 0 / 0.6);
  border-radius: 16px;
  box-shadow: 0 30px 70px oklch(0.12 0.06 262 / 0.55);
  overflow: hidden;
  transform: rotateY(-9deg) rotateX(3deg) translateZ(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-preview:hover .preview-card {
  transform: rotateY(-4deg) rotateX(1deg);
}

.preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.preview-dots {
  display: inline-flex;
  gap: 5px;
}

.preview-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.preview-file {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.preview-fmt {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 6px;
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.pv-stat {
  background: var(--panel);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pv-num {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.pv-stat.pv-high .pv-num {
  color: var(--high);
}

.pv-stat.pv-med .pv-num {
  color: var(--medium);
}

.pv-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.preview-rows {
  margin: 0;
  padding: 6px;
  list-style: none;
  display: grid;
  gap: 2px;
}

.preview-rows li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
}

.preview-rows li:hover {
  background: var(--accent-soft);
}

.pv-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.pv-name em {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--faint);
  margin-left: 8px;
}

.pv-cat {
  font-size: 12px;
  color: var(--muted);
}

.pv-badge {
  min-width: 28px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pv-badge.high {
  background: var(--high-bg);
  color: var(--high);
}

.pv-badge.med {
  background: var(--medium-bg);
  color: var(--medium);
}

.pv-badge.low {
  background: var(--low-bg);
  color: var(--low);
}

/* ============================ Input band ============================ */
.input-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: stretch;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.input-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.input-intro h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.input-intro p {
  margin: 0 0 18px;
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.8;
}

.compare-loader {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.compare-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.dropzone {
  position: relative;
  min-height: 168px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-md);
  background:
    radial-gradient(120% 130% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--panel-2);
  color: var(--accent-strong);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dropzone:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px color-mix(in oklch, var(--accent) 5%, transparent);
}

.dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 4px color-mix(in oklch, var(--accent) 12%, transparent);
}

.dropzone strong {
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
}

.dropzone span:last-child {
  font-size: 13px;
  color: var(--muted);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 6px 16px oklch(0.55 0.15 250 / 0.3);
}

.load-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
}

.load-status[data-kind="success"] {
  color: var(--low);
  background: var(--low-bg);
  border-color: color-mix(in oklch, var(--low) 40%, transparent);
}

.load-status[data-kind="warning"] {
  color: var(--medium);
  background: var(--medium-bg);
  border-color: color-mix(in oklch, var(--medium) 40%, transparent);
}

.load-status[data-kind="error"] {
  color: var(--high);
  background: var(--high-bg);
  border-color: color-mix(in oklch, var(--high) 40%, transparent);
}

.filtered-notice {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--medium-bg);
  color: var(--medium);
  font-size: 13px;
}

/* ============================ Summary metrics ============================ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.metric {
  position: relative;
  padding: 20px 20px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.metric:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.priority-high::before {
  background: var(--high);
}

.priority-high strong {
  color: var(--high);
}

.priority-medium::before {
  background: var(--medium);
}

.priority-medium strong {
  color: var(--medium);
}

/* ============================ Workspace toolbar ============================ */
.workspace-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.toolbar-divider {
  width: 1px;
  align-self: stretch;
  margin: 4px 4px;
  background: var(--line);
}

.report-scope-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.report-scope-field select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 10px;
  background: var(--field-bg);
  color: var(--ink);
}

/* ============================ Footer ============================ */
.site-footer {
  margin-top: 40px;
  padding: 28px clamp(16px, 4vw, 44px);
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.site-footer-copyright {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ink);
}

.site-footer-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  max-width: 820px;
}

.site-footer-knowledge {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

.site-footer-knowledge:empty {
  display: none;
}

.report-copyright {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.trial-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--medium-bg);
  color: var(--medium);
  border: 1px solid color-mix(in oklch, var(--medium) 35%, transparent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ============================ Diff panel ============================ */
.diff-panel {
  margin-top: 20px;
  padding: 16px;
}

.diff-summary {
  margin: 0 0 12px;
  color: var(--muted);
}

.release-summary {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}

.release-summary-title {
  margin: 0 0 6px;
  font-size: 15px;
}

.release-headline {
  margin: 0 0 10px;
  font-weight: 700;
}

.release-points {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.release-point {
  padding: 6px 10px 6px 28px;
  border-radius: var(--r-sm);
  position: relative;
  line-height: 1.6;
}

.release-point::before {
  position: absolute;
  left: 10px;
  font-weight: 800;
}

.release-point.info {
  background: var(--panel-2);
}

.release-point.info::before {
  content: "・";
  color: var(--muted);
}

.release-point.high {
  background: var(--high-bg);
  color: var(--high);
  font-weight: 700;
}

.release-point.high::before {
  content: "!";
  color: var(--high);
}

.diff-table {
  width: 100%;
}

.diff-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.diff-badge.added {
  background: var(--low-bg);
  color: var(--low);
}

.diff-badge.removed {
  background: var(--panel-2);
  color: var(--muted);
}

.diff-badge.changed {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.diff-escalation-mark {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--high-bg);
  color: var(--high);
}

.diff-escalated {
  background: var(--high-bg);
}

.diff-license-changed {
  font-weight: 700;
  color: var(--accent-strong);
}

.diff-dependencies {
  margin-top: 16px;
}

.diff-dep-heading {
  margin: 0 0 8px;
  font-size: 15px;
}

.diff-dep-group {
  margin-bottom: 10px;
}

.diff-dep-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}

.diff-dep-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dep-diff-tree {
  margin-top: 10px;
}

.dep-diff-tree .tree-node {
  margin-right: 4px;
}

/* ============================ Review badges & pills ============================ */
.review-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.review-badge.unreviewed {
  background: var(--panel-2);
  color: var(--muted);
}

.review-badge.in-progress {
  background: var(--medium-bg);
  color: var(--medium);
}

.review-badge.approved {
  background: var(--low-bg);
  color: var(--low);
}

.review-badge.action-required {
  background: var(--high-bg);
  color: var(--high);
}

.review-summary {
  color: var(--accent-strong);
  font-weight: 700;
}

.review-cell,
.review-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.review-pill {
  min-height: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.review-pill:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.review-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.review-pill.is-active {
  border-color: transparent;
}

.review-pill.is-active.unreviewed {
  background: var(--panel-2);
  color: var(--muted);
}

.review-pill.is-active.in-progress {
  background: var(--medium-bg);
  color: var(--medium);
}

.review-pill.is-active.approved {
  background: var(--low-bg);
  color: var(--low);
}

.review-pill.is-active.action-required {
  background: var(--high-bg);
  color: var(--high);
}

.bulk-actions .review-pill.in-progress {
  background: var(--medium-bg);
  color: var(--medium);
  border-color: transparent;
}

.bulk-actions .review-pill.approved {
  background: var(--low-bg);
  color: var(--low);
  border-color: transparent;
}

.bulk-actions .review-pill.action-required {
  background: var(--high-bg);
  color: var(--high);
  border-color: transparent;
}

.select-col {
  width: 1%;
  text-align: center;
  white-space: nowrap;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}

.bulk-count {
  font-weight: 700;
  color: var(--accent-strong);
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bulk-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.bulk-bar .link-button {
  margin-left: auto;
  text-decoration: underline;
  font-weight: 700;
}

.review-alert {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border: 1px solid color-mix(in oklch, var(--high) 45%, transparent);
  border-left-width: 4px;
  border-radius: var(--r-sm);
  background: var(--high-bg);
  color: var(--high);
  font-size: 14px;
  font-weight: 700;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 12px 0;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-info {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.review-edit .review-controls {
  display: grid;
  gap: 12px;
}

.review-field {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.review-status-select {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  min-height: 38px;
  padding: 0 10px;
  background: var(--field-bg);
  color: var(--ink);
}

.review-note-input {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  resize: vertical;
  background: var(--field-bg);
  color: var(--ink);
  font-weight: 400;
  font-family: var(--font-sans);
}

/* ============================ Workspace layout ============================ */
.workspace {
  display: grid;
  grid-template-columns: 264px minmax(520px, 1fr) minmax(300px, 364px);
  gap: 16px;
  align-items: start;
}

.filters,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.panel {
  overflow: hidden;
}

.filters {
  padding: 18px;
  display: grid;
  gap: 16px;
  position: sticky;
  top: 76px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--field-bg);
  color: var(--ink);
  padding: 0 12px;
}

.review-note {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.review-note h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.review-note p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 13.5px;
}

.panel-head,
.tabs {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#formatLabel,
#componentCount {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
}

.table-wrap {
  overflow: auto;
  max-height: 70vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 690px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sort-button {
  min-height: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 2px 4px;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button:hover,
.sort-button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sort-button.is-active::after {
  content: " ↑";
}

.sort-button.is-active[data-direction="desc"]::after {
  content: " ↓";
}

tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: var(--accent-soft);
}

tbody tr.is-selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.pkg-name {
  font-weight: 700;
  color: var(--ink);
}

.pkg-id {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
  margin-top: 2px;
}

td .badge + .badge {
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.high {
  background: var(--high-bg);
  color: var(--high);
}

.badge.medium {
  background: var(--medium-bg);
  color: var(--medium);
}

.badge.low {
  background: var(--low-bg);
  color: var(--low);
}

.category {
  color: var(--muted);
}

.tabs {
  justify-content: flex-start;
  gap: 6px;
  padding: 8px;
}

.tab {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.tab:hover,
.tab.is-active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--accent-strong);
  box-shadow: var(--shadow-xs);
}

.tab-page {
  display: none;
  padding: 18px;
}

.tab-page.is-active {
  display: block;
}

.detail-panel {
  position: sticky;
  top: 76px;
}

.empty,
.empty-cell {
  color: var(--muted);
}

.empty {
  padding: 8px 0;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-title h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.detail-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detail-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.detail-section p,
.detail-section li {
  color: var(--muted);
  line-height: 1.8;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
}

.detail-meta {
  margin: 0;
  display: grid;
  gap: 8px;
}

.detail-meta div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: baseline;
}

.detail-meta dt {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.detail-meta dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  word-break: break-word;
}

.tree-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.tree-list .tree-list {
  margin: 4px 0 4px 13px;
  padding-left: 20px;
  border-left: 1.5px solid var(--line-strong);
}

.tree-list li {
  position: relative;
  margin: 5px 0;
  line-height: 1.5;
}

.tree-list .tree-list > li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 15px;
  width: 16px;
  height: 1.5px;
  background: var(--line-strong);
}

.tree-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 11px;
}

.tree-node::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--faint);
  flex-shrink: 0;
}

#treeView > .tree-list > li > .tree-node {
  background: var(--accent-soft);
  border-color: color-mix(in oklch, var(--accent) 35%, transparent);
  color: var(--accent-strong);
}

#treeView > .tree-list > li > .tree-node::before {
  background: var(--accent);
}

.tree-ref {
  display: inline-block;
  margin-left: 8px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
  vertical-align: middle;
}

/* ============================ Print report ============================ */
.print-report {
  display: none;
}

.print-report[data-scope="procurement"] .report-technical {
  display: none;
}

.print-report[data-scope="technical"] .report-procurement {
  display: none;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.report-head h2 {
  margin: 0;
  font-size: 24px;
}

.report-head dl {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 220px;
}

.report-head dl div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
}

.report-head dt {
  color: var(--muted);
  font-weight: 700;
}

.report-head dd {
  margin: 0;
  text-align: right;
}

.report-table-wrap {
  margin-top: 18px;
}

.report-table {
  min-width: 0;
}

.report-section-title {
  margin: 22px 0 10px;
  font-size: 15px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
}

.report-details {
  display: grid;
  gap: 14px;
}

.report-detail {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

.report-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.report-detail-head h4 {
  margin: 0;
  font-size: 15px;
}

.report-detail-meta {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.report-detail-label {
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.report-detail p {
  margin: 0;
  line-height: 1.6;
}

/* ============================ Responsive ============================ */
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-preview {
    order: -1;
  }

  .preview-card {
    transform: none;
  }

  .input-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .topnav {
    margin-left: auto;
  }

  .topnav-label {
    display: none;
  }

  .summary-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .table-wrap {
    max-height: none;
  }

  .workspace-toolbar {
    gap: 6px;
  }

  .toolbar-spacer {
    flex-basis: 100%;
  }

  .hero {
    padding: 26px 22px;
  }

  .panel-head,
  .tabs {
    flex-wrap: wrap;
    min-height: 0;
    padding: 12px 16px;
  }

  .panel-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  main {
    padding: 16px 14px 36px;
  }

  .brand-tag {
    display: none;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric strong {
    font-size: 28px;
  }

  .input-band {
    padding: 18px;
  }

  .dropzone {
    min-height: 140px;
  }

  .workspace-toolbar {
    padding: 10px;
  }

  .workspace-toolbar .secondary-button {
    flex: 1 1 auto;
  }

  .toolbar-divider {
    display: none;
  }

  .hero h1 {
    font-size: clamp(28px, 8vw, 36px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ============================ Print ============================ */
@media print {
  .topbar,
  .hero,
  .site-footer,
  .input-band,
  .workspace-toolbar,
  .filters,
  .component-panel,
  .detail-panel,
  .tabs {
    display: none;
  }

  .diff-panel {
    display: block;
    border: 1px solid var(--line);
  }

  .diff-panel .panel-meta button {
    display: none;
  }

  body {
    background: #fff;
  }

  main {
    padding: 0;
    max-width: none;
  }

  .workspace {
    display: block;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0 0 16px;
  }

  .print-report {
    display: block;
  }

  .metric,
  .panel,
  .report-detail {
    break-inside: avoid;
    margin-bottom: 12px;
  }

  .report-section-title {
    break-after: avoid;
  }

  .detail-panel {
    display: none;
  }

  .metric {
    padding: 10px;
  }

  .metric strong {
    font-size: 22px;
  }

  th {
    position: static;
  }
}
