/* =========================================================
   Screen-specific styles
   ========================================================= */

/* ---------- Home (dense, no-scroll) ---------- */
.screen--home-fit { padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 12px; max-width: 1360px; }

.home-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px;
}
.home-hero__left { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.home-hero h1 {
  margin: 0;
  font-size: 26px;
  font-weight: var(--fw-semi);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}
.home-hero .ph {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 22px;
  letter-spacing: 0;
}
.home-hero .ph--sm { font-size: 12px; padding: 0 5px; }
.home-hero__sub { font-size: 13px; color: var(--text-secondary); font-family: var(--font-mono); }

.home-kpi--dense { grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; }
.kpi-card--dense { min-height: 0; padding: 12px 14px; gap: 8px; }
.kpi-card--dense .row--meta .icon-chip { width: 24px; height: 24px; font-size: 11px; }
.kpi-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: var(--fw-semi);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--text-primary);
}
.kpi-num span { font-size: 13px; color: var(--text-tertiary); margin-left: 3px; font-weight: 500; }

.home-mid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; }
.home-mid__card { padding: 12px 14px; }
.home-mid__card .card-head { margin-bottom: 8px; }

.tasks-dense { display: flex; flex-direction: column; }
.tasks-dense__row {
  height: 26px;
  display: grid;
  grid-template-columns: 16px 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  margin: 0 -6px;
  border-radius: var(--r-sm);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.tasks-dense__row:last-child { border-bottom: 0; }
.tasks-dense__row:hover { background: var(--bg-hover); }
.tasks-dense__row.is-done .t-title { color: var(--text-tertiary); text-decoration: line-through; text-decoration-color: var(--text-disabled); }
.tasks-dense__row .chk { width: 14px; height: 14px; }
.tasks-dense__row .chk i { font-size: 8px; }
.tasks-dense__row .t-title { font-size: 12.5px; color: var(--text-primary); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tasks-dense__row .t-dot { width: 5px; height: 5px; border-radius: 99px; flex: none; }
.tasks-dense__row .t-proj { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); background: var(--bg-inset); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--border-subtle); }
.tasks-dense__row .t-due  { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); min-width: 44px; text-align: right; }

.notes-dense { display: flex; flex-direction: column; }
.notes-dense__row {
  height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.notes-dense__row:last-child { border-bottom: 0; }
.notes-dense__row:hover { background: var(--bg-hover); }
.notes-dense__row .n-title { font-size: 12.5px; font-weight: var(--fw-semi); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-dense__row .n-prev  { font-size: 11.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-dense__row .n-meta  { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); display: flex; gap: 6px; }

.week-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 8px 14px;
}
.week-bar__head { display: grid; grid-template-columns: 140px 1fr auto; gap: 16px; align-items: center; }
.week-bar__cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wb-cell {
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out);
}
.wb-cell:hover { border-color: var(--border-strong); }
.wb-cell.is-today { background: var(--bg-elevated); border-color: var(--text-primary); }
.wb-cell .wb-name { font-size: 10px; color: var(--text-tertiary); font-weight: var(--fw-semi); letter-spacing: .06em; }
.wb-cell.is-today .wb-name { color: var(--text-primary); }
.wb-cell .wb-num  { font-family: var(--font-mono); font-size: 13px; font-weight: var(--fw-semi); color: var(--text-secondary); }
.wb-cell.is-today .wb-num { color: var(--text-primary); }
.wb-cell .wb-dots { display: flex; gap: 2px; }
.wb-cell .wb-dots span { width: 4px; height: 4px; border-radius: 99px; background: var(--text-tertiary); }
.wb-cell .wb-dots span.d-green { background: var(--green); }
.wb-cell .wb-dots span.d-amber { background: var(--amber); }
.wb-cell .wb-dots span.d-blue  { background: var(--blue); }
.wb-cell .wb-dots span.d-red   { background: var(--red); }
.home-kpi {
  display: grid;
  gap: var(--density-gap);
  grid-template-columns: 1.1fr 1fr 1fr;
}
@media (max-width: 1100px) { .home-kpi { grid-template-columns: 1fr; } }

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 140px;
}
.kpi-card .row--meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi-card .icon-chip {
  width: 28px; height: 28px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 13px;
}
.icon-chip--blue   { background: var(--blue-tint);   color: #93c5fd; }
.icon-chip--green  { background: var(--green-tint);  color: #86efac; }
.icon-chip--amber  { background: var(--amber-tint);  color: #fde047; }
.icon-chip--red    { background: var(--red-tint);    color: #fca5a5; }
.icon-chip--purple { background: var(--purple-tint); color: #d8b4fe; }
.icon-chip--gray   { background: var(--bg-hover);    color: var(--text-secondary); }

/* Checklist */
.check-list { display: flex; flex-direction: column; }
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: var(--r-md);
  transition: background var(--dur-1) var(--ease-out);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.check-item:last-child { border-bottom: 0; }
.check-item:hover { background: var(--bg-hover); }
.check-item .txt { flex: 1; min-width: 0; font-size: var(--fs-small); }
.check-item .txt .title { color: var(--text-primary); font-weight: var(--fw-medium); }
.check-item .txt .meta { color: var(--text-tertiary); font-size: var(--fs-micro); margin-top: 2px; font-family: var(--font-mono); }
.check-item.is-done .txt .title { color: var(--text-tertiary); text-decoration: line-through; text-decoration-color: var(--text-disabled); }
.check-item .proj {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--bg-inset);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
}

/* Notes list */
.notes-list { display: flex; flex-direction: column; gap: 2px; }
.note-item {
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out);
  border-bottom: 1px solid var(--border-subtle);
}
.note-item:last-child { border-bottom: 0; }
.note-item:hover { background: var(--bg-hover); }
.note-item .note-title { font-size: var(--fs-small); color: var(--text-primary); font-weight: var(--fw-medium); }
.note-item .note-prev  { font-size: var(--fs-micro); color: var(--text-secondary); margin-top: 3px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-item .note-meta  { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin-top: 4px; display: flex; gap: 8px; }

/* Week strip */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day {
  padding: 10px 8px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
  transition: border-color var(--dur-1) var(--ease-out);
  cursor: pointer;
}
.week-day:hover { border-color: var(--border-strong); }
.week-day.is-today { background: var(--bg-elevated); border-color: var(--border-strong); }
.week-day.is-today .wd-num { color: var(--text-primary); }
.week-day.is-today .wd-num::after { content: ""; display: inline-block; width: 4px; height: 4px; background: var(--blue); border-radius: 99px; margin-left: 4px; vertical-align: middle; }
.week-day .wd-name { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .08em; font-weight: var(--fw-medium); }
.week-day .wd-num  { font-family: var(--font-mono); font-size: 15px; font-weight: var(--fw-semi); color: var(--text-secondary); line-height: 1; }
.week-day .wd-dots { display: flex; gap: 3px; margin-top: auto; }
.week-day .wd-dots span { width: 5px; height: 5px; border-radius: 99px; background: var(--text-tertiary); }
.week-day .wd-dots span.d-green  { background: var(--green); }
.week-day .wd-dots span.d-amber  { background: var(--amber); }
.week-day .wd-dots span.d-blue   { background: var(--blue); }
.week-day .wd-dots span.d-red    { background: var(--red); }

.week-event {
  font-size: 10px;
  color: var(--text-primary);
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--bg-surface);
  border-left: 2px solid var(--blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: var(--fw-medium);
}
.week-event.ev-green  { border-left-color: var(--green); }
.week-event.ev-amber  { border-left-color: var(--amber); }
.week-event.ev-red    { border-left-color: var(--red); }

/* Mail preview (compact) */
.mail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  margin: 0 -12px;
  border-radius: var(--r-md);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--dur-1) var(--ease-out);
}
.mail-row:last-child { border-bottom: 0; }
.mail-row:hover { background: var(--bg-hover); }
.mail-row .mail-body { flex: 1; min-width: 0; }
.mail-row .mail-from { font-size: var(--fs-small); font-weight: var(--fw-semi); color: var(--text-primary); }
.mail-row .mail-subj { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row .mail-prev { font-size: var(--fs-micro); color: var(--text-tertiary); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.mail-row .mail-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); white-space: nowrap; }
.mail-row .unread-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--blue); margin-top: 8px; flex: none; }
.mail-row.is-read .unread-dot { background: transparent; }

/* ---------- Projects page ---------- */
.proj-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.proj-header h1 { margin: 0; font-size: 28px; font-weight: var(--fw-semi); letter-spacing: -0.02em; }

.proj-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 12px;
  transition: border-color var(--dur-1) var(--ease-out);
}
.proj-row:hover { border-color: var(--border-strong); }
.proj-row.is-open { border-color: var(--border-strong); background: var(--bg-elevated); }

.proj-head {
  display: grid;
  grid-template-columns: 22px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
}
.proj-head .chev {
  color: var(--text-tertiary);
  transition: transform var(--dur-2) var(--ease-out);
  font-size: 12px;
}
.proj-row.is-open .proj-head .chev { transform: rotate(90deg); color: var(--text-primary); }

.proj-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proj-title .name { font-size: 16px; font-weight: var(--fw-semi); color: var(--text-primary); letter-spacing: -0.01em; }
.proj-title .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }

.proj-pct {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: var(--fw-semi);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--text-primary);
  min-width: 70px;
  text-align: right;
}
.proj-pct small { font-size: 14px; color: var(--text-tertiary); margin-left: 2px; }

.proj-body {
  padding: 4px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--border-default);
  margin-top: 4px;
}

/* Project expanded — side by side layout */
.proj-split {
  display: grid;
  grid-template-columns: minmax(260px, 40fr) minmax(0, 60fr);
  gap: 12px;
  align-items: stretch;
}
.proj-metrics--compact {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  align-content: stretch;
}
.metric-card--compact {
  padding: 10px 12px;
  gap: 6px;
  border-radius: var(--r-md);
}
.metric-card--compact .label { font-size: 9.5px; letter-spacing: .05em; }
.metric-card--compact .val { font-size: 20px; letter-spacing: -0.02em; }

.proj-foot { display: flex; }
.proj-foot .range-card { max-width: 560px; width: 100%; }

/* S-curve header layout tighter when side-by-side */
.proj-split .scurve { padding: 12px 14px 8px; }
.proj-split .scurve__head { margin-bottom: 6px; }
.proj-split .scurve__legend--top { margin: 4px 0 6px; padding: 6px 8px; }

/* Shrink rings row a bit so totals fit ~540px */
.proj-row.is-open .proj-rings { gap: 12px; }
.proj-row.is-open .ring-card { padding: 14px 16px; gap: 14px; }
.proj-row.is-open .ring-info .v { font-size: 18px; margin-top: 2px; }
.proj-row.is-open .ring-info .d { margin-top: 4px; }

.proj-rings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ring-card {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.ring-card .ring-info { display: flex; flex-direction: column; gap: 4px; }
.ring-card .ring-info .k { font-size: var(--fs-micro); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: var(--tr-wider); font-weight: var(--fw-medium); }
.ring-card .ring-info .v { font-family: var(--font-mono); font-size: 22px; font-weight: var(--fw-semi); color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; margin-top: 4px; }
.ring-card .ring-info .d { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin-top: 6px; }

.proj-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 1200px) { .proj-metrics { grid-template-columns: repeat(2, 1fr); } }

.metric-card {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--dur-1) var(--ease-out);
}
.metric-card:hover { border-color: var(--border-default); }
.metric-card .row--top { display: flex; align-items: center; justify-content: space-between; }
.metric-card .label { font-size: var(--fs-micro); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-medium); }
.metric-card .val  { font-family: var(--font-mono); font-size: 18px; font-weight: var(--fw-semi); color: var(--text-primary); letter-spacing: -0.02em; }

/* Date-range card — franja compacta de pie (no protagonista, la Curva S lo es) */
.range-card {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 8px 12px;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 0;
  height: 44px;
}
.range-card .r-inputs { display: flex; gap: 6px; align-items: center; }
.range-card .r-inputs .input { height: 26px; font-size: 11px; font-family: var(--font-mono); padding: 0 6px; }
.range-card .r-result { display: flex; align-items: baseline; gap: 6px; margin-left: auto; }
.range-card .r-result .big { font-family: var(--font-mono); font-size: 20px; font-weight: var(--fw-semi); color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; }
.range-card .r-result .cap { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }

/* S-curve chart */
.scurve {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.scurve > svg { flex: 1; min-height: 0; width: 100%; }
.scurve__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.scurve__legend {
  display: flex;
  gap: 14px;
  font-size: var(--fs-micro);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.scurve__legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.scurve__legend--top {
  margin: 6px 0 10px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.scurve__legend .ln {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgb(59 130 246 / .06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgb(168 85 247 / .04), transparent 50%),
    var(--bg-app);
}
.login .card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  background: var(--bg-surface);
  border-color: var(--border-default);
}
.login__logo {
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  background: var(--text-primary);
  color: var(--bg-app);
  display: grid; place-items: center;
  font-weight: var(--fw-bold);
  font-size: 20px;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}
.login h1 {
  margin: 0;
  font-size: 22px;
  font-weight: var(--fw-semi);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.login .hint { margin-top: 6px; font-size: var(--fs-small); color: var(--text-secondary); }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.login form .btn--primary { height: 38px; }
.login .alt { margin-top: 16px; text-align: center; font-size: var(--fs-small); color: var(--text-tertiary); }
.login .footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ---------- Modal Acciones Correctivas ---------- */
.ac-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.ac-head__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--red-tint);
  color: var(--red);
  display: grid; place-items: center;
  flex: none;
  font-size: 15px;
}
.ac-head__title { font-size: 18px; font-weight: var(--fw-semi); letter-spacing: -0.015em; }
.ac-head__meta { display: flex; gap: 12px; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.ac-close {
  width: 28px; height: 28px;
  border-radius: var(--r-md);
  color: var(--text-tertiary);
  display: grid; place-items: center;
  margin-left: auto;
  flex: none;
}
.ac-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.ac-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px 24px;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border-default);
}
.ac-summary .k { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .08em; font-weight: var(--fw-medium); }
.ac-summary .v { font-family: var(--font-mono); font-size: 18px; font-weight: var(--fw-semi); color: var(--text-primary); margin-top: 4px; letter-spacing: -0.02em; }
.ac-summary .v.green { color: #86efac; }
.ac-summary .v.red   { color: #fca5a5; }
.ac-summary .v.amber { color: #fde047; }
.ac-summary .v.blue  { color: #93c5fd; }

.ac-list { padding: 16px 24px; }
.ac-list__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ac-list__head h3 { margin: 0; font-size: 13px; font-weight: var(--fw-semi); color: var(--text-primary); }

.ac-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-inset);
  border-radius: var(--r-md);
  margin-bottom: 6px;
  transition: border-color var(--dur-1) var(--ease-out);
}
.ac-item:hover { border-color: var(--border-default); }
.ac-item .ac-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  padding-top: 2px;
}
.ac-item .ac-title { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--text-primary); }
.ac-item .ac-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }

/* New-action form */
.ac-form {
  padding: 18px 20px;
  margin: 4px 24px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  background: var(--bg-inset);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ac-form .col-full { grid-column: 1 / -1; }

/* ---------- Sidebar showcase ---------- */
.sb-demo-wrap {
  display: grid;
  grid-template-columns: 300px 80px;
  gap: 32px;
  align-items: start;
}
.sb-demo {
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-surface);
  height: 640px;
  display: flex;
  flex-direction: column;
}
.sb-demo-label {
  font-size: var(--fs-micro);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tr-wider);
  font-weight: var(--fw-medium);
  margin-bottom: 10px;
}

/* ---------- Component catalog grid ---------- */
.catalog-section {
  border-top: 1px solid var(--border-default);
  padding: 32px 0;
}
.catalog-section:first-child { border-top: 0; padding-top: 0; }

.catalog-head { margin-bottom: 20px; }
.catalog-head h2 { margin: 0; font-size: 20px; font-weight: var(--fw-semi); letter-spacing: -0.015em; }
.catalog-head p { margin: 4px 0 0; font-size: var(--fs-small); color: var(--text-secondary); max-width: 640px; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.spec-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 20px;
}
.spec-box__label {
  font-size: var(--fs-micro);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tr-wider);
  font-weight: var(--fw-medium);
  margin-bottom: 12px;
}
.spec-box__demo {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spec-box__note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

/* ---------- Token cards ---------- */
.color-swatch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
}
.color-swatch .chip {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid rgb(255 255 255 / .06);
  flex: none;
}
.color-swatch .cs-name { font-size: var(--fs-small); font-weight: var(--fw-medium); }
.color-swatch .cs-code { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.type-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.type-row:last-child { border-bottom: 0; }
.type-row .tr-sample { color: var(--text-primary); }
.type-row .tr-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ---------- Tweaks drawer ---------- */
.tweaks-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / .45);
  z-index: 140;
  animation: fadeIn 160ms var(--ease-out);
}
.tweaks {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-default);
  box-shadow: -8px 0 24px rgb(0 0 0 / .3);
  padding: 20px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideInRight 220ms var(--ease-out);
  overflow-y: auto;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.tweaks h4 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: var(--fw-semi);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
}
.tweaks h4 i { color: var(--text-tertiary); }
.tweak-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.tweak-row:first-of-type { border-top: 0; }
.tweak-row label { font-size: var(--fs-small); color: var(--text-secondary); }
