/* =========================================================
   Contrast Studio — styles
   ========================================================= */

:root {
  --bg:            #080b12;
  --bg-2:          #0b0f18;
  --card:          #0e131d;
  --card-2:        #121826;
  --card-3:        #161d2c;
  --line:          #1c2434;
  --line-2:        #242e40;
  --text:          #e6ebf4;
  --text-2:        #9aa7bd;
  --text-3:        #6b7891;
  --accent:        #2563eb;
  --accent-2:      #3b82f6;
  --accent-soft:   rgba(37, 99, 235, .14);
  --pass:          #34d399;
  --pass-bg:       rgba(16, 185, 129, .14);
  --pass-line:     rgba(16, 185, 129, .32);
  --fail:          #f87171;
  --fail-bg:       rgba(239, 68, 68, .13);
  --fail-line:     rgba(239, 68, 68, .3);
  --aaa:           #34d399;
  --shadow:        0 18px 40px -22px rgba(0, 0, 0, .9);
  --radius:        14px;
  --radius-sm:     9px;
  --topbar-h:      72px;
  --sidebar-w:     230px;
  --rail-w:        340px;
}

html[data-theme="light"] {
  --bg:            #eef1f7;
  --bg-2:          #f6f8fc;
  --card:          #ffffff;
  --card-2:        #f4f6fb;
  --card-3:        #eaeef6;
  --line:          #dde3ee;
  --line-2:        #ccd5e4;
  --text:          #101828;
  --text-2:        #5a6781;
  --text-3:        #8592a8;
  --accent:        #2563eb;
  --accent-2:      #1d4ed8;
  --accent-soft:   rgba(37, 99, 235, .1);
  --pass:          #047857;
  --pass-bg:       rgba(16, 185, 129, .14);
  --pass-line:     rgba(5, 150, 105, .3);
  --fail:          #b91c1c;
  --fail-bg:       rgba(239, 68, 68, .11);
  --fail-line:     rgba(185, 28, 28, .26);
  --aaa:           #047857;
  --shadow:        0 14px 30px -20px rgba(16, 24, 40, .35);
}

* { box-sizing: border-box; }

/* Must beat the layout `display` on .modal-backdrop / table cells. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }

svg { width: 18px; height: 18px; flex: none; }

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

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 11px; width: calc(var(--sidebar-w) - 20px); flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(150deg, #3b82f6, #1d4ed8);
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: #fff;
  box-shadow: 0 4px 14px -4px rgba(37, 99, 235, .8);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }

.topnav { display: flex; gap: 4px; margin: 0 auto; height: 100%; }
.topnav-item {
  background: none; border: 0; padding: 0 16px;
  color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.topnav-item:hover { color: var(--text); }
.topnav-item.is-active { color: var(--accent-2); border-bottom-color: var(--accent-2); }

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  background: none; border: 0; color: var(--text-2);
  display: grid; place-items: center; position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--card-3); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2); border: 2px solid var(--bg-2);
}

.i-sun { display: none; }
html[data-theme="light"] .i-sun { display: block; }
html[data-theme="light"] .i-moon { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--card-2);
  color: var(--text); font-weight: 500; font-size: 13px;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--card-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: transparent; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  font-weight: 600; padding: 10px 16px;
  box-shadow: 0 6px 18px -8px rgba(37, 99, 235, .9);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.split-btn { display: flex; position: relative; margin-left: 6px; }
.split-btn .btn-primary { border-radius: 10px 0 0 10px; }
.btn-caret {
  border-radius: 0 10px 10px 0; padding: 10px 9px;
  border-left: 1px solid rgba(255, 255, 255, .22);
}
.btn-caret svg { width: 15px; height: 15px; }

.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 218px; padding: 6px;
  background: var(--card-2); border: 1px solid var(--line-2);
  border-radius: 11px; box-shadow: var(--shadow);
  display: none;
}
.menu.is-open { display: block; }
.menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 11px; border: 0; background: none;
  border-radius: 7px; font-size: 13px; color: var(--text-2);
}
.menu button:hover { background: var(--card-3); color: var(--text); }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  gap: 18px;
  padding: 18px 20px 32px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: calc(var(--topbar-h) + 18px);
  height: calc(100vh - var(--topbar-h) - 50px);
  display: flex; flex-direction: column;
}
.sidenav { display: flex; flex-direction: column; gap: 4px; }
.sidenav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid transparent; border-radius: 11px;
  background: none; color: var(--text-2); font-weight: 500; text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
.sidenav-item:hover { background: var(--card); color: var(--text); }
.sidenav-item.is-active {
  background: var(--accent-soft); color: var(--accent-2);
  border-color: rgba(59, 130, 246, .32);
}

.workspace {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; width: 100%;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; text-align: left;
}
.workspace:hover { background: var(--card-2); }
.ws-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(150deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px;
}
.ws-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.ws-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-text small { font-size: 11px; color: var(--text-3); }
.ws-caret { width: 15px; height: 15px; margin-left: auto; color: var(--text-3); }

/* ---------- Cards ---------- */
.main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 600; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.head-actions { display: flex; gap: 8px; }

.step {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.pill {
  padding: 3px 9px; border-radius: 7px;
  background: var(--card-3); border: 1px solid var(--line-2);
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
}

.panel { display: none; flex-direction: column; gap: 18px; }
.panel.is-active { display: flex; }

/* ---------- Upload ---------- */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  padding: 26px 20px;
  text-align: center;
  background: var(--card-2);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent-2); background: var(--accent-soft); outline: none; }
.dropzone.is-drag { border-color: var(--accent-2); background: var(--accent-soft); }
.dz-icon { width: 46px; height: 46px; color: var(--accent-2); margin-bottom: 10px; }
.dz-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.dz-sub { margin: 0 0 16px; font-size: 12.5px; color: var(--text-2); }
.dz-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 7px; border-radius: 8px;
  background: var(--card-3); border: 1px solid var(--line-2);
  font-size: 11px; font-weight: 600; color: var(--text-2);
}
.chip-more { letter-spacing: 1px; cursor: pointer; }
.sq { width: 9px; height: 9px; border-radius: 2px; }
.c-png { background: #3b82f6; } .c-jpg { background: #14b8a6; }
.c-pdf { background: #ef4444; } .c-svg { background: #8b5cf6; }
.c-ai  { background: #f59e0b; }
.dz-max { margin: 0; font-size: 11.5px; color: var(--text-3); }

.uploaded-head { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.file-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.file-card {
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card-2); overflow: hidden;
}
.file-thumb {
  height: 118px; display: grid; place-items: center;
  background: var(--card-3); position: relative; overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb .doc { display: grid; place-items: center; gap: 8px; color: var(--text-2); text-align: center; padding: 8px; }
.file-thumb .doc svg { width: 26px; height: 26px; }
.file-thumb .doc span { font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.file-meta { padding: 9px 10px; display: flex; align-items: center; gap: 6px; }
.file-meta .fm-text { min-width: 0; }
.file-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11px; color: var(--text-3); }
.file-menu { margin-left: auto; background: none; border: 0; color: var(--text-3); padding: 2px 4px; border-radius: 6px; letter-spacing: 1px; }
.file-menu:hover { background: var(--card-3); color: var(--text); }
.file-card.is-loading .file-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: shimmer 1.1s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.empty-files {
  grid-column: 1 / -1; padding: 26px 14px; text-align: center;
  border: 1px dashed var(--line); border-radius: 11px;
  font-size: 12.5px; color: var(--text-3);
}

/* ---------- Swatches ---------- */
.swatch-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.swatch { display: block; width: 100%; background: none; border: 0; padding: 0; text-align: left; }
.swatch-chip {
  display: block; height: 74px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .12s, box-shadow .12s;
}
.swatch:hover .swatch-chip { transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgba(0,0,0,.9); }
.swatch.is-selected .swatch-chip { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent-2); }
.swatch-hex { display: block; font-size: 12px; font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; }
.swatch-src { display: block; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.tool { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.tool select {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 8px;
  padding: 6px 26px 6px 10px; font-size: 12.5px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa7bd' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 13px;
}
.tool-range { gap: 7px; }
.rng-ico { width: 14px; height: 14px; color: var(--text-3); }
.rng-ico.big { width: 17px; height: 17px; }
input[type="range"] {
  appearance: none; width: 96px; height: 4px; border-radius: 3px;
  background: var(--line-2); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent-2); border: 2px solid var(--card); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent-2); border: 2px solid var(--card); cursor: pointer;
}

.switch {
  appearance: none; width: 38px; height: 21px; border-radius: 999px;
  background: var(--line-2); position: relative; cursor: pointer;
  transition: background .18s;
}
.switch::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .18s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(17px); }

/* ---------- Results table ---------- */
.table-wrap { overflow-x: auto; }
table.results { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.results th {
  font-weight: 500; color: var(--text-2); text-align: center;
  padding: 9px 10px; white-space: nowrap;
}
.results .group-row th { font-size: 12.5px; color: var(--text-2); }
.results .sub-row th { font-size: 11.5px; color: var(--text-3); border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.results .col-color { text-align: left; padding-left: 4px; vertical-align: bottom; border-bottom: 1px solid var(--line); }
.results .group-row th.grp { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.results td { padding: 11px 10px; text-align: center; border-bottom: 1px solid var(--line); }
.results tbody tr:last-child td { border-bottom: 0; }
.results tbody tr { cursor: pointer; }
.results tbody tr:hover td { background: var(--card-2); }
.results tbody tr.is-selected td { background: var(--accent-soft); }
.results tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--accent-2); border-radius: 8px 0 0 8px; }
.results tbody tr.is-selected td:last-child { border-radius: 0 8px 8px 0; }

.cell-color { display: flex; align-items: center; gap: 10px; text-align: left; }
.cell-color .sel-dot {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  display: grid; place-items: center; border: 1px solid var(--line-2);
}
.cell-color .sel-dot svg { width: 10px; height: 10px; color: #fff; opacity: 0; }
tr.is-selected .cell-color .sel-dot { background: var(--accent-2); border-color: var(--accent-2); }
tr.is-selected .cell-color .sel-dot svg { opacity: 1; }
.cell-swatch { width: 17px; height: 17px; border-radius: 5px; border: 1px solid rgba(255,255,255,.14); flex: none; }
.cell-hex { font-variant-numeric: tabular-nums; font-weight: 500; }
.ratio { font-variant-numeric: tabular-nums; font-weight: 600; }

.badge {
  display: inline-block; min-width: 46px; padding: 3px 9px;
  border-radius: 7px; font-size: 11.5px; font-weight: 600; text-align: center;
}
.badge.pass { background: var(--pass-bg); color: var(--pass); border: 1px solid var(--pass-line); }
.badge.fail { background: var(--fail-bg); color: var(--fail); border: 1px solid var(--fail-line); }
.badge.aaa  { background: var(--pass-bg); color: var(--aaa); border: 1px solid var(--pass-line); }
.badge.mute { background: var(--card-3); color: var(--text-3); border: 1px solid var(--line-2); }

.empty-note, .placeholder { color: var(--text-3); font-size: 13px; padding: 20px 4px; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-2); text-decoration: underline; }

.col-hidden { display: none; }

/* ---------- Right rail ---------- */
.rail {
  position: sticky; top: calc(var(--topbar-h) + 18px);
  display: flex; flex-direction: column; gap: 18px;
}
.rail-card { padding: 16px; }
.rail-sub { margin: 18px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.selected { display: flex; align-items: center; gap: 12px; }
.sel-swatch {
  width: 42px; height: 42px; border-radius: 9px; flex: none;
  border: 1px solid rgba(255, 255, 255, .14); background: var(--card-3);
}
.sel-hex { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sel-src { font-size: 12px; color: var(--text-3); }

.sel-ratios { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ratio-box { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: var(--card-2); }
.rb-label { font-size: 11.5px; color: var(--text-2); margin-bottom: 7px; }
.rb-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rb-val {
  font-size: 18px; font-weight: 700; letter-spacing: -.3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rb-row .badge { min-width: 0; padding: 3px 8px; }
.rb-note { font-size: 11px; color: var(--text-3); margin-top: 7px; }

.rail-link {
  margin-top: 14px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--card-2);
  color: var(--accent-2); font-size: 13px; font-weight: 500;
}
.rail-link:hover { background: var(--card-3); }
.rail-link svg { width: 15px; height: 15px; }

.seg {
  display: flex; gap: 4px; padding: 3px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 9px;
  margin-bottom: 14px;
}
.seg-btn {
  flex: 1; padding: 6px 4px; border: 0; border-radius: 7px;
  background: none; color: var(--text-2); font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--accent); color: #fff; font-weight: 600; }

.preview {
  border-radius: 12px; padding: 18px; min-height: 168px;
  background: var(--card-3); transition: background .2s;
}
.pv-head { margin: 0 0 10px; font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -.3px; }
.pv-body { margin: 0 0 12px; font-size: 13px; opacity: .92; }
.pv-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; text-decoration: underline; color: inherit;
}
.pv-link svg { width: 14px; height: 14px; }
.pv-ui { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.pv-btn { padding: 9px 14px; border-radius: 8px; border: 0; font-size: 13px; font-weight: 600; }
.pv-chip { padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1.5px solid currentColor; }
.preview[data-mode="normal"] .pv-head { display: none; }
.preview[data-mode="large"] .pv-body,
.preview[data-mode="large"] .pv-link,
.preview[data-mode="large"] .pv-ui { display: none; }
.preview[data-mode="ui"] .pv-head,
.preview[data-mode="ui"] .pv-body,
.preview[data-mode="ui"] .pv-link { display: none; }

.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.insights li { display: flex; gap: 10px; }
.ins-icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.ins-ok { color: var(--pass); }
.ins-bad { color: var(--fail); }
.ins-warn { color: #fbbf24; }
.ins-title { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.ins-desc { font-size: 12px; color: var(--text-2); margin: 0; line-height: 1.45; }

/* ---------- Checker panel ---------- */
.checker { display: grid; gap: 18px; }
.checker-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cinput label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.cfield {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card-2); padding: 7px 10px;
}
.cfield input[type="color"] {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px;
  background: none; cursor: pointer;
}
.cfield input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cfield input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-2); border-radius: 8px; }
.cfield input[type="text"] {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--text); font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; text-transform: uppercase;
}

.checker-score { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.score-ratio { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.score-ratio span { font-size: 20px; font-weight: 600; color: var(--text-3); margin-left: 4px; }
.score-grid { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 26px; }
.score-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }

.checker-preview { border-radius: 12px; padding: 22px; }
.checker-preview h3 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.4px; }
.checker-preview p { margin: 0 0 8px; }
.checker-preview .small { font-size: 13px; opacity: .9; }

.suggestion {
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card-2); padding: 14px; font-size: 12.5px; color: var(--text-2);
}
.suggestion strong { color: var(--text); }
.suggest-swatches { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.suggest-swatch {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--card-3);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.suggest-swatch i { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- Library / reports ---------- */
.library-list { display: flex; flex-direction: column; gap: 12px; }
.lib-item {
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card-2); padding: 13px 14px;
}
.lib-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lib-name { font-weight: 600; font-size: 13.5px; }
.lib-meta { font-size: 11.5px; color: var(--text-3); }
.lib-actions { margin-left: auto; display: flex; gap: 6px; }
.lib-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.lib-swatches i { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card-2); padding: 14px;
}
.stat-val { font-size: 26px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.report-breakdown { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 54px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar { height: 8px; border-radius: 5px; background: var(--card-3); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--pass); border-radius: 5px; }
.bar-val { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Guide ---------- */
.guide-lead { font-size: 13.5px; color: var(--text-2); margin: 0 0 18px; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 22px; }
.guide-table th, .guide-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.guide-table th { color: var(--text-2); font-weight: 500; font-size: 12px; }
.guide-table td:first-child { color: var(--text-2); }
.guide-table td:not(:first-child) { font-weight: 600; font-variant-numeric: tabular-nums; }
.guide-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.guide-notes h4 { margin: 0 0 6px; font-size: 13px; }
.guide-notes p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
code {
  background: var(--card-3); padding: 1px 5px; border-radius: 5px;
  font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Modal & toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 6, 12, .68); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
}
.modal {
  width: min(680px, 100%); max-height: 82vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 15px; box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card);
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; }

.pair-list { display: flex; flex-direction: column; gap: 10px; }
.pair {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--card-2);
}
.pair-demo { padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.pair-hexes { font-size: 11.5px; color: var(--text-3); margin-top: 5px; font-variant-numeric: tabular-nums; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.detail-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--card-2); }
.detail-lbl { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.detail-val { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.shade-row { display: flex; gap: 6px; flex-wrap: wrap; }
.shade { flex: 1 1 60px; }
.shade i { display: block; height: 44px; border-radius: 7px; border: 1px solid rgba(255,255,255,.1); }
.shade small { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 5px; text-align: center; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--card-2); border: 1px solid var(--line-2);
  padding: 11px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 200;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .rail { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 1080px) {
  .upload-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 14px; }
  .sidebar { position: static; height: auto; }
  .sidenav { flex-direction: row; overflow-x: auto; }
  .sidenav-item { white-space: nowrap; }
  .workspace { display: none; }
  .brand { width: auto; }
  .checker-inputs { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .topbar, .sidebar, .rail, .toolbar, .card-head .head-actions, .report-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ddd; }
}

/* Standalone local tool: omit unavailable account and team features. */
.topnav, #workspaceBtn, #notifyBtn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .rail { min-width: 0; }
  .rail { grid-template-columns: minmax(0, 1fr); }
  .topbar { height: auto; min-height: 72px; flex-wrap: wrap; gap: 12px; padding: 14px; }
  .topbar-actions { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .file-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .section-head, .card-head { flex-wrap: wrap; gap: 12px; }
  .head-actions { flex-wrap: wrap; }
  .score-grid { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
}
