/* ORDECK v2 "room HUD" — Claude Design pass (2026-06-11).
   Scoped under html.od-v2 so the legacy widget canvas keeps its own look.
   Token NAMES are unchanged (hub contract); values are ORDECK-v2 overrides.
   User accent still arrives via inline --accent/--hub-amber from
   applyJkOSTheme — every derived token below tracks var(--accent). */

html.od-v2 {
  --accent:        #c84020;
  --accent-warm:   #a83018;
  --accent-soft:   #f0d0c0;

  --hub-bg-0: #ede2c8;
  --hub-bg-1: #e4d5b0;
  --hub-bg-2: #f5ead4;
  --hub-bg-3: #ead9bb;
  --hub-bg-4: #f7f1e3;

  --hub-screen:      #f0e8d8;
  --hub-screen-line: #d8c8b0;

  --hub-line:        #d3bd97;
  --hub-line-strong: #b09a72;
  --hub-line-bright: #907854;

  --hub-cream:        #6b5038;
  --hub-cream-bright: #1c1408;
  --hub-cream-dim:    #9c8060;
  --hub-cream-faint:  #b8a888;

  --hub-amber:        var(--accent);
  --hub-amber-glow:   color-mix(in srgb, var(--accent) 30%, transparent);
  --accent-ink:       color-mix(in srgb, var(--accent) 80%, #000000);
  --accent-tint:      color-mix(in srgb, var(--accent) 11%, var(--hub-bg-2));
  --accent-contrast:  #fffaf0;

  --hub-green:      #2a7040;
  --hub-green-soft: color-mix(in srgb, #2a7040 12%, var(--hub-bg-2));
  --hub-red:        #b42010;
  --hub-red-soft:   color-mix(in srgb, #b42010 10%, var(--hub-bg-2));
  --hub-warn:       #a04010;
  --hub-warn-soft:  color-mix(in srgb, #a04010 11%, var(--hub-bg-2));
  --hub-cyan:       #3a5c78;

  --hub-radius:        10px;
  --hub-radius-sm:     7px;
  --hub-radius-lg:     16px;

  --od-shadow:      0 1px 2px rgba(60, 40, 15, 0.05), 0 8px 24px -12px rgba(60, 40, 15, 0.16);
  --od-shadow-lift: 0 2px 4px rgba(60, 40, 15, 0.06), 0 18px 40px -16px rgba(60, 40, 15, 0.26);

  --grain-opacity: 0.05;
  --grain-blend:   multiply;
  --glow: none;
}

html.od-v2[data-mode="dark"] {
  --accent:      #ffb000;
  --accent-warm: #ffc840;
  --accent-soft: #3a2800;

  --hub-bg-0: #11100d;
  --hub-bg-1: #1a1814;
  --hub-bg-2: #201d17;
  --hub-bg-3: #2c2820;
  --hub-bg-4: #38321f;

  --hub-screen:      #0e0c08;
  --hub-screen-line: #2a2418;

  --hub-line:        #363023;
  --hub-line-strong: #4a4232;
  --hub-line-bright: #6a5d3e;

  --hub-cream:        #d6cba8;
  --hub-cream-bright: #efe6c9;
  --hub-cream-dim:    #8a8067;
  --hub-cream-faint:  #5a543f;

  --hub-amber-glow:   color-mix(in srgb, var(--accent) 35%, transparent);
  --accent-ink:       color-mix(in srgb, var(--accent) 78%, #ffffff);
  --accent-tint:      color-mix(in srgb, var(--accent) 13%, var(--hub-bg-2));
  --accent-contrast:  #1a1000;

  --hub-green:      #5cd66a;
  --hub-green-soft: color-mix(in srgb, #5cd66a 13%, var(--hub-bg-2));
  --hub-red:        #ff4530;
  --hub-red-soft:   color-mix(in srgb, #ff4530 12%, var(--hub-bg-2));
  --hub-warn:       #fbbf24;
  --hub-warn-soft:  color-mix(in srgb, #fbbf24 12%, var(--hub-bg-2));
  --hub-cyan:       #4ecdc4;

  --od-shadow:      0 1px 2px rgba(0,0,0,0.35), 0 10px 30px -14px rgba(0,0,0,0.65);
  --od-shadow-lift: 0 2px 6px rgba(0,0,0,0.4), 0 22px 50px -18px rgba(0,0,0,0.75);

  --grain-opacity: 0.07;
  --grain-blend:   screen;
  --glow: 0 0 14px var(--hub-amber-glow);
}

/* ── Base surface ──────────────────────────────────────────────────────── */

html.od-v2 body {
  background: var(--hub-bg-0);
  color: var(--hub-cream-bright);
  font-family: var(--hub-font-sans);
  user-select: text;
  transition: background-color 0.4s ease, color 0.3s ease;
}

/* Quiet grain — the jkOS motif, kept but calm (replaces canvas scanlines) */
html.od-v2 body::before {
  content: "";
  position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.65'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: var(--grain-blend);
  opacity: var(--grain-opacity);
}

html.od-v2 ::selection { background: var(--accent); color: var(--accent-contrast); }

@keyframes od-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes od-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ── Shell layout ──────────────────────────────────────────────────────── */

.hud-root {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hud-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px 0;
}

.hud-logo {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  display: grid; place-items: center;
  font-family: var(--hub-font-mono);
  font-weight: 700; font-size: 11px;
  box-shadow: var(--hub-accent-press);
  border: none;
}

.hud-wordmark {
  font-family: var(--hub-font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--hub-cream-dim);
}

.hud-syschip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--hub-font-mono);
  font-size: 10px; letter-spacing: 0.14em;
  color: var(--hub-cream-dim);
}

.hud-dot { width: 6px; height: 6px; border-radius: 999px; flex: none; }
.hud-dot.pulse { animation: od-pulse 2.4s ease-in-out infinite; }

.hud-topbtn {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--hub-line);
  background: transparent;
  color: var(--hub-cream);
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.hud-topbtn:hover {
  border-color: var(--hub-line-strong);
  background: var(--hub-bg-2);
  color: var(--hub-cream-bright);
}
.hud-topbtn[data-active="true"] {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-tint);
}

/* Apps popover — anchored to the jk logo (top-left) */
.hud-apps-pop {
  position: absolute;
  top: 50px; left: 28px;
  z-index: 100;
  min-width: 240px;
  border-radius: var(--hub-radius-lg);
  background: var(--hub-bg-4);
  border: 1px solid var(--hub-line-strong);
  box-shadow: var(--od-shadow-lift);
  padding: 8px;
  animation: od-fade-up 0.25s cubic-bezier(0.22,1,0.36,1) both;
}
.hud-apps-pop a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--hub-radius);
  transition: background 0.12s;
}
.hud-apps-pop a:hover { background: var(--accent-tint); }
.hud-app-glyph {
  width: 28px; height: 28px; flex: none;
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--hub-font-mono);
  font-size: 10px; font-weight: 700;
  background: var(--hub-bg-2);
  border: 1px solid var(--hub-line);
  color: var(--hub-cream);
}
.hud-app-name { font-size: 13.5px; font-weight: 600; color: var(--hub-cream-bright); }
.hud-app-domain {
  font-family: var(--hub-font-mono);
  font-size: 10px; color: var(--hub-cream-dim);
}

/* ── Main grid ─────────────────────────────────────────────────────────── */

.hud-grid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 0.9fr;
  gap: 18px;
  padding: 16px 28px;
}

.hud-col {
  display: flex; flex-direction: column;
  gap: 18px; min-height: 0;
  animation: od-fade-up 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.hud-col:nth-child(2) { animation-delay: 0.06s; }
.hud-col:nth-child(3) { animation-delay: 0.12s; }

.hud-card {
  border-radius: var(--hub-radius-lg);
  background: var(--hub-bg-2);
  border: 1px solid var(--hub-line);
  box-shadow: var(--od-shadow);
}

.hud-eyebrow {
  font-family: var(--hub-font-mono);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--hub-cream-dim);
}
.hud-eyebrow-src {
  font-family: var(--hub-font-mono);
  font-size: 10.5px;
  color: var(--hub-cream-faint);
}

/* ── Clock (raw on background, no chrome) ──────────────────────────────── */

.hud-clock { padding: 14px 6px 2px; }
.hud-clock-time { display: flex; align-items: baseline; gap: 10px; }
.hud-clock-hm {
  font-family: var(--hub-font-mono);
  font-size: clamp(60px, 7vw, 104px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 0.95;
  color: var(--hub-amber);
  text-shadow: var(--glow);
}
.hud-clock-ss {
  font-family: var(--hub-font-mono);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--hub-cream-dim);
}
.hud-clock-meta {
  margin-top: 12px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.hud-clock-date {
  font-family: var(--hub-font-mono);
  font-size: 13.5px; font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--hub-cream);
}
.hud-clock-utc {
  font-family: var(--hub-font-mono);
  font-size: 11px; letter-spacing: 0.12em;
  color: var(--hub-cream-dim);
}

/* ── Weather ───────────────────────────────────────────────────────────── */

.hud-weather {
  flex: 1; min-height: 0;
  padding: 18px 22px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.hud-weather-head { display: flex; align-items: center; gap: 8px; }
.hud-weather-now { display: flex; align-items: center; gap: 20px; }
.hud-weather-icon { flex: none; filter: drop-shadow(var(--glow)); }
.hud-weather-temp { display: flex; align-items: flex-start; gap: 4px; }
.hud-weather-temp b {
  font-size: 50px; font-weight: 650;
  letter-spacing: -0.03em; line-height: 1;
  color: var(--hub-cream-bright);
}
.hud-weather-unit {
  font-size: 19px; font-weight: 600;
  color: var(--hub-cream-dim);
  margin-top: 4px;
}
.hud-weather-desc {
  margin-top: 5px;
  font-size: 14px; font-weight: 600;
  color: var(--hub-cream);
}
.hud-weather-hilo {
  margin-left: auto;
  display: flex; flex-direction: column; gap: 6px;
  text-align: right;
  font-family: var(--hub-font-mono);
  font-size: 12.5px;
}
.hud-weather-hilo .hi { color: var(--hub-cream); }
.hud-weather-hilo .lo { color: var(--hub-cream-dim); }
.hud-weather-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--hub-line);
}
.hud-weather-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hud-weather-slot .t {
  font-family: var(--hub-font-mono);
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--hub-cream-faint);
}
.hud-weather-slot .v {
  font-family: var(--hub-font-mono);
  font-size: 13.5px; font-weight: 600;
  color: var(--hub-cream);
}

/* ── Compact weather ───────────────────────────────────────────────────── */

.hud-weather-compact {
  flex: none;
  padding: 14px 18px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.hud-weather-compact-row {
  display: flex; align-items: center; gap: 14px;
}
.hud-weather-compact-temp {
  display: flex; align-items: flex-start; gap: 2px;
}
.hud-weather-compact-temp b {
  font-size: 32px; font-weight: 650;
  letter-spacing: -0.03em; line-height: 1;
  color: var(--hub-cream-bright);
}
.hud-weather-compact-temp span {
  font-size: 14px; font-weight: 600;
  color: var(--hub-cream-dim);
  margin-top: 2px;
}
.hud-weather-compact-desc {
  margin-top: 3px;
  font-size: 11.5px; font-weight: 550;
  color: var(--hub-cream);
}

/* ── Monthly mini-calendar ─────────────────────────────────────────────── */

.hud-calendar {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 14px 16px;
  overflow: hidden;
}
.hud-calendar-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; flex: none;
}
.hud-cal-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  align-content: start;
}
.hud-cal-dow {
  font-family: var(--hub-font-mono);
  font-size: 8.5px; letter-spacing: 0.08em;
  color: var(--hub-cream-faint);
  text-align: center;
  padding: 3px 0;
}
.hud-cal-day {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 3px 2px;
  border-radius: 5px;
  cursor: default;
  position: relative;
  min-height: 26px;
  justify-content: center;
  gap: 2px;
}
.hud-cal-day.today { background: var(--accent-tint); }
.hud-cal-day.today .hud-cal-num { color: var(--accent-ink); font-weight: 700; }
.hud-cal-num {
  font-family: var(--hub-font-mono);
  font-size: 10.5px;
  color: var(--hub-cream);
  line-height: 1;
}
.hud-cal-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  flex: none;
}

/* ── Edit mode ─────────────────────────────────────────────────────────── */

.hud-root.edit-mode .hud-card {
  outline: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: -2px;
}
.hud-edit-remove {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--hub-red) 50%, transparent);
  background: color-mix(in srgb, var(--hub-red) 12%, transparent);
  color: var(--hub-red);
  font-size: 15px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.12s;
}
.hud-edit-remove:hover {
  background: color-mix(in srgb, var(--hub-red) 25%, transparent);
}
.hud-edit-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 28px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  font-family: var(--hub-font-mono);
  font-size: 10px; color: var(--hub-cream-dim);
}
.hud-edit-restore {
  padding: 2px 8px;
  border: 1px solid var(--hub-line);
  background: var(--hub-bg-2);
  color: var(--accent-ink);
  font-family: var(--hub-font-mono);
  font-size: 9.5px; letter-spacing: 0.06em;
  cursor: pointer; border-radius: 4px;
  transition: border-color 0.12s;
  text-transform: capitalize;
}
.hud-edit-restore:hover { border-color: var(--accent); }

/* ── Today (tasks) ─────────────────────────────────────────────────────── */

.hud-today {
  min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hud-today-head {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px 12px;
  border-bottom: 1px solid var(--hub-line);
}
.hud-today-count {
  font-family: var(--hub-font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--hub-cream);
}
.hud-bar {
  width: 56px; height: 5px;
  border-radius: 999px;
  background: var(--hub-line);
  overflow: hidden;
  display: inline-block;
}
.hud-bar > span {
  display: block; height: 100%;
  border-radius: 999px;
  background: var(--hub-amber);
  box-shadow: var(--hub-accent-press);
}
.hud-today-list {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  justify-content: space-evenly;
  padding: 4px 20px;
  overflow-y: auto;
}
.hud-task {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hub-line);
}
.hud-task:last-child { border-bottom: none; }
.hud-task.done { opacity: 0.45; }
.hud-task.done .hud-task-title { text-decoration: line-through; }
.hud-task-time {
  font-family: var(--hub-font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--hub-cream-dim);
  width: 46px; flex: none;
}
.hud-task-title {
  font-size: 15.5px; font-weight: 550;
  color: var(--hub-cream-bright);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hud-task-tag {
  margin-left: auto; flex: none;
  font-family: var(--hub-font-mono);
  font-size: 10.5px;
  color: var(--hub-cream-dim);
}
.hud-task-check {
  margin-left: auto;
  width: 20px; height: 20px; flex: none;
  border-radius: 999px;
  background: var(--hub-green);
  display: grid; place-items: center;
}
.hud-task.now {
  padding: 10px 14px;
  margin: 2px -14px;
  border-radius: var(--hub-radius);
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.hud-task.now .hud-task-time { font-weight: 600; color: var(--accent-ink); }
.hud-task.now .hud-task-title { font-size: 16px; font-weight: 650; }
.hud-task-sub {
  display: block;
  font-family: var(--hub-font-mono);
  font-size: 10.5px;
  color: var(--hub-cream-dim);
  margin-top: 2px;
}
.hud-now-chip {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--hub-font-mono);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
}
.hud-now-chip .hud-dot { background: var(--accent); box-shadow: var(--hub-accent-press); }

.hud-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: var(--hub-cream-dim);
  font-family: var(--hub-font-mono);
  font-size: 11px; letter-spacing: 0.12em;
  text-align: center;
  padding: 20px;
}
.hud-empty a { color: var(--accent-ink); text-decoration: underline; }

/* ── Systems ───────────────────────────────────────────────────────────── */

.hud-systems {
  flex: 1.3; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hud-systems-head {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--hub-line);
}
.hud-systems-count {
  margin-left: auto;
  font-family: var(--hub-font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--hub-cream-faint);
}
.hud-systems-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  display: flex; flex-direction: column;
  justify-content: space-evenly;
  gap: 1px;
  padding: 4px 18px;
}
.hud-sys {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; flex: none;
}
.hud-sys-name { font-size: 13.5px; font-weight: 600; color: var(--hub-cream-bright); }
.hud-sys-val {
  margin-left: auto; white-space: nowrap;
  font-family: var(--hub-font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--hub-cream-dim);
}
.hud-sys.down {
  padding: 5px 8px; margin: 0 -8px;
  border-radius: var(--hub-radius-sm);
  background: var(--hub-red-soft);
}
.hud-sys.down .hud-sys-val { color: var(--hub-red); }
.hud-sys.warn {
  padding: 5px 8px; margin: 0 -8px;
  border-radius: var(--hub-radius-sm);
  background: var(--hub-warn-soft);
}
.hud-sys.warn .hud-sys-val { color: var(--hub-warn); }

/* ── Study / generic info card ─────────────────────────────────────────── */

.hud-info { flex: none; padding: 15px 18px; }
.hud-info-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hud-info-title {
  margin: 0;
  font-size: 16.5px; font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--hub-cream-bright);
  line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hud-info-sub {
  margin: 5px 0 0;
  font-family: var(--hub-font-mono);
  font-size: 11px;
  color: var(--hub-cream-dim);
}
.hud-study-row { display: flex; align-items: center; gap: 14px; }
.hud-study-main { min-width: 0; flex: 1; }
.hud-streak {
  flex: none;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 7px 11px;
  border-radius: var(--hub-radius);
  background: var(--hub-warn-soft);
}
.hud-streak b {
  font-family: var(--hub-font-mono);
  font-size: 17px; font-weight: 700;
  line-height: 1;
  color: var(--hub-warn);
}
.hud-streak span {
  font-family: var(--hub-font-mono);
  font-size: 8px; letter-spacing: 0.14em;
  color: var(--hub-warn);
}

a.hud-card { display: block; transition: box-shadow 0.2s, transform 0.2s; }
a.hud-card:hover { box-shadow: var(--od-shadow-lift); transform: translateY(-1px); }

/* ── Bottom strip ──────────────────────────────────────────────────────── */

.hud-bottom {
  flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px 14px;
  font-family: var(--hub-font-mono);
  font-size: 10px; letter-spacing: 0.14em;
  color: var(--hub-cream-faint);
  white-space: nowrap;
}
.hud-bottom .ready { display: inline-flex; align-items: center; gap: 7px; }
.hud-bottom .ready .hud-dot { width: 5px; height: 5px; background: var(--hub-green); }

/* ── Small screens ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  html.od-v2 body { overflow: auto; }
  .hud-root { height: auto; min-height: 100vh; }
  .hud-grid { grid-template-columns: 1fr; }
  .hud-weather, .hud-systems { flex: none; }
  .hud-today { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-col, .hud-apps-pop { animation: none; }
  .hud-dot.pulse { animation: none; }
}
/* Shell global — @jkos/ui/tokens.css → @jkos/design/tokens.css is the single source of truth.
   This file contains only ORDECK shell-specific styles. */
/* @jkos/ui — ORDECK design tokens
   Single source of truth: Design/tokens/hub.css defines all --hub-* variables.
   ORDECK-specific extensions (layout, CRT, widget tuning) remain here. */
/*
 * Design/tokens/hub.css — jkOS shared design token system
 *
 * :root                    → paper / light mode defaults (warm kraft paper aesthetic)
 * :root[data-mode="dark"]  → CRT phosphor overrides
 *
 * Each app @imports this file, then appends its own per-app accent overrides.
 * applyJkOSTheme() (Design/utils/applyJkOSTheme.ts) overrides --accent and
 * --hub-amber families at runtime with the user's saved color preference.
 *
 * Do not rename --hub-* tokens. Per-app personality is expressed via
 * --accent, --accent-warm, --accent-soft overrides only.
 */
/* ─── Paper / light mode defaults ─────────────────────────────────────── */
:root {
  /* App accent (ORDECK default: burnt sienna; overridden per-app and at runtime) */
  --accent:        #c84020;
  --accent-warm:   #a83018;
  --accent-soft:   #f0d0c0;

  /* Backward-compat aliases consumed by existing components */
  --accent-base:      var(--accent);
  --accent-secondary: var(--hub-cyan);

  /* Background layers — warm kraft tan → light cream */
  --hub-bg-0: #ede2c8;
  --hub-bg-1: #e4d5b0;
  --hub-bg-2: #f5ead4;
  --hub-bg-3: #ead9bb;
  --hub-bg-4: #f7f1e3;

  /* Inner content panels ("screen" areas inside widget frames) */
  --hub-screen:      #f0e8d8;
  --hub-screen-line: #d8c8b0;

  /* Hardware tones — warm brass / paper metal */
  --hub-metal-0: #d4c8a8;
  --hub-metal-1: #c8bca0;
  --hub-metal-2: #b8a888;
  --hub-bevel-light: rgba(255, 252, 230, 0.85);
  --hub-bevel-dark:  rgba(80, 50, 20, 0.18);

  /* Border lines — warm paper lines */
  --hub-line:        #c8ae88;
  --hub-line-strong: #b09a72;
  --hub-line-bright: #907854;

  /* Primary accent family — tracks --accent; overridden at runtime by applyJkOSTheme */
  --hub-amber:        var(--accent);
  --hub-amber-bright: color-mix(in srgb, var(--accent) 55%, #ffffff);
  --hub-amber-dim:    color-mix(in srgb, var(--accent) 72%, #1a0a00);
  --hub-amber-deep:   color-mix(in srgb, var(--accent) 20%, var(--hub-bg-2));
  --hub-amber-glow:   color-mix(in srgb, var(--accent) 30%, transparent);

  /* Secondary accent (ORDECK default: cool ink-blue on paper) */
  --hub-cyan:        #3a5c78;
  --hub-cyan-dim:    color-mix(in srgb, #3a5c78 60%, #000000);
  --hub-cyan-glow:   color-mix(in srgb, #3a5c78 25%, transparent);

  /* Semantic status */
  --hub-red:        #b42010;
  --hub-red-dim:    color-mix(in srgb, #b42010 60%, #000000);
  --hub-red-glow:   color-mix(in srgb, #b42010 22%, transparent);
  --hub-green:      #2a7040;
  --hub-green-glow: color-mix(in srgb, #2a7040 22%, transparent);
  --hub-magenta:    #8a2060;

  /* Text — dark ink on paper */
  --hub-cream:        #6b5038;
  --hub-cream-bright: #1c1408;
  --hub-cream-dim:    #9c8060;
  --hub-cream-faint:  #b8a888;

  /* Shared --color-* aliases (used by components across all apps) */
  --color-paper:          var(--hub-bg-0);
  --color-paper-2:        var(--hub-bg-1);
  --color-card:           var(--hub-bg-2);
  --color-card-2:         var(--hub-bg-3);
  --color-ink:            var(--hub-cream-bright);
  --color-muted:          var(--hub-cream);
  --color-faint:          var(--hub-cream-dim);
  --color-line:           var(--hub-line);
  --color-line-strong:    var(--hub-line-strong);
  --color-accent:         var(--hub-amber);
  --color-accent-bright:  var(--hub-amber-bright);
  --color-accent-dim:     var(--hub-amber-dim);
  --color-accent-deep:    var(--hub-amber-deep);
  --color-accent-glow:    var(--hub-amber-glow);
  --color-accent-soft:    color-mix(in srgb, var(--hub-amber) 12%, var(--hub-bg-2));
  --color-accent-ink:     color-mix(in srgb, var(--hub-amber) 80%, #000000);
  --color-accent-contrast: #ffffff;
  --color-secondary:      var(--hub-cyan);
  --color-secondary-dim:  var(--hub-cyan-dim);
  --color-secondary-glow: var(--hub-cyan-glow);
  --color-ok:     #2a7040;
  --color-warn:   #a04010;
  --color-danger: #b42010;

  /* Grain overlay */
  --grain-opacity: 0.04;
  --grain-blend:   multiply;

  /* Typography */
  --hub-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --hub-font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --hub-font-seg:  'Big Shoulders Display', 'IBM Plex Sans', sans-serif;

  /* Spacing grid */
  --hub-grid:             40px;
  --hub-radius:           0px;
  --hub-radius-sm:        0px;
  --hub-radius-lg:        2px;
  --hub-radius-soft:      2px;
  --hub-radius-widget:    0px;
  --hub-radius-button:    0px;

  /* Widget layout tuning */
  --hub-widget-pad:       12px;
  --hub-title-h:          34px;
  --hub-glow-mul:         0.5;
  --hub-clip-widget:      none;
  --hub-clip-title:       none;
  --hub-widget-blur:      none;
  --hub-widget-bg-alpha:  1;

  /* Shadows */
  --hub-shadow-amber:  0 0 6px var(--hub-amber-glow);
  --hub-shadow-widget: 0 0 0 1px var(--hub-amber-dim);
  --hub-shadow-inset:  inset 0 1px 0 var(--hub-bevel-light), inset 0 -1px 0 var(--hub-bevel-dark);
  --hub-shadow-card:   0 2px 8px color-mix(in srgb, var(--hub-cream-bright) 10%, transparent),
                       0 0 0 1px var(--hub-line);
  /* Accent "pressed into the paper" — the light-mode analog of dark-mode
     halation. A debossed stamp: dark inner top shadow (pushed in) + a light
     lower-inner highlight + a hairline top highlight, like a brass badge set
     into leather. Dark mode overrides this with an emissive glow. */
  --hub-accent-press:
    inset 0 2px 3px color-mix(in srgb, var(--hub-cream-bright) 32%, transparent),
    inset 0 -1px 1px color-mix(in srgb, #ffffff 55%, transparent),
    0 1px 0 color-mix(in srgb, #ffffff 45%, transparent);

  /* Shell layout */
  --hub-header-h:          52px;
  --hub-bus-h:             28px;
  --hub-footer-h:          28px;
  --hub-sidebar-w:         200px;
  --hub-sidebar-collapsed: 40px;
  --hub-rail-w:            56px;

  /* CRT effects (off in paper mode) */
  --crt-scanline-opacity: 0;
  --crt-vignette-opacity: 0.08;

  /* Canvas */
  --canvas-grid-opacity: 0.5;

  /* Screw display toggle */
  --screw-display: inline-block;
}
/* ─── CRT phosphor overrides ───────────────────────────────────────────── */
:root[data-mode="dark"] {
  --accent:      #ffb000;
  --accent-warm: #ffc840;
  --accent-soft: #3a2800;

  --hub-bg-0: #11100d;
  --hub-bg-1: #1a1814;
  --hub-bg-2: #232019;
  --hub-bg-3: #2c2820;
  --hub-bg-4: #38321f;

  --hub-screen:      #0e0c08;
  --hub-screen-line: #2a2418;

  --hub-metal-0: #2a2620;
  --hub-metal-1: #3a342b;
  --hub-metal-2: #4a4234;
  --hub-bevel-light: rgba(255, 220, 160, 0.06);
  --hub-bevel-dark:  rgba(0, 0, 0, 0.5);

  --hub-line:        #3a3528;
  --hub-line-strong: #4a4232;
  --hub-line-bright: #6a5d3e;

  --hub-amber:        #ffb000;
  --hub-amber-bright: #ffd266;
  --hub-amber-dim:    #8a5f00;
  --hub-amber-deep:   #4a3300;
  --hub-amber-glow:   rgba(255, 176, 0, 0.35);

  /* Dark mode: accents glow (halation) rather than press into the surface. */
  --hub-accent-press: 0 0 10px var(--hub-amber-glow), inset 0 0 0 1px color-mix(in srgb, var(--hub-amber) 30%, transparent);

  --hub-cyan:        #4ecdc4;
  --hub-cyan-dim:    #2a6e6a;
  --hub-cyan-glow:   rgba(78, 205, 196, 0.35);

  --hub-red:        #ff4530;
  --hub-red-dim:    #6b1c14;
  --hub-red-glow:   rgba(255, 69, 48, 0.4);
  --hub-green:      #5cd66a;
  --hub-green-glow: rgba(92, 214, 106, 0.35);
  --hub-magenta:    #ff5d8f;

  --hub-cream:        #d6cba8;
  --hub-cream-bright: #efe6c9;
  --hub-cream-dim:    #8a8067;
  --hub-cream-faint:  #5a543f;

  --color-ok:     #34d399;
  --color-warn:   #fbbf24;
  --color-danger: #f87171;
  --color-accent-contrast: #000000;

  --grain-opacity: 0.08;
  --grain-blend:   screen;

  --hub-glow-mul: 1;

  --crt-scanline-opacity: 0.012;
  --crt-vignette-opacity: 0.45;

  --canvas-grid-opacity: 1;
}
/* ─── Shared CSS component classes ─────────────────────────────────────── */
/* Keyframes */
@keyframes led-pulse    { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes blink        { 50% { opacity: 0; } }
@keyframes data-flicker { 0%, 92%, 100% { opacity: 1; } 94% { opacity: 0.6; } 96% { opacity: 0.95; } }
@keyframes grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-2%, -3%); }
  20%  { transform: translate(3%, 1%); }
  30%  { transform: translate(-1%, 4%); }
  40%  { transform: translate(4%, -2%); }
  50%  { transform: translate(-3%, 3%); }
  60%  { transform: translate(2%, -4%); }
  70%  { transform: translate(-4%, 2%); }
  80%  { transform: translate(1%, -1%); }
  90%  { transform: translate(-2%, 4%); }
  100% { transform: translate(0, 0); }
}
/* LEDs */
.led {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px currentColor, inset 0 0 2px rgba(0,0,0,0.4);
  animation: led-pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
.led.green  { background: var(--hub-green);   color: var(--hub-green); }
.led.amber  { background: var(--hub-amber);   color: var(--hub-amber); }
.led.red    { background: var(--hub-red);     color: var(--hub-red);   animation-duration: 1s; }
.led.cyan   { background: var(--hub-cyan);    color: var(--hub-cyan); }
.led.off    { background: var(--hub-metal-2); color: var(--hub-metal-2);
              box-shadow: inset 0 0 2px rgba(0,0,0,0.4); animation: none; }
.led.steady { animation: none; }
.led.sm     { width: 6px;  height: 6px; }
.led.lg     { width: 12px; height: 12px; }
/* Hardware bits */
.screw {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    var(--hub-line-bright) 0%,
    var(--hub-metal-1)     60%,
    var(--hub-metal-0)     100%
  );
  box-shadow: inset 0 0 2px rgba(0,0,0,0.8), 0 0 1px rgba(0,0,0,0.6);
  position: relative;
  flex-shrink: 0;
  display: var(--screw-display, inline-block);
}
.screw::after {
  content: '';
  position: absolute;
  left: 1px; right: 1px;
  top: 50%;
  height: 1px;
  background: rgba(0,0,0,0.75);
  transform: translateY(-50%) rotate(var(--screw-rot, 25deg));
}
.screw.sm { width: 7px; height: 7px; }
.vent {
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 6px;
  background: var(--hub-bg-0);
  border: 1px solid var(--hub-line);
}
.vent > i {
  display: block;
  height: 2px;
  background: var(--hub-bg-2);
  border-top: 1px solid rgba(0,0,0,0.4);
}
.label-tape {
  display: inline-block;
  background: linear-gradient(180deg, var(--hub-metal-1), var(--hub-metal-0));
  color: var(--hub-cream-bright);
  padding: 3px 8px;
  font-family: var(--hub-font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  border: 1px solid var(--hub-metal-0);
  box-shadow: inset 0 1px 0 var(--hub-bevel-light), 0 1px 0 rgba(0,0,0,0.4);
}
/* Dymo tape is always dark (physical object, contrasts with both backgrounds) */
.dymo-tape {
  display: inline-block;
  background: #1f1c16;
  color: var(--hub-cream-bright);
  padding: 3px 10px;
  font-family: var(--hub-font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  font-weight: 600;
  position: relative;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.8);
}
.dymo-tape::before, .dymo-tape::after {
  content: '';
  position: absolute; top: 0; bottom: 0;
  width: 4px;
  background: radial-gradient(circle at center, #0a0906 1.4px, transparent 1.6px);
  background-size: 4px 4px;
  background-repeat: repeat-y;
}
.dymo-tape::before { left: 0; }
.dymo-tape::after  { right: 0; }
.perf {
  background: var(--hub-bg-0);
  background-image: radial-gradient(circle, var(--hub-metal-0) 1.2px, var(--hub-bg-2) 1.4px);
  background-size: 6px 6px;
}
/* Rubber stamp */
.stamp {
  display: inline-block;
  border: 2px solid currentColor;
  padding: 2px 8px;
  font-family: var(--hub-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.65;
  transform: rotate(-2deg);
}
/* 7-segment glow text */
.seg {
  font-family: var(--hub-font-seg);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--hub-amber);
  text-shadow: 0 0 8px var(--hub-amber-glow), 0 0 2px var(--hub-amber-glow);
}
/* Bar meters */
.bar-track {
  background: var(--hub-bg-0);
  border: 1px solid var(--hub-line);
  position: relative;
  overflow: hidden;
}
.bar-fill {
  background: linear-gradient(90deg, var(--hub-amber-dim), var(--hub-amber));
  box-shadow: 0 0 4px var(--hub-amber-glow);
  height: 100%;
}
/* Phosphor text glow */
.glow     { text-shadow: 0 0 6px var(--hub-amber-glow), 0 0 2px var(--hub-amber-glow); }
.glow-dim { text-shadow: 0 0 4px var(--hub-amber-glow); }
.glow-cyan { text-shadow: 0 0 6px var(--hub-cyan-glow), 0 0 2px var(--hub-cyan-glow); }
/* Utility */
.mono-eyebrow {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--hub-cream-dim);
  text-transform: uppercase;
}
/* Canvas grid background */
.canvas-grid {
  background-image:
    linear-gradient(var(--hub-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hub-line) 1px, transparent 1px);
  background-size: var(--hub-grid) var(--hub-grid);
  opacity: var(--canvas-grid-opacity, 1);
}
/* Boot / canvas layout cells */
.canvas-cell {
  position: relative;
  background: var(--hub-bg-1);
  border: 1px solid var(--hub-line);
}
.boot-sweep {
  animation: bootIn 0.4s ease-out both;
}
@keyframes bootIn { to { opacity: 1; } }
/* Scrollbars */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--hub-bg-1); }
::-webkit-scrollbar-thumb { background: var(--hub-line-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--hub-amber-dim); }
/* Selection */
::selection {
  background: var(--hub-amber-dim);
  color: var(--hub-cream-bright);
}
/* ── ORDECK keeps the amber-first dark identity as its base dark accent ── */
/* (No override needed — hub.css dark mode already defaults to #ffb000)    */
/* ── CRT overlay controls — 0 in paper mode, JS sets scan opacity in dark ── */
:root {
  --crt-scanline-opacity: 0;
  --crt-vignette-opacity: 0;
}
:root[data-mode="dark"] {
  --crt-vignette-opacity: 0.5;
}
/* ── Backward-compat aliases for ORDECK panel / settings components ───── */
:root {
  --color-paper:          var(--hub-bg-0);
  --color-paper-2:        var(--hub-bg-1);
  --color-card:           var(--hub-bg-2);
  --color-card-2:         var(--hub-bg-3);
  --color-ink:            var(--hub-cream-bright);
  --color-muted:          var(--hub-cream-dim);
  --color-faint:          var(--hub-cream-faint);
  --color-line:           var(--hub-line);
  --color-line-strong:    var(--hub-line-strong);
  --color-accent:         var(--hub-amber);
  --color-accent-bright:  var(--hub-amber-bright);
  --color-accent-dim:     var(--hub-amber-dim);
  --color-accent-deep:    var(--hub-amber-deep);
  --color-accent-glow:    var(--hub-amber-glow);
  --color-accent-soft:    color-mix(in srgb, var(--hub-amber) 12%, var(--hub-bg-2));
  --color-secondary:      var(--hub-cyan);
  --color-secondary-dim:  var(--hub-cyan-dim);
  --color-secondary-glow: var(--hub-cyan-glow);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--hub-bg-0);
  color: var(--hub-cream);
  font-family: var(--hub-font-mono);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
/* CRT scanline overlay — driven by --crt-scanline-opacity (0 in paper mode).
   Canvas view only; the v2 room HUD (html.od-v2) has its own quiet grain. */
html:not(.od-v2) body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,176,0,var(--crt-scanline-opacity)) 0px,
    rgba(255,176,0,var(--crt-scanline-opacity)) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
}
/* CRT vignette overlay — canvas view only */
html:not(.od-v2) body::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,var(--crt-vignette-opacity)) 100%);
  pointer-events: none;
  z-index: 9998;
}
button { font: inherit; background: none; color: inherit; cursor: pointer; border: none; }
input, textarea { font-family: var(--hub-font-mono); color: var(--hub-cream); }
a { color: inherit; text-decoration: none; }
/* === ORDECK animation classes === */
@keyframes spin          { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes reel-spin     { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes crtExpand {
  0%   { clip-path: inset(49.5% 0 49.5% 0); filter: brightness(6); }
  9%   { clip-path: inset(0% 0 0% 0);        filter: brightness(2.2); }
  16%  { clip-path: inset(1.2% 0 1.2% 0);   filter: brightness(0.55); }
  24%  { clip-path: inset(0% 0 0% 0);        filter: brightness(1.5); }
  33%  { filter: brightness(0.75); }
  42%  { filter: brightness(1.15); }
  54%  { filter: brightness(0.9); }
  68%  { filter: brightness(1.05); }
  100% { filter: brightness(1); clip-path: inset(0% 0 0% 0); }
}
@keyframes introTitleReveal {
  from { opacity: 0; transform: translateY(6px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}
@keyframes introFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeSlideUp  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseOpacity { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes checkBounce  { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 70% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes panelIn      { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes itemIn       { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn      { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes scanRoll     { from { background-position: 0 0; } to { background-position: 0 -4px; } }
@keyframes scanPulse    { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes artifactFlash {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { opacity: 0; }
}
.view-enter   { animation: fadeSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) both; }
.panel-enter  { animation: panelIn     0.34s cubic-bezier(0.16, 1, 0.3, 1) both; }
.item-in      { animation: itemIn      0.26s cubic-bezier(0.16, 1, 0.3, 1) both; }
.modal-in     { animation: modalIn     0.22s cubic-bezier(0.16, 1, 0.3, 1) both; }
.crt-expand   { animation: crtExpand 0.55s ease-out both; }
.intro-title  { animation: introTitleReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.intro-out    { animation: introFadeOut 0.45s ease-in forwards; }
.now-dot      { animation: pulseOpacity 1.8s ease-in-out infinite; }
.check-pop    { animation: checkBounce 0.25s ease-out; }
/* Allow text selection inside widget content */
.selectable, .selectable * { user-select: text; }
