/* ========================================
   调色枢 · Design Color Hub · Design System
   Apple-inspired minimal redesign
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700;900&family=Noto+Sans+SC:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Colors */
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #FAFAFA;
  --border: #D2D2D7;
  --border-light: #E8E8ED;
  --ink: #1D1D1F;
  --ink-2: #424245;
  --muted: #6E6E73;
  --muted-2: #9A9A9E;

  /* Accent */
  --accent: #0071E3;
  --accent-hover: #0058B3;
  --accent-soft: #E8F1FD;
  --accent-tint: #F0F6FF;

  /* Status */
  --success: #1D8348;
  --warn: #B7590A;
  --danger: #C0392B;
  --gold: #B8873A;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.10);

  /* Radius */
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Layout */
  --header-h: 52px;
  --project-status-h: 148px;
  --page-max: 1440px;
  --page-pad-x: 56px;
  --page-pad-y: 38px;
  --page-bottom: 88px;
  --page-grid-gap: 36px;
  --rail-w: 380px;

  /* Font */
  --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-serif: "Noto Serif SC", Georgia, serif;
  --font-mono: "DM Mono", "SF Mono", "Consolas", monospace;

  /* Typography scale — panel & section headings */
  --fs-panel-title: 16px;    /* tool panel sub-headers (.screen-panel-title) */
  --fs-section-title: 20px;  /* page section headers (.lib-grid-title etc.) */
  --fs-rail-title: 22px;     /* rail / sidebar main titles (.gen-right-title etc.) */

  /* Sticky rail top offsets */
  --rail-sticky-top: calc(var(--header-h) + var(--project-status-h) + 20px);
  --rail-sticky-top-with-bar: calc(var(--header-h) + var(--project-status-h) + 72px);

  /* Transition tokens */
  --t-fast: 0.12s;
  --t-base: 0.15s;
}

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

/* ── Global disabled state ── */
[disabled], :disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Prevent clicks on disabled buttons/links; let form elements handle natively */
button[disabled], a[disabled] { pointer-events: none; }

/* ── Global input invalid state hook ── */
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger) !important;
  outline-color: var(--danger);
}

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ====== App Shell — NO SIDEBAR ====== */
.app {
  min-height: 100vh;
  background: var(--bg);
}

/* ====== Fixed translucent header (Apple.com style) ====== */
#header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--header-h);
}

body.has-project-status #header {
  display: none;
}

.app-header {
  position: relative;
  z-index: 1;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.3px;
}

.header-sep {
  color: var(--border);
  font-size: 18px;
  font-weight: 300;
}

.header-page-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 0;
  transition: opacity 0.15s;
}
.back-btn:hover { opacity: 0.75; }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ====== Current project status ====== */
.project-status-bar {
  position: sticky;
  top: 0;
  z-index: 130;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,250,252,.9));
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 10px 34px rgba(20,23,31,.05);
}

.project-status-inner {
  max-width: 100%;
  margin: 0;
  min-height: var(--project-status-h);
  padding: 0 48px;
  display: grid;
  grid-template-rows: 78px 50px;
  row-gap: 20px;
}

.project-status-topline {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  border-bottom: 1px solid var(--border-light);
  margin: 8px -18px 0;
  padding: 0 18px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(246,247,250,.95), rgba(255,255,255,.68));
}

.project-status-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 1 auto;
  justify-content: flex-start;
  padding: 8px 0;
  max-width: min(880px, 70vw);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.project-status-actions {
  margin-left: auto;
}

.project-status-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-status-kicker {
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.project-status-copy strong {
  min-width: 0;
  max-width: min(340px, 28vw);
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-status-copy span:last-child {
  max-width: 240px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-status-strip {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding-left: 2px;
}

.project-status-strip span {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.94);
  box-shadow: 0 8px 18px rgba(20,23,31,.14);
  display: inline-block;
}

@media (max-width: 900px) {
  .project-status-topline {
    margin: 4px 0 0;
    padding: 0;
    border-radius: 0;
  }

  .project-status-main {
    max-width: min(560px, 68vw);
    gap: 12px;
  }

  .project-status-copy span:last-child {
    display: none;
  }

  .project-status-copy strong {
    max-width: min(240px, 30vw);
    font-size: 20px;
  }

  .project-status-strip {
    gap: 5px;
  }

  .project-status-strip span {
    width: 28px;
    height: 28px;
  }

  .project-status-strip span:nth-child(n+6) {
    display: none;
  }
}

@media (max-width: 720px) {
  .project-status-main {
    max-width: calc(100vw - 150px);
    gap: 8px;
  }

  .project-status-copy strong {
    max-width: 86px;
    font-size: 18px;
  }

  .project-status-strip {
    display: none;
  }
}

.project-status-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.project-nav-group {
  position: relative;
}

.project-nav-link,
.project-nav-trigger {
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.project-nav-link {
  min-width: 68px;
}

.project-nav-trigger em {
  max-width: 84px;
  font-style: normal;
  color: inherit;
  opacity: .68;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-nav-trigger::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.project-nav-link:hover,
.project-nav-group:hover .project-nav-trigger,
.project-nav-trigger:focus-visible {
  color: var(--ink);
  background: rgba(29,29,31,.06);
  outline: none;
}

.project-nav-link.active,
.project-nav-group.active .project-nav-trigger {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(20,23,31,.12);
}

.project-nav-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  min-width: 150px;
  padding: 8px;
  display: grid;
  gap: 3px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  box-shadow: 0 18px 48px rgba(20,23,31,.14);
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) ease, transform var(--t-base) ease;
}

.project-nav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.project-nav-group:hover .project-nav-menu,
.project-nav-group:focus-within .project-nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.project-nav-menu a {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.project-nav-menu a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.project-nav-menu a.active {
  background: var(--ink);
  color: #fff;
}

/* ====== Search modal ====== */
.search-modal.hidden { display: none; }
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 24px 24px;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,23,31,.28);
}

.search-panel {
  position: relative;
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-input-row {
  height: 58px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
}

.search-input-row input {
  flex: 1;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.search-close {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid var(--border-light);
}

.search-results {
  max-height: 440px;
  overflow: auto;
  padding: 8px;
}

.search-result {
  width: 100%;
  min-height: 58px;
  padding: 10px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  text-align: left;
}

.search-result:hover {
  background: var(--surface-2);
}

.search-result-color {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.search-result-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-copy strong {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy small {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-arrow {
  color: var(--muted);
}

.search-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ====== Page header (below app-header, sticky) ====== */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 48px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  position: sticky;
  top: calc(var(--header-h) + var(--project-status-h));
  z-index: 99;
}

.page-header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

/* ====== Main content area ====== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}

/* ====== HOME PAGE ====== */
.function-home {
  max-width: 1184px;
  min-height: calc(100vh - var(--header-h));
  padding-top: 72px;
}

.home-nav-panel {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

.home-nav-section {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 22px;
  align-items: start;
}

.home-nav-section h2 {
  position: sticky;
  top: 72px;
  min-height: 42px;
  display: flex;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.home-nav-section-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-nav-item {
  min-height: 144px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 34px rgba(20,23,31,.045);
  color: var(--ink);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

.home-nav-item:hover,
.home-nav-item:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(29,29,31,.28);
  box-shadow: 0 20px 52px rgba(20,23,31,.09);
  outline: none;
}

.home-nav-item.is-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 22px 58px rgba(20,23,31,.18);
}

.home-nav-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r);
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--ink);
}

.home-nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-nav-copy {
  display: grid;
  gap: 7px;
}

.home-nav-copy strong {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
  color: inherit;
  letter-spacing: 0;
}

.home-nav-copy small {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.home-nav-item.is-primary .home-nav-icon {
  color: #fff;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
}

.home-nav-item.is-primary .home-nav-copy small {
  color: rgba(255,255,255,.72);
}

.dashboard-tool-entry {
  width: 100%;
  margin: 0;
}

.dashboard-tool-entry .home-nav-item {
  min-height: 142px;
}

.function-board {
  overflow: hidden;
  min-height: 720px;
  background:
    linear-gradient(135deg, rgba(36,71,232,.08), transparent 32%),
    linear-gradient(315deg, rgba(242,199,68,.14), transparent 36%),
    var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(20,23,31,.08);
}

.function-board-hero {
  min-height: 260px;
  padding: 48px 54px 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 460px);
  gap: 40px;
  align-items: end;
  border-bottom: 1px solid var(--border-light);
}

.function-title-block h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 72px;
  line-height: .98;
  color: var(--ink);
}

.function-title-block p:last-child {
  margin-top: 18px;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.function-hero-strip {
  height: 178px;
  display: grid;
  grid-template-columns: 1.2fr .9fr .75fr .95fr .65fr;
  gap: 8px;
  align-items: stretch;
}

.function-hero-strip span {
  display: block;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 16px 28px rgba(20,23,31,.08);
}

.function-hero-strip span:nth-child(1) { margin-top: 34px; }
.function-hero-strip span:nth-child(2) { margin-top: 8px; margin-bottom: 24px; }
.function-hero-strip span:nth-child(3) { margin-top: 52px; }
.function-hero-strip span:nth-child(4) { margin-bottom: 18px; }
.function-hero-strip span:nth-child(5) { margin-top: 22px; }

.function-sections {
  padding: 34px;
  display: grid;
  gap: 28px;
}

.function-section {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
}

.function-section-head {
  padding-top: 4px;
}

.function-section-head span {
  display: inline-flex;
  width: 40px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11px;
}

.function-section-head h2 {
  margin: 14px 0 0;
  font-size: 19px;
  color: var(--ink);
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.function-card {
  min-height: 164px;
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 14px;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.74);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(20,23,31,.04);
}

.function-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 54px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .18;
}

.function-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20,23,31,.2);
  box-shadow: 0 18px 42px rgba(20,23,31,.1);
}

.function-card.primary {
  background: var(--ink);
  border-color: var(--ink);
}

.function-index {
  width: 38px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.function-card strong {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0;
}

.function-card small {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.function-card.primary .function-index {
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
}

.function-card.primary strong,
.function-card.primary small {
  color: #fff;
}

.function-card.primary::after {
  background: #fff;
  opacity: .22;
}

.home-workbench {
  padding-top: 36px;
}

.home-workbench-hero {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 22px;
}

.dashboard-project-only {
  max-width: 520px;
  grid-template-columns: 1fr;
  margin-bottom: 0;
}

.dashboard-project-main {
  padding-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(320px, 420px);
  gap: 48px;
  align-items: center;
  justify-content: center;
}

.home-workbench-hero .hero-title {
  font-size: 38px;
  margin-top: 6px;
}

.home-workbench-hero .hero-subtitle {
  margin-left: 0;
  margin-right: 0;
}

.home-project-card,
.home-panel,
.home-function-nav {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.home-project-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.home-project-card .project-strip-home {
  justify-content: flex-start;
  margin-top: 0;
}

.home-project-card .project-strip-home span {
  width: 42px;
  height: 42px;
}

.home-project-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.home-function-nav {
  padding: 24px;
}

.home-function-nav .panel-title {
  margin-bottom: 16px;
}

.home-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-nav-card {
  min-height: 116px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface-2);
}

.home-nav-card:hover {
  transform: translateY(-1px);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.home-nav-card.primary {
  background: var(--ink);
  border-color: var(--ink);
}

.home-nav-card.wide {
  grid-column: span 3;
  min-height: 86px;
  grid-template-columns: auto minmax(0, .28fr) minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
}

.home-nav-card span {
  width: 34px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--border-light);
}

.home-nav-card strong {
  color: var(--ink);
  font-size: 15px;
}

.home-nav-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.home-nav-card.primary span {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.18);
}

.home-nav-card.primary strong,
.home-nav-card.primary small {
  color: #fff;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 20px;
}

.home-panel {
  padding: 24px;
}

.home-step-list,
.home-recent-list {
  display: grid;
  gap: 10px;
}

.home-step,
.home-recent-item {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface-2);
}

.home-step {
  grid-template-columns: 30px 1fr;
}

.home-step span {
  grid-row: span 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
}

.home-step.primary {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.home-step strong,
.home-recent-item strong {
  font-size: 14px;
  color: var(--ink);
}

.home-step small,
.home-recent-item small {
  font-size: 12px;
  color: var(--muted);
}

.home-recent-strip {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  margin-bottom: 4px;
}

.home-recent-strip i {
  flex: 1;
}

.home-step:hover,
.home-recent-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.home-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: var(--r);
}

@media (max-width: 960px) {
  .function-board-hero,
  .function-section {
    grid-template-columns: 1fr;
  }

  .function-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-nav-section {
    grid-template-columns: 72px 1fr;
    gap: 16px;
  }

  .home-nav-section-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-workbench-hero,
  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard-project-main {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .home-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-nav-card.wide {
    grid-column: span 2;
  }
}

/* Hero */
.home-hero {
  padding: 80px 0 56px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--ink);
  font-family: var(--font-serif);
}

.hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.6;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Project color strip on home */
.project-strip-home {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}
.project-strip-home span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: var(--shadow-sm);
  display: inline-block;
}

/* Feature grid */
.features-section {
  margin-bottom: 80px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 0;
}

@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .function-home {
    padding-top: 36px;
  }

  .home-nav-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-nav-section h2 {
    position: static;
  }

  .home-nav-section-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid { grid-template-columns: 1fr; }
  .main { padding: 32px 24px 60px; }
  .app-header { padding: 0 24px; }
  .project-status-inner { padding: 0 24px; }
  .project-status-topline { gap: 12px; }
  .project-status-main { justify-content: flex-start; }
  .project-status-copy { grid-template-columns: auto 1fr; }
  .project-status-copy span:last-child { grid-column: 1 / -1; }
  .project-status-steps {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .project-status-steps::-webkit-scrollbar { display: none; }
  .hero-title { font-size: 36px; }
}

.feature-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 36px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-light);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.feature-card-preview {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 4px;
}

/* Preview layouts */
.fc-preview-circles {
  display: flex;
  align-items: center;
  gap: -6px;
}
.fc-preview-circles span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  display: inline-block;
  margin-left: -6px;
  box-shadow: var(--shadow-sm);
}
.fc-preview-circles span:first-child { margin-left: 0; }

.fc-preview-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  padding: 16px;
}
.fc-preview-swatches span {
  height: 28px;
  border-radius: 6px;
  display: block;
}

.fc-preview-palettes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 16px;
}
.fc-palette-row {
  display: flex;
  gap: 4px;
}
.fc-palette-row span {
  flex: 1;
  height: 22px;
  border-radius: 4px;
  display: block;
}

.fc-preview-devices {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
}
.fc-device {
  background: var(--border);
  border-radius: 6px;
}
.fc-device-desktop {
  width: 80px;
  height: 60px;
  border-radius: 6px 6px 4px 4px;
}
.fc-device-phone {
  width: 34px;
  height: 60px;
  border-radius: 8px;
}

.fc-preview-cmyk {
  display: flex;
  gap: 6px;
  padding: 12px;
}
.fc-cmyk-block {
  width: 48px;
  height: 56px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: rgba(0,0,0,0.7);
}

.fc-preview-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px;
  justify-content: center;
}
.fc-format-tag {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}

.feature-card-body {
  flex: 1;
  margin-top: 20px;
}

.feature-card-tag {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.feature-card-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-serif);
}

.feature-card-desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

.feature-card-arrow {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin-top: 24px;
  display: block;
}

/* Favorites entry card */
.favorites-entry-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px 36px;
  margin-top: 16px;
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.favorites-entry-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.fav-entry-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.fav-entry-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  flex-shrink: 0;
}

.fav-entry-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-serif);
}

.fav-entry-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.fav-entry-count {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.fav-entry-arrow {
  font-size: 18px;
  color: var(--accent);
  margin-left: 12px;
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  transition: all 0.15s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--border); box-shadow: var(--shadow-sm); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ink {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-ink:hover { background: #000; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 15px; }

/* Disabled state */
.btn[disabled], .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Focus-visible — unified blue ring */
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ====== Icon button ====== */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  border: 1px solid var(--border-light);
  background: transparent;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ====== Cards / Panels ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-title h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.panel-title .sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
}

/* ====== Page head (within main) ====== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}
.page-head h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.page-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 5px;
  max-width: 540px;
  line-height: 1.6;
}
.page-actions { display: flex; gap: 8px; }

/* ====== Workflow steps ====== */
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.workflow-step {
  border: 1px solid var(--border-light);
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px 16px;
}
.workflow-step.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.workflow-step .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.workflow-step .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.workflow-step .hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* ====== Tabs ====== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-color: var(--ink); }
.tab .count { color: var(--muted-2); font-size: 11px; margin-left: 6px; }

/* Chip filters */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.15s;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ====== Color Swatch Card ====== */
.swatch {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
}
.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.swatch.selected { box-shadow: 0 0 0 2px var(--ink), var(--shadow-lg); }
.swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch-color {
  aspect-ratio: 4 / 3;
  position: relative;
}
.swatch-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  opacity: 0;
  transition: all 0.15s;
}
.swatch:hover .swatch-fav { opacity: 1; }
.swatch-fav.active { opacity: 1; color: #D04F44; }
.swatch-meta { padding: 12px 14px 14px; }
.swatch-name {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-serif);
  margin-bottom: 2px;
}
.swatch-name .en {
  display: block;
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.swatch-hex {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ====== Color Detail Panel ====== */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-h) + var(--project-status-h) + 24px);
  box-shadow: var(--shadow-sm);
}
.detail-color {
  height: 160px;
  border-radius: var(--r);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.detail-color .label {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.detail-color .label .en {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 2px;
}

.value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
}
.value-row:last-child { border-bottom: none; }
.value-row .label {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
}
.value-row .value {
  font-family: var(--font-mono);
  color: var(--ink);
  font-weight: 500;
}
.value-copy {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}
.value-copy:hover { color: var(--accent); }

/* ====== Filter Bar ====== */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.select-pill {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.range-mini { width: 90px; }

/* ====== Grids ====== */
.grid-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.layout-split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1180px) {
  .layout-split { grid-template-columns: 1fr; }
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

.trad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

/* ====== Generator — two-column task layout ====== */
.gen-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: start;
  padding: 40px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .gen-layout { grid-template-columns: 1fr; padding: 32px 24px 60px; }
}

/* Left panel */
.gen-left {
  position: sticky;
  top: var(--rail-sticky-top);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}

.gen-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.gen-sep {
  height: 1px;
  background: var(--border-light);
  margin: 22px 0;
}

/* Color wheel — responsive, no distortion */
.gen-wheel-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* Right column */
.gen-right {
  min-width: 0;
}
.gen-right-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.gen-right-title {
  font-family: var(--font-serif);
  font-size: var(--fs-rail-title);
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}
.gen-right-hint {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

/* Generator color wheel */
.gen-wheel-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 34px;
  margin: -4px 0 22px;
  padding: 30px 34px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(250,250,250,.88)),
    radial-gradient(circle at 82% 18%, rgba(0,113,227,.13), transparent 34%);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.gen-wheel-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.6), transparent 28%),
    radial-gradient(circle at 100% 50%, rgba(20,23,31,.07), transparent 36%);
}

.gen-wheel-copy,
.gen-wheel-stage {
  position: relative;
  z-index: 1;
}

.gen-wheel-eyebrow {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.gen-wheel-copy h3 {
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
}

.gen-wheel-copy p {
  margin-top: 8px;
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.gen-wheel-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.gen-wheel-readout span {
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
}

.gen-wheel-controls {
  margin-top: 24px;
  max-width: 760px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(20,23,31,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.64);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.gen-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gen-wheel-controls .pfb-group {
  min-height: 38px;
  padding: 0;
}

.gen-wheel-controls .pfb-group + .pfb-group {
  padding-left: 10px;
  border-left: 1px solid rgba(20,23,31,.08);
}

.gen-color-chip {
  min-width: 132px;
  padding-right: 4px;
}

.gen-color-chip .gen-chip-swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  background: #1F3FD9;
  box-shadow: 0 8px 18px rgba(20,23,31,.16);
}

.gen-color-chip span {
  min-width: 74px;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.gen-wheel-controls .pfb-slider {
  width: 100px;
}

.gen-control-secondary {
  justify-content: space-between;
  align-items: flex-start;
}

.gen-control-secondary #harmonyChips {
  flex: 1 1 430px;
  gap: 6px;
  align-items: flex-start;
  border-left: 0;
  padding-left: 0;
}

.gen-wheel-actions {
  margin-left: auto;
  gap: 8px;
}

.gen-wheel-stage {
  justify-self: end;
  width: 238px;
  height: 238px;
  display: grid;
  place-items: center;
}

.gen-wheel {
  --wheel-color: #1F3FD9;
  --handle-x: 45%;
  --handle-y: 78%;
  width: 226px;
  height: 226px;
  border-radius: 50%;
  position: relative;
  cursor: crosshair;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.98) 0 10%, rgba(255,255,255,.72) 18%, transparent 48%),
    radial-gradient(circle, rgba(255,255,255,.88) 0, rgba(255,255,255,0) 34%),
    conic-gradient(from 90deg,
      #ff2a2a 0deg,
      #ffb12a 45deg,
      #fff02a 78deg,
      #42d957 125deg,
      #22d6c8 178deg,
      #2367ff 226deg,
      #8b3cff 276deg,
      #ff3aad 323deg,
      #ff2a2a 360deg);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.76),
    inset 0 0 0 12px rgba(255,255,255,.12),
    inset 0 -24px 48px rgba(20,23,31,.16),
    0 24px 50px rgba(20,23,31,.16);
}

.gen-wheel::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.96) 0 4%, rgba(255,255,255,.54) 15%, rgba(255,255,255,0) 44%),
    radial-gradient(circle at 28% 24%, rgba(255,255,255,.58), transparent 23%),
    radial-gradient(circle at 62% 66%, rgba(0,0,0,.14), transparent 44%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.gen-wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 61%, rgba(255,255,255,.72) 62%, rgba(255,255,255,.96) 68%, transparent 69%);
  pointer-events: none;
}

.gen-wheel-grid {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.34);
  box-shadow:
    inset 0 0 0 34px rgba(255,255,255,.04),
    inset 0 0 0 68px rgba(255,255,255,.035);
  pointer-events: none;
}

.gen-wheel-handle {
  position: absolute;
  left: var(--handle-x);
  top: var(--handle-y);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--wheel-color);
  border: 3px solid #fff;
  box-shadow:
    0 0 0 1px rgba(20,23,31,.18),
    0 8px 20px rgba(20,23,31,.24);
  pointer-events: none;
  z-index: 3;
}

.gen-wheel-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 82px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72)),
    var(--wheel-color);
  border: 1px solid rgba(255,255,255,.86);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    0 18px 36px rgba(20,23,31,.18);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2px;
  z-index: 2;
}

.gen-wheel-shadow {
  position: absolute;
  width: 178px;
  height: 28px;
  border-radius: 50%;
  bottom: 10px;
  background: rgba(20,23,31,.12);
  filter: blur(12px);
  z-index: 0;
}

.gen-wheel:focus-visible {
  outline: 3px solid rgba(0,113,227,.28);
  outline-offset: 4px;
}

@media (max-width: 900px) {
  .gen-wheel-panel { grid-template-columns: 1fr; }
  .gen-wheel-stage { justify-self: center; }
}

/* Color chip (hex + hsl display) */
.gen-color-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 20px;
}
.gen-chip-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.gen-chip-hex {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.gen-chip-hsl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.gen-sliders { margin-bottom: 4px; }

/* Harmony mode buttons */
.gen-harmony-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gen-harmony-btn {
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--r);
  padding: 9px 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: center;
  line-height: 1.2;
}
.gen-harmony-btn:hover {
  background: var(--accent-tint);
  border-color: var(--accent-soft);
}
.gen-harmony-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Scheme cards */
.gen-schemes {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gen-scheme-card {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.gen-scheme-card:hover {
  box-shadow: var(--shadow);
}
.gen-scheme-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink), var(--shadow);
}

/* Color bar — tall, colors are the star */
.gen-scheme-bar {
  display: flex;
  height: 88px;
}
.gen-scheme-swatch {
  flex: 1;
  position: relative;
  transition: flex 0.2s;
}
.gen-scheme-swatch:hover {
  flex: 1.4;
}
.gen-swatch-hex {
  position: absolute;
  bottom: 7px;
  left: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.28);
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.gen-scheme-swatch:hover .gen-swatch-hex {
  opacity: 1;
}

/* Card footer */
.gen-scheme-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 12px;
}
.gen-scheme-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gen-scheme-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.gen-scheme-meta {
  font-size: 11.5px;
  color: var(--muted);
}
.gen-scheme-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Apply button — primary action, most visible */
.btn-apply {
  background: var(--ink);
  color: #fff;
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-apply:hover { background: var(--accent); }

/* Preview section */
.gen-preview {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
}
.gen-preview-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.gen-preview-grid {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .gen-preview-grid { grid-template-columns: 1fr 1fr; }
}

/* Brand mockup */
.gen-mockup {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.gen-mockup-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  background: #F5EFE0;
  min-height: 160px;
}
.gen-mockup-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1F3FD9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 22px;
  transition: background 0.3s;
}
.gen-mockup-name {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 16px;
  color: #1D1D1F;
  transition: color 0.3s;
}
.gen-mockup-tagline {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
}

/* UI mockup */
.gen-mockup-ui {
  overflow: hidden;
}
.gen-mockup-bar {
  background: #1F3FD9;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}
.gen-mockup-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
}
.gen-mockup-body {
  background: #F2F4FF;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.3s;
}
.gen-mockup-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
}
.gen-mockup-card-label {
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
}
.gen-mockup-card-value {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  margin-top: 2px;
}
.gen-mockup-card-trend {
  font-size: 10px;
  color: var(--success);
  margin-top: 2px;
}
.gen-mockup-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gen-mockup-cta-primary,
.gen-mockup-cta-accent {
  padding: 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  transition: background 0.3s;
}
.gen-mockup-cta-primary { background: #1F3FD9; }
.gen-mockup-cta-accent  { background: #FF5A4E; }

/* Values panel */
.gen-preview-values {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 18px;
}
.gen-val-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.gen-val-row:last-of-type { border-bottom: none; }
.gen-val-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--border);
  transition: background 0.3s;
}
.gen-val-role {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.gen-val-hex {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
}
.gen-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.gen-preview-actions .btn {
  justify-content: center;
}

/* ====== Sliders ====== */
.slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.slider-head { display: flex; justify-content: space-between; font-size: 11.5px; }
.slider-head .label { color: var(--muted); letter-spacing: 0.5px; font-weight: 500; }
.slider-head .val { font-family: var(--font-mono); color: var(--ink); font-weight: 500; }
.slider input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.slider input[type=range].grad-h {
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.slider input[type=range].grad-s {
  background: linear-gradient(to right, #ccc, #0071E3);
}
.slider input[type=range].grad-l {
  background: linear-gradient(to right, #000, #0071E3, #fff);
}
.slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: #fff; border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.slider input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: #fff; border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
}

/* ====== Color Wheel — responsive, aspect-ratio based ====== */
.color-wheel {
  width: 100%;
  max-width: 248px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #ff0000, #ff7f00, #ffff00, #7fff00,
    #00ff00, #00ff7f, #00ffff, #007fff,
    #0000ff, #7f00ff, #ff00ff, #ff007f, #ff0000
  );
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,.12), inset 0 0 0 1px rgba(0,0,0,.05);
  /* height: auto — do NOT set a fixed height */
}
.color-wheel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.85) 0%, transparent 60%);
  pointer-events: none;
}
.color-wheel::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 0%, transparent 38%);
  pointer-events: none;
}
.wheel-thumb {
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 8px rgba(0,0,0,.25);
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: background 0.1s;
}

/* scheme-card, scheme-bar — replaced by gen-scheme-* in generator page */

/* ====== Comparison Bar ====== */
.compare-bar {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.compare-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.compare-slots { display: flex; gap: 8px; flex: 1; }
.compare-slot {
  flex: 1; height: 56px;
  border-radius: var(--r);
  border: 1.5px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono);
  position: relative; overflow: hidden;
}
.compare-slot.filled {
  border: none; color: rgba(255,255,255,.95);
  font-weight: 500; font-size: 10.5px; letter-spacing: 0.5px;
}
.compare-slot.filled .remove {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: rgba(0,0,0,.35); color: #fff;
  border-radius: 50%; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}

/* ====== Stat Cards ====== */
.stat {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat .label {
  font-size: 11px; color: var(--muted);
  letter-spacing: 1.3px; text-transform: uppercase; font-weight: 600;
}
.stat .value {
  font-family: var(--font-serif);
  font-size: 30px; font-weight: 800;
  margin: 6px 0 4px; line-height: 1.15;
  letter-spacing: 0; overflow-wrap: anywhere;
}
.stat .delta { font-size: 12px; color: var(--success); font-weight: 500; }
.stat .delta.down { color: var(--danger); }
.stat .deco {
  position: absolute; right: -8px; bottom: -8px;
  width: 70px; height: 70px; border-radius: 50%; opacity: 0.18;
}

/* ====== Mockup frame ====== */
.mockup-frame {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 18px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
}
.mockup-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.mockup-tab {
  padding: 5px 10px; font-size: 11px;
  border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--muted);
}
.mockup-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ====== Template card ====== */
.template-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
}
.template-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.template-cover {
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.template-meta { padding: 14px 16px; }
.template-meta .industry {
  font-size: 10.5px; color: var(--muted);
  letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600;
}
.template-meta .title {
  font-family: var(--font-serif); font-size: 15px; font-weight: 700;
  margin: 4px 0 8px;
}
.template-meta .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.template-meta .tag {
  font-size: 10px; padding: 2px 7px;
  background: var(--bg); color: var(--ink-2);
  border-radius: 4px;
}
.template-mini-palette { display: flex; height: 8px; border-radius: 4px; overflow: hidden; }
.template-mini-palette > div { flex: 1; }

/* ====== Print simulation ====== */
.print-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.print-side {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 20px;
}
.print-side h4 {
  font-family: var(--font-serif); font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.print-side .badge {
  font-size: 10px; padding: 2px 8px;
  border-radius: 4px; font-weight: 600;
  letter-spacing: 0.5px;
}
.print-side .badge.rgb { background: #E8F1FD; color: var(--accent); }
.print-side .badge.cmyk { background: #FFF1E5; color: #B7590A; }
.print-canvas {
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  position: relative;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 18px; overflow: hidden;
}
.print-detail {
  margin-top: 12px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 11.5px;
}
.print-detail .lab { color: var(--muted); font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; }
.print-detail .val { font-family: var(--font-mono); color: var(--ink); }

/* ====== Quality pills ====== */
.quality-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--success); color: #fff;
}
.quality-pill.warn { background: var(--warn); }
.quality-pill.danger { background: var(--danger); }
.quality-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ====== Device frames ====== */
.device-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr 0.5fr;
  gap: 16px;
  align-items: end;
}
.device {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex; flex-direction: column;
}
.device-label {
  font-size: 10px; letter-spacing: 1px;
  color: var(--muted); font-weight: 600; text-transform: uppercase;
  margin-bottom: 10px;
}
.device-screen {
  background: var(--bg);
  border-radius: 8px;
  flex: 1;
  position: relative; overflow: hidden;
  min-height: 120px;
}

/* ====== WCAG ====== */
.wcag-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}
.wcag-row:last-child { border-bottom: none; }
.wcag-pair {
  width: 60px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-mono);
}
.wcag-grade {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
}
.grade-aaa { color: var(--success); }
.grade-aa { color: #4F7B16; }
.grade-fail { color: var(--danger); }

/* ====== Folders ====== */
.folder-list { display: flex; flex-direction: column; gap: 4px; }
.folder {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.folder:hover { background: var(--surface-2); }
.folder.active { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.folder .count { margin-left: auto; font-size: 11px; color: var(--muted); }
.folder-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ====== Export Format Card ====== */
.format-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 18px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.format-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.format-card.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.format-head {
  display: flex; justify-content: space-between; align-items: start;
  margin-bottom: 10px;
}
.format-ext {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 800;
  letter-spacing: 0.5px;
}
.format-size { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.format-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.format-check {
  position: absolute; top: 14px; right: 14px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.format-card.selected .format-check {
  background: var(--ink); border-color: var(--ink); color: #fff;
}

/* ====== Checkbox row ====== */
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.check-row:last-child { border-bottom: none; }
.check-row input { accent-color: var(--ink); width: 14px; height: 14px; }
.check-row .desc { color: var(--muted); font-size: 11px; margin-left: auto; }

/* ====== AI input ====== */
.ai-input {
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-input .ai-head {
  font-size: 11px; color: var(--accent);
  font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.ai-input textarea {
  width: 100%;
  min-height: 60px;
  border: none; background: transparent;
  font-size: 13px; resize: none; outline: none;
}
.ai-input .ai-foot { display: flex; justify-content: space-between; align-items: center; }
.ai-input .ai-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.ai-input .ai-chip {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink-2);
}

/* ====== Task panels ====== */
.task-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.task-panel-title h3 {
  font-family: var(--font-serif);
  font-size: 16px;
}
.task-panel-title .step {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.next-action-box {
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: 10px;
  padding: 12px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.55;
}

/* ====== Toast ====== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 13px;
  z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: all 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.toast svg { flex: 0 0 auto; }
.toast-success { background: var(--ink); }
.toast-error { background: #B42318; }
.toast-warn { background: #8A4B0B; }
.toast-info { background: #175CD3; }

/* ====== Empty states ====== */
.dch-empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  padding: 34px 24px;
  border: 1px dashed rgba(20, 23, 31, 0.18);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}
.dch-empty-state strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.dch-empty-state p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.dch-empty-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 16px;
}
.dch-empty-state-plain {
  min-height: 280px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* ====== Search results ====== */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  max-height: 360px;
  overflow-y: auto;
  z-index: 80;
}
.search-results.show { display: block; }
.search-result {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 8px;
  transition: background 0.15s;
}
.search-result:hover { background: var(--surface-2); }
.search-chip {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
}
.search-result-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.search-result-meta {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono); margin-top: 1px;
}
.search-result-type {
  font-size: 10px; color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 7px; white-space: nowrap;
}
.search-empty {
  padding: 14px; color: var(--muted);
  font-size: 12px; text-align: center;
}

/* ====== Utility ====== */
.row { display: flex; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 20px; }
.flex-1 { flex: 1; }
.text-muted { color: var(--muted); }
.text-mono { font-family: var(--font-mono); }
.text-serif { font-family: var(--font-serif); }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.mb-3 { margin-bottom: 20px; }
.mt-2 { margin-top: 14px; }
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }

/* ====== Palette elements ====== */
.palette-stack,
.palette-strip {
  display: flex;
  overflow: hidden;
  border-radius: 9px;
}
.palette-stack { width: 148px; height: 44px; }
.palette-stack span,
.palette-strip span { flex: 1; min-width: 0; }

/* ====== ICC Strip ====== */
.icc-strip {
  display: flex;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.icc-strip > div { flex: 1; }

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ====== Library page ====== */
.lib-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 32px;
  padding: 40px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

/* Library type nav */
.lib-type-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lib-type-nav .lib-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  border: none;
  background: transparent;
  width: 100%;
}
.lib-type-nav .lib-type-item:hover { background: var(--bg); }
.lib-type-nav .lib-type-item.active { background: var(--ink); color: #fff; }
.lib-type-nav .lib-type-item.active .lib-type-count { color: rgba(255,255,255,0.6); }
.lib-type-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lib-type-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* Hue filter dots */
.lib-hue-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lib-hue-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.lib-hue-btn:hover { transform: scale(1.1); }
.lib-hue-btn.active { border-color: var(--ink); }

/* Favorites toggle */
.lib-fav-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.lib-fav-toggle input { accent-color: var(--ink); }

/* Center */
.lib-center { min-width: 0; }
.lib-center-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.lib-center-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}
.lib-center-count {
  font-size: 13px;
  color: var(--muted);
}

/* Color grid */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 0;
}
.lib-swatch {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.lib-swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lib-swatch.is-selected { box-shadow: 0 0 0 3px var(--ink); }
.lib-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.lib-swatch-title {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  max-width: calc(100% - 32px);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 10px rgba(0,0,0,.22);
  transition: left .55s cubic-bezier(.22, 1, .36, 1), right .55s cubic-bezier(.22, 1, .36, 1), top .55s cubic-bezier(.22, 1, .36, 1), bottom .55s cubic-bezier(.22, 1, .36, 1), transform .55s cubic-bezier(.22, 1, .36, 1);
}

.lib-swatch:hover .lib-swatch-title,
.lib-swatch:focus-within .lib-swatch-title {
  left: auto;
  right: 16px;
  top: 14px;
  bottom: auto;
  text-align: right;
  transform: translateY(0);
}

.lib-swatch-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.08) 0%, rgba(0,0,0,.46) 58%, rgba(0,0,0,.74) 100%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease .12s, transform .5s cubic-bezier(.22, 1, .36, 1) .12s;
  pointer-events: none;
}

.lib-swatch:hover .lib-swatch-info,
.lib-swatch:focus-within .lib-swatch-info {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lib-swatch-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.lib-swatch-meta {
  font-size: 11px;
  letter-spacing: .9px;
  opacity: .8;
}

.lib-swatch-values {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.35;
}

.lib-swatch-copy {
  width: fit-content;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: 99px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .12s ease, border-color .12s ease;
}

.lib-swatch-copy:hover {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.72);
}

.lib-similar-swatch {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  transition: transform .12s ease, box-shadow .12s ease;
}

.lib-similar-swatch:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 6px 14px rgba(0,0,0,.12);
}

/* Compare bar */
.lib-compare-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.lib-compare-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.lib-compare-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.lib-compare-head p {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.lib-compare-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.lib-compare-slot {
  min-width: 0;
  height: 46px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}
.lib-compare-slot.empty {
  border: 1.5px dashed var(--border);
  color: var(--muted-2);
  font-size: 14px;
  cursor: pointer;
}
.lib-compare-slot.filled {
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.3px;
}
.lib-compare-remove {
  position: absolute;
  top: 2px; right: 4px;
  font-size: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 0;
}

/* Detail panel */
.lib-right-rail {
  position: sticky;
  top: var(--rail-sticky-top-with-bar);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lib-detail {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  min-height: 300px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - var(--rail-sticky-top-with-bar) - 24px);
  overscroll-behavior: contain;
}
.lib-detail::-webkit-scrollbar { width: 4px; }
.lib-detail::-webkit-scrollbar-track { background: transparent; }
.lib-detail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.lib-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 280px;
  color: var(--muted);
  text-align: center;
  gap: 12px;
}
.lib-detail-empty-icon { font-size: 32px; opacity: 0.3; }
.lib-detail-empty p { font-size: 13px; line-height: 1.6; }
/* Detail fill (populated by JS) */
.lib-detail-swatch {
  width: 100%;
  min-height: 140px;
}
.lib-detail-body { padding: 20px; }
.lib-detail-name { font-family: var(--font-serif); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.lib-detail-en { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.lib-detail-values { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
.lib-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
}
.lib-detail-row:last-child { border-bottom: none; }
.lib-detail-row .k { color: var(--muted); }
.lib-detail-row .v { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; }
.lib-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ====== Templates page ====== */
.tmpl-layout {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 32px;
  padding: 40px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.tmpl-industry-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tmpl-industry-nav .tmpl-industry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  transition: background 0.12s;
  width: 100%;
}
.tmpl-industry-nav .tmpl-industry-item:hover { background: var(--bg); }
.tmpl-industry-nav .tmpl-industry-item.active { background: var(--ink); color: #fff; }
.tmpl-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.tmpl-industry-nav .tmpl-industry-item.active .tmpl-count { color: rgba(255,255,255,.5); }

.tmpl-style-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tmpl-style-filters .tmpl-style-btn {
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--border-light);
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 0.12s;
}
.tmpl-style-filters .tmpl-style-btn:hover { background: var(--bg); }
.tmpl-style-filters .tmpl-style-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.tmpl-center { min-width: 0; }
.tmpl-center-head {
  margin-bottom: 20px;
}
.tmpl-center-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.tmpl-center-hint {
  font-size: 13px;
  color: var(--muted);
}

/* Template list: 2-column grid */
.tmpl-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* Template card */
.tmpl-card {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.tmpl-card:hover { box-shadow: var(--shadow); }
.tmpl-card.is-selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }

.tmpl-card-bar {
  display: flex;
  height: 72px;
}
.tmpl-card-bar > div { flex: 1; }

.tmpl-card-body {
  padding: 14px 16px;
}
.tmpl-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.tmpl-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tmpl-card-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 500;
}

/* Detail panel */
.tmpl-detail {
  position: sticky;
  top: var(--rail-sticky-top-with-bar);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  min-height: 300px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - var(--rail-sticky-top-with-bar) - 24px);
  overscroll-behavior: contain;
}
.tmpl-detail::-webkit-scrollbar { width: 4px; }
.tmpl-detail::-webkit-scrollbar-track { background: transparent; }
.tmpl-detail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.tmpl-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}

/* Detail fill */
.tmpl-detail-header {
  padding: 20px 20px 0;
}
.tmpl-detail-name { font-family: var(--font-serif); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.tmpl-detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tmpl-detail-tag {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.tmpl-detail-palette {
  display: flex;
  height: 56px;
  margin: 0 20px;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.tmpl-detail-palette > div { flex: 1; }

.tmpl-detail-swatch-list {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tmpl-swatch-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tmpl-swatch-dot {
  width: 28px; height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}
.tmpl-swatch-info { flex: 1; min-width: 0; }
.tmpl-swatch-role { font-size: 11px; color: var(--muted); }
.tmpl-swatch-hex { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.tmpl-swatch-pct { font-size: 11px; color: var(--muted); margin-left: auto; }

.tmpl-detail-actions {
  padding: 14px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tmpl-detail-actions .btn { justify-content: center; }

/* ====== Screen page ====== */
.screen-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px 80px;
}

.dashboard-screen-section {
  padding-top: 8px;
}

/* Control bar */
.screen-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.screen-ctrl-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.screen-ctrl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.screen-ctrl-sep {
  width: 1px;
  height: 20px;
  background: var(--border-light);
}
.screen-ctrl-chips {
  display: flex;
  gap: 4px;
}
.screen-chip {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--border-light);
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 0.12s;
}
.screen-chip:hover { background: var(--bg); }
.screen-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.screen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.screen-readable-area {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.screen-palette-strip,
.screen-panel {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.screen-palette-strip { margin-bottom: 0; }
.screen-palette-bar {
  display: flex;
  height: 48px;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.screen-palette-bar > div { flex: 1; }

.readability-preview {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
  transition: filter .2s ease;
}

.readability-card {
  min-height: 168px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.readability-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .62;
}

.readability-card h2,
.readability-card h3,
.readability-card p {
  margin: 0;
}

.readability-card h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.15;
}

.readability-card h3,
.readability-card strong {
  font-size: 18px;
  line-height: 1.3;
}

.readability-card p {
  font-size: 13px;
  line-height: 1.7;
  opacity: .78;
}

.readability-card button {
  width: fit-content;
  margin-top: auto;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r);
  font-weight: 700;
}

.readability-card-main {
  grid-row: span 2;
}

/* Device grid */
.screen-device-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  transition: filter .2s ease, background .2s ease, padding .2s ease;
}
.screen-device { display: flex; flex-direction: column; gap: 8px; }
.screen-device-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
}
.screen-device-frame {
  background: #F2F4FF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 140px;
}
.screen-device--desktop { grid-column: span 2; }
.screen-device--desktop .screen-device-frame { min-height: 180px; }
.screen-device-frame--dark { background: #000; justify-content: center; }

.screen-main.screen-theme-dark .screen-device-grid {
  background: #10131B;
  border-radius: var(--r-lg);
  padding: 16px;
}
.screen-main.screen-theme-dark .screen-device-label {
  color: rgba(255,255,255,.64);
}
.screen-main.screen-theme-dark .screen-palette-strip,
.screen-main.screen-theme-dark .screen-panel {
  background: #171A23;
  color: #F5F5F7;
  border-color: rgba(255,255,255,.12);
}
.screen-main.screen-theme-dark .screen-panel-sub,
.screen-main.screen-theme-dark .screen-meta-row span:first-child {
  color: rgba(255,255,255,.56);
}
.screen-main.screen-theme-dark .wcag-item {
  background: #1F2330;
  border-color: rgba(255,255,255,.1);
}
.screen-main.screen-theme-dark .screen-meta-row {
  border-color: rgba(255,255,255,.1);
}

/* Right panel */
.screen-right {
  position: sticky;
  top: var(--rail-sticky-top);
}
.screen-panel-title {
  font-family: var(--font-serif);
  font-size: var(--fs-panel-title);
  font-weight: 700;
  margin-bottom: 2px;
}
.screen-panel-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* WCAG list */
.wcag-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.wcag-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
}
.wcag-item-swatch {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.wcag-item-info { flex: 1; }
.wcag-item-name { font-size: 12.5px; font-weight: 500; }
.wcag-item-ratio { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.wcag-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.wcag-badge--aaa { background: #D1F5E3; color: #1D8348; }
.wcag-badge--aa  { background: #E8F4FF; color: #0071E3; }
.wcag-badge--fail { background: #FFE8E6; color: #C0392B; }

.screen-notice {
  background: #FFF3E0;
  border: 1px solid #FFD180;
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 12px;
  color: #7A4100;
  line-height: 1.5;
}

.screen-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.screen-actions .btn {
  justify-content: center;
  text-decoration: none;
}

@media (max-width: 960px) {
  .screen-layout,
  .readability-preview {
    grid-template-columns: 1fr;
  }

  .screen-right {
    position: static;
  }

  .readability-card-main {
    grid-row: auto;
  }
}

.screen-meta { margin-top: 16px; }
.screen-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
}
.screen-meta-row:last-child { border-bottom: none; }
.screen-meta-row span:first-child { color: var(--muted); }
.screen-meta-row span:last-child { font-family: var(--font-mono); font-size: 11.5px; }

/* ====== Print page ====== */
.print-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  padding: 40px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.print-setting {
  margin-bottom: 14px;
}
.print-setting-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.print-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236E6E73' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.print-select:focus { border-color: var(--accent); }

/* Compare section */
.print-compare-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 28px;
}
.print-compare-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 40px;
}
.print-side {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.print-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.print-side-title {
  font-size: 13px;
  font-weight: 600;
}
.print-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.8px;
}
.print-badge.rgb  { background: #E8F4FF; color: #0071E3; }
.print-badge.cmyk { background: #FFF0E8; color: #B7590A; }

.print-canvas {
  min-height: 160px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.print-side-values {
  background: var(--surface);
  padding: 10px 16px;
}
.print-val-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
}
.print-val-row:last-child { border-bottom: none; }
.print-val-row span:first-child { color: var(--muted); }
.print-val-row span:last-child { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; }

/* Report grid */
.print-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.print-report-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 20px;
}
.print-report-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 14px;
}
.print-delta-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.print-delta-value {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 800;
  color: var(--success);
  line-height: 1;
}
.print-delta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.print-delta-grade { font-size: 12px; color: var(--success); margin-top: 3px; }

.print-ink-list { display: flex; flex-direction: column; gap: 8px; }

.print-gamut-bar {
  display: flex;
  height: 36px;
  border-radius: var(--r);
  overflow: hidden;
  gap: 2px;
}
.print-gamut-bar > div { flex: 1; border-radius: 4px; }

/* ====== Export page — palette header ====== */
.export-palette-header {
  padding: 0 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0;
}
.export-palette-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1184px;
  margin: 0 auto;
  padding: 16px 0;
}
.export-palette-strip {
  display: flex;
  height: 40px;
  width: 120px;
  border-radius: var(--r);
  overflow: hidden;
  flex-shrink: 0;
}
.export-palette-strip > div { flex: 1; }
.export-palette-info { flex: 1; }
.export-palette-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.export-palette-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.export-palette-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 900px) {
  .export-palette-header { padding: 0 20px; }
  .export-palette-inner {
    flex-wrap: wrap;
    padding: 14px 0;
  }
  .export-palette-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ====== Favorites page ====== */
.fav-layout {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 32px;
  padding: 40px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.fav-left { /* uses gen-left */ }

.fav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r);
  transition: border-color 0.15s;
}
.fav-search:focus-within { border-color: var(--ink); }
.fav-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}

.fav-type-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fav-folder-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.fav-folder-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--r);
  transition: color 0.15s, background 0.12s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.fav-folder-add:hover { color: var(--accent); background: var(--bg); }

.fav-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fav-tag-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 99px;
  background: transparent;
  border: 1.5px solid var(--border-light);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s;
}
.fav-tag-chip:hover { background: var(--bg); }
.fav-tag-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.fav-left-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fav-center { min-width: 0; }
.fav-center-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.fav-center-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}
.fav-center-count {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   横向顶部筛选栏 (page-filter-bar) — 替代所有左侧边栏
   ============================================================ */

.page-filter-bar {
  position: sticky;
  top: calc(var(--header-h) + var(--project-status-h));
  z-index: 90;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 max(48px, calc((100% - 1280px) / 2));
  height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}
.page-filter-bar::-webkit-scrollbar { display: none; }

body.has-project-status .page-filter-bar {
  top: var(--project-status-h);
}

.lib-filter-bar {
  padding: 0 48px;
}

.lib-filter-inner {
  width: 100%;
  max-width: 1184px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.lib-filter-inner::-webkit-scrollbar {
  display: none;
}

.tmpl-filter-bar {
  padding: 0;
  overflow: visible;
}

.tmpl-filter-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  overflow: visible;
}

.tmpl-filter-inner::-webkit-scrollbar {
  display: none;
}

/* Compact sizing scoped to the industry nav */
#industryNav .pfb-tab {
  padding: 4px 9px;
  font-size: 11.5px;
}

.fav-filter-bar {
  padding: 0 48px;
}

.fav-filter-inner {
  width: 100%;
  max-width: 1184px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.fav-filter-inner::-webkit-scrollbar {
  display: none;
}

.pfb-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  flex-shrink: 0;
}
.pfb-group:first-child { padding-left: 0; }

.pfb-sep {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  flex-shrink: 0;
}

.pfb-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 2px;
}

/* 通用胶囊 tab */
.pfb-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.pfb-tab:hover { background: var(--bg); color: var(--ink); border-color: var(--border-light); }
.pfb-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pfb-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 次级 tab（页内分类）— 浅色卡片样式，与主导航黑底形成层级差异 */
.lib-type-item.active,
.tmpl-industry-item.active,
#inspirationTabs .pfb-tab.active,
#inspirationTone .pfb-tab.active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.lib-type-item.active:hover,
.tmpl-industry-item.active:hover,
#inspirationTabs .pfb-tab.active:hover,
#inspirationTone .pfb-tab.active:hover {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.pfb-tab em {
  flex: 0 0 auto;
  min-width: 2.8ch;
  font-style: normal;
  font-size: 10px;
  opacity: 0.55;
  text-align: left;
}
.pfb-tab .pfb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.tmpl-style-menu {
  position: relative;
  overflow: visible;
}

.tmpl-style-trigger {
  gap: 8px;
}

.tmpl-style-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: .55;
}

.tmpl-style-trigger strong {
  font: inherit;
  font-weight: 700;
}

.tmpl-style-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--t-fast) ease, transform var(--t-fast) ease, visibility var(--t-fast) ease;
}

.tmpl-style-menu:hover .tmpl-style-dropdown,
.tmpl-style-menu:focus-within .tmpl-style-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tmpl-style-dropdown .tmpl-style-btn {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.tmpl-style-dropdown .tmpl-style-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.tmpl-style-dropdown .tmpl-style-btn.active {
  background: var(--ink);
  color: #fff;
}

/* 色系圆点 */
.pfb-hue-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: border-color 0.12s, transform 0.1s;
  flex-shrink: 0;
}
.pfb-hue-dot:hover { transform: scale(1.15); }
.pfb-hue-dot.active { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink), 0 1px 3px rgba(0,0,0,.2); }

/* 内联开关 */
.pfb-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.pfb-toggle input { accent-color: var(--ink); }

/* 紧凑滑块 */
.pfb-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pfb-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 84px;
  height: 3px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: var(--border);
}
.pfb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.pfb-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
  cursor: pointer;
}
.pfb-slider-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 30px;
  white-space: nowrap;
}
.pfb-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.pfb-slider:disabled { opacity: 0.45; cursor: not-allowed; }

/* 紧凑下拉选择框 */
.pfb-select {
  -webkit-appearance: none;
  appearance: none;
  border: 1.5px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  padding: 5px 28px 5px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' stroke='%236E6E73' stroke-width='1.3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  white-space: nowrap;
}
.pfb-select:hover, .pfb-select:focus { border-color: var(--accent); background-color: var(--surface); }
.pfb-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pfb-select:disabled { opacity: 0.45; cursor: not-allowed; }
.pfb-select[aria-invalid="true"] { border-color: var(--danger); }

/* 内联搜索框 */
.pfb-search {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--border-light);
  border-radius: 99px;
  padding: 5px 14px;
  background: var(--bg);
  transition: border-color 0.12s;
}
.pfb-search:focus-within { border-color: var(--accent); background: var(--surface); }
.pfb-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--ink);
  width: 200px;
}
.pfb-search input::placeholder { color: var(--muted-2); }

/* ============================================================
   Library — 新布局（无左侧栏）
   ============================================================ */
.lib-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  padding: 32px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.lib-grid-area { min-width: 0; }
.lib-grid-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.lib-grid-title {
  font-family: var(--font-serif);
  font-size: var(--fs-section-title);
  font-weight: 700;
}
.lib-grid-count {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   Generator — 新布局（无左侧栏）
   ============================================================ */
.gen-main {
  padding: 32px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

/* 三列并排方案卡 */
.gen-schemes-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 0;
}
@media (max-width: 960px) {
  .gen-schemes-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Templates — 新布局（无左侧栏）
   ============================================================ */
.tmpl-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 32px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.tmpl-grid-area { min-width: 0; }
.tmpl-grid-head { margin-bottom: 20px; }
.tmpl-grid-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.tmpl-grid-hint {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   Print — 新布局（无左侧栏）
   ============================================================ */
.print-main {
  padding: 32px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-print-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 48px 90px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.dashboard-print-section .print-main {
  max-width: none;
  padding: 0;
}

.dashboard-print-filter {
  margin-bottom: 20px;
}

.dashboard-print-filter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-print-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dashboard-print-control-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr)) minmax(190px, 1.2fr);
  gap: 10px;
}

.dashboard-print-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
}

.dashboard-print-field > span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-print-field .pfb-select {
  width: 100%;
  background-color: var(--surface);
}

.dashboard-print-field .pfb-slider {
  width: 100%;
}

.dashboard-print-field--range .pfb-slider-wrap {
  width: 100%;
}

@media (max-width: 1180px) {
  .dashboard-print-control-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-print-filter-head {
    flex-direction: column;
  }

  .dashboard-print-actions {
    width: 100%;
  }

  .dashboard-print-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .dashboard-print-control-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Favorites — 新布局（无左侧栏）
   ============================================================ */
.fav-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  padding: 32px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.fav-grid-area { min-width: 0; }
.fav-detail-panel {
  position: sticky;
  top: var(--rail-sticky-top-with-bar);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  min-height: 200px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - var(--rail-sticky-top-with-bar) - 24px);
  overscroll-behavior: contain;
}
.fav-detail-panel::-webkit-scrollbar { width: 4px; }
.fav-detail-panel::-webkit-scrollbar-track { background: transparent; }
.fav-detail-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================================
   Extractor — 图片取色
   ============================================================ */
.extractor-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.extractor-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.extractor-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.extractor-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.extractor-actions,
.extractor-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.extractor-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  min-height: 360px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.extractor-drop:hover,
.extractor-drop.is-dragging {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px rgba(0,113,227,.12);
}

.extractor-preview {
  width: 100%;
  height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.extractor-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background:
    linear-gradient(45deg, rgba(0,0,0,.03) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,.03) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,.03) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,.03) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.extractor-empty-preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.extractor-empty-preview span {
  width: 54px;
  height: 54px;
  border-radius: var(--r);
  border: 1px solid var(--border-light);
  background:
    linear-gradient(135deg, #1F3FD9 0 26%, #6FBEAA 26% 50%, #F2C744 50% 72%, #FF5A4E 72% 100%);
  box-shadow: var(--shadow-sm);
}

.extractor-empty-preview strong {
  color: var(--ink);
  font-size: 16px;
}

.extractor-empty-preview small {
  max-width: 320px;
  font-size: 12px;
}

.extractor-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.extractor-color-card {
  min-height: 142px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.extractor-color-card:hover,
.extractor-color-card.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.extractor-color-role {
  margin-bottom: auto;
  display: inline-flex;
  height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 11px;
  font-weight: 700;
}

.extractor-color-card strong {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0;
}

.extractor-color-card small {
  font-size: 11px;
  opacity: .78;
}

.extractor-detail {
  overflow: hidden;
  padding: 0;
}

.extractor-detail-swatch {
  min-height: 156px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}

.extractor-detail-swatch span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.extractor-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.extractor-action-stack {
  display: grid;
  gap: 8px;
}

.extractor-action-stack .btn {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   Scale — 色阶生成器
   ============================================================ */
.scale-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.scale-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.scale-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.scale-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.scale-controls {
  display: grid;
  grid-template-columns: 150px minmax(180px, 220px) 1fr;
  gap: 12px;
  align-items: end;
}

.scale-color-field,
.scale-hex-field {
  display: grid;
  gap: 7px;
}

.scale-color-field span,
.scale-hex-field span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.scale-color-field input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
}

.scale-hex-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.scale-hex-field input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.scale-mode-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.scale-swatch {
  min-height: 128px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.44);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.scale-swatch:hover,
.scale-swatch.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.scale-swatch span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.scale-swatch strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.scale-swatch small {
  font-size: 11px;
  opacity: .76;
}

.scale-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.scale-preview-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale-preview-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .62;
}

.scale-preview-card strong {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.15;
}

.scale-preview-card p {
  max-width: 360px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  opacity: .78;
}

.scale-preview-card button {
  width: fit-content;
  height: 36px;
  margin-top: auto;
  padding: 0 16px;
  border-radius: var(--r);
  font-weight: 700;
}

.scale-preview-strip {
  grid-column: 1 / -1;
  display: flex;
  height: 54px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.scale-preview-strip i {
  flex: 1;
}

.scale-detail {
  overflow: hidden;
  padding: 0;
}

.scale-detail-swatch {
  min-height: 156px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}

.scale-detail-swatch span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  opacity: .72;
}

.scale-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

/* ============================================================
   Converter — 色值转换器
   ============================================================ */
.converter-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.converter-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.converter-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.converter-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.converter-source {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: calc(var(--r) + 6px);
  background:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,.9), transparent 28%),
    linear-gradient(135deg, rgba(29,29,31,.04), rgba(255,255,255,.88));
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.converter-color-field {
  display: grid;
  gap: 8px;
}

.converter-color-field span,
.converter-value-card span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.converter-color-field input[type="color"] {
  width: 100%;
  height: 102px;
  padding: 6px;
  border: 1px solid var(--border-light);
  border-radius: calc(var(--r) + 4px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.converter-source-copy {
  min-width: 0;
  padding: 12px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.converter-source-copy strong {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
}

.converter-source-copy small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.converter-value-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
}

.converter-value-card input {
  grid-column: 1 / -1;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: calc(var(--r) - 2px);
  background: var(--surface);
  outline: 1px solid transparent;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}

.converter-value-card input:focus {
  outline-color: var(--accent);
  background: #fff;
}

.converter-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.converter-preview-card {
  min-height: 198px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.converter-preview-card span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .62;
}

.converter-preview-card strong {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.12;
}

.converter-preview-card p {
  max-width: 360px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  opacity: .76;
}

.converter-preview-card button {
  width: fit-content;
  height: 36px;
  margin-top: auto;
  padding: 0 16px;
  border-radius: var(--r);
  border: 0;
  font-weight: 800;
}

.converter-preview-line {
  grid-column: 1 / -1;
  height: 58px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  box-shadow: var(--shadow-sm);
}

.converter-preview-line i {
  flex: 1;
}

.converter-detail {
  overflow: hidden;
  padding: 0;
}

.converter-detail-swatch {
  min-height: 172px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.converter-detail-swatch span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  opacity: .72;
}

.converter-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1;
}

.converter-detail-swatch small {
  max-width: 220px;
  font-size: 12px;
  line-height: 1.55;
  opacity: .72;
}

/* ============================================================
   Named colors — 命名颜色查询
   ============================================================ */
.named-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.named-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.named-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.named-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.named-query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: end;
}

.named-query-field,
.named-color-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.named-query-field span,
.named-color-field span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.named-query-field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  outline: none;
  font-size: 14px;
  color: var(--ink);
}

.named-query-field input:focus {
  border-color: var(--accent);
  background: #fff;
}

.named-color-field input[type="color"] {
  width: 100%;
  height: 50px;
  padding: 5px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
}

.named-tabs {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.named-tabs em {
  margin-left: 4px;
  color: inherit;
  opacity: .52;
  font-style: normal;
}

.named-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.named-card {
  min-height: 136px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: var(--r);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.named-card:hover,
.named-card.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.named-card span {
  margin-bottom: auto;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.named-card strong {
  font-family: var(--font-mono);
  font-size: 14px;
}

.named-card small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  opacity: .78;
}

.named-empty {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--border-light);
  border-radius: var(--r);
}

.named-detail {
  overflow: hidden;
  padding: 0;
}

.named-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.named-detail-swatch span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  opacity: .7;
}

.named-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1;
}

.named-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .76;
}

/* ============================================================
   Ratio — 比例配色
   ============================================================ */
.ratio-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.ratio-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.ratio-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.ratio-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ratio-mode-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ratio-controls {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.ratio-range {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.ratio-color-pickers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ratio-picker {
  width: 74px;
  height: 48px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px;
  align-items: center;
  padding: 5px;
  transition: opacity .18s ease, transform .18s ease;
}

.ratio-picker.is-muted {
  opacity: .32;
}

.ratio-picker span {
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.ratio-picker input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 2px;
  border: 0;
  border-radius: calc(var(--r) - 4px);
  background: transparent;
}

.ratio-stage-panel {
  padding: 0;
  overflow: hidden;
}

.ratio-stage {
  min-height: 420px;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(250px, .55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  color: #fff;
}

.ratio-stage-copy {
  display: grid;
  gap: 10px;
}

.ratio-stage-copy span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: .78;
}

.ratio-stage-copy strong {
  max-width: 360px;
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1.08;
}

.ratio-stage-copy small {
  max-width: 400px;
  font-size: 14px;
  line-height: 1.7;
  opacity: .82;
}

.ratio-preview {
  min-width: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.ratio-ring {
  width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 26px;
  box-shadow: 0 24px 64px rgba(0,0,0,.26), inset 0 0 0 1px rgba(255,255,255,.32);
}

.ratio-ring-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.ratio-ring-core strong {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1;
}

.ratio-ring-core span {
  max-width: 120px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.ratio-mosaic {
  min-height: 250px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: calc(var(--r) + 8px);
  background: rgba(255,255,255,.16);
  display: flex;
  align-items: stretch;
  gap: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.ratio-mosaic-cell {
  min-width: 0;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.3);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  text-align: left;
  overflow: hidden;
  transition: transform .18s ease, outline-color .18s ease;
}

.ratio-mosaic-cell:hover,
.ratio-mosaic-cell.active {
  transform: translateY(-2px);
  outline: 3px solid rgba(255,255,255,.88);
  outline-offset: 2px;
}

.ratio-mosaic-cell strong {
  font-family: var(--font-serif);
  font-size: clamp(10px, 1vw, 16px);
  line-height: 1;
  white-space: nowrap;
}

.ratio-mosaic-cell span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  opacity: .78;
}

.ratio-bars,
.ratio-notes {
  display: grid;
  gap: 10px;
}

.ratio-bar {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px 14px;
  align-items: center;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.ratio-bar:hover,
.ratio-bar.active {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: #fff;
}

.ratio-bar i {
  grid-column: 1 / -1;
  height: 10px;
  min-width: 4px;
  border-radius: 999px;
}

.ratio-bar span {
  font-weight: 800;
}

.ratio-bar strong,
.ratio-bar small {
  font-family: var(--font-mono);
  font-size: 12px;
}

.ratio-bar small {
  color: var(--muted);
}

.ratio-note {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
  gap: 6px;
}

.ratio-note strong {
  font-family: var(--font-serif);
  font-size: 18px;
}

.ratio-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.ratio-detail {
  overflow: hidden;
  padding: 0;
}

.ratio-detail-swatch {
  min-height: 172px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.ratio-detail-swatch span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  opacity: .72;
}

.ratio-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1;
}

.ratio-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .72;
}

/* ============================================================
   Simultaneous contrast — 同时对比
   ============================================================ */
.sim-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.sim-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.sim-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.sim-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sim-color-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sim-color-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: center;
}

.sim-color-field span {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.sim-color-field input[type="color"] {
  width: 48px;
  height: 42px;
  padding: 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.sim-color-field input[type="text"] {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.sim-slider-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sim-range {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
}

.sim-range input {
  grid-column: 1 / -1;
}

.sim-stage-panel {
  padding: 0;
  overflow: hidden;
}

.sim-stage {
  min-height: 500px;
  padding: 16px;
  background: #101114;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sim-field {
  position: relative;
  min-height: 468px;
  padding: 24px;
  border-radius: calc(var(--r) + 8px);
  overflow: hidden;
  background: var(--sim-bg);
  color: var(--sim-text);
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.sim-field::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--sim-grid);
  background-image:
    linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size: 32px 32px;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.sim-field::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 44%, rgba(255,255,255,.24), transparent 42%);
  pointer-events: none;
}

.sim-field-label,
.sim-field-foot,
.sim-patch-wrap {
  position: relative;
  z-index: 1;
}

.sim-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sim-field-label span,
.sim-field-foot span {
  font-size: 12px;
  font-weight: 800;
  opacity: .72;
}

.sim-field-label strong,
.sim-field-foot em {
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.sim-patch-wrap {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.sim-patch {
  position: relative;
  width: var(--sim-size);
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--sim-patch);
  box-shadow:
    0 24px 60px rgba(0,0,0,.24),
    0 0 0 10px rgba(255,255,255,.18),
    inset 0 0 0 1px rgba(255,255,255,.42);
}

.sim-patch::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: inherit;
  background: radial-gradient(circle, var(--sim-perceived), transparent 66%);
  opacity: .22;
  filter: blur(12px);
  z-index: -1;
}

.sim-patch-meta {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sim-patch-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sim-patch-meta strong {
  font-family: var(--font-mono);
  font-size: 12px;
}

.sim-field-foot {
  min-height: 50px;
  padding: 12px;
  border-radius: var(--r);
  background: rgba(255,255,255,.72);
  color: var(--ink);
  display: grid;
  grid-template-columns: 1fr 34px auto;
  gap: 10px;
  align-items: center;
}

.sim-field-foot i {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.sim-comparison,
.sim-notes {
  display: grid;
  gap: 10px;
}

.sim-comparison {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sim-shift-card,
.sim-note {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
}

.sim-shift-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.sim-shift-card > span {
  width: 46px;
  aspect-ratio: 1;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.sim-shift-card strong,
.sim-note strong {
  display: block;
  font-weight: 900;
  color: var(--ink);
}

.sim-shift-card small,
.sim-note span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.sim-detail {
  overflow: hidden;
  padding: 0;
}

.sim-detail-hero {
  min-height: 188px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  position: relative;
  overflow: hidden;
}

.sim-detail-hero::after {
  content: "";
  position: absolute;
  width: 130px;
  aspect-ratio: 1;
  right: -24px;
  top: -24px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
}

.sim-detail-hero span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: .78;
}

.sim-detail-hero strong {
  max-width: 220px;
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.08;
}

.sim-detail-hero small {
  opacity: .74;
  font-size: 12px;
}

/* ============================================================
   Multi scene preview — App / Web / Email / Social / PPT
   ============================================================ */
.preview-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.preview-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.preview-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.preview-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.preview-mode-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-controls {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.preview-range {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
}

.preview-range input {
  grid-column: 1 / -1;
}

.preview-stage-panel {
  padding: 0;
  overflow: hidden;
}

.preview-stage {
  min-height: 540px;
  padding: 32px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--preview-accent) 18%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--preview-primary) var(--preview-brand), #f7f8fb), #f7f8fb 56%, var(--preview-light));
  display: grid;
  place-items: center;
  gap: 28px;
}

.preview-stage--app {
  grid-template-columns: 360px minmax(0, 1fr);
}

.preview-phone {
  width: 340px;
  height: 500px;
  padding: 18px;
  border-radius: 34px;
  border: 10px solid #17181d;
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
}

.preview-phone-top,
.preview-bottom-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-phone-top span {
  width: 28px;
  aspect-ratio: 1;
  border-radius: 10px;
}

.preview-phone-top strong {
  margin-right: auto;
}

.preview-phone-top i {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.preview-app-hero {
  min-height: 170px;
  padding: 22px;
  border-radius: var(--preview-radius);
  display: grid;
  align-content: end;
  gap: 8px;
}

.preview-app-hero span,
.preview-side-copy span,
.preview-web-page section span,
.preview-social span,
.preview-slide span,
.preview-email-card header span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .76;
}

.preview-app-hero strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.05;
}

.preview-app-hero button,
.preview-web-page button,
.preview-email-card button {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 900;
}

.preview-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preview-app-grid article {
  min-height: 96px;
  padding: 14px;
  border-radius: var(--preview-radius);
  display: grid;
  align-content: space-between;
}

.preview-app-grid span {
  font-size: 12px;
  font-weight: 800;
  opacity: .68;
}

.preview-app-grid strong {
  font-family: var(--font-serif);
  font-size: 28px;
}

.preview-bottom-nav {
  justify-content: space-around;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
}

.preview-bottom-nav span {
  width: 34px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
}

.preview-side-copy {
  max-width: 430px;
  color: var(--preview-dark);
  display: grid;
  gap: 12px;
}

.preview-side-copy strong {
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1.04;
}

.preview-side-copy small {
  max-width: 360px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.preview-web-page {
  width: min(100%, 920px);
  min-height: 460px;
  border-radius: calc(var(--preview-radius) + 10px);
  padding: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.14);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 28px;
}

.preview-web-page nav {
  height: 54px;
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr auto;
  align-items: center;
  gap: 18px;
}

.preview-web-page nav span {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--preview-muted) 35%, transparent);
}

.preview-web-page section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 26px;
  align-items: stretch;
}

.preview-web-page section > div {
  display: grid;
  align-content: center;
  gap: 16px;
}

.preview-web-page section strong {
  max-width: 520px;
  font-family: var(--font-serif);
  font-size: 54px;
  line-height: 1;
}

.preview-web-page section p {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.7;
}

.preview-web-page aside {
  border-radius: calc(var(--preview-radius) + 8px);
  padding: 24px;
  display: grid;
  align-content: end;
  gap: 10px;
}

.preview-web-page aside i {
  width: 72px;
  height: 10px;
  border-radius: 999px;
}

.preview-web-page aside strong {
  font-family: var(--font-serif);
  font-size: 58px;
}

.preview-email {
  width: min(100%, 720px);
  min-height: 480px;
  padding: 42px;
  border-radius: calc(var(--preview-radius) + 12px);
  display: grid;
  place-items: center;
}

.preview-email-card {
  width: min(100%, 520px);
  overflow: hidden;
  border-radius: calc(var(--preview-radius) + 8px);
  box-shadow: 0 28px 80px rgba(0,0,0,.16);
}

.preview-email-card header {
  min-height: 180px;
  padding: 30px;
  display: grid;
  align-content: end;
  gap: 8px;
}

.preview-email-card header strong {
  font-family: var(--font-serif);
  font-size: 38px;
}

.preview-email-card main {
  padding: 28px 30px 32px;
  display: grid;
  gap: 18px;
}

.preview-email-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.preview-email-tags {
  display: flex;
  gap: 8px;
}

.preview-email-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.preview-social {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--preview-radius) + 18px);
  padding: 46px;
  overflow: hidden;
  box-shadow: 0 34px 90px rgba(0,0,0,.18);
  display: grid;
  align-content: end;
  gap: 12px;
}

.preview-social-orbit {
  position: absolute;
  width: 240px;
  aspect-ratio: 1;
  right: -48px;
  top: -48px;
  border-radius: 50%;
  opacity: .9;
}

.preview-social strong {
  max-width: 420px;
  font-family: var(--font-serif);
  font-size: 58px;
  line-height: .98;
  position: relative;
}

.preview-social p {
  max-width: 370px;
  margin: 0;
  line-height: 1.7;
  opacity: .82;
  position: relative;
}

.preview-social div:last-child {
  display: flex;
  gap: 10px;
  position: relative;
}

.preview-social i {
  width: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,.22);
}

.preview-ppt {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 16px;
}

.preview-slide {
  min-height: 220px;
  padding: 26px;
  border-radius: calc(var(--preview-radius) + 10px);
  box-shadow: 0 22px 70px rgba(0,0,0,.12);
}

.preview-slide-cover {
  min-height: 456px;
  grid-row: span 2;
  display: grid;
  align-content: end;
  gap: 14px;
}

.preview-slide-cover strong {
  max-width: 440px;
  font-family: var(--font-serif);
  font-size: 54px;
  line-height: 1;
}

.preview-slide-cover i {
  width: var(--preview-brand);
  height: 12px;
  border-radius: 999px;
}

.preview-slide-data {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.preview-slide-data header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-slide-data header span {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.preview-chart {
  display: flex;
  align-items: end;
  gap: 10px;
}

.preview-chart i {
  flex: 1;
  min-height: 30px;
  border-radius: 999px 999px 8px 8px;
}

.preview-slide-end {
  display: grid;
  align-content: center;
  gap: 8px;
}

.preview-slide-end strong {
  font-family: var(--font-serif);
  font-size: 34px;
}

.preview-scene-grid,
.preview-checks {
  display: grid;
  gap: 10px;
}

.preview-scene-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.preview-scene-card,
.preview-check {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
}

.preview-scene-card {
  min-width: 0;
  text-align: left;
  display: grid;
  gap: 7px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.preview-scene-card:hover,
.preview-scene-card.active {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: #fff;
}

.preview-scene-card span,
.preview-detail-hero span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}

.preview-scene-card strong {
  font-weight: 900;
}

.preview-scene-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.preview-checks {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preview-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-check strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 26px;
}

.preview-check small {
  display: inline-flex;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.preview-check.ok small {
  color: #1b8a4b;
  background: #d8f8e6;
}

.preview-check.warn small {
  color: #9a5b00;
  background: #fff2d6;
}

.preview-check.bad small {
  color: #c02b20;
  background: #ffe4e1;
}

.preview-detail {
  overflow: hidden;
  padding: 0;
}

.preview-detail-hero {
  min-height: 188px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.preview-detail-hero span {
  color: inherit;
  opacity: .7;
}

.preview-detail-hero strong {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.05;
}

.preview-detail-hero small {
  opacity: .76;
  font-size: 12px;
}

.preview-detail-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.preview-detail-strip i {
  height: 48px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* ============================================================
   Palette tools — compare / dedupe / Delta E / reduce
   ============================================================ */
.ptools-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.ptools-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.ptools-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.ptools-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ptools-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ptools-textarea-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.ptools-textarea-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ptools-textarea-field textarea {
  min-height: 144px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}

.ptools-controls {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.ptools-range {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
}

.ptools-range input {
  grid-column: 1 / -1;
}

.ptools-actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ptools-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ptools-stage-block {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(247,248,251,.94)),
    var(--bg);
  display: grid;
  gap: 14px;
}

.ptools-stage-block.wide {
  grid-column: 1 / -1;
}

.ptools-stage-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ptools-stage-title span {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
}

.ptools-stage-title strong {
  font-weight: 900;
}

.ptools-stage-title em {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
}

.ptools-swatch-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.ptools-swatch {
  min-height: 70px;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: flex-end;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .18s ease;
}

.ptools-swatch:hover {
  transform: translateY(-2px);
}

.ptools-swatch span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
}

.ptools-band {
  height: 92px;
  overflow: hidden;
  border-radius: calc(var(--r) + 6px);
  display: flex;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.ptools-band i {
  flex: 1;
  min-width: 18px;
}

.ptools-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ptools-result-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
  gap: 14px;
}

.ptools-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ptools-result-head strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
}

.ptools-result-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ptools-result-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.ptools-result-swatch {
  min-height: 88px;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  display: grid;
  align-content: end;
  gap: 4px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.ptools-result-swatch strong,
.ptools-result-swatch small {
  font-family: var(--font-mono);
  font-size: 11px;
}

.ptools-result-swatch small {
  opacity: .75;
}

.ptools-pairs {
  display: grid;
  gap: 10px;
}

.ptools-pair {
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.ptools-pair.good {
  border-color: rgba(31, 204, 142, .35);
}

.ptools-pair.warn {
  border-color: rgba(245, 169, 48, .36);
}

.ptools-pair.bad {
  border-color: rgba(255, 90, 78, .32);
}

.ptools-pair-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.ptools-pair-swatches i {
  height: 42px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.ptools-pair strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
}

.ptools-pair span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ptools-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  color: var(--muted);
  background: var(--bg);
}

.ptools-detail {
  overflow: hidden;
  padding: 0;
}

.ptools-detail-hero {
  min-height: 188px;
  padding: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 18%, rgba(255,255,255,.28), transparent 32%),
    linear-gradient(135deg, #17181d, #2f35d8 52%, #ff5a4e);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.ptools-detail-hero span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .75;
}

.ptools-detail-hero strong {
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1;
}

.ptools-detail-hero small {
  opacity: .76;
  font-size: 12px;
}

.ptools-detail-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.ptools-detail-strip i {
  height: 48px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

@media (max-width: 1100px) {
  .ptools-main {
    grid-template-columns: 1fr;
    padding: 24px 28px 64px;
  }

  .ptools-rail {
    position: static;
  }

  .ptools-controls,
  .ptools-results {
    grid-template-columns: 1fr;
  }

  .ptools-actions-inline {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .ptools-main {
    padding: 18px 14px 48px;
  }

  .ptools-panel-head,
  .ptools-editor-grid,
  .ptools-stage {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ptools-stage-block.wide {
    grid-column: auto;
  }

  .ptools-pair {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .ptools-pair .value-copy {
    grid-column: 2;
    justify-self: start;
  }

  .ptools-textarea-field textarea {
    min-height: 112px;
  }
}

@media (max-width: 1100px) {
  .preview-main {
    grid-template-columns: 1fr;
    padding: 24px 28px 64px;
  }

  .preview-rail {
    position: static;
    grid-template-columns: 1fr;
  }

  .preview-stage--app {
    grid-template-columns: 1fr;
  }

  .preview-side-copy {
    max-width: none;
  }

  .preview-web-page section,
  .preview-ppt {
    grid-template-columns: 1fr;
  }

  .preview-slide-cover {
    min-height: 320px;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .preview-main {
    padding: 18px 14px 48px;
  }

  .preview-panel-head,
  .preview-controls,
  .preview-scene-grid,
  .preview-checks {
    grid-template-columns: 1fr;
  }

  .preview-panel-head {
    display: grid;
  }

  .preview-stage {
    min-height: 0;
    padding: 18px;
  }

  .preview-phone {
    width: min(100%, 340px);
  }

  .preview-side-copy strong,
  .preview-web-page section strong,
  .preview-social strong,
  .preview-slide-cover strong {
    font-size: 36px;
  }

  .preview-web-page {
    min-height: 0;
  }

  .preview-email {
    padding: 18px;
  }
}

/* ============================================================
   Contrast fix — 对比度修复器
   ============================================================ */
.contrast-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.contrast-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.contrast-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.contrast-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.contrast-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.contrast-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)) minmax(240px, 1fr);
  gap: 12px;
  align-items: end;
}

.contrast-color-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.contrast-color-field span {
  grid-column: 1 / -1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.contrast-color-field input[type="color"] {
  width: 64px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
}

.contrast-color-field input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.contrast-color-field input[type="text"]:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.contrast-target-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.contrast-score-panel {
  display: grid;
  gap: 16px;
}

.contrast-score-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contrast-score-sample {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  border: 1px solid var(--border-light);
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 800;
}

.contrast-score-copy {
  display: grid;
  gap: 2px;
}

.contrast-score-copy span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--muted);
}

.contrast-score-copy strong {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1.05;
}

.contrast-score-copy small {
  font-size: 13px;
  font-weight: 700;
}

.contrast-score-copy .is-pass { color: var(--success); }
.contrast-score-copy .is-fail { color: var(--danger); }

.contrast-meter-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}

.contrast-meter-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.contrast-meter-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.contrast-candidates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.contrast-candidate {
  min-height: 176px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.contrast-candidate:hover,
.contrast-candidate.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.contrast-candidate span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 11px;
  font-weight: 700;
}

.contrast-candidate strong {
  font-size: 16px;
  line-height: 1.25;
}

.contrast-candidate small,
.contrast-candidate em {
  font-style: normal;
  font-size: 11px;
  opacity: .78;
}

.contrast-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 14px;
}

.contrast-preview-card {
  min-height: 230px;
  padding: 24px;
  border-radius: var(--r);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contrast-preview-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .64;
}

.contrast-preview-card h2,
.contrast-preview-card h3,
.contrast-preview-card p {
  margin: 0;
}

.contrast-preview-card h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.12;
}

.contrast-preview-card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.2;
}

.contrast-preview-card p {
  font-size: 13px;
  line-height: 1.75;
  opacity: .82;
}

.contrast-preview-card button {
  width: fit-content;
  height: 38px;
  margin-top: auto;
  padding: 0 16px;
  border-radius: var(--r);
  font-weight: 700;
}

.contrast-detail {
  overflow: hidden;
  padding: 0;
}

.contrast-detail-swatch {
  min-height: 172px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.contrast-detail-swatch span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.contrast-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.contrast-detail-swatch small {
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Tokens — 语义色板
   ============================================================ */
.tokens-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.tokens-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.tokens-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.tokens-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tokens-mode-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tokens-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tokens-card {
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.tokens-card:hover,
.tokens-card.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.tokens-card-swatch {
  width: 100%;
  min-height: 112px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  text-align: left;
}

.tokens-card-swatch span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 11px;
  font-weight: 700;
}

.tokens-card-swatch strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.tokens-card-body {
  min-height: 92px;
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
}

.tokens-card-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tokens-card-body small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.tokens-card-body input[type="color"] {
  width: 38px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--surface);
}

.tokens-preview {
  display: grid;
}

.tokens-product-preview {
  min-height: 380px;
  padding: 20px;
  border: 1px solid;
  border-radius: var(--r);
  display: grid;
  gap: 16px;
}

.tokens-preview-nav {
  height: 44px;
  padding: 0 12px;
  border: 1px solid;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tokens-preview-nav span {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
}

.tokens-preview-card {
  padding: 22px;
  border: 1px solid;
  border-radius: var(--r);
  display: grid;
  gap: 10px;
}

.tokens-preview-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.tokens-preview-card h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.15;
}

.tokens-preview-card p {
  max-width: 540px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.tokens-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.tokens-preview-actions button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-weight: 700;
}

.tokens-status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tokens-status-row span {
  min-height: 58px;
  padding: 0 14px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  font-weight: 700;
}

.tokens-detail {
  overflow: hidden;
  padding: 0;
}

.tokens-detail-swatch {
  min-height: 172px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.tokens-detail-swatch span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.tokens-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.tokens-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Gradient — 渐变生成器
   ============================================================ */
.gradient-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.gradient-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.gradient-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.gradient-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.gradient-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(180px, 240px);
  gap: 12px;
  align-items: center;
}

.gradient-type-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gradient-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gradient-range .pfb-slider {
  flex: 1;
}

.gradient-preview-panel {
  padding: 18px;
}

.gradient-preview {
  min-height: 430px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-end;
  padding: 26px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.38);
}

.gradient-preview-content {
  max-width: 420px;
  padding: 22px;
  border-radius: var(--r);
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 54px rgba(0,0,0,.18);
}

.gradient-preview-content span {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .74;
}

.gradient-preview-content strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.14;
}

.gradient-preview-content small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .74;
}

.gradient-stops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gradient-stop-card {
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.gradient-stop-card:hover,
.gradient-stop-card.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.gradient-stop-swatch {
  width: 100%;
  min-height: 94px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  text-align: left;
}

.gradient-stop-swatch span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.gradient-stop-swatch strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.gradient-stop-controls {
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 44px auto;
  gap: 8px;
  align-items: center;
}

.gradient-stop-controls input[type="color"] {
  width: 38px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: var(--surface);
}

.gradient-stop-controls input[type="range"] {
  width: 100%;
}

.gradient-stop-controls span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.gradient-stop-controls .btn[disabled] {
  opacity: .35;
  cursor: not-allowed;
}

.gradient-code {
  margin: 0;
  padding: 18px;
  min-height: 138px;
  border-radius: var(--r);
  background: #14171F;
  color: #F5F5F7;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.gradient-detail {
  overflow: hidden;
  padding: 0;
}

.gradient-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.gradient-detail-swatch span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.gradient-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.gradient-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Blend — 颜色混合器
   ============================================================ */
.blend-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.blend-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.blend-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.blend-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.blend-color-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr)) minmax(260px, .95fr);
  gap: 12px;
  align-items: end;
}

.blend-color-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.blend-color-field span {
  grid-column: 1 / -1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.blend-color-field input[type="color"] {
  width: 64px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
}

.blend-color-field input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.blend-color-field input[type="text"]:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.blend-mode-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.blend-slider-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.blend-range {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.blend-range .pfb-slider {
  flex: 1;
}

.blend-result-panel {
  padding: 18px;
}

.blend-result {
  min-height: 330px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-end;
  padding: 26px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.38);
}

.blend-result-copy {
  min-width: 260px;
  padding: 22px;
  border-radius: var(--r);
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 54px rgba(0,0,0,.18);
}

.blend-result-copy span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .74;
}

.blend-result-copy strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1.05;
}

.blend-result-copy small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .76;
}

.blend-ramp {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.blend-swatch {
  min-height: 140px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 5px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.blend-swatch:hover,
.blend-swatch.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.blend-swatch span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.blend-swatch strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.blend-swatch small {
  font-size: 11px;
  opacity: .76;
}

.blend-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.blend-preview-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blend-preview-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .62;
}

.blend-preview-card strong {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.15;
}

.blend-preview-card p {
  max-width: 360px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  opacity: .78;
}

.blend-preview-card button {
  width: fit-content;
  height: 36px;
  margin-top: auto;
  padding: 0 16px;
  border-radius: var(--r);
  font-weight: 700;
}

.blend-preview-strip {
  grid-column: 1 / -1;
  display: flex;
  height: 54px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.blend-preview-strip i {
  flex: 1;
}

.blend-detail {
  overflow: hidden;
  padding: 0;
}

.blend-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.blend-detail-swatch span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.blend-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.blend-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Hue Ring — 色相环工具
   ============================================================ */
.hue-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.hue-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.hue-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.hue-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.hue-hero-grid {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.hue-ring-stage {
  position: relative;
  width: 340px;
  height: 340px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.hue-ring {
  width: 310px;
  height: 310px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 0 34%, transparent 35%),
    conic-gradient(from -90deg, #f43 0deg, #ff0 60deg, #28c76f 125deg, #00bcd4 180deg, #2f49e8 235deg, #9c27b0 300deg, #f43 360deg);
  box-shadow: 0 28px 70px rgba(20,23,31,.16), inset 0 0 0 1px rgba(255,255,255,.6);
}

.hue-ring::after {
  content: '';
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: inset 0 0 38px rgba(255,255,255,.24);
  pointer-events: none;
}

.hue-ring-inner {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(255,255,255,.8);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  box-shadow: 0 16px 44px rgba(0,0,0,.12);
  position: relative;
  z-index: 2;
}

.hue-ring-inner span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
}

.hue-ring-inner strong {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1;
}

.hue-ring-inner small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.hue-markers {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 5;
}

.hue-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translate(calc(var(--x) - 12px), calc(var(--y) - 12px));
  border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
  transition: transform .18s ease, width .18s ease, height .18s ease;
}

.hue-marker.active {
  width: 32px;
  height: 32px;
  transform: translate(calc(var(--x) - 16px), calc(var(--y) - 16px));
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

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

.hue-color-field {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.hue-color-field span {
  grid-column: 1 / -1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.hue-color-field input[type="color"] {
  width: 64px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
}

.hue-color-field input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.hue-color-field input[type="text"]:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.hue-range {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hue-range .pfb-slider {
  flex: 1;
}

.hue-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hue-mode-card {
  min-height: 156px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.hue-mode-card:hover,
.hue-mode-card.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.hue-mode-card span {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
}

.hue-mode-card strong {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.hue-mode-card small {
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hue-mode-card i {
  margin-top: auto;
  height: 18px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
}

.hue-mode-card b {
  flex: 1;
}

.hue-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hue-swatch {
  min-height: 142px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 5px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.hue-swatch:hover,
.hue-swatch.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.hue-swatch span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.hue-swatch strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.hue-swatch small {
  font-size: 11px;
  opacity: .76;
}

.hue-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hue-preview-card {
  min-height: 204px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hue-preview-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .62;
}

.hue-preview-card strong {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.15;
}

.hue-preview-card p {
  max-width: 360px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  opacity: .78;
}

.hue-preview-card button {
  width: fit-content;
  height: 36px;
  margin-top: auto;
  padding: 0 16px;
  border-radius: var(--r);
  font-weight: 700;
}

.hue-preview-strip {
  grid-column: 1 / -1;
  display: flex;
  height: 54px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.hue-preview-strip i {
  flex: 1;
}

.hue-detail {
  overflow: hidden;
  padding: 0;
}

.hue-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.hue-detail-swatch span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.hue-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.hue-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Monochrome — 单色配色生成器
   ============================================================ */
.mono-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.mono-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.mono-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.mono-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mono-controls {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: end;
}

.mono-color-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.mono-color-field span {
  grid-column: 1 / -1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}

.mono-color-field input[type="color"] {
  width: 64px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
}

.mono-color-field input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.mono-color-field input[type="text"]:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.mono-mode-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mono-slider-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mono-range {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mono-range .pfb-slider {
  flex: 1;
}

.mono-spectrum-panel {
  padding: 18px;
}

.mono-spectrum {
  min-height: 300px;
  border-radius: var(--r-lg);
  padding: 26px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.42);
}

.mono-spectrum-copy {
  min-width: 280px;
  padding: 22px;
  border-radius: var(--r);
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 54px rgba(0,0,0,.18);
}

.mono-spectrum-copy span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .76;
}

.mono-spectrum-copy strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.1;
}

.mono-spectrum-copy small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .78;
}

.mono-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mono-swatch {
  min-height: 148px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 5px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.mono-swatch:hover,
.mono-swatch.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.mono-swatch span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 11px;
  font-weight: 700;
}

.mono-swatch strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.mono-swatch small {
  font-size: 11px;
  opacity: .76;
}

.mono-preview {
  display: grid;
  gap: 14px;
}

.mono-preview-shell {
  min-height: 320px;
  padding: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  display: grid;
  gap: 16px;
}

.mono-preview-top {
  height: 56px;
  padding: 0 16px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  gap: 12px;
}

.mono-preview-top span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.mono-preview-top strong {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-right: auto;
}

.mono-preview-top button {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r);
  font-weight: 700;
}

.mono-preview-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mono-preview-body section {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.mono-preview-body small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .62;
}

.mono-preview-body strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.1;
}

.mono-preview-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  opacity: .78;
}

.mono-preview-strip {
  display: flex;
  height: 54px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.mono-preview-strip i {
  flex: 1;
}

.mono-detail {
  overflow: hidden;
  padding: 0;
}

.mono-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.mono-detail-swatch span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.mono-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.mono-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Value Preview — 明度对比 / 黑白稿预览
   ============================================================ */
.value-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.value-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.value-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.value-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.value-controls {
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(180px, auto) minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
}

.value-mode-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.value-range {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.value-range .pfb-slider {
  flex: 1;
}

.value-preview-panel {
  padding: 18px;
}

.value-preview-stage {
  min-height: 360px;
  padding: 26px;
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.42);
}

.value-preview-copy {
  padding: 22px;
  border-radius: var(--r);
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 54px rgba(0,0,0,.18);
}

.value-preview-copy span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .76;
}

.value-preview-copy strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.08;
}

.value-preview-copy small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .78;
}

.value-preview-ui {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
}

.value-ui-card {
  min-height: 218px;
  padding: 22px;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.28);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
  box-shadow: 0 18px 54px rgba(0,0,0,.12);
}

.value-ui-card span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .66;
}

.value-ui-card strong {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.1;
}

.value-ui-card p,
.value-ui-card small {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  opacity: .78;
}

.value-ui-card button {
  width: fit-content;
  height: 36px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: var(--r);
  font-weight: 700;
}

.value-ui-side span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

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

.value-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 10px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.value-card:hover,
.value-card.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.value-card-swatches {
  grid-row: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.value-card-swatches i {
  min-height: 82px;
}

.value-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.value-card-copy strong {
  font-family: var(--font-serif);
  font-size: 20px;
}

.value-card-copy small {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 11px;
}

.value-meter {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border-light);
}

.value-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}

.value-pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.value-pair {
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.value-pair-swatches {
  height: 46px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.value-pair strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
}

.value-pair small {
  color: var(--muted);
  font-size: 12px;
}

.value-pair > span {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.value-pair.ok > span {
  color: var(--success);
  background: rgba(29,131,72,.12);
}

.value-pair.warn > span {
  color: var(--warn);
  background: rgba(183,89,10,.12);
}

.value-pair.bad > span {
  color: var(--danger);
  background: rgba(192,57,43,.12);
}

.value-detail {
  overflow: hidden;
  padding: 0;
}

.value-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.value-detail-swatch span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.value-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.value-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Temperature — 冷暖对比分析器
   ============================================================ */
.temp-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.temp-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.temp-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.temp-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.temp-controls {
  display: grid;
  grid-template-columns: minmax(360px, auto) minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
}

.temp-mode-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.temp-range {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.temp-range .pfb-slider {
  flex: 1;
}

.temp-hero-panel {
  padding: 18px;
}

.temp-hero {
  min-height: 340px;
  padding: 26px;
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.42);
}

.temp-hero-copy {
  padding: 22px;
  border-radius: var(--r);
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 54px rgba(0,0,0,.18);
}

.temp-hero-copy span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .76;
}

.temp-hero-copy strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.08;
}

.temp-hero-copy small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .78;
}

.temp-balance {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--r);
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.temp-balance-row {
  display: grid;
  grid-template-columns: 54px 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: #fff;
}

.temp-balance-row span,
.temp-balance-row strong {
  font-weight: 800;
  text-shadow: 0 1px 10px rgba(0,0,0,.18);
}

.temp-balance-row i {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.24);
}

.temp-balance-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.temp-balance-row.cool b { background: #1F6DFF; }
.temp-balance-row.neutral b { background: #F5F5F7; }
.temp-balance-row.warm b { background: #FF5A4E; }

.temp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.temp-card {
  min-height: 148px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 5px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.temp-card:hover,
.temp-card.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.temp-card span {
  margin-bottom: auto;
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 11px;
  font-weight: 800;
}

.temp-card strong {
  font-family: var(--font-mono);
  font-size: 15px;
}

.temp-card small {
  font-size: 11px;
  opacity: .76;
}

.temp-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.temp-preview-card {
  min-height: 204px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.temp-preview-card span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
  opacity: .62;
}

.temp-preview-card strong {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.15;
}

.temp-preview-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  opacity: .78;
}

.temp-preview-strip {
  grid-column: 1 / -1;
  height: 56px;
  padding: 8px;
  display: flex;
  gap: 8px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.temp-preview-strip i {
  flex: 1;
  border-radius: 8px;
}

.temp-detail {
  overflow: hidden;
  padding: 0;
}

.temp-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.temp-detail-swatch span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.temp-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
}

.temp-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

/* ============================================================
   Area Contrast — 面积对比模拟器
   ============================================================ */
.area-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.area-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.area-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.area-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.area-controls,
.area-slider-grid {
  display: grid;
  gap: 12px;
}

.area-controls {
  grid-template-columns: minmax(300px, auto) repeat(3, auto);
  align-items: center;
}

.area-mode-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.area-slider-grid {
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.area-range {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.area-range .pfb-slider {
  flex: 1;
}

.area-stage-panel {
  padding: 18px;
}

.area-stage {
  min-height: 430px;
  padding: 26px;
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: minmax(240px, .55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.42);
}

.area-stage-copy {
  padding: 22px;
  border-radius: var(--r);
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 54px rgba(0,0,0,.18);
}

.area-stage-copy span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .76;
}

.area-stage-copy strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1.05;
}

.area-stage-copy small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .78;
}

.area-composition {
  min-height: 310px;
  padding: 14px;
  border-radius: var(--r);
  background: rgba(255,255,255,.24);
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  display: grid;
  gap: 12px;
}

.area-composition.ui {
  grid-template-columns: 1fr .34fr;
}

.area-composition.poster {
  grid-template-columns: 1.2fr .55fr;
  grid-template-rows: 1fr .32fr;
}

.area-composition.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.area-block {
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  font-weight: 800;
  box-shadow: 0 16px 38px rgba(0,0,0,.12);
}

.area-block.ui-bg {
  min-height: 280px;
}

.area-block.ui-bg div {
  margin-top: auto;
  min-height: 92px;
  padding: 18px;
  border-radius: var(--r-sm);
}

.area-block.ui-bg button {
  width: fit-content;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r);
  font-weight: 800;
}

.area-block.ui-panel {
  min-height: 280px;
}

.poster-main {
  grid-row: 1 / -1;
}

.poster-accent {
  min-height: 88px;
}

.card-cell {
  min-height: 84px;
}

.area-bars {
  display: grid;
  gap: 12px;
}

.area-bar {
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 52px 92px;
  gap: 12px;
  align-items: center;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, outline-color .18s ease;
}

.area-bar:hover,
.area-bar.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.area-bar i {
  height: 18px;
  border-radius: 999px;
  min-width: 16px;
}

.area-bar span {
  font-weight: 800;
}

.area-bar strong,
.area-bar small {
  font-family: var(--font-mono);
}

.area-bar small {
  color: var(--muted);
}

.area-warnings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.area-warning {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  display: grid;
  gap: 6px;
}

.area-warning strong {
  font-family: var(--font-serif);
  font-size: 20px;
}

.area-warning span {
  color: var(--muted);
  line-height: 1.65;
}

.area-warning.ok { border-color: rgba(29,131,72,.28); background: rgba(29,131,72,.06); }
.area-warning.warn { border-color: rgba(183,89,10,.3); background: rgba(183,89,10,.06); }
.area-warning.bad { border-color: rgba(192,57,43,.3); background: rgba(192,57,43,.06); }

.area-detail {
  overflow: hidden;
  padding: 0;
}

.area-detail-swatch {
  min-height: 184px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.area-detail-swatch span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .72;
}

.area-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1;
}

.area-detail-swatch small {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: .78;
}

@media (max-width: 1120px) {
  .area-main {
    grid-template-columns: 1fr;
  }

  .area-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .area-controls,
  .area-slider-grid,
  .area-stage,
  .area-warnings {
    grid-template-columns: 1fr;
  }

  .area-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .temp-main {
    grid-template-columns: 1fr;
  }

  .temp-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .temp-controls,
  .temp-hero,
  .temp-preview {
    grid-template-columns: 1fr;
  }

  .temp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .value-main {
    grid-template-columns: 1fr;
  }

  .value-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .value-controls,
  .value-preview-stage,
  .value-preview-ui,
  .value-grid,
  .value-pairs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .mono-main {
    grid-template-columns: 1fr;
  }

  .mono-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .mono-controls,
  .mono-slider-row,
  .mono-preview-body {
    grid-template-columns: 1fr;
  }

  .mono-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .hue-main {
    grid-template-columns: 1fr;
  }

  .hue-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .hue-hero-grid,
  .hue-preview {
    grid-template-columns: 1fr;
  }

  .hue-mode-grid,
  .hue-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .blend-main {
    grid-template-columns: 1fr;
  }

  .blend-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .blend-color-controls,
  .blend-slider-row,
  .blend-preview {
    grid-template-columns: 1fr;
  }

  .blend-ramp {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .gradient-main {
    grid-template-columns: 1fr;
  }

  .gradient-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .gradient-controls,
  .gradient-stops {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .tokens-main {
    grid-template-columns: 1fr;
  }

  .tokens-rail {
    position: static;
  }
}

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

  .tokens-status-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .contrast-main {
    grid-template-columns: 1fr;
  }

  .contrast-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .contrast-controls,
  .contrast-preview {
    grid-template-columns: 1fr;
  }

  .contrast-candidates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .scale-main {
    grid-template-columns: 1fr;
  }

  .scale-rail {
    position: static;
  }
}

@media (max-width: 900px) {
  .scale-controls,
  .scale-preview {
    grid-template-columns: 1fr;
  }

  .scale-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .extractor-main {
    grid-template-columns: 1fr;
  }

  .extractor-rail {
    position: static;
  }
}

@media (max-width: 760px) {
  .extractor-main {
    padding: 24px;
  }

  .extractor-panel-head {
    flex-direction: column;
  }

  .extractor-actions,
  .extractor-range {
    width: 100%;
  }

  .extractor-palette-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================
   Itten Contrast Tool
   ========================================== */

.itten-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.itten-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.itten-rail {
  display: grid;
  align-content: start;
  gap: 16px;
  position: sticky;
  top: var(--rail-sticky-top);
}

.itten-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.itten-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(31, 63, 217, .12), transparent 34%),
    linear-gradient(135deg, #fff, #f6f7fb 52%, #fff9e8);
}

.itten-hero-copy {
  align-self: center;
  padding: 18px 0;
}

.itten-hero-copy h1 {
  margin: 12px 0 12px;
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1.05;
  color: var(--ink);
}

.itten-hero-copy p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.itten-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.itten-demo {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-self: center;
  min-height: 230px;
  padding: 16px;
  border-radius: 34px;
  background: rgba(255, 255, 255, .66);
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, .08), 0 28px 80px rgba(29, 29, 31, .12);
}

.itten-demo span {
  display: grid;
  place-items: center;
  min-height: 184px;
  border-radius: 24px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.itten-demo.light-dark span,
.itten-demo.saturation span {
  border-radius: 999px;
}

.itten-demo.extension {
  grid-template-columns: 2.3fr 1.4fr .8fr .6fr .4fr;
}

.itten-demo.simultaneous span:nth-child(2),
.itten-demo.simultaneous span:nth-child(4) {
  transform: translateY(28px);
}

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

.itten-card {
  display: grid;
  gap: 14px;
  min-height: 172px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.itten-card:hover,
.itten-card.active {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: 0 18px 44px rgba(29, 29, 31, .10);
}

.itten-card-demo {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  height: 56px;
  border-radius: 18px;
  background: #f4f5f8;
}

.itten-card-demo i,
.itten-preview-strip i,
.itten-detail-swatches i {
  display: block;
}

.itten-card strong {
  font-size: 20px;
  color: var(--ink);
}

.itten-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.itten-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.itten-preview-card {
  display: grid;
  gap: 12px;
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
}

.itten-preview-card span,
.itten-detail-head span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: .68;
}

.itten-preview-card strong {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.1;
}

.itten-preview-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
  opacity: .74;
}

.itten-preview-card button {
  align-self: end;
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
}

.itten-preview-card.quiet {
  color: var(--ink);
}

.itten-preview-card.strip {
  align-content: space-between;
  grid-column: 1 / -1;
}

.itten-preview-strip,
.itten-detail-swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.itten-preview-strip i {
  height: 82px;
  border-radius: 18px;
}

.itten-detail-head {
  display: grid;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.itten-detail-head strong {
  font-family: var(--font-serif);
  font-size: 34px;
  color: var(--ink);
}

.itten-detail-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.itten-detail-swatches {
  margin: 20px 0;
}

.itten-detail-swatches i {
  height: 58px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, .08);
}

@media (max-width: 1120px) {
  .itten-main {
    grid-template-columns: 1fr;
  }

  .itten-rail {
    position: static;
  }

  .itten-hero,
  .itten-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .itten-main {
    padding: 24px;
  }

  .itten-grid {
    grid-template-columns: 1fr;
  }

  .itten-demo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .itten-demo span {
    min-height: 120px;
  }
}

/* ==========================================
   Inspiration Palette Library
   ========================================== */

.inspiration-filter-bar {
  position: sticky;
  top: var(--project-status-h);
  z-index: 80;
}

.inspiration-filter-inner {
  min-height: 64px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.inspiration-tone-group {
  flex-wrap: nowrap;
}

.inspiration-search {
  margin-left: auto;
  min-width: 260px;
  height: 42px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--surface);
}

.inspiration-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inspiration-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
}

.inspiration-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.inspiration-workspace {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.inspiration-grid-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.inspiration-card {
  overflow: hidden;
  display: grid;
  min-height: 220px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.inspiration-card:hover,
.inspiration-card.active {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: 0 20px 52px rgba(29, 29, 31, .10);
}

.inspiration-card-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: 92px;
}

.inspiration-card-strip i {
  display: block;
}

.inspiration-card-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.inspiration-card-body strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.inspiration-card-body small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.inspiration-card-body span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inspiration-card-body em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.inspiration-rail {
  position: sticky;
  top: calc(var(--header-h) + var(--project-status-h) + 84px);
  display: grid;
  gap: 16px;
}

.inspiration-detail {
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h) - var(--project-status-h) - 84px - 24px);
  overscroll-behavior: contain;
}
.inspiration-detail::-webkit-scrollbar { width: 4px; }
.inspiration-detail::-webkit-scrollbar-track { background: transparent; }
.inspiration-detail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.inspiration-detail-hero {
  min-height: 210px;
  padding: 24px;
  display: grid;
  align-content: end;
  gap: 10px;
}

.inspiration-detail-hero span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: .72;
}

.inspiration-detail-hero strong {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.12;
}

.inspiration-detail-hero small {
  line-height: 1.7;
  opacity: .78;
}

.inspiration-detail-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.inspiration-detail-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.inspiration-detail-strip button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.inspiration-preview {
  display: grid;
  grid-template-columns: 1fr 54px 54px 54px;
  gap: 8px;
  min-height: 160px;
}

.inspiration-preview div {
  grid-row: span 3;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
}

.inspiration-preview div span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .65;
}

.inspiration-preview div strong {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.15;
}

.inspiration-preview div p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  opacity: .72;
}

.inspiration-preview div button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.inspiration-preview i {
  display: block;
  border-radius: 16px;
}

@media (max-width: 1180px) {
  .inspiration-main {
    grid-template-columns: 1fr;
  }

  .inspiration-rail {
    position: static;
  }
}

@media (max-width: 980px) {
  .inspiration-filter-inner {
    overflow-x: auto;
    padding: 0 24px;
  }

  .inspiration-search {
    min-width: 220px;
  }

  .inspiration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .inspiration-main {
    padding: 24px;
  }

  .inspiration-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   Pantone Spot Match
   ========================================== */

.pantone-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.pantone-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.pantone-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.pantone-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.pantone-controls {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr auto;
  gap: 14px;
  align-items: center;
}

.pantone-color-field {
  min-height: 54px;
  padding: 7px 12px;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  background: var(--surface);
  display: grid;
  grid-template-columns: auto 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.pantone-color-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pantone-color-field input[type="color"] {
  width: 40px;
  height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
}

.pantone-color-field input[type="text"] {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
}

.pantone-mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pantone-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}

.pantone-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pantone-chip {
  min-height: 230px;
  padding: 24px;
  border-radius: 30px;
  display: grid;
  align-content: end;
  gap: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.pantone-chip span,
.pantone-detail-swatch span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: .72;
}

.pantone-chip strong {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.05;
}

.pantone-score {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 30px;
  background: var(--surface);
  display: grid;
  align-content: center;
  gap: 12px;
}

.pantone-score-badge,
.pantone-result em,
.pantone-batch-row em {
  justify-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.pantone-score-badge.ok,
.pantone-result em.ok,
.pantone-batch-row em.ok {
  background: #D9F8E7;
  color: #16784A;
}

.pantone-score-badge.warn,
.pantone-result em.warn,
.pantone-batch-row em.warn {
  background: #FFF4CE;
  color: #9A6500;
}

.pantone-score-badge.bad,
.pantone-result em.bad,
.pantone-batch-row em.bad {
  background: #FFE2DE;
  color: #B23024;
}

.pantone-score strong {
  font-family: var(--font-serif);
  font-size: 42px;
}

.pantone-score p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.pantone-results {
  display: grid;
  gap: 10px;
}

.pantone-result {
  width: 100%;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.pantone-result:hover,
.pantone-result.active {
  transform: translateY(-1px);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.pantone-result i,
.pantone-batch-row i {
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, .08);
}

.pantone-result span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pantone-result strong,
.pantone-batch-row .to {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.pantone-result small,
.pantone-batch-row .from {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.pantone-batch {
  display: grid;
  gap: 8px;
}

.pantone-batch-row {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 42px 88px 22px 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.pantone-batch-row i {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.pantone-batch-row .arrow {
  color: var(--muted);
  font-weight: 900;
}

.pantone-detail {
  padding: 0;
  overflow: hidden;
}

.pantone-detail-swatch {
  min-height: 210px;
  padding: 24px;
  display: grid;
  align-content: end;
  gap: 10px;
}

.pantone-detail-swatch strong {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.1;
}

.pantone-detail-swatch small {
  font-size: 13px;
  opacity: .72;
}

.pantone-note .screen-panel-sub {
  line-height: 1.8;
}

@media (max-width: 1180px) {
  .pantone-main {
    grid-template-columns: 1fr;
  }

  .pantone-rail {
    position: static;
  }
}

@media (max-width: 920px) {
  .pantone-controls,
  .pantone-hero,
  .pantone-compare {
    grid-template-columns: 1fr;
  }

  .pantone-batch-row {
    grid-template-columns: 42px 1fr;
  }

  .pantone-batch-row .arrow {
    display: none;
  }
}

/* ==========================================
   Scene Preview
   ========================================== */

.scene-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.scene-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.scene-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

.scene-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.scene-controls {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
}

.scene-mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scene-range {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--surface);
}

.scene-stage {
  min-height: 500px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--scene-accent) 24%, transparent), transparent 34%),
    linear-gradient(135deg, #f8f8fa, #eef0f5);
  padding: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.scene-card-stack {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}

.scene-business-card {
  aspect-ratio: 1.72 / 1;
  border-radius: 26px;
  padding: 30px;
  display: grid;
  align-content: end;
  gap: 10px;
  box-shadow: 0 28px 70px rgba(29, 29, 31, .16);
}

.scene-business-card.front {
  transform: translateY(-16px) rotate(-2deg);
}

.scene-business-card.back {
  transform: translateY(22px) rotate(2deg);
}

.scene-logo {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 800;
  top: 28px;
  left: 28px;
}

.scene-business-card strong,
.scene-box strong,
.scene-pouch strong,
.scene-letter strong,
.scene-detail-hero strong {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.1;
}

.scene-business-card small,
.scene-business-card p {
  margin: 0;
  opacity: .72;
  line-height: 1.6;
}

.scene-mini-line {
  width: var(--scene-weight);
  height: 8px;
  border-radius: 99px;
}

.scene-vi-board {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  grid-template-rows: 230px 150px;
  gap: 18px;
}

.scene-letter,
.scene-envelope,
.scene-badge,
.scene-signage {
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(29, 29, 31, .13);
}

.scene-letter {
  grid-row: span 2;
  display: grid;
  align-content: start;
  gap: 16px;
}

.scene-letter span {
  width: var(--scene-weight);
  height: 12px;
  border-radius: 99px;
}

.scene-letter p {
  margin: 0;
  color: inherit;
  opacity: .65;
}

.scene-letter i {
  display: block;
  width: 42%;
  height: 42px;
  border-radius: 16px;
}

.scene-envelope {
  display: grid;
  align-content: space-between;
}

.scene-envelope span,
.scene-signage span,
.scene-box span,
.scene-pouch p,
.scene-label span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: .75;
}

.scene-envelope i {
  display: block;
  width: 70%;
  height: 10px;
  border-radius: 99px;
}

.scene-badge {
  display: grid;
  place-items: center;
}

.scene-badge strong {
  font-family: var(--font-serif);
  font-size: 72px;
}

.scene-signage {
  display: grid;
  align-content: space-between;
}

.scene-signage strong {
  font-size: 54px;
}

.scene-packaging-board {
  width: min(850px, 100%);
  display: grid;
  grid-template-columns: 1fr .86fr .72fr;
  gap: 22px;
  align-items: end;
}

.scene-box,
.scene-pouch,
.scene-label {
  border-radius: 30px;
  padding: 26px;
  box-shadow: 0 28px 72px rgba(29, 29, 31, .16);
}

.scene-box {
  min-height: 380px;
  display: grid;
  align-content: space-between;
}

.scene-box i {
  display: block;
  width: var(--scene-weight);
  height: 18px;
  border-radius: 99px;
}

.scene-pouch {
  min-height: 300px;
  display: grid;
  align-content: end;
  gap: 12px;
  border-bottom-left-radius: 70px;
  border-bottom-right-radius: 70px;
}

.scene-pouch span {
  width: 76px;
  height: 76px;
  border-radius: 50%;
}

.scene-label {
  min-height: 210px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.scene-label p {
  margin: 0;
  opacity: .7;
  line-height: 1.7;
}

.scene-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scene-template-card {
  min-height: 160px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: 22px;
  background: var(--surface);
  display: grid;
  align-content: start;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.scene-template-card:hover,
.scene-template-card.active {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.scene-template-card span,
.scene-detail-hero span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.scene-template-card strong {
  font-size: 22px;
  color: var(--ink);
}

.scene-template-card small {
  color: var(--muted);
  line-height: 1.7;
}

.scene-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.scene-check {
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.scene-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scene-check strong {
  font-family: var(--font-serif);
  font-size: 26px;
}

.scene-check small {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.scene-check.ok small {
  background: #D9F8E7;
  color: #16784A;
}

.scene-check.warn small {
  background: #FFF4CE;
  color: #9A6500;
}

.scene-check.bad small {
  background: #FFE2DE;
  color: #B23024;
}

.scene-detail {
  padding: 0;
  overflow: hidden;
}

.scene-detail-hero {
  min-height: 190px;
  padding: 24px;
  display: grid;
  align-content: end;
  gap: 10px;
}

.scene-detail-hero span {
  color: inherit;
  opacity: .72;
}

.scene-detail-hero small {
  opacity: .75;
}

.scene-detail-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 18px;
}

.scene-detail-strip i {
  display: block;
  height: 52px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, .08);
}

@media (max-width: 1180px) {
  .scene-main {
    grid-template-columns: 1fr;
  }

  .scene-rail {
    position: static;
  }
}

@media (max-width: 920px) {
  .scene-controls,
  .scene-card-stack,
  .scene-vi-board,
  .scene-packaging-board,
  .scene-template-grid,
  .scene-checks {
    grid-template-columns: 1fr;
  }
}

/* ====== Screen Picker (sp-) ====== */

.sp-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 32px 48px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.sp-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.sp-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

body.has-project-status .sp-rail {
  top: calc(var(--header-h) + var(--project-status-h) + 24px);
}

/* Compatibility notice */
.sp-compat-notice {
  display: none;
  align-items: flex-start;
  gap: 10px;
  background: #FFF8EC;
  border: 1px solid #F2C744;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--warn);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Hero section */
.sp-hero {
  display: flex;
  align-items: center;
  gap: 32px;
}

.sp-preview-big {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  transition: background 0.2s;
  cursor: default;
}

.sp-preview-hex {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.9;
  user-select: all;
}

.sp-hero-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Pick button */
.sp-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  align-self: flex-start;
}

.sp-pick-btn:hover {
  background: var(--ink-2);
}

.sp-pick-btn:active {
  transform: scale(0.97);
}

.sp-pick-btn--active {
  background: var(--accent);
  opacity: 0.85;
  cursor: wait;
}

/* Manual input row */
.sp-manual-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-native-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.sp-native-wrap input[type="color"] {
  width: 38px;
  height: 38px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  cursor: pointer;
  background: var(--surface);
}

.sp-native-wrap span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.sp-hex-input {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  width: 108px;
  text-transform: uppercase;
  transition: border-color 0.15s;
}

.sp-hex-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Info panel */
.sp-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Colour bar (shade strip) */
.sp-color-bar {
  display: flex;
  border-radius: var(--r-sm);
  overflow: hidden;
  height: 56px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.sp-bar-swatch {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px 8px;
  border: none;
  cursor: pointer;
  transition: flex 0.2s;
  min-width: 0;
}

.sp-bar-swatch:hover,
.sp-bar-swatch.is-base {
  flex: 1.7;
}

.sp-bar-swatch.is-base {
  outline: 3px solid rgba(255,255,255,0.5);
  outline-offset: -3px;
}

.sp-bar-swatch small {
  font-size: 10px;
  opacity: 0.7;
  display: block;
  white-space: nowrap;
  overflow: hidden;
}

.sp-bar-swatch b {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

/* Values table */
.sp-values {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.sp-value-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}

.sp-value-row:last-child { border-bottom: none; }
.sp-value-row:nth-child(odd) { background: var(--surface-2); }

.sp-value-key {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  width: 40px;
  flex-shrink: 0;
}

.sp-value-val {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sp-value-val code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  flex: 1;
}

/* Send panel */
.sp-send-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.sp-send-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: left;
}

.sp-send-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,113,227,0.12);
  transform: translateY(-1px);
}

.sp-send-item:active {
  transform: translateY(0);
  box-shadow: none;
}

.sp-send-preview {
  display: block;
  width: 100%;
  height: 28px;
  border-radius: var(--r-sm);
  margin-bottom: 2px;
  transition: background 0.3s;
}

.sp-send-item strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.sp-send-item small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

/* History panel */
.sp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sp-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  overflow-y: auto;
}

.sp-history-empty {
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  padding: 24px 0;
}

.sp-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  width: 100%;
}

.sp-history-item:hover {
  background: var(--surface-2);
}

.sp-history-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.sp-history-hex {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  flex: 1;
}

.sp-history-time {
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 1100px) {
  .sp-main {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .sp-rail {
    position: static;
  }

  .sp-send-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .sp-main {
    padding: 16px;
  }

  .sp-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .sp-preview-big {
    width: 100%;
    height: 120px;
  }

  .sp-send-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ====== Limited Palette (lp-) ====== */

.lp-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 32px 48px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.lp-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.lp-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

body.has-project-status .lp-rail {
  top: calc(var(--header-h) + var(--project-status-h) + 24px);
}

.lp-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

/* Drop zone */
.lp-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  min-height: 260px;
  display: flex;
  align-items: stretch;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
  overflow: hidden;
}

.lp-drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.lp-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 260px;
}

.lp-image-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  padding: 32px;
}

.lp-image-empty svg { opacity: 0.45; }

.lp-image-empty strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.lp-image-empty small {
  font-size: 12px;
  color: var(--muted-2);
}

.lp-displayed-img {
  max-width: 100%;
  max-height: 360px;
  width: 100%;
  object-fit: contain;
  display: block;
  cursor: crosshair;
  user-select: none;
  -webkit-user-drag: none;
}

.lp-canvas-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Slots */
.lp-count-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.lp-slots-grid {
  display: grid;
  grid-template-columns: repeat(var(--lp-count, 3), 1fr);
  gap: 10px;
}

.lp-slot {
  position: relative;
  border-radius: var(--r);
  border: 2px solid var(--border-light);
  min-height: 110px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  overflow: hidden;
}

.lp-slot:hover { border-color: var(--border); }

.lp-slot.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.18);
}

.lp-slot.is-active:hover { border-color: var(--accent); }

.lp-slot-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.7;
}

.lp-slot-hex {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  margin-top: auto;
}

.lp-slot-empty {
  font-size: 11px;
  opacity: 0.55;
  line-height: 1.5;
  margin-top: auto;
}

.lp-slot-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  color: inherit;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  border: none;
}

.lp-slot:hover .lp-slot-clear { opacity: 1; }
.lp-slot-clear:hover { background: rgba(0,0,0,0.35); }

.lp-slot-active-ring {
  position: absolute;
  inset: -1px;
  border-radius: var(--r);
  border: 2px solid var(--accent);
  pointer-events: none;
}

/* The inline HEX input inside each slot */
.lp-slot-input {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  background: rgba(0,0,0,0.15);
  color: inherit;
  opacity: 0;
  transition: opacity 0.15s;
  outline: none;
}

.lp-slot:hover .lp-slot-input,
.lp-slot.is-active .lp-slot-input {
  opacity: 1;
}

.lp-slot.is-filled .lp-slot-input {
  bottom: 10px;
}

/* Preview canvases */
.lp-preview-canvases {
  display: flex;
  gap: 12px;
  margin: 16px 0 12px;
}

.lp-preview-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.lp-preview-item canvas {
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-light);
  display: block;
}

.lp-preview-item span {
  font-size: 11px;
  color: var(--muted);
}

/* Coverage bars */
.lp-coverage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.lp-cov-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-cov-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lp-cov-hex {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  width: 68px;
  flex-shrink: 0;
}

.lp-cov-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 99px;
  overflow: hidden;
}

.lp-cov-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.lp-cov-pct {
  font-size: 11px;
  color: var(--muted);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* Mode panel */
.lp-mode-tabs {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

/* Score ring */
.lp-score-ring {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 16px auto 10px;
}

.lp-score-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.lp-score-label strong {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
}

.lp-score-label small {
  font-size: 10px;
  color: var(--muted);
}

.lp-score-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  padding: 0 4px;
  margin-top: 4px;
}

/* Challenge reveal */
.lp-reveal {
  margin-top: 14px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-reveal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-reveal-label {
  font-size: 11px;
  color: var(--muted);
  width: 44px;
  flex-shrink: 0;
}

.lp-reveal-swatches {
  display: flex;
  gap: 3px;
  flex: 1;
}

.lp-reveal-swatches span {
  flex: 1;
  height: 20px;
  border-radius: 4px;
}

.lp-reveal-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

.lp-reveal-score.is-great { color: var(--success); }
.lp-reveal-score.is-good  { color: var(--accent); }
.lp-reveal-score.is-ok    { color: var(--warn); }
.lp-reveal-score.is-poor  { color: var(--danger); }

.lp-reveal-verdict {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}

/* Responsive */
@media (max-width: 1100px) {
  .lp-main {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .lp-rail { position: static; }

  .lp-preview-canvases { flex-direction: row; }
}

@media (max-width: 720px) {
  .lp-main { padding: 16px; }

  .lp-slots-grid { grid-template-columns: repeat(3, 1fr); }

  .lp-panel-head { flex-direction: column; gap: 10px; }
}

/* ====== Brand Reverse (br-) ====== */

.br-main {
  display: grid;
  grid-template-columns: 1fr 288px;
  gap: 24px;
  padding: 32px 48px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.br-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.br-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

body.has-project-status .br-rail {
  top: calc(var(--header-h) + var(--project-status-h) + 24px);
}

/* Input panel */
.br-input-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.br-seed-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.br-seed-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--r);
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: background 0.2s;
}

.br-seed-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.br-native-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.br-native-wrap input[type="color"] {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  background: var(--surface);
  cursor: pointer;
}

.br-native-wrap span {
  font-size: 10px;
  color: var(--muted);
}

.br-hex-input {
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  width: 120px;
  text-transform: uppercase;
  transition: border-color 0.15s;
}

.br-hex-input:focus { outline: none; border-color: var(--accent); }

.br-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Controls */
.br-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.br-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.br-control-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

/* System / Groups panel */
.br-system-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.br-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.br-group {
  border: 1.5px solid var(--border-light);
  border-radius: var(--r);
  padding: 14px 16px;
  transition: border-color 0.15s;
}

.br-group.is-selected { border-color: var(--accent); }

.br-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.br-group-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.br-group-title strong { font-size: 13px; font-weight: 700; }

.br-group-title span { font-size: 11px; color: var(--muted); }

.br-group-token-dots {
  display: flex;
  gap: 4px;
}

.br-group-token-dots span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: block;
}

/* Scale swatches */
.br-scale {
  display: flex;
  border-radius: var(--r-sm);
  overflow: hidden;
  height: 52px;
}

.br-swatch {
  flex: 1;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px 3px;
  transition: flex 0.2s;
  min-width: 0;
  position: relative;
}

.br-swatch:hover { flex: 2; z-index: 1; }

.br-swatch-stop {
  font-size: 9px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  overflow: hidden;
}

.br-swatch:hover .br-swatch-stop { opacity: 0.85; }

/* Tokens grid */
.br-tokens-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 4px;
}

.br-token-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--muted);
  margin-bottom: 8px;
}

.br-token-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
}

.br-token-row:last-child { border-bottom: none; }

.br-token-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.br-token-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.br-token-hex {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  width: 68px;
  flex-shrink: 0;
}

.br-token-copy {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--muted);
  flex-shrink: 0;
}

.br-token-copy:hover { color: var(--ink); border-color: var(--border); }

/* Badges */
.br-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.br-badge--aaa   { background: #D5F0E3; color: #1D8348; }
.br-badge--aa    { background: #D6EAF8; color: #0071E3; }
.br-badge--large { background: #FEF9E7; color: #B7590A; }
.br-badge--fail  { background: #FDECEA; color: #C0392B; }

/* Detail panel */
.br-detail-empty {
  color: var(--muted-2);
  font-size: 13px;
  padding: 20px 0;
  text-align: center;
}

.br-detail-swatch {
  height: 100px;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px;
  margin-bottom: 12px;
  transition: background 0.2s;
}

.br-detail-swatch span { font-size: 11px; opacity: 0.75; }
.br-detail-swatch strong { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }

/* Rationale */
.br-rationale-body p {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.7;
}

/* UI Mock */
.br-ui-mock {
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 4px;
}

.br-mock { font-size: 12px; }

.br-mock-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 44px;
}

.br-mock-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }

.br-mock-logo {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
}

.br-mock-nav-links { display: flex; gap: 18px; flex: 1; font-size: 12px; }

.br-mock-btn-outline {
  padding: 5px 12px; border-radius: 6px; background: transparent;
  border: 1.5px solid; font-size: 11px; font-weight: 600; cursor: pointer;
}

.br-mock-body { display: flex; min-height: 240px; }

.br-mock-sidebar {
  width: 120px; flex-shrink: 0;
  border-right: 1px solid; padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}

.br-mock-sidebar-item {
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  font-size: 11px; transition: background 0.1s;
}

.br-mock-content { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.br-mock-hero {
  border-radius: 8px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.br-mock-hero-text { flex: 1; }

.br-mock-cta {
  padding: 7px 14px; border-radius: 6px; border: none;
  font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}

.br-mock-stats { display: flex; gap: 8px; }

.br-mock-stat-card {
  flex: 1; border: 1px solid; border-radius: 8px; padding: 10px 10px;
  display: flex; align-items: center; gap: 8px;
}

.br-mock-stat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.br-mock-stat-body { min-width: 0; }

.br-mock-card {
  border: 1px solid; border-radius: 8px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}

.br-mock-card-head { display: flex; align-items: center; justify-content: space-between; }

.br-mock-card-head span:first-child { font-size: 12px; }

.br-mock-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
}

.br-mock-card-body { font-size: 11px; line-height: 1.5; }
.br-mock-card-actions { display: flex; gap: 8px; margin-top: 2px; }

/* Responsive */
@media (max-width: 1100px) {
  .br-main {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .br-rail { position: static; }
}

@media (max-width: 720px) {
  .br-main { padding: 16px; }
  .br-controls { flex-direction: column; }
  .br-mock-sidebar { display: none; }
  .br-mock-stats { flex-wrap: wrap; }
  .br-mock-stats > * { min-width: calc(50% - 4px); }
}

/* ====== OKLCH Scale (ok-) ====== */

.ok-main {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 24px;
  padding: 32px 48px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.ok-workspace { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.ok-rail {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
body.has-project-status .ok-rail { top: calc(var(--header-h) + var(--project-status-h) + 24px); }

/* Input panel */
.ok-input-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}

.ok-seed-row {
  display: flex; align-items: stretch; gap: 16px; margin-bottom: 20px;
}

.ok-seed-swatch {
  width: 80px; height: 80px; border-radius: var(--r);
  display: flex; align-items: flex-end; padding: 8px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  box-shadow: var(--shadow); flex-shrink: 0;
  transition: background 0.2s;
}

.ok-seed-controls { flex: 1; display: flex; flex-direction: column; gap: 10px; }

.ok-seed-inputs { display: flex; align-items: center; gap: 8px; }

.ok-native-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
}
.ok-native-wrap input[type="color"] {
  width: 38px; height: 38px; border: 2px solid var(--border); border-radius: var(--r-sm);
  padding: 2px; background: var(--surface); cursor: pointer;
}
.ok-native-wrap span { font-size: 10px; color: var(--muted); }

.ok-hex-input {
  font-family: var(--font-mono); font-size: 14px; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); width: 108px; text-transform: uppercase;
}
.ok-hex-input:focus { outline: none; border-color: var(--accent); }

/* OKLCH display */
.ok-oklch-display { display: flex; flex-direction: column; gap: 6px; }

.ok-oklch-values { display: flex; gap: 20px; }

.ok-oklch-item {
  display: flex; flex-direction: column; gap: 2px;
}
.ok-oklch-key {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted);
}
.ok-oklch-val {
  font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--ink);
}
.ok-oklch-desc { font-size: 10px; color: var(--muted-2); }

.ok-oklch-css {
  font-size: 12px; color: var(--muted);
}
.ok-oklch-css code { font-family: var(--font-mono); font-size: 12px; }

.ok-control-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted); margin-bottom: 2px;
}
.ok-chroma-tabs { display: flex; flex-direction: column; gap: 6px; }

/* Panel head */
.ok-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}

/* Scale grid */
.ok-scale-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
}

.ok-swatch-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.ok-swatch {
  width: 100%; aspect-ratio: 1 / 1.4;
  border-radius: var(--r-sm); border: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 5px; position: relative;
  transition: transform 0.12s, box-shadow 0.12s;
}
.ok-swatch:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); z-index: 1; }
.ok-swatch.is-selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.ok-swatch.is-clipped { opacity: 0.88; }

.ok-swatch-stop { font-size: 10px; font-weight: 700; opacity: 0.75; }
.ok-swatch-hex  { font-family: var(--font-mono); font-size: 8.5px; opacity: 0.8; }

.ok-clip-badge {
  position: absolute; top: 3px; right: 3px;
  font-size: 8px; font-weight: 700;
  background: rgba(0,0,0,0.25); border-radius: 3px; padding: 1px 3px;
}

.ok-swatch-css {
  font-family: var(--font-mono); font-size: 8px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center;
}

/* Compare panel */
.ok-compare-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.ok-compare-row { display: flex; align-items: center; gap: 10px; }

.ok-compare-label {
  font-size: 11px; font-weight: 600; color: var(--muted); width: 72px;
  flex-shrink: 0; text-align: right;
}

.ok-compare-swatches { display: flex; flex: 1; gap: 2px; }

.ok-cmp-swatch {
  flex: 1; height: 32px; border-radius: 4px; display: block;
  transition: transform 0.1s;
}
.ok-cmp-swatch:hover { transform: scaleY(1.2); z-index: 1; }
.ok-cmp-grey { height: 20px; }

/* Evenness chart */
.ok-evenness-chart { margin-top: 4px; }

.ok-chart-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted); margin-bottom: 6px;
}
.ok-chart-score strong { color: var(--accent); }

.ok-evenness-legend {
  display: flex; gap: 20px; margin-top: 8px;
}
.ok-legend-oklch::before, .ok-legend-hsl::before {
  content: ''; display: inline-block; width: 20px; height: 2px;
  border-radius: 2px; margin-right: 6px; vertical-align: middle;
}
.ok-legend-oklch { font-size: 11px; color: #0071E3; }
.ok-legend-oklch::before { background: #0071E3; }
.ok-legend-hsl { font-size: 11px; color: var(--muted); }
.ok-legend-hsl::before { background: var(--border); }

/* Code panel */
.ok-code {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); padding: 16px; overflow-x: auto;
  color: var(--ink-2); white-space: pre;
  max-height: 280px; overflow-y: auto;
}

/* Detail panel */
.ok-detail-empty {
  color: var(--muted-2); font-size: 13px; padding: 20px 0; text-align: center;
}
.ok-detail-swatch {
  height: 90px; border-radius: var(--r-sm); display: flex; flex-direction: column;
  justify-content: flex-end; padding: 12px 14px; margin-bottom: 12px;
  transition: background 0.2s;
}
.ok-detail-swatch span  { font-size: 11px; opacity: 0.75; }
.ok-detail-swatch strong { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }

/* Responsive */
@media (max-width: 1180px) {
  .ok-main { grid-template-columns: 1fr; padding: 24px; }
  .ok-rail  { position: static; }
}
@media (max-width: 840px) {
  .ok-main { padding: 16px; }
  .ok-scale-grid { grid-template-columns: repeat(6, 1fr); }
  .ok-swatch-css { display: none; }
}
@media (max-width: 540px) {
  .ok-scale-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   Radix 12阶色阶  (rx-)
   ═══════════════════════════════════════════════════════════ */
.rx-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}
.rx-workspace {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rx-rail {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Input panel */
.rx-input-panel { padding: 20px; }
.rx-input-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.rx-seed-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.rx-seed-swatch {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.rx-seed-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rx-seed-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rx-eye-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rx-name-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
}
.rx-name-label {
  font-size: 11px;
  color: var(--muted-fg);
  font-weight: 500;
}
.rx-name-input {
  width: 110px;
  padding: 6px 9px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-mono);
}
.rx-name-hint {
  font-size: 11px;
  color: var(--muted-fg);
  font-family: var(--font-mono);
}

/* Scale panel */
.rx-scale-panel { padding: 20px; }
.rx-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rx-scale-table {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 6px;
}
.rx-scale-row-label {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-fg);
  font-family: var(--font-mono);
}
.rx-swatches {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  min-height: 70px;
}
.rx-swatches-dark {
  padding: 6px;
  border-radius: 10px;
  transition: background 0.3s;
}
.rx-swatch {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 2px 5px;
  min-height: 64px;
  transition: opacity 0.12s, transform 0.12s;
  overflow: hidden;
}
.rx-swatch:hover { opacity: 0.88; transform: scaleY(1.04); z-index: 2; }
.rx-sw-num {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  opacity: 0.75;
  font-family: var(--font-mono);
}
.rx-sw-cr {
  position: absolute;
  top: 19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  opacity: 0.85;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.rx-sw-hex {
  font-size: 9px;
  font-family: var(--font-mono);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.rx-swatch:hover .rx-sw-hex { opacity: 0.9; }

.rx-step-nums {
  display: flex;
  gap: 0;
  margin-top: 2px;
}
.rx-step-nums-row {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  margin-left: 44px;
}
.rx-step-nums-row span {
  text-align: center;
  font-size: 10px;
  color: var(--muted-fg);
  font-family: var(--font-mono);
}
.rx-zone-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.rx-zl {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.rx-zl.bg     { background: #f1f5f9; color: #475569; }
.rx-zl.comp   { background: #dbeafe; color: #1d4ed8; }
.rx-zl.border { background: #fef3c7; color: #b45309; }
.rx-zl.solid  { background: #dcfce7; color: #15803d; }
.rx-zl.text   { background: #e2e8f0; color: #334155; }

/* Semantic table */
.rx-semantic-panel { padding: 20px; }
.rx-sem-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}
.rx-sem-row.rx-zone-bg     { border-left-color: #94a3b8; background: rgba(148,163,184,.06); }
.rx-sem-row.rx-zone-comp   { border-left-color: #3b82f6; background: rgba(59,130,246,.06); }
.rx-sem-row.rx-zone-border { border-left-color: #f59e0b; background: rgba(245,158,11,.06); }
.rx-sem-row.rx-zone-solid  { border-left-color: #22c55e; background: rgba(34,197,94,.06); }
.rx-sem-row.rx-zone-text   { border-left-color: #64748b; background: rgba(100,116,139,.08); }
.rx-sem-step {
  width: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-fg);
  font-family: var(--font-mono);
  text-align: center;
  flex-shrink: 0;
}
.rx-sem-swatches { display: flex; gap: 3px; flex-shrink: 0; }
.rx-sem-sw {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.08);
}
.rx-sem-sw-dk { border: 1px solid rgba(255,255,255,.12); }
.rx-sem-info { flex: 0 0 200px; }
.rx-sem-en { font-size: 11px; font-weight: 500; color: var(--fg); }
.rx-sem-zh { font-size: 10px; color: var(--muted-fg); margin-top: 1px; }
.rx-sem-eg { flex: 1; font-size: 11px; color: var(--muted-fg); font-family: var(--font-mono); }
.rx-sem-badges { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.rx-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.rx-bp { background: #dcfce7; color: #15803d; }
.rx-bf { background: #fee2e2; color: #b91c1c; }

/* Preview panel */
.rx-preview-panel { padding: 20px; }
.rx-preview-body { border-radius: 8px; overflow: hidden; }

/* Contrast panel */
.rx-contrast-panel { padding: 16px; }
.rx-cr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.rx-cr-row:last-child { border-bottom: none; }
.rx-cr-swatches { display: flex; gap: 2px; flex-shrink: 0; }
.rx-cr-sw { width: 18px; height: 36px; border-radius: 3px; border: 1px solid var(--border); }
.rx-cr-info { flex: 1; min-width: 0; }
.rx-cr-label { font-size: 11px; font-weight: 500; color: var(--fg); }
.rx-cr-sub { font-size: 10px; color: var(--muted-fg); margin-top: 1px; }
.rx-cr-val {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: right;
  flex-shrink: 0;
  line-height: 1.4;
}
.rx-cr-ok   { color: #15803d; }
.rx-cr-fail { color: #b91c1c; }

/* Code panel */
.rx-code-panel { padding: 16px; }
.rx-code {
  max-height: 340px;
  overflow-y: auto;
  font-size: 11px;
}

/* Actions */
.rx-actions-panel { padding: 16px; }

@media (max-width: 900px) {
  .rx-main { flex-direction: column; }
  .rx-rail { width: 100%; }
  .rx-swatches { min-height: 52px; }
  .rx-sem-eg { display: none; }
  .rx-sem-info { flex: 1; }
}

/* ═══════════════════════════════════════════════════════════
   暗色模式适配  (da-)
   ═══════════════════════════════════════════════════════════ */
.da-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}
.da-workspace {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.da-rail {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Import panel */
.da-import-panel { padding: 20px; }
.da-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.da-import-btns { display: flex; gap: 6px; flex-shrink: 0; }
.da-add-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--hover-bg);
  border-radius: 8px;
  margin-top: 4px;
}
.da-add-name {
  flex: 1;
  min-width: 120px;
  padding: 6px 9px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--fg);
  font-size: 13px;
}

/* Pairs panel */
.da-pairs-panel { padding: 0; overflow: hidden; }
.da-pairs-hd {
  display: grid;
  grid-template-columns: 110px 1fr 130px 28px 1fr 60px;
  gap: 6px;
  align-items: center;
  padding: 8px 16px;
  background: var(--hover-bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.da-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted-fg);
  font-size: 13px;
}
.da-row {
  display: grid;
  grid-template-columns: 110px 1fr 130px 28px 1fr 60px;
  gap: 6px;
  align-items: center;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.da-row:last-child { border-bottom: none; }
.da-row:hover { background: var(--hover-bg); }

.da-row-name {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  min-width: 0;
}
.da-row-name:hover,
.da-row-name:focus { background: var(--input-bg); border: 1px solid var(--border); outline: none; }

/* Color cell (light or dark side) */
.da-cell-light,
.da-cell-dark {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.da-sw {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1.5px solid rgba(0,0,0,.08);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.da-sw-hex {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity 0.12s;
  letter-spacing: -0.02em;
  padding: 1px;
  word-break: break-all;
  line-height: 1;
}
.da-sw:hover .da-sw-hex { opacity: 1; }
.da-hex-inp {
  flex: 1;
  min-width: 0;
  width: 0;
  padding: 4px 6px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--fg);
  font-size: 11px;
  font-family: var(--font-mono);
}
.da-hex-locked {
  border-color: var(--accent-color, #f59e0b);
  background: color-mix(in srgb, var(--accent-color, #f59e0b) 8%, var(--input-bg));
}

/* Role cell */
.da-cell-role {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.da-role-sel {
  font-size: 11px;
  padding: 3px 5px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--fg);
  max-width: 72px;
}
.da-cr-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}
.da-cr-ok   { background: #dcfce7; color: #15803d; }
.da-cr-fail { background: #fee2e2; color: #b91c1c; }

/* Arrow */
.da-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-fg);
}

/* Action buttons */
.da-cell-act { display: flex; gap: 4px; justify-content: flex-end; }
.da-icon-btn {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--muted-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.da-icon-btn:hover { background: var(--hover-bg); color: var(--fg); }
.da-lock-btn.is-locked { border-color: #f59e0b; color: #b45309; background: #fef3c7; }
.da-del-btn:hover { border-color: #ef4444; color: #ef4444; }

/* Panel head */
.da-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Preview panel */
.da-preview-panel { padding: 20px; }
.da-preview-wrap { border-radius: 8px; overflow: hidden; }
.da-pv-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.da-pv-half { display: flex; flex-direction: column; gap: 6px; }
.da-pv-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-fg);
  letter-spacing: .05em;
  text-align: center;
}
.da-pv-pane {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.da-pv-single .da-pv-pane {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Adjust panel (rail) */
.da-adjust-panel { padding: 16px; }
.da-slider-group { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.da-slider-row { display: flex; align-items: center; gap: 8px; }
.da-slider-lbl { font-size: 11px; color: var(--muted-fg); width: 58px; flex-shrink: 0; }
.da-slider {
  flex: 1;
  height: 4px;
  accent-color: var(--accent-color, #3b82f6);
}
.da-slider-val {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Code / actions (rail) */
.da-code-panel { padding: 16px; }
.da-code { max-height: 280px; overflow-y: auto; font-size: 11px; }
.da-actions-panel { padding: 16px; }

@media (max-width: 960px) {
  .da-main { flex-direction: column; }
  .da-rail { width: 100%; }
  .da-pairs-hd,
  .da-row { grid-template-columns: 90px 1fr 90px 24px 1fr 52px; }
  .da-pv-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .da-pairs-hd { display: none; }
  .da-row { grid-template-columns: 80px 1fr 80px 20px 1fr 48px; gap: 4px; }
}

/* ═══════════════════════════════════════════════════════════
   Tailwind 导出  (tw-)
   ═══════════════════════════════════════════════════════════ */
.tw-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}
.tw-workspace {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tw-rail {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Add panel */
.tw-add-panel { padding: 20px; }
.tw-add-head { margin-bottom: 16px; }
.tw-add-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tw-add-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  background: #3b82f6;
}
.tw-eye-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
}
.tw-name-input {
  width: 100px;
  padding: 6px 9px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-mono);
}
.tw-add-selects { display: flex; gap: 6px; align-items: center; }
.tw-sel-label {
  font-size: 11px;
  color: var(--muted-fg);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.tw-sel {
  font-size: 12px;
  padding: 4px 6px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--fg);
}
.tw-add-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted-fg);
  font-family: var(--font-mono);
  min-height: 16px;
}

/* Palette list */
.tw-palette-list { display: flex; flex-direction: column; gap: 12px; }
.tw-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted-fg);
  font-size: 13px;
}
.tw-card { padding: 16px 20px; }
.tw-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tw-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  width: 100px;
  padding: 2px 4px;
  border-radius: 4px;
}
.tw-card-name:hover, .tw-card-name:focus {
  background: var(--input-bg);
  border: 1px solid var(--border);
  outline: none;
}
.tw-card-meta { display: flex; gap: 8px; align-items: center; }
.tw-card-seed {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.tw-card-sw {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1.5px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}
.tw-card-native { font-size: 11px; }
.tw-card-hex {
  width: 84px;
  padding: 4px 6px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--fg);
  font-size: 11px;
  font-family: var(--font-mono);
}

/* Scale row */
.tw-scale-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  border-radius: 8px;
  overflow: hidden;
  height: 68px;
}
.tw-sw {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 5px;
  transition: opacity 0.12s;
  overflow: hidden;
}
.tw-sw:hover { opacity: 0.85; }
.tw-sw-stop {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
}
.tw-sw-hex {
  font-size: 8px;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity 0.12s;
  text-align: center;
  line-height: 1.2;
}
.tw-sw:hover .tw-sw-hex { opacity: 0.9; }

/* Stop labels */
.tw-stop-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  margin-top: 3px;
}
.tw-stop-row span {
  text-align: center;
  font-size: 10px;
  color: var(--muted-fg);
  font-family: var(--font-mono);
}

/* Panel head */
.tw-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tw-config-btns { display: flex; gap: 6px; }

/* Preview panel */
.tw-preview-panel { padding: 20px; }
.tw-preview-body { }
.tw-comp-wrap { display: flex; flex-direction: column; gap: 20px; }
.tw-comp-section { }
.tw-comp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.tw-comp-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tw-swatch-overview { display: flex; flex-direction: column; gap: 16px; }
.tw-ov-palette { }
.tw-ov-name {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--fg);
  margin-bottom: 4px;
}
.tw-ov-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  border-radius: 8px;
  overflow: hidden;
  height: 80px;
}
.tw-ov-sw {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

/* Config panel (rail) */
.tw-config-panel { padding: 16px; }
.tw-fmt-tabs { margin-bottom: 6px; }
.tw-filename {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted-fg);
  margin-bottom: 6px;
}
.tw-code { max-height: 420px; overflow-y: auto; font-size: 10.5px; }
.tw-actions-panel { padding: 16px; }

@media (max-width: 1000px) {
  .tw-main { flex-direction: column; }
  .tw-rail { width: 100%; }
}
@media (max-width: 700px) {
  .tw-scale-row, .tw-stop-row, .tw-ov-row { grid-template-columns: repeat(11, 1fr); }
  .tw-add-form { gap: 6px; }
}

/* ==========================================
   色相偏移 · Hue Shift  (hs-)
   ========================================== */

/* Layout */
.hs-main {
  display: flex;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  align-items: flex-start;
}
.hs-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hs-rail {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Input panel */
.hs-input-panel { padding: 20px; }
.hs-input-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.hs-seed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hs-seed-swatch {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.hs-seed-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hs-seed-opts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Controls panel */
.hs-controls-panel { padding: 20px; }
.hs-ctrl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.hs-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hs-preset-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-right: 2px;
}
.hs-arc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.hs-arc-val {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  min-width: 44px;
  text-align: right;
}
.hs-arc-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 12px;
  min-height: 16px;
}
.hs-curve-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Scale panel */
.hs-scale-panel { padding: 20px; }
.hs-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.hs-swatch-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  border-radius: 10px;
  overflow: hidden;
  height: 72px;
}
.hs-sw {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  cursor: pointer;
  transition: opacity .15s;
  position: relative;
}
.hs-sw:hover { opacity: .85; }
.hs-sw-val {
  font-size: 8px;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
  pointer-events: none;
}
.hs-sw:hover .hs-sw-val { opacity: 1; }
.hs-stop-labels {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  margin-top: 4px;
}
.hs-stop-labels span {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}
.hs-h-labels {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  margin-top: 2px;
}
.hs-h-labels span {
  font-size: 9px;
  color: var(--muted-2);
  text-align: center;
  font-family: var(--font-mono);
}

/* Compare panel */
.hs-compare-panel { padding: 20px; }
.hs-cmp-block { }
.hs-cmp-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.hs-swatch-sm {
  height: 36px;
}
.hs-sw-sm {
  cursor: pointer;
  transition: opacity .15s;
}
.hs-sw-sm:hover { opacity: .85; }
.hs-delta-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  margin-top: 6px;
}
.hs-delta {
  font-size: 9px;
  font-family: var(--font-mono);
  text-align: center;
  color: var(--muted-2);
}
.hs-delta.pos { color: #D97706; }
.hs-delta.neg { color: #3B82F6; }

/* Chart panel */
.hs-chart-panel { padding: 20px; }
.hs-chart {
  display: block;
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  margin-top: 8px;
}

/* Rail: detail panel */
.hs-detail-panel { padding: 16px; }
.hs-detail-grid {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 1fr;
  font-size: 11px;
  gap: 1px;
}
.hs-dg-head {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 2px;
  border-bottom: 1px solid var(--border-light);
}
.hs-dg-cell {
  padding: 3px 2px;
  color: var(--ink-2);
}
.hs-dg-cell.mono { font-family: var(--font-mono); }
.hs-dg-cell.pos { color: #D97706; }
.hs-dg-cell.neg { color: #3B82F6; }

/* Rail: export panel */
.hs-export-panel { padding: 16px; }
.hs-fmt-tabs { margin-bottom: 6px; }

/* Rail: actions panel */
.hs-actions-panel { padding: 16px; }

@media (max-width: 1100px) {
  .hs-main { flex-direction: column; }
  .hs-rail { width: 100%; }
}
@media (max-width: 700px) {
  .hs-swatch-row { height: 56px; }
  .hs-swatch-sm  { height: 28px; }
  .hs-seed-opts  { gap: 6px; }
}

/* ==========================================
   风格色系生成器 (sp-)
   ========================================== */

.sp-main {
  display: flex;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  align-items: flex-start;
}
.sp-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sp-rail {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Control panel */
.sp-ctrl-panel { padding: 20px; }
.sp-ctrl-head { margin-bottom: 14px; }
.sp-style-tabs { margin-bottom: 16px; }
.sp-params { min-height: 40px; }
.sp-param-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Swatch panel */
.sp-swatch-panel { padding: 20px; }
.sp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sp-swatches {
  display: grid;
  border-radius: 10px;
  overflow: hidden;
  height: 88px;
}
.sp-sw {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  cursor: pointer;
  transition: opacity .15s;
}
.sp-sw:hover { opacity: .82; }
.sp-sw-val {
  font-size: 8px;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
  pointer-events: none;
}
.sp-sw:hover .sp-sw-val { opacity: 1; }
.sp-swatch-labels {
  display: grid;
  margin-top: 6px;
}
.sp-label-hex {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--muted);
  text-align: center;
}

/* Preview panel */
.sp-preview-panel { padding: 20px; }
.sp-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.sp-pv-app { min-height: 200px; }
.sp-pv-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
}
.sp-pv-nav-links {
  display: flex;
  gap: 14px;
  flex: 1;
  justify-content: center;
}
.sp-pv-cta {
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.sp-pv-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-pv-strip {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 20px;
}
.sp-pv-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sp-pv-card {
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
.sp-pv-chip {
  width: 100%;
  height: 32px;
  border-radius: 5px;
  margin-bottom: 4px;
}
.sp-pv-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.sp-pv-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

/* Rail: info */
.sp-info-panel { padding: 16px; }
.sp-style-en {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}
.sp-style-desc {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 10px;
}
.sp-oklch-range {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted-2);
  line-height: 1.8;
  white-space: pre;
}

/* Rail: export / actions */
.sp-export-panel  { padding: 16px; }
.sp-actions-panel { padding: 16px; }

@media (max-width: 1100px) {
  .sp-main { flex-direction: column; }
  .sp-rail { width: 100%; }
}
@media (max-width: 700px) {
  .sp-pv-cards { grid-template-columns: repeat(2, 1fr); }
  .sp-swatches { height: 64px; }
}

/* ═══════════════════════════════════════════════════════════════════
   APCA 对比度页面
   ═══════════════════════════════════════════════════════════════════ */

/* Layout — identical to contrast-main */
.apca-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.apca-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}
.apca-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

/* WCAG hint bar */
.apca-wcag-hint {
  display: none;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surface-2, #FFF8E6);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Score panel */
.apca-score-dual {
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding: 16px;
}
.apca-score-left {
  display: flex;
  gap: 14px;
  align-items: center;
  flex: 1;
}
.apca-score-sample {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-serif);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.apca-score-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.apca-polarity {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.apca-polarity--normal  { color: var(--success, #1D8348); }
.apca-polarity--reverse { color: #1565C0; }

.apca-lc-number {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--ink);
  line-height: 1;
}
.apca-score-copy .apca-badge {
  margin-top: 2px;
}
.apca-score-copy .is-pass { font-size: 11px; color: var(--success); }
.apca-score-copy .is-fail { font-size: 11px; color: var(--danger); }

.apca-score-right {
  border-left: 1px solid var(--border);
  padding-left: 16px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.apca-wcag-ref {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.apca-wcag-ref span {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.apca-wcag-ref strong {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--ink-2);
}
.apca-wcag-ref em {
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Lc badge variants */
.apca-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
}
.apca-badge--90   { background: #D1F5E3; color: #1D8348; }
.apca-badge--75   { background: #E8F4FF; color: #0071E3; }
.apca-badge--60   { background: #EFF8FF; color: #2563EB; }
.apca-badge--45   { background: #FFF8E6; color: #B45309; }
.apca-badge--30   { background: #FFEEDC; color: #C05A00; }
.apca-badge--fail { background: #FFE8E6; color: #C0392B; }

/* Lc Meter */
.apca-meter {
  padding: 0 16px 14px;
}
.apca-meter-track {
  position: relative;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: visible;
  margin-bottom: 20px;
}
.apca-meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s ease, background 0.2s ease;
}
.apca-meter-tick {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 14px;
  background: var(--border-strong, rgba(0,0,0,0.2));
  transform: translateX(-50%);
}
.apca-meter-labels {
  position: relative;
  height: 16px;
}
.apca-meter-labels span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  top: 0;
}

/* Context panel */
.apca-context-panel {
  padding: 16px;
}
.apca-context-table {
  margin-top: 12px;
}
.apca-ctx-head {
  display: grid;
  grid-template-columns: 1fr 120px 64px 72px;
  gap: 8px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.apca-ctx-row {
  display: grid;
  grid-template-columns: 1fr 120px 64px 72px;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 12.5px;
}
.apca-ctx-row:last-child { border-bottom: none; }
.apca-ctx--pass { opacity: 1; }
.apca-ctx--fail { opacity: 0.55; }

.apca-ctx-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
}
.apca-ctx-preview {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  font-style: normal;
  flex-shrink: 0;
  overflow: hidden;
}
.apca-ctx-icon { font-size: 13px; }

.apca-ctx-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.apca-ctx-minlc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  text-align: center;
}
.apca-ctx-status {
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-mono);
}
.apca-ctx--pass .apca-ctx-status { color: var(--success); }
.apca-ctx--fail .apca-ctx-status { color: var(--danger); }

/* Rail: level reference */
.apca-level-ref {
  padding: 16px;
}
.apca-level-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.apca-level-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
}
.apca-level-item strong {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 50px;
}
.apca-level-item span {
  color: var(--ink-2);
  line-height: 1.4;
}
.apca-level--90   { background: #D1F5E3; }
.apca-level--90 strong { color: #1D8348; }
.apca-level--75   { background: #E8F4FF; }
.apca-level--75 strong { color: #0071E3; }
.apca-level--60   { background: #EFF8FF; }
.apca-level--60 strong { color: #2563EB; }
.apca-level--45   { background: #FFF8E6; }
.apca-level--45 strong { color: #B45309; }
.apca-level--30   { background: #FFEEDC; }
.apca-level--30 strong { color: #C05A00; }
.apca-level--fail { background: #FFE8E6; }
.apca-level--fail strong { color: #C0392B; }

/* APCA vs WCAG explainer */
.apca-vs-wcag {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.apca-vs-wcag p {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0 0 8px;
}
.apca-wcag-link {
  font-size: 11.5px;
  color: var(--accent, #1565C0);
  text-decoration: none;
}
.apca-wcag-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 1120px) {
  .apca-main {
    grid-template-columns: 1fr;
    padding: 24px 24px 60px;
  }
  .apca-rail { position: static; }
}
@media (max-width: 700px) {
  .apca-main { padding: 16px 16px 48px; }
  .apca-ctx-head,
  .apca-ctx-row { grid-template-columns: 1fr 80px 48px 60px; }
}

/* ═══════════════════════════════════════════════════════════════════
   数据可视化色板页面
   ═══════════════════════════════════════════════════════════════════ */

/* Layout */
.dv-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.dv-workspace {
  min-width: 0;
  display: grid;
  gap: 20px;
}
.dv-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

/* Controls panel */
.dv-controls-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.dv-top-btns { display: flex; gap: 8px; flex-shrink: 0; }
.dv-controls-body {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.dv-ctrl-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dv-ctrl-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.dv-count-btns {
  display: flex;
  gap: 4px;
}
.dv-count-btn {
  width: 32px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dv-count-btn:hover { background: var(--surface-2); }
.dv-count-btn.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.dv-hue-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.dv-hue-pick input[type="color"] {
  width: 32px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: var(--surface);
}
.dv-hue-pick span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

/* Palette display */
.dv-palette-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.dv-swatches {
  display: flex;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  gap: 2px;
}
.dv-swatch {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  cursor: pointer;
  transition: flex 0.2s ease;
}
.dv-swatch:hover { flex: 1.6; }
.dv-swatch-copy {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.dv-swatch:hover .dv-swatch-copy { opacity: 1; }
.dv-swatch-idx {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  opacity: 0.6;
}

/* Chart panel */
.dv-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.dv-chart-view { line-height: 0; }
.dv-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* Color blind panel */
.dv-cb-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.dv-cb-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dv-cb-meta {
  width: 150px;
  flex-shrink: 0;
}
.dv-cb-meta strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.dv-cb-meta span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}
.dv-cb-strip {
  flex: 1;
  display: flex;
  height: 36px;
  border-radius: 7px;
  overflow: hidden;
  gap: 1px;
}
.dv-cb-swatch { flex: 1; }
.dv-cb-score {
  flex-shrink: 0;
  width: 64px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
}
.dv-cb-score small {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--font-sans);
  margin-top: 3px;
}
.dv-cb-score--good { color: var(--success); }
.dv-cb-score--warn { color: #B45309; }
.dv-cb-score--bad  { color: var(--danger); }

/* Quality panel */
.dv-quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.dv-q-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2, #F5F5F7);
}
.dv-q-item strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 4px;
}
.dv-q-item span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  display: block;
}
.dv-q-item small {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  display: block;
}
.dv-q--good strong { color: var(--success); }
.dv-q--warn strong { color: #B45309; }
.dv-q--bad  strong { color: var(--danger); }
.dv-q--neutral strong { color: var(--ink); }

/* Values list */
.dv-values-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dv-val-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.dv-val-row:last-child { border-bottom: none; }
.dv-val-swatch {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.dv-val-info { flex: 1; min-width: 0; }
.dv-val-hex {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.dv-val-oklch {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

/* Export panel */
.dv-export-fmt { margin: 10px 0 8px; }
.dv-export-code {
  background: var(--surface-2, #F5F5F7);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 1120px) {
  .dv-main {
    grid-template-columns: 1fr;
    padding: 24px 24px 60px;
  }
  .dv-rail { position: static; }
  .dv-quality-grid { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 700px) {
  .dv-main { padding: 16px 16px 48px; }
  .dv-controls-body { flex-direction: column; align-items: flex-start; }
  .dv-quality-grid { grid-template-columns: 1fr 1fr; }
  .dv-cb-meta { width: 110px; }
}

/* ═══════════════════════════════════════════════════════════════
   SHADOW COLOR GENERATOR  (shadow.html)
   ═══════════════════════════════════════════════════════════════ */

/* Layout */
.shadow-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.shadow-workspace { min-width: 0; display: grid; gap: 20px; }
.shadow-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

/* Panel head */
.shadow-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

/* Controls */
.shadow-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.shadow-color-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.shadow-color-field input[type="color"] {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
  background: none;
}
.shadow-color-field input[type="text"] {
  width: 82px;
  height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
}
.shadow-color-field input[type="text"]:focus { border-color: var(--accent); }
.shadow-ctrl-group { display: flex; flex-direction: column; gap: 6px; }
.shadow-ctrl-label { font-size: 13px; color: var(--ink-2); }
.shadow-range-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.shadow-range-ctrl input[type="range"] {
  width: 120px;
  accent-color: var(--accent);
}
.shadow-range-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  min-width: 32px;
}

/* Preview stage */
.shadow-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 32px;
  border-radius: 12px;
  transition: background .3s;
  min-height: 180px;
}
.shadow-stage--light  { background: #F8F8FA; }
.shadow-stage--mid    { background: #C8C8D0; }
.shadow-stage--colored { background: var(--shadow-stage-bg, #D4E5FF); }

.shadow-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  min-width: 160px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shadow-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.shadow-card-sub {
  font-size: 12px;
  color: var(--muted);
}

/* CSS code panel */
.shadow-code {
  background: var(--surface-2, #F5F5F7);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
}

/* Shadow color detail (rail) */
.shadow-detail-swatch {
  width: 100%;
  height: 72px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.shadow-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.shadow-detail-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2, #F5F5F7);
}
.shadow-detail-item strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 3px;
}
.shadow-detail-item span {
  font-size: 11px;
  color: var(--muted);
}

/* Levels panel */
.shadow-levels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.shadow-level-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.shadow-level-dot {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}
.shadow-level-info { flex: 1; min-width: 0; }
.shadow-level-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.shadow-level-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* bg-switcher reuse pfb-group style inline */
.shadow-bg-switcher { display: flex; gap: 4px; }

/* Responsive */
@media (max-width: 1120px) {
  .shadow-main {
    grid-template-columns: 1fr;
    padding: 24px 24px 60px;
  }
  .shadow-rail { position: static; }
}
@media (max-width: 700px) {
  .shadow-main { padding: 16px 16px 48px; }
  .shadow-stage { padding: 20px; gap: 16px; }
  .shadow-controls { gap: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   KOBAYASHI EMOTION-COLOR COORDINATE  (kobayashi.html)
   ═══════════════════════════════════════════════════════════════ */

/* Layout */
.kobayashi-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.kobayashi-workspace { min-width: 0; display: grid; gap: 20px; }
.kobayashi-rail {
  position: sticky;
  top: var(--rail-sticky-top);
  display: grid;
  gap: 16px;
}

/* Panel head */
.kobayashi-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Chart container */
.kobayashi-chart-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.kobayashi-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Word hover interaction */
.kob-word-g { transition: opacity .15s; }
.kob-word-g:hover text { font-weight: 700 !important; }

/* Nearest match list */
.kob-nearest-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.kob-near-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.kob-near-item:hover { border-color: var(--accent); background: var(--surface-2, #F5F5F7); }
.kob-near-best { border-color: var(--accent) !important; background: var(--accent-bg, #EEF2FF) !important; }
.kob-near-swatches { display: flex; gap: 3px; flex-shrink: 0; }
.kob-near-sw {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid var(--border);
  display: inline-block;
}
.kob-near-info { flex: 1; min-width: 0; }
.kob-near-zh {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.kob-near-en {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}
.kob-near-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  flex-shrink: 0;
}

/* Detail panel */
.kob-det-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.kob-det-zh {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-serif, serif);
  color: var(--ink);
  line-height: 1;
}
.kob-det-en {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.kob-det-coord {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.kob-det-coord-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--surface-2, #F5F5F7);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.kob-det-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
}
.kob-det-swatch-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kob-det-swatch {
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.kob-det-hex {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.kob-det-note {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

/* Responsive */
@media (max-width: 1120px) {
  .kobayashi-main {
    grid-template-columns: 1fr;
    padding: 24px 24px 60px;
  }
  .kobayashi-rail { position: static; }
}
@media (max-width: 700px) {
  .kobayashi-main { padding: 16px 16px 48px; }
  .kobayashi-panel-head { flex-direction: column; }
}

/* ============================================================
   Global visual calibration
   ============================================================ */

.main,
.gen-main,
.screen-main,
.lib-main,
.tmpl-main,
.tmpl-layout,
.fav-main,
.print-main,
.dashboard-print-section,
.extractor-main,
.scale-main,
.converter-main,
.named-main,
.ratio-main,
.palette-tools-main,
.contrast-main,
.apca-main,
.tokens-main,
.gradient-main,
.blend-main,
.hue-main,
.mono-main,
.value-main,
.temperature-main,
.area-main,
.itten-main,
.pantone-main,
.screen-picker-main,
.limited-palette-main,
.brand-reverse-main,
.oklch-main,
.radix-main,
.tailwind-main,
.hue-shift-main,
.style-palette-main,
.dataviz-main,
.shadow-main,
.kobayashi-main {
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
}

.main,
.gen-main,
.screen-main,
.lib-main,
.tmpl-main,
.fav-main,
.print-main,
.extractor-main,
.scale-main,
.converter-main,
.named-main,
.ratio-main,
.palette-tools-main,
.contrast-main,
.apca-main,
.tokens-main,
.gradient-main,
.blend-main,
.hue-main,
.mono-main,
.value-main,
.temperature-main,
.area-main,
.itten-main,
.pantone-main,
.screen-picker-main,
.limited-palette-main,
.brand-reverse-main,
.oklch-main,
.radix-main,
.tailwind-main,
.hue-shift-main,
.style-palette-main,
.dataviz-main,
.shadow-main,
.kobayashi-main {
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  padding-bottom: var(--page-bottom);
}

.lib-main,
.tmpl-main,
.screen-layout,
.extractor-layout,
.scale-layout,
.converter-layout,
.named-layout,
.ratio-layout,
.ptools-layout,
.contrast-layout,
.tokens-layout,
.gradient-layout,
.blend-layout,
.hue-layout,
.mono-layout,
.value-layout,
.temperature-layout,
.area-layout,
.itten-layout,
.pantone-layout,
.sp-layout,
.lp-layout,
.br-layout,
.ok-layout,
.rx-layout,
.tw-layout,
.hs-layout,
.style-layout,
.dv-layout,
.shadow-layout,
.kobayashi-main {
  gap: var(--page-grid-gap);
}

.screen-layout,
.extractor-layout,
.scale-layout,
.converter-layout,
.named-layout,
.ratio-layout,
.ptools-layout,
.contrast-layout,
.tokens-layout,
.gradient-layout,
.blend-layout,
.hue-layout,
.mono-layout,
.value-layout,
.temperature-layout,
.area-layout,
.itten-layout,
.pantone-layout,
.sp-layout,
.lp-layout,
.br-layout,
.ok-layout,
.rx-layout,
.tw-layout,
.hs-layout,
.style-layout,
.dv-layout,
.shadow-layout {
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
}

.contrast-main,
.apca-main {
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
}

.extractor-main,
.scale-main,
.converter-main,
.named-main,
.ratio-main,
.palette-tools-main,
.tokens-main,
.gradient-main,
.blend-main,
.hue-main,
.mono-main,
.value-main,
.temperature-main,
.area-main,
.itten-main,
.pantone-main,
.screen-picker-main,
.limited-palette-main,
.brand-reverse-main,
.oklch-main,
.radix-main,
.tailwind-main,
.hue-shift-main,
.style-palette-main,
.dataviz-main,
.shadow-main {
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
}

.lib-main,
.tmpl-main {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.fav-main {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.screen-panel,
.screen-palette-strip,
.lib-detail,
.lib-compare-bar,
.tmpl-detail,
.section-block,
.extractor-panel,
.scale-panel,
.converter-panel,
.named-panel,
.ratio-panel,
.ptools-panel,
.contrast-panel,
.tokens-panel,
.gradient-panel,
.blend-panel,
.hue-panel,
.mono-panel,
.value-panel,
.temp-panel,
.area-panel,
.itten-panel,
.pantone-panel,
.sp-panel,
.lp-panel,
.br-panel,
.ok-panel,
.rx-panel,
.tw-panel,
.hs-panel,
.style-panel,
.dv-panel,
.shadow-panel,
.kobayashi-panel {
  border-color: rgba(20,23,31,.08);
  box-shadow: 0 14px 38px rgba(20,23,31,.055);
}

.btn {
  height: 38px;
  padding: 0 17px;
  border-radius: 999px;
  font-weight: 650;
  border-color: rgba(20,23,31,.16);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(20,23,31,.08);
}

.btn-sm {
  height: 32px;
  padding: 0 13px;
  font-size: 12px;
}

.btn-apply,
.btn-primary,
.btn-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20,23,31,.16);
}

.btn-apply:hover,
.btn-primary:hover,
.btn-ink:hover {
  background: #000;
  border-color: #000;
  box-shadow: 0 12px 28px rgba(20,23,31,.22);
}

.screen-actions,
.extractor-action-stack,
.tmpl-detail-actions,
.lib-detail-actions {
  gap: 12px;
}

.screen-actions .btn,
.extractor-action-stack .btn,
.tmpl-detail-actions .btn,
.lib-detail-actions .btn {
  justify-content: center;
}

.screen-panel:has(.extractor-action-stack) {
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.74)),
    var(--surface);
}

.extractor-action-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.extractor-action-stack .btn {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.extractor-action-stack .btn-apply {
  grid-column: 1 / -1;
  height: 44px;
  font-size: 14px;
}

.extractor-action-stack .btn-ghost {
  grid-column: 1 / -1;
  background: var(--surface-2);
  border-color: rgba(20,23,31,.08);
  color: var(--muted);
  box-shadow: none;
}

.extractor-action-stack .btn-ghost:hover {
  color: var(--ink);
  border-color: rgba(20,23,31,.14);
  box-shadow: 0 8px 20px rgba(20,23,31,.06);
}

.screen-palette-bar,
.palette-strip,
.palette-stack,
.summary-palette,
.spec-cover-palette,
.export-palette-strip,
.gen-scheme-bar,
.tmpl-card-bar,
.tmpl-detail-palette,
.lib-detail-swatch,
.extractor-detail-swatch,
.scale-detail-swatch,
.converter-detail-swatch,
.named-detail-swatch,
.ratio-detail-swatch,
.contrast-detail-swatch,
.tokens-detail-swatch,
.gradient-detail-swatch,
.blend-detail-swatch,
.hue-detail-swatch,
.mono-detail-swatch,
.value-detail-swatch,
.temp-detail-swatch,
.area-detail-swatch,
.pantone-detail-swatch,
.shadow-detail-swatch {
  border-radius: 16px;
}

@media (max-width: 1120px) {
  :root {
    --page-pad-x: 32px;
    --page-grid-gap: 24px;
    --rail-w: 340px;
  }

  .screen-layout,
  .extractor-layout,
  .scale-layout,
  .converter-layout,
  .named-layout,
  .ratio-layout,
  .ptools-layout,
  .contrast-layout,
  .tokens-layout,
  .gradient-layout,
  .blend-layout,
  .hue-layout,
  .mono-layout,
  .value-layout,
  .temperature-layout,
  .area-layout,
  .itten-layout,
  .pantone-layout,
  .sp-layout,
  .lp-layout,
  .br-layout,
  .ok-layout,
  .rx-layout,
  .tw-layout,
  .hs-layout,
  .style-layout,
  .dv-layout,
  .shadow-layout,
  .lib-main,
  .tmpl-main,
  .fav-main,
  .contrast-main,
  .apca-main,
  .extractor-main,
  .scale-main,
  .converter-main,
  .named-main,
  .ratio-main,
  .palette-tools-main,
  .tokens-main,
  .gradient-main,
  .blend-main,
  .hue-main,
  .mono-main,
  .value-main,
  .temperature-main,
  .area-main,
  .itten-main,
  .pantone-main,
  .screen-picker-main,
  .limited-palette-main,
  .brand-reverse-main,
  .oklch-main,
  .radix-main,
  .tailwind-main,
  .hue-shift-main,
  .style-palette-main,
  .dataviz-main,
  .shadow-main,
  .kobayashi-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --page-pad-x: 20px;
    --page-pad-y: 24px;
    --page-bottom: 60px;
  }
}

/* ── Language switch button ────────────────── */
.lang-switch-btn {
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: .04em;
  min-width: 28px;
  color: var(--muted);
  padding: 0 6px;
}
.lang-switch-btn:hover {
  color: var(--ink);
}

/* ── AdSense ad units ──────────────────────── */
.dch-ad-unit {
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
}
.dch-ad-banner {
  width: 100%;
  min-height: 90px;
  margin: 24px 0;
}

/* ===== Guide / Article pages ===== */
.guide-wrap { max-width: 780px; margin: 0 auto; padding: 48px 24px 80px; }
.guide-hero { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.guide-hero h1 { font-size: clamp(24px,4vw,36px); font-weight: 700; line-height: 1.2; margin: 0 0 14px; }
.guide-hero .guide-lead { font-size: 16px; color: var(--muted); line-height: 1.75; margin: 0; }
.guide-body h2 { font-size: 21px; font-weight: 700; margin: 40px 0 12px; }
.guide-body h3 { font-size: 16px; font-weight: 600; margin: 28px 0 8px; }
.guide-body p { font-size: 15px; line-height: 1.85; margin: 0 0 16px; }
.guide-body ul, .guide-body ol { padding-left: 22px; margin: 0 0 16px; }
.guide-body li { font-size: 15px; line-height: 1.8; margin-bottom: 6px; }
.guide-body strong { font-weight: 600; }
.guide-cta { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 28px; margin: 48px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.guide-cta-text { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.guide-cta-sub { font-size: 13px; color: var(--muted); margin: 0; }
.guide-cta a.guide-cta-btn { background: var(--accent); color: #fff; text-decoration: none; padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.guide-cta a.guide-cta-btn:hover { opacity: 0.88; }
.guide-breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.guide-breadcrumb a { color: var(--muted); text-decoration: none; }
.guide-breadcrumb a:hover { color: var(--ink); }
