/* ══════════════════════════════════════════════════
   ONE DESIGN — SHARED STYLESHEET
   style.css
══════════════════════════════════════════════════ */

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── TOKENS ── */
:root {
  /* color palette — primary (backgrounds/surfaces) */
  --color-primary-50: oklch(96.7% 0 89.9);
  --color-primary-100: oklch(93.7% 0.001 106.4);
  --color-primary-200: oklch(83.9% 0.001 106.4);
  --color-primary-300: oklch(70.3% 0.002 67.8);
  --color-primary-400: oklch(53.6% 0.003 48.7);
  --color-primary-500: oklch(28.2% 0.005 67.6);
  --color-primary-600: oklch(24.8% 0.004 84.6);
  --color-primary-700: oklch(21.4% 0.004 84.6);
  --color-primary-800: oklch(17.4% 0.002 17.3);
  --color-primary-900: oklch(14% 0 89.9);

  /* color palette — text */
  --color-text-50: oklch(97.7% 0.002 67.8);
  --color-text-100: oklch(95.2% 0.003 84.6);
  --color-text-200: oklch(88% 0.008 80.7);
  --color-text-300: oklch(78.1% 0.014 82.4);
  --color-text-400: oklch(66.5% 0.022 84.6);
  --color-text-500: oklch(49.4% 0.033 82.4);
  --color-text-600: oklch(42.4% 0.028 81.9);
  --color-text-700: oklch(35.1% 0.022 84.5);
  --color-text-800: oklch(27.1% 0.016 79.5);
  --color-text-900: oklch(19.8% 0.009 75.1);

  /* backgrounds */
  --bg: var(--color-primary-900);
  --bg2: var(--color-primary-800);
  --bg3: var(--color-primary-700);
  --bg4: var(--color-primary-600);

  /* borders */
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.14);
  --border3: rgba(255, 255, 255, 0.24);

  /* semantic */
  --green: #6ee7a0;
  --green-bg: rgba(110, 231, 160, 0.07);
  --green-border: rgba(110, 231, 160, 0.25);

  /* fonts */
  --mono: "DM Sans", sans-serif;
  --serif: "Fraunces", serif;

  /* radii */
  --r-sm: 6px;
  --r: 10px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 16px;

  /* ── TYPE SCALE ──
     All sizes in px; weights: 300 (light), 400 (regular), 500 (medium).
      Serif (Fraunces) for display/headings, sans (DM Sans) for everything else.
  */

  /* display */
  --text-h1: font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-text-100);
  --text-h2: font-family: var(--serif);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--color-text-100);
  --text-h3: font-family: var(--serif);
  font-size: 19px;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--color-text-100);

  /* ui */
  --text-h4: font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--color-text-50);
  --text-h5: font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--color-text-50);
  --text-h6: font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--color-text-50);

  /* body */
  --text-p: font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.65;
  color: var(--color-text-300);
  --text-sm: font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
  color: var(--color-text-300);
  --text-xs: font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: var(--color-text-300);

  /* labels — all caps, spaced */
  --text-label: font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--color-text-300);
  --text-micro: font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--color-text-300);
}

/* ── APPLY TYPE SCALE TO ELEMENTS ── */
h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-text-100);
}
h2 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.4;
  color: var(--color-text-100);
}
h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--color-text-100);
}
h4 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--color-text-50);
}
h5 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--color-text-50);
}
h6 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--color-text-50);
}

h1 em,
h2 em,
h3 em {
  font-style: italic;
}

p {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.65;
  color: var(--color-text-300);
  text-transform: none;
}

a {
  color: var(--color-text-100);
  transition: color 0.2s ease-in-out;
}
a:hover {
  color: var(--color-text-300);
}

/* utility classes */
.text-sm {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
  color: var(--color-text-300);
}
.text-xs {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: var(--color-text-300);
}
.text-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.4;
  color: var(--color-text-300);
  text-transform: uppercase;
}
.text-micro {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.4;
  color: var(--color-text-300);
  text-transform: uppercase;
}

/* ── BASE ── */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--color-text-50);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
}

/* grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}

/* ── ANIMATIONS ── */
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeSlide 0.4s ease both;
}
.fade-in-1 {
  animation: fadeSlide 0.4s ease 0.05s both;
}
.fade-in-2 {
  animation: fadeSlide 0.4s ease 0.1s both;
}
.fade-in-3 {
  animation: fadeSlide 0.4s ease 0.15s both;
}
.fade-in-4 {
  animation: fadeSlide 0.4s ease 0.2s both;
}
.fade-in-5 {
  animation: fadeSlide 0.4s ease 0.25s both;
}
.fade-in-6 {
  animation: fadeSlide 0.4s ease 0.3s both;
}

/* ══════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════ */

.shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding-left: 210px;
}

/* pages that need full viewport height (color picker) */
.shell.full-height {
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════ */

aside {
  width: 210px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-logo {
  padding: 0 20px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-logo a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--color-text-100);
  text-decoration: none;
}

.sidebar-logo-icon {
  display: block;
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: center / contain no-repeat
    url("/assets/logo/oneredesigns-default.svg");
}

.sidebar-logo-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center / contain no-repeat
    url("/assets/logo/oneredesigns-hover.svg");
  opacity: 0;
  transition: opacity 0.22s ease-in-out;
}

.sidebar-logo a:hover .sidebar-logo-icon::after,
.sidebar-logo a:focus-visible .sidebar-logo-icon::after {
  opacity: 1;
}

.sidebar-logo a em {
  font-style: italic;
}

.sidebar-logo .tagline {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-300);
  margin-top: 5px;
}

.sidebar-section {
  padding: 0 10px;
  margin-bottom: 24px;
}

.sidebar-section-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-200);
  padding: 0 8px;
  margin-bottom: 5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  color: var(--color-text-300);
  transition:
    background 0.12s,
    color 0.12s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-200);
}
.sidebar-link.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-50);
}

.sidebar-link svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-link .soon {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-300);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0 20px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text-300);
  line-height: 1.7;
}
/* Deliberately near-invisible — an owner-only door, not a nav item. */
.sidebar-footer-admin {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-footer-admin:hover {
  color: var(--color-text-400);
}
.sidebar-footer-link {
  color: var(--color-text-300);
  text-decoration: underline;
  transition: color 0.15s;
}
.sidebar-footer-link:hover {
  color: var(--color-text-300);
}
.sidebar-footer-coffee {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--color-text-300);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-footer-coffee svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.sidebar-footer-coffee:hover {
  color: var(--color-text-100);
}

/* ══════════════════════════════════════════════════
   MAIN / TOP STRIP
══════════════════════════════════════════════════ */

main {
  flex: 1;
  min-width: 0;
}

/* scrollable main (most pages) */
main.scrollable {
  overflow-y: auto;
  padding: 36px 40px 64px;
}

/* flex-column main (tool pages with fixed topstrip) */
main.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* scrolling content area beneath a fixed topstrip */
.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 36px 40px 64px;
}

.topstrip {
  padding: 13px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
}

.topstrip-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.015em;
  color: var(--color-text-100);
}

.topstrip-title em {
  font-style: italic;
}

.topstrip-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.topstrip-intro {
  margin: 0;
  max-width: 720px;
  font-size: 12px;
  line-height: 1.65;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border2);
  background: var(--color-primary-500);
  color: var(--color-text-300);
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 0.13s,
    color 0.13s,
    transform 0.12s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  font-weight: 600;
  background: var(--color-primary-700);
  color: var(--color-text-100);
  border-color: var(--color-primary-300) !important;
  transition: background 0.13s ease-in-out;
}
.btn-primary:hover {
  background: var(--color-primary-500) !important;
  color: var(--color-text-100) !important;
  border-color: var(--color-primary-300) !important;
}

.btn-secondary {
  font-weight: 600;
  background: var(--color-primary-600);
  color: var(--color-text-300);
  transition: background 0.13s ease-in-out;
}
.btn-secondary:hover {
  background: var(--color-primary-700);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--color-primary-300);
}
.btn-ghost:hover {
  border: none;
  color: var(--color-primary-400);
}

.btn-applied {
  border-color: var(--border2);
  color: var(--color-text-100);
  background: rgba(255, 255, 255, 0.06);
}

.btn-large {
  font-size: 15px;
  padding: 12px 24px;
}

.btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-pill {
  border-radius: 100px;
  padding: 8px 18px;
}

/* ══════════════════════════════════════════════════
   BADGES / TAGS
══════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  border: 1px solid var(--border2);
  border-radius: 100px;
  color: var(--color-text-300);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--color-text-300);
  white-space: nowrap;
}

.tag-green {
  border-color: var(--green-border);
  color: var(--green);
  background: var(--green-bg);
}

/* ══════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: var(--color-text-50);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
  z-index: 500;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════════════ */

.field-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-200);
  margin-bottom: 8px;
  display: block;
}

input[type="text"],
input[type="color"],
textarea {
  font-family: var(--mono);
  color: var(--color-text-50);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  outline: none;
  transition: border-color 0.13s;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--border2);
}

/* ══════════════════════════════════════════════════
   RANGE SLIDERS
══════════════════════════════════════════════════ */

/* Canonical slider — every range input on the site carries .slider.
   The color-picker's channel sliders add .oklch-slider on top for their
   gradient tracks + always-white thumb (its selector is more specific,
   so it wins where it needs to). */
.slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--border2);
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-text-100);
  border: 2px solid var(--bg);
  cursor: pointer;
  transition: transform 0.12s;
}
.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-text-100);
  border: 2px solid var(--bg);
  cursor: pointer;
}

input[type="range"].oklch-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: transparent;
  outline: none;
  position: absolute;
  top: 0;
  margin: 0;
  cursor: pointer;
  border-radius: var(--r);
}

input[type="range"].oklch-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"].oklch-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"].oklch-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.slider-wrap {
  flex: 1;
  position: relative;
  height: 8px;
}

.slider-track {
  width: 100%;
  height: 8px;
  border-radius: var(--r);
  position: absolute;
  top: 0;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-300);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.slider-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-300);
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════ */

.tabs {
  display: flex;
  background: var(--color-primary-500);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}

.tab-btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-300);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--bg3);
  color: var(--color-text-50);
  border-color: var(--border2);
}

.tab-btn:active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: var(--border3);
  transition: all 0s;
}

/* ══════════════════════════════════════════════════
   DASHBOARD — index.html
══════════════════════════════════════════════════ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-greeting p {
  margin-top: 6px;
}

.greeting-name-wrap {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.greeting-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-300);
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
  vertical-align: middle;
  margin-bottom: 1px;
  padding: 0;
  flex-shrink: 0;
}
.greeting-edit-btn svg {
  width: 13px;
  height: 13px;
}
.topbar-greeting h2:hover .greeting-edit-btn,
.greeting-edit-btn:focus {
  opacity: 1;
}
.greeting-edit-btn:hover {
  color: var(--color-text-300);
}
.greeting-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-text-400);
  outline: none;
  font-family: var(--serif);
  font-size: inherit;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.015em;
  color: var(--color-text-100);
  width: 180px;
  padding: 0 0 1px;
  line-height: 1;
}
.greeting-input::placeholder {
  color: var(--color-text-300);
  font-style: italic;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Apply-to-site first-visit tooltip ── */
.apply-btn-wrap {
  position: relative;
}

.apply-tip {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 230px;
  background: var(--color-text-50);
  border-radius: var(--r-lg);
  padding: 14px 36px 14px 16px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.28);
  z-index: 300;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.apply-tip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* upward-pointing arrow */
.apply-tip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 28px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--color-text-50);
}

.apply-tip-title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--color-primary-900);
  margin-bottom: 5px;
  line-height: 1.2;
}

.apply-tip-body {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-primary-600);
}

.apply-tip-close {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-primary-400);
  padding: 0;
  transition:
    background 0.15s,
    color 0.15s;
}

.apply-tip-close:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--color-primary-700);
}

.apply-tip-close svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.scales-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.scales-header-label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-300);
}
.swatch-count-control {
  display: flex;
  align-items: center;
  gap: 2px;
}
.swatch-count-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 5px;
  color: var(--color-text-300);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.swatch-count-btn:hover {
  border-color: var(--border2);
  color: var(--color-text-300);
}
#stop-count {
  width: 28px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-300);
  padding: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
#stop-count::-webkit-outer-spin-button,
#stop-count::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* recent row */
.recent-section {
  margin-bottom: 44px;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: var(--r);
  background: var(--bg2);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s;
}

.recent-item:hover {
  border-color: var(--border2);
}

.recent-swatches {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.recent-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.recent-name {
  font-size: 13px;
  color: var(--color-text-50);
  flex: 1;
}
.recent-tool {
  font-size: 11px;
  color: var(--color-text-300);
  letter-spacing: 0.04em;
}
.recent-time {
  font-size: 11px;
  color: var(--color-text-300);
  letter-spacing: 0.03em;
  font: 1em sans-serif;
  min-width: 60px;
  text-align: right;
}

/* tools grid */
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-300);
  margin-bottom: 14px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

/* tool card */
.tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.18s,
    transform 0.18s;
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}
.tool-card.coming-soon {
  cursor: default;
  opacity: 0.5;
}
.tool-card.coming-soon:hover {
  transform: none;
  border-color: var(--border);
}

.card-preview {
  height: 140px;
  position: relative;
  overflow: hidden;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
}

.card-preview-swatches {
  display: flex;
  width: 100%;
  height: 100%;
}
.card-preview-swatches .ps {
  flex: 1;
  height: 100%;
}

.card-preview-soon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-300);
}

.card-preview-soon .soon-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 300;
  font-style: italic;
  color: var(--color-text-300);
  margin-bottom: 6px;
}

.card-preview-tags {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.card-preview-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-preview-tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--color-text-300);
}

.card-preview-type {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 20px 24px;
  width: 100%;
  height: 100%;
}
.card-preview-type-line {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  height: 4px;
}
.card-preview-type-line:nth-child(1) {
  width: 62%;
  height: 20px;
  border-radius: 5px;
  margin-bottom: 10px;
}
.card-preview-type-line:nth-child(2) {
  width: 44%;
  height: 13px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.card-preview-type-line:nth-child(3) {
  width: 92%;
  margin-bottom: 6px;
}
.card-preview-type-line:nth-child(4) {
  width: 84%;
  margin-bottom: 6px;
}
.card-preview-type-line:nth-child(5) {
  width: 58%;
}

@keyframes grad-card-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
#grad-card-preview {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    oklch(72% 0.18 265),
    oklch(72% 0.18 340),
    oklch(72% 0.13 180),
    oklch(72% 0.18 265)
  );
  background-size: 300% 300%;
  animation: grad-card-shift 20s ease-in-out infinite;
}

.card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-50);
  letter-spacing: 0.01em;
}
.card-desc {
  font-size: 12px;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-meta {
  font-size: 10px;
  color: var(--color-text-300);
  letter-spacing: 0.05em;
}

.card-arrow {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-300);
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}

.tool-card:hover .card-arrow {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border3);
  color: var(--color-text-50);
  transform: translateX(2px);
}

.card-arrow svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-arrow.disabled {
  opacity: 0.3;
}

/* ══════════════════════════════════════════════════
   PALETTE GENERATOR — oklch-palette.html
══════════════════════════════════════════════════ */

.palette-sections {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

@media (min-width: 1024px) {
  .palette-sections {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 32px;
    align-items: start;
  }
}

.pickers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  align-items: stretch;
  padding: 0px;
}

.picker-card {
  border-top: 1px solid var(--border);
  padding: 20px;
  transition: border-color 0.2s;
  position: relative;
}

.picker-card:focus-within {
  border-color: var(--border2);
}

.picker-card-header {
  margin-bottom: 14px;
}

.name-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-300);
  width: 100%;
  padding: 6px 6px;
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.15s,
    color 0.15s;
  cursor: text;
  border-radius: var(--r-sm) !important;
}

.name-input:hover {
  border-bottom-color: var(--border2);
  color: var(--color-text-300);
}
.name-input:focus {
  border-bottom-color: var(--border3);
  color: var(--color-text-50);
}

.picker-oklch {
  display: block;
  margin-top: 10px;
  font-size: 10px;
  color: var(--color-text-300);
  font-family: var(--mono);
  white-space: nowrap;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.15s,
    background 0.15s,
    border-color 0.15s;
  color: var(--color-text-300);
}

.picker-card:hover .remove-btn {
  opacity: 1;
}
.remove-btn:hover {
  background: rgba(255, 80, 80, 0.1);
  border-color: rgba(255, 80, 80, 0.3);
  color: #ff6b6b;
}
.remove-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.picker-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.color-swatch-btn:hover {
  transform: scale(1.05);
}

.color-swatch-btn input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: none;
  cursor: pointer;
  opacity: 0;
}

.color-swatch-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hex-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.add-color-card {
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  color: var(--color-text-300);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.add-color-card:hover {
  border-color: var(--border3);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-300);
}

.add-icon {
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.add-color-card:hover .add-icon,
.picker-action--add:hover .add-icon {
  transform: rotate(90deg);
}

/* Split add-color / color-library card */
.picker-actions-card {
  border: 1px dashed var(--border2);
  display: flex;
  overflow: hidden;
  transition: border-color 0.2s;
}
.picker-actions-card:hover {
  border-color: var(--border3);
}
.picker-action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-300);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    background 0.2s,
    color 0.2s;
}
.picker-action + .picker-action {
  border-left: 1px dashed var(--border2);
}
.picker-action:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-200);
}
.add-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ─────────────────────────────────────────────────────────────
   SHADOW & ELEVATION TOOL
   Add these rules to assets/style.css
   ───────────────────────────────────────────────────────────── */

/* ── Shared control labels ─────────────────────────────────── */
.shadow-hint {
  font-size: 12px;
  color: var(--color-text-tertiary);
  line-height: 1.5;
  margin: 0;
}

.shadow-control-label {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

/* ── Palette chip row ─────────────────────────────────────── */
.palette-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.shadow-palette-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    transform 0.1s,
    border-color 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.shadow-palette-chip:hover {
  transform: scale(1.15);
}
.shadow-palette-chip.active {
  border: 3px solid var(--color-text-100);
}

/* ── Palette swatch strip ─────────────────────────────────── */
.palette-swatch-strip {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.shadow-swatch-stop {
  flex: 1;
}

/* ── Slider rows ──────────────────────────────────────────── */
.shadow-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.shadow-slider-row input[type="range"] {
  flex: 1;
}

.shadow-slider-val {
  font-size: 11px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
  color: var(--color-text-secondary);
  min-width: 34px;
  text-align: right;
}

/* ── Dual surface preview ─────────────────────────────────── */
.shadow-surfaces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.shadow-surfaces--single {
  grid-template-columns: 1fr;
}

.shadow-surface {
  border-radius: var(--radius-md, 8px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid transparent;
}

.shadow-surface--light {
  background: #f5f4f0;
  border-color: #e5e4e0;
}

.shadow-surface--dark {
  background: #141414;
  border-color: #2a2a2a;
}

.shadow-surface-label {
  font-size: 10px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shadow-surface--light .shadow-surface-label {
  color: #999;
}
.shadow-surface--dark .shadow-surface-label {
  color: #555;
}

/* ── Individual preview cards ─────────────────────────────── */
.shadow-preview-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.shadow-preview-card {
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: box-shadow 0.2s ease;
}

.shadow-preview-card--light {
  background: #ffffff;
}
.shadow-preview-card--dark {
  background: #222222;
}

.shadow-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shadow-card-label {
  font-size: 11px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.shadow-preview-card--light .shadow-card-label {
  color: #333;
}
.shadow-preview-card--dark .shadow-card-label {
  color: #ccc;
}

.shadow-card-use {
  font-size: 10px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
}

.shadow-preview-card--light .shadow-card-use {
  color: #999;
}
.shadow-preview-card--dark .shadow-card-use {
  color: #555;
}

.shadow-card-blur {
  font-size: 10px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
  opacity: 0.4;
}

.shadow-preview-card--light .shadow-card-blur {
  color: #333;
}
.shadow-preview-card--dark .shadow-card-blur {
  color: #aaa;
}

/* ── Token rows ───────────────────────────────────────────── */
.shadow-tokens {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shadow-token-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface-subtle, rgba(0, 0, 0, 0.02));
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.shadow-token-row:hover {
  border-color: var(--color-border-strong, rgba(0, 0, 0, 0.2));
  background: rgba(255, 255, 255, 0.04);
}

.shadow-token-name {
  font-size: 12px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.shadow-token-value {
  font-size: 10px;
  font-family: var(--font-mono, "DM Sans", sans-serif);
  color: var(--color-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shadow-token-swatch {
  height: 26px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

/* ── HARMONY SUGGESTIONS ──────────────────────────────── */
.harmony-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.harmony-from-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-500);
  flex-shrink: 0;
}
.harmony-base-sel {
  display: flex;
  gap: 5px;
  align-items: center;
}
.harmony-base-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition:
    transform 0.1s,
    border-color 0.12s;
}
.harmony-base-dot:hover {
  transform: scale(1.2);
}
.harmony-base-dot.active {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.harmony-divider {
  width: 1px;
  height: 14px;
  background: var(--border2);
  flex-shrink: 0;
}
.harmony-tabs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.harmony-tab {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--color-text-500);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.harmony-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-300);
  border-color: var(--border2);
}
.harmony-tab.active {
  background: var(--bg3);
  border-color: var(--border3);
  color: var(--color-text-100);
}
.harmony-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.harmony-chip {
  flex-shrink: 0;
  width: 168px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.15s;
}
.harmony-chip:hover {
  border-color: var(--border2);
}
.harmony-chip-scale {
  display: flex;
  border-radius: var(--r-sm);
  overflow: hidden;
  height: 30px;
}
.harmony-chip-sw {
  flex: 1;
}
.harmony-chip-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.harmony-chip-lbl {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-500);
}
.harmony-chip-hex {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-300);
  letter-spacing: 0.02em;
}
.harmony-chip-add {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--color-text-300);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.harmony-chip-add:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border3);
  color: var(--color-text-100);
}
.harmony-chip-add:disabled {
  opacity: 0.35;
  cursor: default;
}
.harmony-chip-load:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border3);
  color: var(--color-text-100);
}
.chip-saved {
  color: var(--color-text-500);
}
/* harmony-header inside output-scroll: label is inline with tabs */
.harmony-header .out-section-title {
  margin-bottom: 0;
  flex-shrink: 0;
}

.scales-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.scale-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.scale-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.scale-name-display {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-300);
}

.swatches {
  display: flex;
  gap: 3px;
  border-radius: var(--r);
  overflow: hidden;
}

.swatch {
  flex: 1;
  height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px;
  cursor: pointer;
  transition: flex 0.2s ease;
  position: relative;
  min-width: 0;
}

.swatch:hover {
  flex: 1.8;
}

.swatch-stop {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1;
}
.swatch-hex {
  font-size: 8px;
  font-family: var(--mono);
  margin-top: 3px;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swatch-copy-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
}

.swatch:hover .swatch-copy-hint {
  opacity: 0.6;
  transform: translate(-50%, -50%);
}

@keyframes fadeUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.swatch.copied::after {
  content: "✓";
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 11px;
  animation: fadeUp 0.8s ease forwards;
}

.divider {
  height: 1px;
  background: var(--border);
}

.output-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.output-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #c9c5be;
  white-space: pre;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.75;
}

.token-key {
  color: #8ba4c7;
}
.token-val {
  color: #b9d09a;
}
.token-comment {
  color: #4d4d52;
}
.token-punct {
  color: #6b6868;
}

/* ══════════════════════════════════════════════════
   COLOR PICKER — color-picker.html
══════════════════════════════════════════════════ */

.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Structural role (width, border, scroll, column) comes from .grad-panel —
   this modifier only adds the picker's internal padding + gap. */
.picker-panel {
  padding: 24px 20px;
  gap: 24px;
}

.canvas-stack {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  flex-shrink: 0;
}

#hue-canvas {
  position: absolute;
  inset: 0;
  /* A canvas keeps its intrinsic 280px unless width/height are explicit —
     inset:0 alone won't scale it to the responsive stack, which would
     leave the hue ring oversized and off-centre from the gamut. */
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: crosshair;
}
#gamut-canvas {
  position: absolute;
  border-radius: 50%;
  cursor: crosshair;
}

.gamut-thumb {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hue-thumb {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.output-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.color-stage {
  height: 180px;
  flex-shrink: 0;
  position: relative;
  transition: background 0.08s;
  display: flex;
  align-items: flex-end;
  padding: 18px 24px;
}

.stage-values {
  display: flex;
  gap: 20px;
  align-items: baseline;
}

.stage-hex {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: color 0.08s;
}

.stage-oklch {
  font-family: var(--mono);
  font-size: 12px;
  transition: color 0.08s;
  letter-spacing: 0.02em;
}

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

.stage-copy-btn {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.13s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-copy-btn:hover {
  background: rgba(0, 0, 0, 0.35);
}
.stage-copy-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.output-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.output-step {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.output-step:last-child,
.output-step:last-of-type {
  border-bottom: none;
}

/* Palette (final step) */
.output-step--palette {
  flex-direction: column;
}
.output-palette-btn {
  display: flex;
  margin: 8px auto 0;
}

.out-section-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-300);
  margin-bottom: 10px;
}

/* Save-to-palette button in stage gets a white-on-color tint treatment */
.stage-save-btn {
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* ── Saved colors (color-picker page) ── */
.saved-colors-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.saved-colors-header .out-section-title {
  margin-bottom: 0;
}
.saved-color-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.saved-color-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 0.13s;
}
.saved-color-item:hover {
  border-color: var(--border2);
}
.saved-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.saved-color-hex {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-200);
  flex: 1;
  letter-spacing: 0.04em;
}
.saved-color-remove {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--color-text-500);
  padding: 0;
  flex-shrink: 0;
  transition:
    color 0.13s,
    background 0.13s;
}
.saved-color-remove:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}
.saved-color-remove svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* ── Picker-card glow (palette page) ── */
@keyframes pickerCardGlow {
  0% {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.12);
  }
  22% {
    box-shadow:
      0 0 0 3px var(--glow-solid, rgba(255, 255, 255, 0.4)),
      0 0 24px 8px var(--glow-dim, rgba(255, 255, 255, 0.1));
    border-color: var(--glow-solid, var(--border2));
  }
  100% {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.12);
  }
}
.picker-card.new-from-picker .color-swatch-btn {
  animation: pickerCardGlow 2s cubic-bezier(0.25, 0, 0.35, 1) forwards;
}

.format-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.format-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.13s;
}

.format-row:hover {
  border-color: var(--border2);
}

.format-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-300);
  width: 56px;
  flex-shrink: 0;
}

.format-value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-300);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.format-copy {
  color: var(--color-text-300);
  transition: color 0.13s;
  flex-shrink: 0;
}
.format-row:hover .format-copy {
  color: var(--color-text-300);
}
.format-copy svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.harmony-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.harmony-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.harmony-swatch-color {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    transform 0.15s,
    border-color 0.15s;
}

.harmony-swatch:hover .harmony-swatch-color {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
}
.harmony-swatch.active .harmony-swatch-color {
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.harmony-swatch-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--color-text-300);
  text-align: center;
}

.contrast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contrast-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Nested preview: outer = contrast bg, inner = user's color */
.contrast-preview {
  width: 58px;
  height: 58px;
  border-radius: var(--r);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contrast-preview-inner {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
}

.contrast-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.contrast-against {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-500);
}

.contrast-ratio {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--color-text-50);
}

.contrast-ratio span {
  font-size: 14px;
  color: var(--color-text-300);
}

.contrast-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 1px;
}

.wcag-badge {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

.wcag-pass {
  background: rgba(110, 231, 160, 0.12);
  color: #6ee7a0;
  border: 1px solid rgba(110, 231, 160, 0.2);
}
.wcag-fail {
  background: rgba(255, 100, 100, 0.08);
  color: #f87171;
  border: 1px solid rgba(255, 100, 100, 0.15);
}

.harmony-tabs {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}

.htab {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--color-text-300);
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.htab.active {
  background: var(--bg3);
  color: var(--color-text-50);
  border: 1px solid var(--border2);
}

/* ══════════════════════════════════════════════════
   CASE CONVERTER — case-converter.html
══════════════════════════════════════════════════ */

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px 48px;
}

.input-section {
  margin-bottom: 28px;
}

.textarea-wrap {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.textarea-wrap:focus-within {
  border-color: var(--border2);
}

textarea#main-input {
  width: 100%;
  min-height: 200px;
  background: var(--bg2);
  border: none;
  outline: none;
  resize: vertical;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

textarea#main-input::placeholder {
  color: var(--color-text-300);
}

.input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.input-stats {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-300);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-dot {
  color: var(--color-text-300);
}

.tx-section {
  margin-bottom: 32px;
}

.tx-section-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-50);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tx-grid {
  display: grid;
  gap: 10px;
}
.tx-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
.tx-grid.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}
.tx-grid.cols-auto {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

@media (max-width: 900px) {
  .tx-grid.cols-4,
  .tx-grid.cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .tx-grid.cols-4,
  .tx-grid.cols-5 {
    grid-template-columns: 1fr;
  }
}

@keyframes txCardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.tx-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px 18px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.12s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
  animation: txCardIn 0.3s ease both;
  animation-delay: calc(var(--tx-i, 0) * 30ms);
}

.tx-card:hover {
  border-color: var(--border2);
  background: var(--bg3);
  transform: translateY(-1px);
}
.tx-card:active {
  transform: scale(0.98);
}

.tx-card.applied {
  border-color: var(--green-border);
  background: rgba(110, 231, 160, 0.04);
}

.tx-card-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-50);
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-transform: none;
}

.tx-card-desc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-300);
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-transform: none;
}

.tx-card-preview {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--color-text-300);
  letter-spacing: 0.02em;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.tx-card:hover .tx-card-preview {
  color: var(--color-text-300);
}

.tx-card::after {
  content: "Applied!";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(110, 231, 160, 0.1);
  border-radius: 11px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.tx-card.flash::after {
  opacity: 1;
}

/* ── SPACING UTILITIES ── */
.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-5 {
  margin-top: 20px;
}
.mt-6 {
  margin-top: 24px;
}
.mt-7 {
  margin-top: 28px;
}
.mt-8 {
  margin-top: 32px;
}
.mt-9 {
  margin-top: 36px;
}
.mt-10 {
  margin-top: 40px;
}
.mt-11 {
  margin-top: 44px;
}
.mt-12 {
  margin-top: 48px;
}
.mt-13 {
  margin-top: 52px;
}
.mt-14 {
  margin-top: 56px;
}

.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 16px;
}
.mb-5 {
  margin-bottom: 20px;
}
.mb-6 {
  margin-bottom: 24px;
}
.mb-7 {
  margin-bottom: 28px;
}
.mb-8 {
  margin-bottom: 32px;
}
.mb-9 {
  margin-bottom: 36px;
}
.mb-10 {
  margin-bottom: 40px;
}
.mb-11 {
  margin-bottom: 44px;
}
.mb-12 {
  margin-bottom: 48px;
}
.mb-13 {
  margin-bottom: 52px;
}
.mb-14 {
  margin-bottom: 56px;
}

/* ══════════════════════════════════════════════════
   GRADIENT STUDIO
══════════════════════════════════════════════════ */

.grad-panel {
  width: 290px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.grad-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.grad-section-stops {
  border-bottom: none;
  flex: 1;
}

.grad-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grad-preview-section {
  padding: 24px 28px 0;
  flex-shrink: 0;
}

/* ── GRADIENT SAVES ──────────────────────────────────── */
.grad-saves-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 24px;
}
.grad-saves-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.grad-save-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grad-save-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.15s;
}
.grad-save-card:hover {
  border-color: var(--border2);
}
.grad-save-bar {
  height: 44px;
  width: 100%;
  display: block;
  transition: background 0.06s;
}
.grad-save-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
}
.grad-save-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-text-200);
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 1px solid transparent;
  min-width: 0;
  flex: 1;
  cursor: text;
  transition: border-color 0.13s;
}
.grad-save-name:hover {
  border-bottom-color: var(--border2);
}
.grad-save-name:focus {
  border-bottom-color: var(--border3);
}
.grad-save-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--color-text-500);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  white-space: nowrap;
}
.grad-save-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.grad-save-load {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--color-text-300);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.grad-save-load:hover {
  background: var(--bg3);
  border-color: var(--border3);
  color: var(--color-text-100);
}
.grad-save-del {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--color-text-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.grad-save-del:hover {
  background: rgba(255, 100, 100, 0.1);
  color: #f87171;
  border-color: rgba(255, 100, 100, 0.3);
}
.grad-save-del svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.grad-preview {
  height: 220px;
  border-radius: var(--r-lg);
  transition: background 0.06s;
  position: relative;
  overflow: hidden;
}

@keyframes gradIntroSweep {
  0% {
    background-position: 0% 50%;
  }
  40% {
    background-position: 100% 20%;
  }
  70% {
    background-position: 40% 100%;
  }
  100% {
    background-position: 50% 50%;
  }
}

#grad-intro-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    oklch(58% 0.25 265),
    oklch(67% 0.22 305),
    oklch(72% 0.19 350),
    oklch(66% 0.18 200),
    oklch(60% 0.24 250)
  );
  background-size: 300% 300%;
  animation: gradIntroSweep 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: opacity 0.55s ease;
  pointer-events: none;
  z-index: 1;
}

#grad-intro-overlay.fade-out {
  opacity: 0;
}

.grad-track-outer {
  position: relative;
  height: 28px;
  margin-top: 12px;
  cursor: crosshair;
}

.grad-track {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: 4px;
  pointer-events: none;
}

.grad-handles {
  position: absolute;
  inset: 0;
}

.grad-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.4);
  top: 3px;
  transform: translateX(-50%);
  cursor: grab;
  transition: box-shadow 0.1s;
  z-index: 2;
}

.grad-handle:hover {
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.3),
    0 3px 10px rgba(0, 0, 0, 0.5);
}
.grad-handle.selected {
  box-shadow:
    0 0 0 2.5px rgba(255, 255, 255, 0.7),
    0 0 0 4px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.5);
}

.grad-track-hint {
  text-align: center;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-300);
}

.grad-code-section {
  flex: 1;
  min-height: 0;
  padding: 16px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.grad-output-box {
  flex: 1;
  min-height: 0;
  max-height: none !important;
}

/* angle wheel */
.angle-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 10px;
}

.angle-wheel {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  position: relative;
  cursor: crosshair;
  flex-shrink: 0;
  background: var(--bg3);
  user-select: none;
}

.angle-wheel::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.angle-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-400);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.angle-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.angle-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 9px;
}

.angle-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--color-text-50);
  width: 46px;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}
.angle-input::-webkit-inner-spin-button,
.angle-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.angle-unit {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--color-text-300);
}

.dir-presets {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  gap: 2px;
}

.dir-presets button,
.dir-presets span {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--color-text-300);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.1s,
    color 0.1s,
    border-color 0.1s;
  line-height: 1;
}

.dir-presets button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-text-300);
  border-color: var(--border2);
}
.dir-presets span {
  cursor: default;
  opacity: 0.2;
  border-color: transparent;
}

/* stop rows */
.stop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.1s,
    border-color 0.1s;
  margin-bottom: 3px;
}

.stop-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}
.stop-row.selected {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border2);
}

.stop-swatch-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.stop-swatch {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.stop-color-input {
  position: absolute;
  inset: -3px;
  opacity: 0;
  cursor: pointer;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  border: none;
}

.stop-hex-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 1px solid transparent;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--color-text-300);
  padding: 2px 0;
  transition: border-color 0.1s;
}

.stop-hex-input:hover {
  border-bottom-color: var(--border2);
}
.stop-hex-input:focus {
  border-bottom-color: var(--border3);
  color: var(--color-text-50);
}

.stop-pos-input {
  width: 42px;
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 1px solid transparent;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-300);
  text-align: right;
  padding: 2px 0;
  appearance: textfield;
  -moz-appearance: textfield;
  transition: border-color 0.1s;
}

.stop-pos-input::-webkit-inner-spin-button,
.stop-pos-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.stop-pos-input:hover {
  border-bottom-color: var(--border2);
}
.stop-pos-input:focus {
  border-bottom-color: var(--border3);
  color: var(--color-text-50);
}

.stop-pos-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-300);
}

.stop-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.12s,
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
  color: var(--color-text-300);
  flex-shrink: 0;
}

.stop-row:hover .stop-remove {
  opacity: 1;
}
.stop-remove:hover {
  background: rgba(255, 80, 80, 0.1);
  border-color: rgba(255, 80, 80, 0.3);
  color: #ff6b6b;
}
.stop-remove svg {
  width: 8px;
  height: 8px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.stop-remove-placeholder {
  width: 20px;
  flex-shrink: 0;
}

.add-stop-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 6px;
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--color-text-300);
  text-transform: uppercase;
  transition:
    border-color 0.12s,
    color 0.12s,
    background 0.12s;
  margin-top: 4px;
}

.add-stop-btn:hover {
  border-color: var(--border3);
  color: var(--color-text-300);
  background: rgba(255, 255, 255, 0.02);
}
.add-stop-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   SAVED PALETTES
══════════════════════════════════════════════════ */

.palettes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

.palette-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.18s;
}

.palette-card:hover {
  border-color: var(--border2);
}

.palette-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.palette-name-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text-50);
  width: 100%;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s;
  cursor: text;
}

.palette-name-input:hover {
  border-bottom-color: var(--border2);
}
.palette-name-input:focus {
  border-bottom-color: var(--border3);
}

.palette-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.palette-meta-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--color-text-300);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.palette-swatches {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.palette-scale-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.palette-scale-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-300);
  width: 60px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-scale-strip {
  display: flex;
  flex: 1;
  border-radius: 5px;
  overflow: hidden;
  height: 22px;
}

.palette-scale-block {
  flex: 1;
  height: 100%;
}

.palette-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.palette-card-footer .btn {
  font-size: 11px;
  padding: 5px 11px;
}

.palette-delete-btn {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-300);
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
  flex-shrink: 0;
}

.palette-delete-btn:hover {
  background: rgba(255, 80, 80, 0.1);
  border-color: rgba(255, 80, 80, 0.3);
  color: #ff6b6b;
}
.palette-delete-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* empty state */
.palettes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
  border: 1px dashed var(--border2);
  border-radius: var(--r-lg);
  max-width: 480px;
  margin: 0 auto 48px;
}

.palettes-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-300);
  margin-bottom: 4px;
}

.palettes-empty-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.palettes-empty h3 {
  font-size: 18px;
  color: var(--color-text-300);
}
.palettes-empty p {
  font-size: 12px;
  color: var(--color-text-300);
  max-width: 280px;
  line-height: 1.7;
}
.palettes-empty em {
  font-style: italic;
  color: var(--color-text-300);
}

/* ── 404 ── */
.not-found {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 60px 24px;
}
.not-found-inner {
  text-align: center;
  max-width: 400px;
}
.not-found-code {
  font-family: var(--serif);
  font-size: 120px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--color-text-200);
  margin-bottom: 12px;
}
.not-found-inner h2 {
  margin-bottom: 16px;
}
.not-found-desc {
  color: var(--color-text-300);
  max-width: 320px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.not-found-btn {
  display: inline-flex;
}

/* ── TYPE SAVE CARD PREVIEW ── */
.type-save-preview {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.type-save-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.type-save-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-300);
  width: 44px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.type-save-bar {
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  min-width: 8px;
}
.type-save-row:first-child .type-save-bar {
  background: var(--color-text-300);
  height: 6px;
}
.type-save-row:nth-child(2) .type-save-bar {
  background: var(--color-text-400);
  height: 5px;
}

/* ── SITE FOOTER ── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 24px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--color-text-300);
  text-align: center;
  pointer-events: none;
  z-index: 10;
}
.site-footer-link {
  color: var(--color-text-300);
  text-decoration: none;
  pointer-events: all;
  transition: color 0.15s;
}
.site-footer-link:hover {
  color: var(--color-text-500);
}

/* ── MOBILE NAV (hidden on desktop) ── */
.mob-header {
  display: none;
}
.mob-backdrop {
  display: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 760px) {
  .shell {
    padding-left: 0;
  }

  /* ── Mobile header bar ── */
  .mob-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    padding: 0 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 400;
  }
  .mob-menu-btn {
    order: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--r-sm);
    color: var(--color-text-300);
    cursor: pointer;
    flex-shrink: 0;
  }
  .mob-menu-btn svg {
    width: 16px;
    height: 16px;
  }
  .mob-logo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 300;
    color: var(--color-text-100);
    text-decoration: none;
    letter-spacing: -0.01em;
  }
  .mob-logo-icon {
    display: block;
    position: relative;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    background: center / contain no-repeat
      url("/assets/logo/oneredesigns-default.svg");
  }
  .mob-logo-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: center / contain no-repeat
      url("/assets/logo/oneredesigns-hover.svg");
    opacity: 0;
    transition: opacity 0.22s ease-in-out;
  }
  .mob-logo:hover .mob-logo-icon::after,
  .mob-logo:focus-visible .mob-logo-icon::after {
    opacity: 1;
  }
  .mob-logo em {
    font-style: italic;
  }

  /* ── Sidebar becomes slide-in drawer ── */
  aside {
    display: flex !important;
    position: fixed;
    left: auto;
    right: -230px;
    top: 0;
    bottom: 0;
    z-index: 500;
    width: 220px;
    height: 100dvh;
    border-right: none;
    border-left: 1px solid var(--border);
    transition: right 0.25s ease;
  }
  .shell.nav-open aside {
    right: 0;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
  }
  /* Logo already lives in the mobile header bar — hide the drawer's copy. */
  .sidebar-logo {
    display: none;
  }

  /* ── Backdrop ── */
  .mob-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 499;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .shell.nav-open .mob-backdrop {
    opacity: 1;
    pointer-events: all;
  }

  /* ── Content offset for fixed header ── */
  main.scrollable {
    padding: 20px 18px 28px;
    padding-top: 72px;
  }
  .scroll-area {
    padding: 20px 18px 28px;
    padding-top: 72px;
  }
  main.panel {
    padding-top: 52px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* ── Unstick full-height constraint on mobile ── */
  .shell.full-height {
    height: auto;
    overflow: visible;
  }

  /* ── Topstrip wrapping ── */
  .topstrip {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }
  .topstrip-actions {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  /* ── Harmony tabs scroll on mobile ── */
  .harmony-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Stack tool panels ── */
  .workspace {
    flex-direction: column;
    overflow: visible;
    height: auto;
    flex: none;
  }

  /* Color picker left panel */
  .picker-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    height: auto;
  }

  /* Color picker right panel */
  .output-panel {
    overflow: visible;
    flex: none;
    height: auto;
  }
  .color-stage {
    height: 120px;
  }

  /* Gradient + type guide left panel */
  .grad-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    height: auto;
    max-height: none;
    overflow: visible;
  }

  /* Gradient + type guide right area */
  .grad-main {
    overflow: visible;
    flex: none;
    height: auto;
  }
  .grad-code-section {
    overflow: visible;
    height: auto;
  }

  /* ── Palette topbar right row ── */
  .topbar-right {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .badge {
    display: none;
  }

  /* ── Saved page grid ── */
  .palettes-grid {
    grid-template-columns: 1fr;
  }

  /* ── Panel-scroll pages (shadow / palette): match other pages' side padding ── */
  .panel-scroll {
    padding: 20px 16px 56px;
  }

  /* In-card segmented controls fill the width instead of overflowing the card */
  .picker-card .tabs {
    width: 100%;
  }
  .picker-card .tab-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 6px 4px;
    font-size: 11px;
  }
}

/* ══════════════════════════════════════════════════
   EXPORT MODAL (shared)
══════════════════════════════════════════════════ */

.export-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.export-modal.open {
  opacity: 1;
  pointer-events: all;
}
.export-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.export-modal-box {
  position: relative;
  width: 700px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.18s;
}
.export-modal.open .export-modal-box {
  transform: none;
}
.export-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.export-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.export-modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--color-text-300);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition:
    background 0.12s,
    color 0.12s;
}
.export-modal-close:hover {
  background: var(--bg3);
  color: var(--color-text-300);
}
.export-modal-body {
  flex: 1;
  overflow: auto;
}
.export-modal-code {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #c9c5be;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.75;
  margin: 0;
  display: block;
}
.export-modal .format-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── PRESETS MODAL ── */
.presets-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.presets-modal.open {
  opacity: 1;
  pointer-events: all;
}
.presets-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.presets-modal-box {
  position: relative;
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.18s;
}
.presets-modal.open .presets-modal-box {
  transform: none;
}
.presets-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-300);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.presets-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
}
.preset-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg3);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  text-align: left;
  transition:
    border-color 0.15s,
    transform 0.12s;
}
.preset-card:hover {
  border-color: var(--border3);
  transform: scale(1.03);
}
.preset-card:active {
  transform: scale(0.98);
}
.preset-swatches {
  display: flex;
  height: 32px;
}
.preset-swatch {
  flex: 1;
  display: block;
}
.preset-name {
  display: block;
  padding: 5px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-300);
  letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════
   TYPE GUIDE
══════════════════════════════════════════════════ */

.type-scale-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.type-scale-device {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-300);
  width: 54px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.type-base-input {
  width: 52px;
  padding: 5px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--color-text-300);
  font-size: 13px;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}
.type-base-input::-webkit-inner-spin-button,
.type-base-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.type-base-input:focus {
  outline: none;
  border-color: var(--border3);
}

.type-scale-unit {
  font-size: 12px;
  color: var(--color-text-300);
}

.type-ratio-row {
  margin-bottom: 4px;
}

.type-ratio-select {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--color-text-300);
  font-size: 12px;
  cursor: pointer;
}
.type-ratio-select:focus {
  outline: none;
  border-color: var(--border2);
}

.type-font-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.type-font-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-300);
  width: 54px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.type-font-input {
  flex: 1;
  padding: 5px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--color-text-300);
  font-size: 12px;
  min-width: 0;
}
.type-font-input:focus {
  outline: none;
  border-color: var(--border3);
}

.type-font-load {
  padding: 5px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--color-text-300);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.type-font-load:hover {
  background: var(--bg4);
  color: var(--color-text-300);
}

.type-font-hint {
  font-size: 11px;
  color: var(--color-text-300);
  margin: 0;
}

/* ── Font picker ─────────────────────────────────── */
.font-picker-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.font-picker-trigger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--color-text-300);
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.15s;
  font-family: inherit;
}
.font-picker-trigger:hover {
  border-color: var(--border2);
}
.font-picker-trigger.open {
  border-color: var(--border3);
}

.font-picker-trigger-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1;
}

.font-picker-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  opacity: 0.5;
}

.font-picker-dropdown {
  position: fixed;
  z-index: 900;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  overflow: hidden;
  display: none;
}
.font-picker-dropdown.open {
  display: flex;
}

.font-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.font-picker-search-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: var(--color-text-300);
  stroke-width: 2;
  fill: none;
}

.font-picker-search {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 12px;
  color: var(--color-text-300);
  font-family: var(--mono);
}
.font-picker-search::placeholder {
  color: var(--color-text-300);
}

.font-picker-list {
  overflow-y: auto;
  max-height: 300px;
  padding: 4px 0;
}

.font-picker-cat {
  padding: 8px 12px 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-300);
  font-weight: 500;
  font-family: var(--mono);
}

.font-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--color-text-300);
  transition: background 0.1s;
  font-family: inherit;
}
.font-picker-item:hover {
  background: var(--bg3);
}
.font-picker-item.active {
  background: var(--bg3);
}

.font-picker-item-name {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.font-picker-check {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: var(--color-text-300);
  stroke-width: 2.5;
  fill: none;
}

.font-picker-empty {
  padding: 20px 12px;
  font-size: 12px;
  color: var(--color-text-300);
  text-align: center;
  font-family: var(--mono);
}

/* ── Preview area ─────────────────────────────── */

.type-preview-wrap {
  flex: 1;
  overflow-y: auto;
}

.type-preview {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.type-level-row {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--border);
}
.type-level-row:last-child {
  border-bottom: none;
}

.type-level-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.type-level-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-300);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.type-level-size-badge {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--color-text-300);
  flex-shrink: 0;
}

.type-level-ctrls {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.type-ctrl {
  padding: 3px 5px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--color-text-300);
  font-size: 11px;
  cursor: pointer;
  min-width: 0;
}
.type-ctrl:focus {
  outline: none;
  border-color: var(--border3);
}
.type-ctrl:hover {
  background: var(--bg3);
}

.type-level-sample {
  outline: none;
  color: var(--color-text-50);
  word-break: break-word;
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.15s;
}
.type-level-sample:hover {
  background: var(--bg2);
}
.type-level-sample:focus {
  background: var(--bg2);
}

/* ── EXPORT HISTORY ── */
:root {
  --eh-palette: oklch(74% 0.15 200);
  --eh-gradient: oklch(74% 0.15 290);
  --eh-color: oklch(74% 0.15 55);
  --eh-type: oklch(74% 0.15 150);
}

.eh-wrap {
  padding: 24px;
  max-width: 820px;
}

.eh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 80px 0;
  color: var(--color-text-500);
  text-align: center;
}
.eh-empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}
.eh-empty p {
  font-size: 14px;
  max-width: 340px;
  line-height: 1.6;
}

.eh-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eh-entry {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eh-entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eh-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 100px;
  line-height: 1.6;
}
.eh-badge-palette {
  background: oklch(74% 0.15 200 / 0.15);
  color: var(--eh-palette);
}
.eh-badge-gradient {
  background: oklch(74% 0.15 290 / 0.15);
  color: var(--eh-gradient);
}
.eh-badge-color {
  background: oklch(74% 0.15 55 / 0.15);
  color: var(--eh-color);
}
.eh-badge-type {
  background: oklch(74% 0.15 150 / 0.15);
  color: var(--eh-type);
}

.eh-format {
  font-size: 12px;
  color: var(--color-text-300);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--mono);
}

.eh-label {
  font-size: 12px;
  color: var(--color-text-300);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eh-time {
  font-size: 11px;
  color: var(--color-text-500);
  margin-left: auto;
  white-space: nowrap;
}

.eh-preview {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-300);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  overflow: hidden;
  max-height: 84px;
  line-height: 1.6;
  white-space: pre;
  text-overflow: ellipsis;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.eh-entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  gap: 5px;
}
.btn-sm svg {
  width: 13px;
  height: 13px;
}

/* ══════════════════════════════════════════════════
   BUTTON MAKER
══════════════════════════════════════════════════ */

/* ── Left panel slider controls ── */
.bm-slider-row {
  margin-top: 16px;
}

/* ── Typeface weight + size row ── */
.bm-type-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.bm-select {
  flex: 1;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--color-text-200);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 28px 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.bm-select:hover {
  border-color: var(--border2);
}
/* Typeface source select — full row, sits above the custom font picker */
.bm-typeface-source {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}
.bm-select:focus {
  outline: none;
  border-color: var(--border3);
}

.bm-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}

.bm-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-400);
}

.bm-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-200);
}

/* ── Color swatches ── */
.bm-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.bm-color-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bm-color-control {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.16s;
}

.bm-row-off .bm-color-control {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Layer toggle switch ── */
.bm-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 30px;
  height: 17px;
  cursor: pointer;
}

.bm-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.bm-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border2);
  transition: background 0.16s;
}

.bm-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.16s;
}

.bm-switch input:checked + .bm-switch-track {
  background: var(--color-primary-500);
}

.bm-switch input:checked + .bm-switch-track::after {
  transform: translateX(13px);
}

.bm-switch-spacer {
  width: 30px;
  flex-shrink: 0;
}

/* ── Pull-from-palette trigger ── */
.bm-palette-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg2);
  color: var(--color-text-400);
  cursor: pointer;
  transition:
    color 0.14s,
    border-color 0.14s;
}

.bm-palette-btn:hover {
  color: var(--color-text-100);
  border-color: var(--border2);
}

.bm-palette-btn svg {
  width: 13px;
  height: 13px;
}

/* ── Palette popover ── */
.bm-pop {
  position: fixed;
  z-index: 200;
  width: 248px;
  max-height: 340px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}

.bm-pop.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.bm-pop-pal {
  margin-bottom: 14px;
}
.bm-pop-pal:last-child {
  margin-bottom: 0;
}

.bm-pop-pal-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-200);
  margin-bottom: 8px;
}

.bm-pop-color {
  margin-bottom: 8px;
}
.bm-pop-color:last-child {
  margin-bottom: 0;
}

.bm-pop-color-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--color-text-400);
  margin-bottom: 4px;
}

.bm-pop-scale {
  display: flex;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.bm-pop-sw {
  flex: 1;
  height: 24px;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s;
}
.bm-pop-sw:hover {
  transform: scaleY(1.25);
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 1.5px var(--bg2),
    0 0 0 2.5px #fff;
}

.bm-pop-empty {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--color-text-400);
  text-align: center;
  padding: 8px 4px;
}
.bm-pop-empty a {
  color: var(--color-primary-400);
  text-decoration: none;
}
.bm-pop-empty a:hover {
  text-decoration: underline;
}

.bm-swatch-wrap {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: 6px;
}

.bm-swatch {
  width: 38px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border);
  transition:
    transform 0.14s,
    box-shadow 0.14s;
}

.bm-swatch-wrap:hover .bm-swatch {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.bm-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* ── Preview area ── */
.bm-preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 48px 56px;
}

.bm-preview-inner {
  width: 100%;
  max-width: 660px;
}

.bm-preview-header {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 1fr;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.bm-col-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-400);
}

.bm-size-row {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.bm-size-row:last-child {
  border-bottom: none;
}

.bm-size-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-400);
}

.bm-btn-cell {
  display: flex;
  align-items: center;
}

.bm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1;
  cursor: default;
  white-space: nowrap;
}

/* ── Saved-work button card preview ── */
.btn-save-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 28px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.btn-save-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}

/* ── Homepage card preview ── */
.card-preview--buttons {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.bm-home-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.bm-home-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bm-home-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.bm-home-btn--filled {
  background: var(--color-primary-500);
  color: #fff;
}

.bm-home-btn--outlined {
  background: transparent;
  color: var(--color-primary-400);
  border-color: var(--color-primary-500);
}

.bm-home-btn--ghost {
  background: transparent;
  color: var(--color-text-400);
}

.bm-home-btn--sm {
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 4px;
}

/* ── fade-in-7 ── */
.fade-in-7 {
  animation: fadeSlide 0.4s ease 0.35s both;
}

/* ── fade-in-8 ── */
.fade-in-8 {
  animation: fadeSlide 0.4s ease 0.4s both;
}

/* ══════════════════════════════════════════════════
   GUIDED FLOW — "Your design file"
   Sidebar checklist + tool-page chrome bar. Injected
   by assets/design-flow.js while a flow is active.
══════════════════════════════════════════════════ */

:root {
  /* file/product identity accent (green = progress, gold = the file) */
  --gold: oklch(78% 0.13 85);
}

/* ── Stepper trigger + checklist dropdown (in the flow chrome bar) ── */
.df-stepper-wrap {
  position: relative;
  flex-shrink: 0;
}

.df-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--color-text-100);
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 8px 14px;
  cursor: pointer;
  text-transform: none;
  transition: border-color 0.13s;
}

.df-stepper:hover {
  border-color: var(--border3);
}

.df-stepper > svg {
  width: 13px;
  height: 13px;
  stroke: var(--green);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.df-stepper .df-chevron {
  width: 11px;
  height: 11px;
  stroke: var(--color-text-400);
  transition: transform 0.15s ease;
}

.df-stepper.open .df-chevron {
  transform: rotate(180deg);
}

.df-dropdown {
  position: absolute;
  /* The chrome bar is docked at the bottom, so the panel opens upward. */
  bottom: calc(100% + 10px);
  left: 0;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 16px 12px 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  z-index: 650;
  display: none;
  text-transform: none;
}

.df-dropdown.open {
  display: block;
}

.df-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  margin-bottom: 8px;
}

.df-checklist-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}

.df-checklist-count {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--color-text-400);
}

.df-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 8px 12px;
  overflow: hidden;
}

.df-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.df-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.df-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-300);
  text-decoration: none;
  text-transform: none;
}

.df-step:hover {
  background: rgba(255, 255, 255, 0.04);
}

.df-ring {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--border3);
  flex-shrink: 0;
}

.df-step--current {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-50);
}

.df-step--current .df-ring {
  border: 1.5px solid var(--green);
  box-shadow: 0 0 8px rgba(110, 231, 160, 0.4);
}

.df-now {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.df-step--done {
  color: var(--color-primary-400);
}

.df-step--done .df-label {
  text-decoration: line-through;
}

.df-step--skipped {
  color: var(--color-text-500);
}

.df-step--skipped .df-ring {
  border-style: dashed;
}

.df-skip-tag {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-500);
}

.df-check {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.df-check svg {
  width: 9px;
  height: 9px;
  stroke: var(--bg);
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.df-actions {
  margin-top: 10px;
  border-top: 1px dashed var(--border2);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.df-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: var(--r-sm);
  border: none;
  background: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--color-text-400);
  text-decoration: none;
  text-align: left;
  text-transform: none;
  cursor: pointer;
}

.df-action svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.df-action:hover {
  color: var(--color-text-200);
}

.df-action--clear {
  color: var(--color-text-500);
}

.df-action--clear:hover {
  color: var(--color-text-300);
}

.df-action--ready {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
}

.df-action--ready:hover {
  color: var(--green);
  filter: brightness(1.12);
}

/* ── Flow chrome bar (docked at the bottom of tool pages during a flow) ── */
.df-chrome {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  border-top: 1px solid var(--border2);
  background: var(--bg2);
  flex-shrink: 0;
  flex-wrap: wrap;
  text-transform: none;
  /* Docks to the viewport bottom when main scrolls (mobile);
     sits naturally at the column end otherwise. */
  position: sticky;
  bottom: 0;
  margin-top: auto;
  z-index: 300;
}

.df-chrome .df-progress {
  flex: 1;
  min-width: 80px;
  margin: 0;
}

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

.df-btn-skip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border2);
  background: none;
  color: var(--color-text-300);
  cursor: pointer;
  transition:
    border-color 0.13s,
    color 0.13s;
}

.df-btn-skip:hover {
  border-color: var(--border3);
  color: var(--color-text-100);
}

.df-btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: none;
  background: var(--color-text-100);
  color: var(--color-primary-900);
  cursor: pointer;
  transition: filter 0.13s;
}

.df-btn-continue svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.df-btn-continue:hover {
  filter: brightness(1.06);
}

/* Below the shell's mobile breakpoint the window scrolls (main's
   overflow never engages), so sticky can't pin the bar — fix it to the
   viewport bottom instead and pad main so content scrolls clear of it. */
@media (max-width: 760px) {
  .df-chrome {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 350;
  }

  main:has(> .df-chrome) {
    padding-bottom: 110px;
  }
}

@media (max-width: 640px) {
  .df-chrome {
    gap: 10px;
    padding: 10px 16px;
  }
}
