/* ── TresPies Bring Desk — desk.css ── */
/* Night Shift palette: same CSS variables as ../styles.css, duplicated here so
   this page is self-contained (no cross-file link dependency, no build step). */

:root {
  --bg:      #0a0a0f;
  --surface: #111118;
  --raised:  #18181f;
  --text:    #f0f0f5;
  --muted:   #9494a0;
  --subtle:  #6e6e80;
  --accent:  #fbbf24;

  --success: #22c55e;
  --warning: #f59e0b;
  --error:   #ef4444;
  --info:    #3b82f6;

  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);

  --grad: linear-gradient(135deg, #fbbf24 0%, #ec4899 50%, #8b5cf6 100%);

  --r-card:  16px;
  --r-chip:  10px;
  --r-badge:  6px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Mono", Consolas, monospace;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 20% 0%, #2a0f3e 0%, #0a0a0f 50%, #000 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout wrapper ── */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

/* ── Header ── */
.header {
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.back-link {
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--subtle);
  text-decoration: none;
  margin-bottom: 0.25rem;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--text); }

h1.wordmark {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  display: inline-block;
  margin: 0;
}

.header-sub {
  font-size: 0.875rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.375rem;
  flex-wrap: wrap;
}

.status-chip {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-badge);
  padding: 0.2em 0.55em;
}
.status-chip[data-status="red"]     { background: rgba(239,68,68,0.18);  color: var(--error); }
.status-chip[data-status="yellow"]  { background: rgba(245,158,11,0.18); color: var(--warning); }
.status-chip[data-status="green"]   { background: rgba(34,197,94,0.14);  color: var(--success); }
.status-chip[data-status="unknown"] { background: var(--raised);         color: var(--subtle); }

.header-headline {
  font-size: 0.82rem;
  color: var(--muted);
}

.header-ts {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--subtle);
  margin-left: auto;
}

.sample-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0a0f;
  background: var(--warning);
  border-radius: var(--r-badge);
  padding: 0.2em 0.55em;
}

/* ── Section scaffolding ── */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 0.75rem;
}

main > section { margin-bottom: 2.25rem; }

/* ── TODAY hero ── */
.today-hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 1.5rem 1.75rem;
}

.today-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
}

.today-hero[data-empty="true"] {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--success);
  font-size: 1.05rem;
}

.today-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.today-badge {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-badge);
  padding: 0.25em 0.6em;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.today-badge[data-ready="true"]  { background: rgba(34,197,94,0.16); color: var(--success); }
.today-badge[data-ready="false"] { background: rgba(245,158,11,0.16); color: var(--warning); }

.today-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--subtle);
}

.today-title {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0.2rem 0 0.6rem;
}

.today-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--subtle);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  padding: 0.2em 0.55em;
  white-space: nowrap;
}
.tag.tag--overdue { color: var(--error); border-color: rgba(239,68,68,0.35); }
.tag.tag--due-soon { color: var(--warning); border-color: rgba(245,158,11,0.35); }

.fire-steps {
  list-style: decimal;
  margin: 0.75rem 0 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.fire-steps li {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
}

.no-steps-note {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.75rem 0;
  padding: 0.5rem 0.7rem;
  background: rgba(245,158,11,0.06);
  border-left: 2px solid rgba(245,158,11,0.35);
  border-radius: 4px;
}

.deep-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.deep-link {
  font-size: 0.78rem;
  color: var(--info);
  text-decoration: none;
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--r-chip);
  padding: 0.25em 0.65em;
  transition: background 0.15s ease;
}
.deep-link:hover { background: rgba(59,130,246,0.12); }

/* ── copy-command row ── */
.log-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.log-command {
  flex: 1;
  min-width: 220px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-chip);
  padding: 0.6em 0.8em;
  overflow-x: auto;
  white-space: pre;
}

.copy-btn {
  flex-shrink: 0;
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-chip);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6em 1em;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.copy-btn:hover { border-color: var(--accent); background: rgba(251,191,36,0.08); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }

/* ── Lanes ── */
.lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .lanes { grid-template-columns: 1fr; }
}

.lane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1rem 1.1rem 1.1rem;
  min-width: 0;
}

.lane[data-lane="fire_ready"]    { border-top: 3px solid var(--success); }
.lane[data-lane="needs_staging"] { border-top: 3px solid var(--warning); }
.lane[data-lane="proposed"]      { border-top: 3px solid var(--info); }

.lane-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.lane-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.lane-subtitle {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--subtle);
}

.lane-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--subtle);
  background: var(--raised);
  border-radius: var(--r-badge);
  padding: 0.1em 0.5em;
}

.lane-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lane-empty {
  font-size: 0.8rem;
  color: var(--subtle);
  font-style: italic;
  padding: 0.4rem 0;
}

.lane-item {
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  background: var(--raised);
  overflow: hidden;
}

.lane-item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}

.lane-item-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.lane-item-dot[data-status="red"]    { background: var(--error); }
.lane-item-dot[data-status="yellow"] { background: var(--warning); }
.lane-item-dot[data-status="green"]  { background: var(--success); }

.lane-item-title {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-item-chevron {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--subtle);
  transition: transform 0.15s ease;
}
.lane-item.expanded .lane-item-chevron { transform: rotate(90deg); }

.lane-item-detail {
  display: none;
  padding: 0 0.65rem 0.65rem;
  border-top: 1px solid var(--border);
  margin-top: 0.1rem;
  padding-top: 0.55rem;
}
.lane-item.expanded .lane-item-detail { display: block; }

.lane-item-detail .fire-steps { margin-left: 1.1rem; }
.lane-item-detail .fire-steps li { font-size: 0.8rem; }
.lane-item-detail .log-command { font-size: 0.72rem; padding: 0.45em 0.6em; }
.lane-item-detail .copy-btn { font-size: 0.72rem; padding: 0.45em 0.7em; }
.lane-item-detail .deep-link { font-size: 0.72rem; }

.lane-item-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.lane-item-evidence {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Scoreboard ── */
.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.stat-tile--muted .stat-value {
  background: none;
  -webkit-text-fill-color: unset;
  color: var(--subtle);
}

.scoreboard-note {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--subtle);
  font-style: italic;
  margin-top: 0.25rem;
}

/* ── Empty / error state ── */
.desk-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

/* ── Toast ── */
.dk-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-chip);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.5em 1em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  z-index: 100;
}
.dk-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .page { padding: 1rem 1rem 3rem; }
  .today-hero { padding: 1.25rem 1.25rem; }
  .header-ts { margin-left: 0; }
  .log-row { flex-direction: column; }
  .copy-btn { width: 100%; }
}
