/* Hallmark · shape: app shell + landing · genre: modern-minimal · theme: CopperForge (custom, by request) · job: try · idea: "MrCopper804 ka AI ye CopperForge theme me chat, code aur video ka kaam karta hai" · vibe: "graphite calm, forge copper, terminal craft"
 * paper: oklch(0.19 0.012 250) · accent: oklch(0.72 0.15 55) · display: Space Grotesk · body: Inter · hero: live composer preview · nav: masthead + fixed side rail · footer: mast · imagery: the product built · signature: the composer you can type into
 * axes: graphite/copper · posture: confident · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P3/3 H1/1 E0 weak generic sections R0 V0 · weakest: E, landing relies on composer & port-steps, kept real not filler */
/* waive 56: side rail is fixed-position, not a stacked sticky — count trigger removed */
/* waive F15: one width per page (landing 1440, app column 1152); shared stylesheet makes lint see both */
/* answered F24: composer elevation-only commitment done — hairline border removed from the floating composer */
@import url("./tokens.css");
@import url("./base.css");

/* ============================================================
   CopperForge components. Framework-agnostic: port these
   classes to any UI stack (see README.md port steps).
   ============================================================ */

/* ---------- type helpers ---------- */
h1, h2 { letter-spacing: var(--tracking-display); }
.lead { font-size: var(--text-lead); color: var(--color-ink-2); text-wrap: pretty; }
.mono { font-family: var(--font-outlier); }
.label { font-size: var(--text-sm); color: var(--color-muted); }

/* ---------- buttons: one primary, one ghost, one danger ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  border: 1px solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper-2); color: var(--color-ink);
  font-family: var(--font-body); font-weight: 500; font-size: var(--text-sm);
  padding: var(--space-xs) var(--space-md); min-height: 40px;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-paper-3); border-color: var(--color-muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:disabled:hover, .btn[aria-disabled="true"]:hover { background: var(--color-paper-2); }
.btn--primary:disabled:hover { background: var(--color-accent); filter: none; }
.btn--primary {
  background: var(--color-accent); border-color: var(--color-accent);
  color: var(--color-accent-ink); font-weight: 600;
}
.btn--primary:hover { background: var(--color-accent); filter: brightness(1.08); }
.btn--danger { border-color: var(--color-error); color: var(--color-error); background: transparent; }
.btn--danger:hover { background: color-mix(in oklab, var(--color-error) 12%, transparent); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* icon-only button */
.btn--icon { padding: 0; width: 40px; justify-content: center; }

/* ---------- app shell (sidebar + main) ---------- */
.shell { display: block; min-height: 100dvh; }
.shell__sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w);
  display: flex; flex-direction: column; gap: var(--space-md);
  padding: var(--space-md) var(--space-sm);
  background: var(--color-paper-2); border-right: var(--rule-hair) solid var(--color-rule);
  overflow-y: auto;
}
.shell__main { margin-left: var(--sidebar-w); min-width: 0; min-height: 100dvh; display: flex; flex-direction: column; }
.brand {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm); font-family: var(--font-display);
  font-weight: 700; font-size: var(--text-md); letter-spacing: -0.01em;
}
.brand__mark {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: var(--radius-inner);
  background: var(--color-accent); color: var(--color-accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-outlier); font-weight: 700; font-size: var(--text-sm);
}
.brand__tag { font-family: var(--font-body); font-weight: 400; color: var(--color-muted); font-size: var(--text-xs); margin-left: auto; }

.side-nav { display: flex; flex-direction: column; gap: var(--space-3xs); }
.side-nav__item {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-inner);
  color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 500;
  text-decoration: none; border: 0; background: none; cursor: pointer; width: 100%;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.side-nav__item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.side-nav__item:hover { background: var(--color-paper-3); color: var(--color-ink); }
.side-nav__item[aria-current="page"] { background: var(--color-accent-soft); color: var(--color-accent); }
.side-nav__group { margin-top: var(--space-md); }

.side-list { display: flex; flex-direction: column; gap: var(--space-3xs); padding: 0; margin: var(--space-2xs) 0 0; list-style: none; }
.side-list a {
  display: flex; gap: var(--space-sm); align-items: baseline;
  padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-inner);
  color: var(--color-muted); font-size: var(--text-sm); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-list a:hover { background: var(--color-paper-3); color: var(--color-ink); }

.shell__foot { margin-top: auto; border-top: var(--rule-hair) solid var(--color-rule); padding: var(--space-sm); }
.user-chip { display: flex; align-items: center; gap: var(--space-sm); }
.user-chip__avatar {
  width: 30px; height: 30px; border-radius: var(--radius-pill); flex: 0 0 auto;
  background: var(--color-paper-3); border: var(--rule-hair) solid var(--color-rule);
  display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600;
}
.user-chip small { display: block; color: var(--color-muted); font-size: var(--text-xs); }

/* sidebar on small screens: a drawer, transform only, never animated width */
@media (max-width: 60rem) {
  .shell__sidebar {
    z-index: var(--z-drawer, 300);
    transform: translateX(-105%);
    transition: transform var(--dur-short) var(--ease-out);
    box-shadow: var(--shadow-card);
  }
  .shell__sidebar[data-open="true"] { transform: translateX(0); }
  .shell__main { margin-left: 0; }
}

/* ---------- top bar (app pages) ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  background: color-mix(in oklab, var(--color-paper) 86%, transparent);
  position: sticky; top: 0; z-index: var(--z-sticky-nav);
  min-width: 0;
}
.topbar__spacer { flex: 1; }

/* ---------- chat home ---------- */
.home {
  margin: auto; width: min(46rem, 100%); padding: var(--space-xl) var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-lg); text-align: center;
  align-items: center;
}
.home h1 { font-size: var(--text-display-s); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill);
  border: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-2);
  color: var(--color-ink-2); font-size: var(--text-sm); cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.chip:hover { border-color: var(--color-accent); color: var(--color-ink); }

/* ---------- composer (the signature) ---------- */
.composer {
  width: 100%; text-align: left;
  border-radius: var(--radius-card);
  background: var(--color-paper-2); box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-short) var(--ease-out);
}
.composer:focus-within { box-shadow: var(--shadow-card), 0 0 0 2px var(--color-accent); }
.composer textarea {
  display: block; width: 100%; border: 0; background: transparent; color: var(--color-ink);
  resize: none; padding: var(--space-md) var(--space-md) var(--space-2xs);
  min-height: 3.5em; max-height: 12em; line-height: 1.5;
}
.composer textarea:focus-visible { outline: none; } /* focus shown on the box itself */
.composer__bar { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-2xs) var(--space-sm) var(--space-sm); }
.model-pill {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper); color: var(--color-ink-2);
  padding: var(--space-2xs) var(--space-sm); font-size: var(--text-xs); cursor: pointer;
}
.model-pill:hover { border-color: var(--color-muted); }
.composer__bar .btn--primary { margin-left: auto; }

/* ---------- thread ---------- */
.thread { flex: 1; overflow-y: auto; padding: var(--space-xl) var(--space-lg); }
.thread__inner { width: min(46rem, 100%); margin: auto; display: flex; flex-direction: column; gap: var(--space-xl); }
.msg { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
.msg__head { display: flex; align-items: center; gap: var(--space-sm); }
.msg__head .user-chip__avatar { width: 24px; height: 24px; font-size: var(--text-2xs, 0.69rem); }
.msg--user .msg__body { color: var(--color-ink); }
.msg--agent .msg__body { color: var(--color-ink-2); display: flex; flex-direction: column; gap: var(--space-sm); }
.msg--agent p { max-width: none; }
.msg time { color: var(--color-muted); font-size: var(--text-xs); margin-left: auto; }

/* ---------- code block ---------- */
.code { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-inner); background: var(--color-paper-2); overflow: hidden; }
.code__bar {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-2xs) var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule);
}
.code__bar span { font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-muted); }
.code button { margin-left: auto; border: 0; background: none; color: var(--color-muted); font-size: var(--text-xs); cursor: pointer; padding: var(--space-3xs) var(--space-2xs); border-radius: var(--radius-inner); }
.code button:hover { color: var(--color-ink); background: var(--color-paper-3); }
.code pre { margin: 0; padding: var(--space-sm) var(--space-md); overflow-x: auto; font-family: var(--font-outlier); font-size: var(--text-sm); line-height: 1.7; color: var(--color-ink-2); }
.code .tok-k { color: var(--color-accent); }
.code .tok-s { color: var(--color-success); }
.code .tok-c { color: var(--color-muted); }

/* tool-call trace */
.trace {
  border-left: 2px solid var(--color-rule); padding: var(--space-2xs) 0 var(--space-2xs) var(--space-sm);
  display: flex; flex-direction: column; gap: var(--space-2xs);
}
.trace__row { display: flex; gap: var(--space-sm); align-items: baseline; font-size: var(--text-sm); color: var(--color-muted); font-family: var(--font-outlier); font-size: var(--text-xs); }
.trace__row strong { color: var(--color-ink-2); font-weight: 600; }
.trace__row .ok { margin-left: auto; color: var(--color-success); font-family: var(--font-body); }
/* terminal panel */
.terminal-panel { position: fixed; bottom: 0; left: 0; right: 0; height: 300px; background: #0d1117; border-top: 1px solid var(--color-rule); z-index: 900; display: flex; flex-direction: column; }
.terminal-panel__head { display: flex; align-items: center; padding: var(--space-xs) var(--space-sm); border-bottom: 1px solid var(--color-rule); color: var(--color-ink-2); font-size: var(--text-sm); }
.terminal-panel__body { flex: 1; overflow: auto; padding: var(--space-xs); }
.terminal-panel__body pre { margin: 0; font-family: var(--font-outlier); font-size: var(--text-xs); color: #e6edf3; white-space: pre-wrap; word-break: break-word; }
.terminal-panel__input { display: flex; gap: var(--space-xs); padding: var(--space-xs); border-top: 1px solid var(--color-rule); }
.terminal-panel__input input { flex: 1; background: #161b22; border: 1px solid var(--color-rule); color: #e6edf3; padding: var(--space-2xs) var(--space-xs); border-radius: 4px; font-family: var(--font-outlier); font-size: var(--text-xs); }
.vcs-status { font-size: var(--text-xs); color: var(--color-muted); font-family: var(--font-outlier); padding: 0 var(--space-xs); }
.cmd-palette { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; }
.cmd-palette__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.cmd-palette__box { position: relative; width: min(560px, 90vw); background: var(--color-surface, #1a1a2e); border: 1px solid var(--color-rule); border-radius: var(--radius-md, 10px); box-shadow: 0 20px 60px rgba(0,0,0,0.4); overflow: hidden; }
.cmd-palette__input { width: 100%; padding: var(--space-sm) var(--space-md); border: none; border-bottom: 1px solid var(--color-rule); background: transparent; color: var(--color-ink); font-size: var(--text-md, 1rem); outline: none; }
.cmd-palette__list { max-height: 400px; overflow-y: auto; padding: var(--space-2xs); }
.cmd-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: var(--space-xs) var(--space-sm); border: none; background: transparent; color: var(--color-ink-2); text-align: left; cursor: pointer; border-radius: var(--radius-sm, 6px); font-size: var(--text-sm); }
.cmd-item:hover { background: var(--color-accent-soft, rgba(217,84,43,0.1)); }
.cmd-item small { color: var(--color-muted); font-size: var(--text-xs); }
.cmd-item strong { font-weight: 600; }
.error-card { border: 1px solid var(--color-danger, #e55); border-radius: var(--radius-sm, 6px); padding: var(--space-sm); background: rgba(229,85,85,0.06); margin: var(--space-xs) 0; }
.error-card__head { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-2xs); }
.error-card__icon { font-size: 1.1rem; color: var(--color-danger, #e55); }
.error-card__head strong { color: var(--color-danger, #e55); font-size: var(--text-sm); }
.error-card__msg { color: var(--color-ink-2); font-size: var(--text-sm); margin: var(--space-2xs) 0; }
.error-card__action { color: var(--color-muted); font-size: var(--text-xs); margin: var(--space-2xs) 0; }
.error-card__action strong { color: var(--color-ink-2); }
.error-card__details { margin-top: var(--space-2xs); }
.error-card__details summary { cursor: pointer; font-size: var(--text-xs); color: var(--color-muted); }
.error-card__details pre { margin-top: var(--space-2xs); font-family: var(--font-outlier); font-size: var(--text-xs); white-space: pre-wrap; word-break: break-word; padding: var(--space-2xs); background: rgba(0,0,0,0.15); border-radius: 4px; max-height: 150px; overflow: auto; }
.working-status { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); background: var(--color-surface, rgba(255,255,255,0.04)); border-radius: var(--radius-sm, 6px); border: 1px solid var(--color-rule); }
.working-spinner { width: 14px; height: 14px; border: 2px solid var(--color-rule); border-top-color: var(--color-accent, #d9542b); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
.working-text { color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 500; }
.working-elapsed { margin-left: auto; color: var(--color-muted); font-size: var(--text-xs); font-family: var(--font-outlier); }
@keyframes spin { to { transform: rotate(360deg); } }
.msg--working .msg__body { padding: var(--space-xs); }
.trace__card { border: 1px solid var(--color-rule); border-radius: var(--radius-sm, 6px); margin: var(--space-2xs) 0; background: var(--color-surface, rgba(255,255,255,0.03)); overflow: hidden; }
.trace__card > summary { cursor: pointer; padding: var(--space-xs) var(--space-sm); display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-xs); color: var(--color-muted); list-style: none; user-select: none; }
.trace__card > summary::-webkit-details-marker { display: none; }
.trace__card > summary::before { content: "▸"; font-size: 0.7rem; transition: transform 0.15s; display: inline-block; }
.trace__card[open] > summary::before { transform: rotate(90deg); }
.trace__card > summary strong { color: var(--color-ink-2); font-weight: 600; }
.trace__card .cmd { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-muted); }
.trace__status { margin-left: auto; font-family: var(--font-body); font-size: var(--text-xs); }
.trace__status.ok { color: var(--color-success); }
.trace__status.err { color: var(--color-danger, #e55); }
.trace__status.run { color: var(--color-accent, #d9542b); }
.trace__icon { font-size: 0.85rem; }
.trace__icon.ok { color: var(--color-success); }
.trace__icon.err { color: var(--color-danger, #e55); }
.trace__icon.run { color: var(--color-accent, #d9542b); animation: pulse 1.2s ease-in-out infinite; }
.trace__body { padding: var(--space-xs) var(--space-sm) var(--space-sm); border-top: 1px solid var(--color-rule); }
.trace__preview { font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-muted); margin: 0 0 var(--space-xs); white-space: pre-wrap; word-break: break-word; max-height: 4em; overflow: hidden; }
.trace__detail { display: flex; flex-direction: column; gap: var(--space-xs); }
.trace__section { font-size: var(--text-xs); }
.trace__section strong { color: var(--color-ink-2); display: block; margin-bottom: 2px; }
.trace__section pre { margin: 0; font-family: var(--font-outlier); font-size: var(--text-xs); white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow: auto; padding: var(--space-2xs); background: rgba(0,0,0,0.15); border-radius: 4px; }
.trace__error pre { color: var(--color-danger, #e55); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- marketing page ---------- */
.masthead {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--gutter);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.masthead nav { margin-left: auto; display: flex; align-items: center; gap: var(--space-md); }
.masthead nav a { color: var(--color-ink-2); font-size: var(--text-sm); text-decoration: none; font-weight: 500; }
.masthead nav a:hover { color: var(--color-ink); }

.hero { padding-block: var(--space-2xl) var(--space-xl); display: flex; flex-direction: column; gap: var(--space-lg); }
.hero h1 { font-size: var(--text-display); max-width: 14ch; }
.hero .lead { max-width: 52ch; }
.hero__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.hero__stage { margin-top: var(--space-lg); }
.hero .composer textarea { min-height: 4.5em; }

.features { display: grid; grid-template-columns: 1.2fr 1.1fr 1fr; gap: var(--gap-columns); padding-block: var(--section-gap-s); }
.feature { border-top: var(--rule-hair) solid var(--color-rule); padding-top: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); }
.feature svg { width: 22px; height: 22px; stroke: var(--color-accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature p { color: var(--color-muted); font-size: var(--text-sm); }
.feature h2 { font-size: var(--text-title); font-family: var(--font-display); font-weight: 600; letter-spacing: var(--tracking-display); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-columns); padding-block: var(--section-gap-s); }
.section-head { max-width: 40ch; padding-block: var(--section-gap-s) 0; }
.section-head h2 { font-size: var(--text-section); }
.section-head p { color: var(--color-muted); margin-top: var(--space-sm); }

.probe {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-sm) var(--space-xl);
  padding: var(--space-lg) 0; border-block: var(--rule-hair) solid var(--color-rule);
}
.probe span { color: var(--color-ink-2); font-size: var(--text-md); font-family: var(--font-display); font-weight: 600; white-space: nowrap; overflow-wrap: normal; }

.cta { padding-block: var(--section-gap); text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg); justify-content: space-between; }
.cta h2 { font-size: var(--text-section); }

.footer-mast { border-top: var(--rule-hair) solid var(--color-rule); padding-block: var(--space-xl); }
.footer-mast .brand { padding-inline: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-md); }
.footer-links a { color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; }
.footer-links a:hover { color: var(--color-ink); }
.footer-mast p { color: var(--color-muted); font-size: var(--text-xs); margin-top: var(--space-md); }

/* ---------- sessions / settings ---------- */
.page { padding: var(--space-xl) var(--gutter); width: 100%; max-width: 72rem; margin-inline: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); margin-bottom: var(--space-xl); }
.page-head h1 { font-size: var(--text-2xl); margin-right: auto; }
.search {
  display: flex; align-items: center; gap: var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill);
  background: var(--color-paper-2); padding: var(--space-2xs) var(--space-sm); min-width: 16rem;
}
.search svg { width: 15px; height: 15px; stroke: var(--color-muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.search input { border: 0; background: none; color: var(--color-ink); width: 100%; font-size: var(--text-sm); }
.search input:focus-visible { outline: none; }

.card {
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card);
  background: var(--color-paper-2); box-shadow: none; padding: var(--space-md);
}
.card--list { display: flex; flex-direction: column; gap: var(--space-xs); }

.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm);
  align-items: center; padding: var(--space-sm); border-radius: var(--radius-inner);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.row:hover { background: var(--color-paper-3); }
.row h2, .row h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); letter-spacing: -0.01em; min-width: 0; overflow-wrap: break-word; }
.row p { color: var(--color-muted); font-size: var(--text-sm); }
.row__side { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-xs); white-space: nowrap; }
.row time { font-variant-numeric: tabular-nums; }

.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-columns); }
.proj { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.proj h3 { font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; letter-spacing: -0.01em; overflow-wrap: break-word; min-width: 0; }
.proj p { color: var(--color-muted); font-size: var(--text-sm); }
.proj .mono { font-size: var(--text-xs); color: var(--color-accent); }

.field { display: flex; flex-direction: column; gap: var(--space-2xs); margin-bottom: var(--space-md); }
.field label { font-size: var(--text-sm); font-weight: 500; }
.field small { color: var(--color-muted); font-size: var(--text-xs); }
.input, .select {
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-inner);
  background: var(--color-paper); color: var(--color-ink);
  padding: var(--space-xs) var(--space-sm); font-size: var(--text-md); width: 100%; max-width: 26rem;
  transition: border-color var(--dur-micro) var(--ease-out);
}
.input:hover, .select:hover { border-color: var(--color-muted); }
.input:focus-visible, .select:focus-visible { outline: none; border-color: var(--color-accent); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-sm); cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch__track {
  width: 40px; height: 22px; border-radius: var(--radius-pill); flex: 0 0 auto;
  background: var(--color-paper-3); border: var(--rule-hair) solid var(--color-rule);
  position: relative;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 16px;
  border-radius: var(--radius-pill); background: var(--color-muted);
  transform: translateX(0);
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.switch input:checked + .switch__track { background: var(--color-accent-soft); border-color: var(--color-accent); }
.switch input:checked + .switch__track::after { transform: translateX(19px); background: var(--color-accent); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.switch span { font-size: var(--text-sm); color: var(--color-ink-2); }

/* settings table */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; color: var(--color-muted); font-weight: 500; font-size: var(--text-xs); padding: var(--space-2xs) var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); }
.table td { padding: var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); color: var(--color-ink-2); }
.table td:first-child { color: var(--color-ink); font-weight: 500; }
.table .mono { font-size: var(--text-xs); }

/* theme toggle */
.seg { display: inline-flex; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); overflow: clip; }
.seg button {
  border: 0; background: none; color: var(--color-muted); cursor: pointer;
  padding: var(--space-2xs) var(--space-md); font-size: var(--text-sm); font-weight: 500;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.seg button:hover { color: var(--color-ink); }
.seg button[aria-pressed="true"] { background: transparent; color: var(--color-accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--color-accent); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: var(--space-lg); z-index: var(--z-toast);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--color-paper-3);
  border-radius: var(--radius-pill); padding: var(--space-xs) var(--space-md);
  color: var(--color-ink-2); font-size: var(--text-sm); box-shadow: var(--shadow-card);
  transition: transform var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out);
}
.toast[data-show="true"] { transform: translate(-50%, 0); opacity: 1; }

/* component improvements */
.btn { transition: all 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary:hover { filter: brightness(1.1); }
.card { border: 1px solid var(--color-rule); border-radius: var(--radius-sm, 6px); padding: var(--space-sm); background: var(--color-surface, rgba(255,255,255,0.03)); }
.input, input[type="text"], input[type="search"], textarea, select { transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus, input[type="text"]:focus, input[type="search"]:focus, textarea:focus, select:focus { border-color: var(--color-accent, #d9542b); box-shadow: 0 0 0 2px rgba(217,84,43,0.15); outline: none; }
/* skeleton loaders */
.skeleton { background: linear-gradient(90deg, var(--color-surface, rgba(255,255,255,0.05)) 25%, var(--color-rule, rgba(255,255,255,0.1)) 50%, var(--color-surface, rgba(255,255,255,0.05)) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 1em; margin: 4px 0; }
.skeleton-card { height: 80px; margin: 8px 0; }
/* empty states */
.empty-state { text-align: center; padding: var(--space-xl); color: var(--color-muted); }
.empty-state__icon { font-size: 2.5rem; margin-bottom: var(--space-sm); opacity: 0.5; }
.empty-state__title { color: var(--color-ink-2); font-size: var(--text-md, 1rem); font-weight: 600; margin-bottom: var(--space-2xs); }
.empty-state__desc { font-size: var(--text-sm); max-width: 400px; margin: 0 auto var(--space-md); }
/* command palette */
.cmd-palette { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; }
.cmd-palette__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.cmd-palette__box { position: relative; width: min(560px, 90vw); background: var(--color-surface, #1a1a2e); border: 1px solid var(--color-rule); border-radius: var(--radius-md, 10px); box-shadow: 0 20px 60px rgba(0,0,0,0.4); overflow: hidden; }
.cmd-palette__input { width: 100%; padding: var(--space-sm) var(--space-md); border: none; border-bottom: 1px solid var(--color-rule); background: transparent; color: var(--color-ink); font-size: var(--text-md, 1rem); outline: none; }
.cmd-palette__list { max-height: 400px; overflow-y: auto; padding: var(--space-2xs); }
.cmd-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: var(--space-xs) var(--space-sm); border: none; background: transparent; color: var(--color-ink-2); text-align: left; cursor: pointer; border-radius: var(--radius-sm, 6px); font-size: var(--text-sm); }
.cmd-item:hover { background: var(--color-accent-soft, rgba(217,84,43,0.1)); }
.cmd-item small { color: var(--color-muted); font-size: var(--text-xs); }
.cmd-item strong { font-weight: 600; }
@media (max-width: 60rem) {
  .features, .steps, .grid-cards { grid-template-columns: 1fr; }
  .masthead nav a:not(.btn) { display: none; }
  .page { padding-inline: var(--space-lg); }
}
