:root {
  color-scheme: dark;
  --cinema-black: #100D10;
  --burgundy: #39151F;
  --burgundy-deep: #240C13;
  --crimson: #A63242;
  --crimson-deep: #6E1D29;
  --cream: #F5E8D3;
  --cream-mid: #EAD7BA;
  --cream-ink: #1C1216;
  --cream-muted: #67434B;
  --copper: #BD875B;
  --copper-bright: #D6A276;
  --copper-line: rgba(189, 135, 91, 0.56);
  --graphite: #262326;
  --graphite-deep: #1B181B;
  --ivory: #F5E8D3;
  --ivory-soft: rgba(245, 232, 211, 0.8);
  --ivory-muted: #BCAEB0;
  --green: #6EE7B7;
  --green-dark: #1B5E42;
  --danger: #FCA5A5;
  --font-display: 'SF Pro Rounded', ui-rounded, 'Hiragino Maru Gothic ProN', 'Avenir Next', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-sans: 'Avenir Next', 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cinema-black);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 64% 46% at 14% -4%, rgba(166, 50, 66, 0.22), transparent 68%),
    radial-gradient(ellipse 58% 44% at 88% 102%, rgba(57, 21, 31, 0.52), transparent 70%),
    radial-gradient(ellipse 46% 36% at 54% 44%, rgba(189, 135, 91, 0.08), transparent 72%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(189, 135, 91, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 232, 211, 0.032) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 92% 88% at 50% 34%, #000 50%, transparent 100%);
}

h1, h2, h3, p {
  margin: 0;
}

h1,
h2,
h3,
.brand-text strong,
.brand-text span {
  font-family: var(--font-display);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.gold {
  color: var(--copper-bright);
}

.muted {
  color: var(--ivory-muted);
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ivory-muted);
}

/* Deep Burgundy Left Navigation */
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 96px;
  padding: 12px 7px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, var(--burgundy) 0%, #260E15 62%, #17090D 100%);
  border-right: 1px solid var(--copper-line);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
  z-index: 10;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 3px 8px;
  border-bottom: 1px solid rgba(189, 135, 91, 0.34);
}

.brand-svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.02;
}

.brand-text strong {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
}

.brand-text span {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper-bright);
}

nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #D8C4C6;
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.nav-btn:hover {
  color: var(--cream);
  background: rgba(189, 135, 91, 0.16);
  border-color: rgba(189, 135, 91, 0.42);
}

.nav-btn.active {
  color: var(--cream);
  background: linear-gradient(90deg, rgba(166, 50, 66, 0.56), rgba(189, 135, 91, 0.18));
  border-color: rgba(189, 135, 91, 0.65);
}

/* Robotic Companion (Black Mechanical Shell + Copper + Warm Eyes) */
.sidebar-lab {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 6px;
  border-top: 1px solid rgba(189, 135, 91, 0.34);
}

.companion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.companion-svg {
  width: 56px;
  height: 48px;
  animation: compBreathe 4.2s ease-in-out infinite;
}

.comp-eye {
  transform-origin: center;
  transform-box: fill-box;
  animation: compBlink 6.5s ease-in-out infinite;
  transition: fill 0.25s ease, transform 0.25s ease;
}

.comp-beacon {
  transition: fill 0.25s ease;
}

.companion[data-state="running"] .comp-eye,
.companion[data-state="running"] .comp-beacon {
  fill: #FFD39B;
}

.companion[data-state="running"] .comp-visor {
  stroke: #D6A276;
}

.companion[data-state="break"] .comp-eye {
  fill: var(--copper-bright);
  transform: scaleY(0.55);
}

.companion[data-state="break"] .comp-beacon {
  fill: var(--copper-bright);
}

.companion[data-state="hold"] .comp-eye {
  fill: #F28B96;
  transform: scaleY(0.45);
}

.companion[data-state="hold"] .comp-beacon {
  fill: var(--crimson);
}

.companion[data-state="completed"] .comp-eye,
.companion[data-state="completed"] .comp-beacon {
  fill: var(--green);
}

.companion-label {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #DFCFC2;
}

.companion[data-state="running"] .companion-label { color: #FFD39B; }
.companion[data-state="break"] .companion-label { color: var(--copper-bright); }
.companion[data-state="hold"] .companion-label { color: #F28B96; }
.companion[data-state="completed"] .companion-label { color: var(--green); }

.intel-core {
  width: 68px;
  height: 68px;
  opacity: 0.94;
}

.core-orbit-outer {
  transform-origin: 40px 40px;
  animation: orbitCW 32s linear infinite;
}

.core-orbit-inner {
  transform-origin: 40px 40px;
  animation: orbitCCW 22s linear infinite;
}

.core-pulse {
  animation: corePulse 3.6s ease-in-out infinite;
}

@keyframes compBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes compBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.15); }
}

@keyframes orbitCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbitCCW {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes corePulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.private-note {
  padding-top: 8px;
  border-top: 1px solid rgba(189, 135, 91, 0.34);
  font-size: 10px;
  line-height: 1.3;
  color: #D2BFC0;
  letter-spacing: 0.03em;
  text-align: center;
}

/* Main Workspace Canvas (Cinema Black) */
main {
  position: relative;
  z-index: 1;
  margin-left: 96px;
  padding: 10px 16px 14px;
  max-width: 1760px;
}

.neural-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

main > *:not(.neural-net),
.desk-shell > *:not(.desk-neural-net) {
  position: relative;
  z-index: 1;
}

.neural-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.neural-path-ambient {
  stroke-dasharray: 4 6;
}

.neural-node {
  filter: drop-shadow(0 0 4px rgba(189, 135, 91, 0.55));
  transition: fill 0.25s ease, stroke 0.25s ease;
}

.neural-node-active {
  filter: drop-shadow(0 0 7px rgba(245, 232, 211, 0.72));
}

/* Header & Clock: Solid Champagne Cream Surface + Burgundy Typography */
.cmd-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(195px, auto) minmax(245px, 1fr) minmax(260px, auto);
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid var(--copper);
  border-radius: 16px;
  background: linear-gradient(145deg, #F8EDDA 0%, #EFE0C7 56%, #E3CFAF 100%);
  color: var(--cream-ink);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.54),
    0 2px 6px rgba(189, 135, 91, 0.14),
    inset 0 1.5px 0 rgba(255, 253, 249, 0.86),
    inset 0 -1px 0 rgba(57, 21, 31, 0.14);
  overflow: hidden;
}

.cmd-header::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(189, 135, 91, 0.08), transparent 40%, rgba(166, 50, 66, 0.07));
}

.cmd-header .eyebrow {
  color: #6B2E3C;
  font-weight: 600;
}

.hero-brand h1 {
  margin-top: 1px;
  font-size: clamp(16.5px, 1.45vw, 22px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--burgundy);
  white-space: nowrap;
}

.hero-brand h1 .gold {
  color: var(--crimson);
}

.tagline {
  margin-top: 2px;
  font-size: 11px;
  color: #5C3942;
  font-weight: 500;
  white-space: nowrap;
}

.clockblock {
  display: flex;
  justify-content: center;
  border-left: 1px solid rgba(57, 21, 31, 0.2);
  border-right: 1px solid rgba(57, 21, 31, 0.2);
  padding: 0 14px;
}

.clock-dial-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock-dial {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.dial-orbit {
  transform-origin: 44px 44px;
  animation: orbitCW 45s linear infinite;
}

.sec-hand {
  transform-origin: 44px 44px;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.clock-readout {
  text-align: left;
}

#clock {
  font-family: var(--font-display);
  font-size: clamp(23px, 2.2vw, 31px);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--burgundy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#date {
  margin-top: 2px;
  font-size: 11px;
  color: #5C3942;
  font-weight: 500;
  white-space: nowrap;
}

.shift {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shift-inline {
  color: var(--burgundy);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.hours-line,
.break-line {
  font-size: 11px;
  color: #58353E;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.break-line {
  color: var(--crimson);
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-shrink: 0;
}

.cmd-header button {
  background: rgba(57, 21, 31, 0.08);
  border-color: rgba(57, 21, 31, 0.34);
  color: var(--burgundy);
}

.cmd-header button:hover:not(:disabled) {
  background: rgba(57, 21, 31, 0.16);
  border-color: var(--burgundy);
}

.cmd-header button.primary {
  background: linear-gradient(180deg, var(--crimson), var(--burgundy));
  border-color: var(--burgundy);
  color: var(--cream);
}

.cmd-header button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #b83a4b, var(--crimson-deep));
  border-color: var(--copper);
}

/* Global Controls & Inputs (Dark Cinema Surfaces + Glossy Specular Polish) */
button,
input,
textarea,
select {
  font: inherit;
  color: var(--ivory);
  background: var(--graphite-deep);
  border: 1px solid rgba(189, 135, 91, 0.44);
  border-radius: 10px;
  padding: 6px 12px;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

button {
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 550;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(245, 232, 211, 0.14);
}

button:hover:not(:disabled) {
  border-color: var(--copper-bright);
  background: #332C31;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(245, 232, 211, 0.22);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.38;
  cursor: default;
  box-shadow: none;
}

button.primary {
  background: linear-gradient(180deg, #B83D4F 0%, var(--crimson) 52%, var(--crimson-deep) 100%);
  border-color: var(--copper);
  color: var(--cream);
  box-shadow:
    0 6px 16px rgba(110, 29, 41, 0.48),
    inset 0 1px 0 rgba(255, 236, 224, 0.34);
}

button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #C74558 0%, #9E2B3B 55%, #6B1A26 100%);
  border-color: var(--cream);
}

button.good {
  color: #ECFDF5;
  border-color: rgba(110, 231, 183, 0.56);
  background: linear-gradient(180deg, #277E5A 0%, var(--green-dark) 100%);
  box-shadow:
    0 6px 16px rgba(20, 71, 50, 0.44),
    inset 0 1px 0 rgba(236, 253, 245, 0.28);
}

button.good:hover:not(:disabled) {
  border-color: var(--green);
  background: linear-gradient(180deg, #2E9269 0%, #1F6B4B 100%);
}

button.warn {
  color: var(--cream);
  border-color: var(--copper);
  background: linear-gradient(180deg, #7A5231 0%, #5B3C22 100%);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(245, 232, 211, 0.24);
}

button.warn:hover:not(:disabled) {
  border-color: var(--cream);
  background: linear-gradient(180deg, #8B5E39 0%, #6A4628 100%);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--copper-bright);
  outline-offset: 2px;
}

/* Compact Day Bar (Warm Graphite + Copper) */
.daybar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: center;
  gap: 6px;
  margin: 8px 0 6px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #2C272C 0%, #201C20 100%);
  border: 1px solid rgba(189, 135, 91, 0.42);
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(245, 232, 211, 0.08);
}

.daybar button {
  padding: 5px 10px;
  font-size: 11.5px;
  background: linear-gradient(180deg, #221E22 0%, #171417 100%);
}

.date-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--cream);
  white-space: nowrap;
  flex-shrink: 0;
}

.date-label input {
  padding: 3px 7px;
  font-size: 11.5px;
  background: #141114;
  font-variant-numeric: tabular-nums;
}

#saveState {
  margin-left: auto;
  font-size: 11px;
  color: var(--copper-bright);
  white-space: nowrap;
  flex-shrink: 0;
}

#statusNotice {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(252, 165, 165, 0.52);
  background: rgba(110, 29, 41, 0.8);
  color: #fee2e2;
  font-size: 11.5px;
}

#statusNotice.ok {
  border-color: rgba(110, 231, 183, 0.55);
  background: rgba(27, 94, 66, 0.85);
  color: #d1fae5;
}

/* Horizontal Task Cards + Copper/Crimson Architectural Bridge */
.cards-wrap {
  position: relative;
  margin-bottom: 10px;
}

.cards-connector {
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 28px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.88;
}

.conn-pulse {
  stroke-dasharray: 110 960;
  stroke-dashoffset: 110;
  opacity: 0;
}

.cards-wrap.has-active .conn-pulse {
  opacity: 0.95;
  animation: tracePulse 4.6s linear infinite;
}

.cards-wrap.has-active .node-focus {
  filter: drop-shadow(0 0 7px rgba(245, 232, 211, 0.85));
}

@keyframes tracePulse {
  from { stroke-dashoffset: 1070; }
  to { stroke-dashoffset: -110; }
}

.cards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 10px;
  padding-top: 6px;
}

.taskcard {
  position: relative;
  background: var(--graphite);
  border: 1px solid rgba(189, 135, 91, 0.38);
  border-radius: 14px;
  padding: 10px 13px;
  min-width: 0;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.2s ease;
}

.taskcard::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(189, 135, 91, 0.6);
  border-right: 1px solid rgba(189, 135, 91, 0.6);
  pointer-events: none;
}

.taskcard.clickable {
  cursor: pointer;
}

.taskcard.clickable:hover {
  transform: translateY(-1px);
}

/* Previous Task: Warm Graphite */
.taskcard.card-prev {
  background: linear-gradient(155deg, #2F2A2F 0%, #201C20 100%);
  border-color: rgba(189, 135, 91, 0.46);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(245, 232, 211, 0.12);
}

.taskcard.card-prev .card-kicker {
  color: var(--copper-bright);
}

/* Current Focus Task: Rich Cinematic Crimson Red */
.taskcard.card-focus {
  background: linear-gradient(150deg, #B53B4C 0%, #862332 58%, #541521 100%);
  border-color: var(--copper-bright);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.54),
    inset 0 1.5px 0 rgba(255, 239, 226, 0.32),
    inset 0 -1px 0 rgba(16, 13, 16, 0.34);
}

.taskcard.card-focus .card-kicker {
  color: var(--cream);
  font-weight: 600;
}

.taskcard.card-focus h3 {
  color: var(--cream);
}

.taskcard.card-focus .card-meta {
  color: rgba(245, 232, 211, 0.85);
}

.taskcard.card-focus.is-running {
  border-color: var(--cream);
  box-shadow:
    0 0 26px rgba(166, 50, 66, 0.52),
    0 14px 30px rgba(0, 0, 0, 0.52),
    inset 0 1.5px 0 rgba(255, 245, 234, 0.42);
}

/* Next Task: Deep Burgundy with Metallic Copper Details */
.taskcard.card-next {
  background: linear-gradient(150deg, #431925 0%, var(--burgundy-deep) 100%);
  border-color: rgba(189, 135, 91, 0.58);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(245, 232, 211, 0.16);
}

.taskcard.card-next .card-kicker {
  color: var(--copper-bright);
}

/* Rest Periods: Warm Bronze-Graphite with Copper Trim */
.taskcard.is-rest:not(.card-focus) {
  background: linear-gradient(150deg, #2D2523 0%, #1E1818 100%);
  border-color: rgba(189, 135, 91, 0.54);
}

.taskcard.is-completed {
  border-color: rgba(110, 231, 183, 0.52);
}

.taskcard.selected-secondary {
  box-shadow: 0 0 0 1px var(--copper-bright), 0 10px 22px rgba(0, 0, 0, 0.42);
}

.cardtop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.card-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory-muted);
  white-space: nowrap;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.proj-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--copper-bright);
}

.proj-icon.sm {
  width: 14px;
  height: 14px;
}

.proj-icon.lg {
  width: 20px;
  height: 20px;
}

.proj-icon.cat-rest { color: var(--copper-bright); }
.proj-icon.cat-ai,
.proj-icon.cat-science { color: var(--cream); }
.proj-icon.cat-ai .icon-violet,
.proj-icon.cat-science .icon-violet { color: var(--copper-bright); }
.proj-icon.cat-cinema { color: #F5A3AE; }
.proj-icon.cat-business,
.proj-icon.cat-writing { color: var(--cream); }
.proj-icon.cat-game,
.proj-icon.cat-robotics { color: var(--copper-bright); }
.proj-icon.cat-automation,
.proj-icon.cat-software { color: #EED5B7; }

.taskcard h3 {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ivory-muted);
}

.card-project {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.card-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.elapsed-readout {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Status Text (High Contrast Zero-Pill) */
.status-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--ivory-soft);
  flex-shrink: 0;
}

.status-label.completed { color: var(--green); }
.status-label.active { color: #FFE1B0; }
.status-label.hold { color: #FDE68A; }
.status-label.rest { color: #E8C5A0; }

/* Main 2-Column Workspace (65% Left / 35% Right) */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}

.left,
.right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.panel {
  position: relative;
  background: var(--graphite);
  border: 1px solid rgba(189, 135, 91, 0.42);
  border-radius: 16px;
  padding: 13px 15px;
  min-width: 0;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(245, 232, 211, 0.09);
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}

.panel::after {
  content: '';
  position: absolute;
  bottom: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-bottom: 1px solid rgba(189, 135, 91, 0.48);
  border-right: 1px solid rgba(189, 135, 91, 0.48);
  pointer-events: none;
}

.panel:hover {
  border-color: var(--copper-bright);
}

/* Project Work Script: Solid Champagne Cream Editorial Surface + Dark Ink */
.brief-panel {
  border-color: var(--copper);
  background: linear-gradient(160deg, #F8EDDA 0%, #EFE0C7 62%, #E5D1B2 100%);
  color: var(--cream-ink);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.52),
    inset 0 1.5px 0 rgba(255, 253, 249, 0.88),
    inset 0 -1px 0 rgba(57, 21, 31, 0.12);
}

.brief-panel::after {
  border-bottom-color: rgba(57, 21, 31, 0.35);
  border-right-color: rgba(57, 21, 31, 0.35);
}

.brief-panel .heading h2 {
  color: var(--burgundy);
}

.brief-panel .heading-sub {
  color: var(--crimson);
  font-weight: 600;
}

.brief-panel .proj-icon {
  color: var(--burgundy);
}

.brief-panel .proj-icon .icon-violet {
  color: var(--crimson);
}

.brief-panel .muted {
  color: var(--cream-muted);
}

.brief-panel button {
  background: rgba(57, 21, 31, 0.08);
  border-color: rgba(57, 21, 31, 0.32);
  color: var(--burgundy);
}

.brief-panel button:hover:not(:disabled) {
  background: rgba(57, 21, 31, 0.16);
  border-color: var(--burgundy);
}

.brief-panel button.primary {
  background: linear-gradient(180deg, var(--crimson), var(--burgundy));
  border-color: var(--burgundy);
  color: var(--cream);
}

.brief-panel button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ba3a4b, var(--crimson-deep));
  border-color: var(--copper);
}

.brief-panel button.good {
  background: var(--green-dark);
  border-color: #144732;
  color: #F2FDF8;
}

.brief-panel button.good:hover:not(:disabled) {
  background: #237452;
}

.brief-panel button.warn {
  background: #9B6439;
  border-color: #704422;
  color: #FFF9F0;
}

.brief-panel button.warn:hover:not(:disabled) {
  background: #804E28;
}

/* Progress Panel: Warm Graphite */
.progress-panel {
  background: linear-gradient(155deg, #282428 0%, #1D1A1D 100%);
  border-color: rgba(189, 135, 91, 0.45);
}

/* Roadmap Panel: Deep Burgundy with Illuminated Copper Spine */
.roadmap-panel {
  background: linear-gradient(160deg, var(--burgundy) 0%, var(--burgundy-deep) 100%);
  border-color: var(--copper-line);
}

/* Activity Ledger: Warm Graphite with Copper Accents */
#log {
  background: linear-gradient(155deg, var(--graphite) 0%, var(--graphite-deep) 100%);
  border-color: rgba(189, 135, 91, 0.42);
}

/* Today's Summary: Warm Graphite */
#summaryCard {
  background: linear-gradient(155deg, #242024 0%, #191619 100%);
  border-color: rgba(189, 135, 91, 0.38);
}

.progress-panel.just-passed {
  animation: passFlash 0.7s ease-out;
}

@keyframes passFlash {
  0% { box-shadow: 0 0 0 rgba(110, 231, 183, 0); border-color: var(--copper); }
  35% { box-shadow: 0 0 24px rgba(110, 231, 183, 0.34); border-color: var(--green); }
  100% { box-shadow: 0 0 0 rgba(110, 231, 183, 0); border-color: rgba(189, 135, 91, 0.45); }
}

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

.heading-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--copper-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heading h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cream);
}

.heading-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.heading-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Project Work Script Interior (Cream Surface + Dark Ink) */
.brief-scroll {
  max-height: clamp(235px, 43vh, 430px);
  overflow-y: auto;
  padding-right: 4px;
}

.briefgrid {
  display: grid;
  grid-template-columns: 114px minmax(0, 1fr);
  border-top: 1px solid rgba(57, 21, 31, 0.18);
}

.briefgrid dt,
.briefgrid dd {
  margin: 0;
  padding: 5px 0;
  border-bottom: 1px solid rgba(57, 21, 31, 0.13);
  overflow-wrap: anywhere;
}

.briefgrid dt {
  color: var(--cream-muted);
  font-size: 11px;
  font-weight: 600;
  padding-right: 8px;
}

.briefgrid dd {
  font-size: 12.5px;
  color: var(--cream-ink);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.32;
  color: var(--cream-ink);
}

.check-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--crimson);
  cursor: pointer;
  flex-shrink: 0;
}

.check-item.done span {
  color: #7D5E64;
  text-decoration: line-through;
}

.check-summary {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--crimson);
  font-variant-numeric: tabular-nums;
}

.stamp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--cream-muted);
  font-variant-numeric: tabular-nums;
}

.mobile-script-toggle {
  display: none;
}

.script-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  margin-top: 8px;
}

.script-box {
  background: rgba(57, 21, 31, 0.06);
  border: 1px solid rgba(189, 135, 91, 0.48);
  border-radius: 12px;
  padding: 9px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 252, 246, 0.45);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.script-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.script-box-head h3 {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--burgundy);
}

.script-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
  max-height: 118px;
  overflow-y: auto;
  color: #24161A;
}

.inline-notes {
  width: 100%;
  min-height: 78px;
  max-height: 118px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 8px;
  background: #FBF3E6;
  color: var(--cream-ink);
  border-color: rgba(189, 135, 91, 0.65);
}

.inline-notes::placeholder {
  color: #84666B;
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(57, 21, 31, 0.18);
}

.controls-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Bottom Split Row: Activity Ledger + Today's Summary & Reflection */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#events {
  max-height: 170px;
  overflow-y: auto;
}

.event {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(189, 135, 91, 0.2);
  font-size: 12.5px;
  color: var(--ivory);
}

.event:last-child {
  border-bottom: 0;
}

.event time {
  color: var(--copper-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.event-reason {
  color: var(--ivory-muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(189, 135, 91, 0.26);
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-item span {
  font-size: 11px;
  color: var(--ivory-muted);
}

.summary-item strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.reflection-wrap {
  margin-top: 10px;
}

.reflection-label {
  display: block;
  font-size: 11.5px;
  color: var(--ivory-soft);
  margin-bottom: 5px;
}

#reflection {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  font-size: 12.5px;
  background: #141114;
}

/* Right Column: Progress & Roadmap */
.meter {
  height: 8px;
  border-radius: 99px;
  background: #141114;
  border: 1px solid rgba(189, 135, 91, 0.26);
  overflow: hidden;
}

.meter div {
  height: 100%;
  background: linear-gradient(90deg, var(--crimson), var(--copper), var(--cream));
  transition: width 0.25s ease;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 8px;
}

.stat {
  text-align: center;
  padding: 8px 4px;
  border: 1px solid rgba(189, 135, 91, 0.34);
  border-radius: 12px;
  background: linear-gradient(180deg, #211D21 0%, #171417 100%);
  box-shadow: inset 0 1px 0 rgba(245, 232, 211, 0.08);
}

.stat b {
  font-family: var(--font-display);
  display: block;
  font-size: 19px;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.stat small {
  font-size: 10px;
  color: var(--ivory-muted);
}

.progress-note {
  font-size: 11px;
  color: var(--ivory-muted);
}

/* Roadmap with Illuminated Copper Spine inside Deep Burgundy */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: clamp(240px, 44vh, 455px);
  overflow-y: auto;
  padding-left: 18px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 1.5px;
  background: linear-gradient(180deg, var(--copper-bright), rgba(245, 232, 211, 0.48), var(--crimson), rgba(189, 135, 91, 0.35));
}

.roadrow {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
}

.roadrow::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--burgundy-deep);
  border: 1.6px solid var(--copper);
}

.roadrow.completed::before {
  background: var(--green);
  border-color: var(--green);
}

.roadrow.active::before {
  background: var(--cream);
  border-color: var(--crimson);
  box-shadow: 0 0 10px rgba(245, 232, 211, 0.85);
}

.roadrow.hold::before {
  background: var(--crimson);
  border-color: var(--cream);
}

.roadrow.rest::before {
  background: #3A2922;
  border-color: var(--copper-bright);
}

.roadrow:hover {
  background: rgba(189, 135, 91, 0.14);
  border-color: rgba(189, 135, 91, 0.42);
}

.roadrow.selected {
  background: rgba(189, 135, 91, 0.22);
  border-color: var(--copper-bright);
}

.roadrow.active {
  background: rgba(166, 50, 66, 0.48);
  border-color: var(--copper);
}

.roadrow.rest {
  background: rgba(16, 13, 16, 0.34);
}

.road-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #D7C2C4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.road-main {
  min-width: 0;
}

.road-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.road-title {
  display: block;
  font-weight: 550;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.road-project {
  display: block;
  font-size: 11px;
  color: #D2B8BA;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roadrow.rest .road-title {
  color: #E8CBB0;
}

footer {
  text-align: center;
  color: rgba(245, 232, 211, 0.54);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 0 4px;
}

footer span {
  color: var(--copper-bright);
}

/* Modal */
dialog {
  width: min(780px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(160deg, #271118 0%, #151014 100%);
  color: var(--ivory);
  border: 1px solid var(--copper);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
}

dialog::backdrop {
  background: rgba(10, 6, 8, 0.82);
  backdrop-filter: blur(6px);
}

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

.modal-full {
  grid-column: 1 / -1;
}

dialog label {
  display: block;
  font-size: 12px;
  color: var(--cream);
  margin: 0;
}

dialog label input,
dialog label select,
dialog label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 13px;
  background: #141013;
}

dialog label textarea {
  min-height: 76px;
  resize: vertical;
}

dialog .modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

#error {
  color: var(--danger);
  margin-top: 8px;
  font-size: 12.5px;
}

/* Smart Desk Mode Overlay: Complete Cinematic Crimson Theme */
body.desk-mode {
  overflow: hidden;
}

.desk-overlay[hidden] {
  display: none;
}

.desk-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background:
    radial-gradient(ellipse 68% 48% at 16% 0%, rgba(166, 50, 66, 0.24), transparent 70%),
    radial-gradient(ellipse 56% 42% at 86% 100%, rgba(57, 21, 31, 0.55), transparent 70%),
    radial-gradient(ellipse 46% 36% at 50% 50%, rgba(189, 135, 91, 0.08), transparent 72%),
    var(--cinema-black);
  padding: 22px 28px;
  overflow-y: auto;
}

.desk-shell {
  position: relative;
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 44px);
}

.desk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--copper-line);
}

.desk-brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.desk-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper-bright);
  font-weight: 600;
}

.desk-break {
  font-size: 13px;
  color: var(--cream);
}

.desk-hero {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 16px;
  align-items: stretch;
}

.desk-clock-card,
.desk-focus-card,
.desk-instructions,
.desk-progress {
  border-radius: 18px;
  padding: 18px 22px;
}

/* Desk Clock Card: Solid Champagne Cream + Burgundy Type */
.desk-clock-card {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #F8EDDA 0%, #EBDAC0 100%);
  border: 1px solid var(--copper);
  color: var(--cream-ink);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.48), inset 0 1.5px 0 rgba(255, 253, 249, 0.82);
}

.desk-dial {
  width: 86px;
  height: 86px;
}

.desk-clock {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--burgundy);
}

.desk-clock-card .muted {
  color: #5C3942;
}

/* Desk Focus Card: Rich Crimson Red */
.desk-focus-card {
  background: linear-gradient(145deg, #B53B4C 0%, #7C202E 64%, #4F1520 100%);
  border: 1px solid var(--copper-bright);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.52), inset 0 1.5px 0 rgba(255, 239, 226, 0.28);
}

.desk-focus-card h2 {
  font-size: 22px;
  color: var(--cream);
  margin-top: 4px;
}

.desk-focus-card .card-kicker {
  color: var(--cream);
}

.desk-focus-card .card-meta {
  color: rgba(245, 232, 211, 0.86);
}

.desk-focus-card button {
  background: rgba(16, 13, 16, 0.46);
  border-color: rgba(245, 232, 211, 0.42);
  color: var(--cream);
}

.desk-focus-card button:hover:not(:disabled) {
  background: rgba(16, 13, 16, 0.72);
  border-color: var(--cream);
}

.desk-focus-card button.primary {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--burgundy);
  font-weight: 650;
}

.desk-focus-card button.primary:hover:not(:disabled) {
  background: #FFF6E8;
}

.desk-focus-card button.good {
  background: var(--green-dark);
  border-color: var(--green);
  color: #ECFDF5;
}

.desk-focus-card button.warn {
  background: #7A4E2A;
  border-color: var(--copper-bright);
  color: var(--cream);
}

.desk-neighbors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.desk-neighbor {
  background: var(--graphite);
  border: 1px solid rgba(189, 135, 91, 0.42);
  border-radius: 12px;
  padding: 12px 16px;
}

.desk-neighbor.card-prev {
  background: linear-gradient(155deg, #2B272B 0%, #201D20 100%);
  border-color: rgba(189, 135, 91, 0.46);
}

.desk-neighbor.card-next {
  background: linear-gradient(150deg, var(--burgundy) 0%, var(--burgundy-deep) 100%);
  border-color: rgba(189, 135, 91, 0.56);
}

/* Desk Instructions: Solid Champagne Cream Editorial Card */
.desk-instructions {
  background: linear-gradient(160deg, #F5E8D3 0%, #EDE0CA 100%);
  border: 1px solid var(--copper);
  color: var(--cream-ink);
}

.desk-instructions .heading h2 {
  color: var(--burgundy);
}

.desk-instructions .muted {
  color: var(--cream-muted);
}

.desk-instructions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.desk-progress {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--graphite);
  border: 1px solid rgba(189, 135, 91, 0.45);
}

.desk-progress .meter {
  flex: 1;
}

@media (max-width: 1120px) {
  .cmd-header {
    grid-template-columns: 1fr 1fr;
  }
  .clockblock {
    border-right: 0;
  }
  .shift {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(57, 21, 31, 0.18);
    padding-top: 8px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .script-split,
  .bottom-row {
    grid-template-columns: 1fr;
  }
  .brief-scroll {
    max-height: none;
  }
  .daybar {
    flex-wrap: wrap;
  }
}

@media (max-height: 820px) and (min-width: 1121px) {
  .sidebar-lab {
    gap: 4px;
    padding: 6px 4px 4px;
  }
  .companion-svg {
    width: 48px;
    height: 42px;
  }
  .intel-core {
    width: 54px;
    height: 54px;
  }
}

.mobile-nav {
  display: none;
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  aside {
    display: none;
  }

  main {
    margin-left: 0;
    padding:
      max(10px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      calc(86px + env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .neural-net {
    opacity: 0.42;
  }

  .cmd-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
  }

  .hero-brand h1 {
    font-size: 18px;
    white-space: normal;
  }

  .tagline {
    white-space: normal;
  }

  .clockblock {
    justify-content: flex-start;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(57, 21, 31, 0.18);
    border-bottom: 1px solid rgba(57, 21, 31, 0.18);
    padding: 10px 0;
  }

  .clock-dial {
    width: 58px;
    height: 58px;
  }

  #clock {
    font-size: clamp(30px, 8.8vw, 38px);
  }

  #date {
    white-space: normal;
    font-size: 11.5px;
  }

  .shift {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 0;
    border-top: 0;
  }

  .hours-line,
  .break-line {
    white-space: normal;
  }

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

  .toolbar button {
    min-height: 44px;
    flex: 1 1 auto;
    padding: 8px 12px;
  }

  .daybar {
    flex-wrap: wrap;
    overflow-x: visible;
    padding: 10px;
    gap: 8px;
  }

  .date-label {
    width: 100%;
    justify-content: space-between;
  }

  .daybar button {
    min-height: 44px;
    flex: 1 1 calc(33% - 6px);
    padding: 8px 10px;
    font-size: 12.5px;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  #saveState {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }

  .cards-connector {
    display: none;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 2px;
  }

  .taskcard {
    padding: 10px 11px;
    border-radius: 14px;
  }

  .taskcard.card-focus {
    grid-column: 1 / -1;
    order: -1;
    padding: 13px 14px;
  }

  .taskcard.card-focus h3 {
    font-size: 16.5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .panel {
    padding: 13px 12px;
    border-radius: 16px;
  }

  .heading {
    flex-wrap: wrap;
  }

  .heading-title {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions button,
  #exportSummaryBtn {
    min-height: 44px;
    flex: 1 1 0;
  }

  .briefgrid {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .briefgrid dd {
    font-size: 13.5px;
  }

  .check-item {
    min-height: 44px;
    padding: 8px 8px;
    align-items: center;
    border-radius: 10px;
    background: rgba(57, 21, 31, 0.045);
    font-size: 13.5px;
  }

  .check-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
  }

  .mobile-script-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
  }

  .brief-extra {
    display: none;
    margin-top: 8px;
  }

  .brief-extra.is-open {
    display: block;
  }

  .script-pre {
    max-height: 220px;
    font-size: 13px;
  }

  .inline-notes {
    min-height: 96px;
    max-height: 180px;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .controls button {
    min-height: 46px;
    font-size: 13.5px;
    padding: 8px 10px;
  }

  .controls button[data-action="next"] {
    grid-column: 1 / -1;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline {
    max-height: none;
  }

  .roadrow {
    min-height: 48px;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    padding: 8px;
  }

  .modal-grid,
  .desk-hero,
  .desk-neighbors,
  .desk-instructions-grid {
    grid-template-columns: 1fr;
  }

  dialog {
    width: min(96vw, 540px);
    padding: 15px;
    border-radius: 18px;
  }

  dialog .modalActions button {
    min-height: 44px;
    padding: 8px 16px;
  }

  .desk-overlay {
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  .desk-top {
    flex-wrap: wrap;
    gap: 10px;
  }

  .desk-exit {
    min-height: 44px;
  }

  .desk-focus-card .controls button {
    min-height: 46px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding:
      6px
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(57, 21, 31, 0.96) 0%, rgba(23, 9, 13, 0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--copper-line);
    box-shadow:
      0 -10px 28px rgba(0, 0, 0, 0.58),
      inset 0 1px 0 rgba(245, 232, 211, 0.16);
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 46px;
    padding: 4px 2px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    box-shadow: none;
    color: #D8C4C6;
    font-size: 10.5px;
    font-weight: 550;
    line-height: 1.1;
  }

  .mobile-nav-btn svg {
    width: 17px;
    height: 17px;
  }

  .mobile-nav-btn.active {
    color: var(--cream);
    background: linear-gradient(180deg, rgba(166, 50, 66, 0.62), rgba(189, 135, 91, 0.2));
    border-color: rgba(189, 135, 91, 0.65);
    box-shadow: inset 0 1px 0 rgba(245, 232, 211, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .neural-particle {
    display: none !important;
  }
}
