/* JARVIS theme. Active when <body> has the class "jarvis" (the desktop app turns it on; the phone app only with #theme=jarvis). */
body.jarvis {
  --bg: #050b08; --surface: rgba(8, 24, 17, 0.8); --fg: #cdeedd; --muted: #6f9a85; --line: rgba(93, 255, 176, 0.24);
  --accent: #4dffa0; --accent-fg: #02130a; --new: #ffc861; --new-bg: rgba(255, 200, 97, 0.1); --done: #4dffa0; --done-bg: rgba(77, 255, 160, 0.1);
  --font-body: "Cascadia Mono", "Consolas", ui-monospace, monospace; --font-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --br-img: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent));
  --br-size: 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px;
  --br-pos: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom;
  --circuit: radial-gradient(ellipse at 50% 42%, rgba(40, 130, 85, 0.3), transparent 62%), url("circuit.svg") 0 0 / 480px 480px, #050b08;
  background: var(--circuit); background-attachment: fixed; font-size: 14px; letter-spacing: 0.02em; padding-top: 40px;
}
body.jarvis #mapfull, body.jarvis #closeday, body.jarvis .page, body.jarvis .overlay { background: var(--circuit); }
body.jarvis #mapfull, body.jarvis #closeday { padding-top: 34px; }
body.jarvis .page-bar { padding-top: 38px; background: transparent; }
body.jarvis .overlay { padding-top: 40px; }

/* HUD bar: title, link status, clock, window buttons */
.hud { display: none; }
body.jarvis .hud span { white-space: nowrap; }
body.jarvis .hud { display: flex; position: fixed; top: 0; left: 0; right: 0; height: 30px; z-index: 58; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 0 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted);
  background: linear-gradient(rgba(3, 9, 6, 0.95), rgba(3, 9, 6, 0)); -webkit-app-region: drag; user-select: none; }
.hud b { color: var(--accent); font-weight: 600; text-shadow: 0 0 8px rgba(77, 255, 160, 0.7); }
.hud-right { display: inline-flex; align-items: center; gap: 14px; }
.hud-clock { color: #cdeedd; letter-spacing: 0.2em; }
.hud-btns { display: inline-flex; gap: 2px; -webkit-app-region: no-drag; }
.hud-btns button { font: inherit; color: var(--accent); background: transparent; border: 0; width: 30px; height: 24px; cursor: pointer; letter-spacing: 0; }
.hud-btns button:hover { background: rgba(77, 255, 160, 0.14); }
.hud-btns[hidden] { display: none; }

/* panels: thin neon border, soft inner glow, corner brackets */
body.jarvis .tile, body.jarvis .score, body.jarvis .cd-card, body.jarvis .mf-sheet, body.jarvis .ql-panel, body.jarvis .map-info, body.jarvis .day.md, body.jarvis .draft-item, body.jarvis .signin {
  border: 1px solid var(--line); border-radius: 3px; box-shadow: inset 0 0 22px rgba(77, 255, 160, 0.05), 0 0 18px rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
  background-image: var(--br-img); background-size: var(--br-size); background-position: var(--br-pos); background-repeat: no-repeat; }
body.jarvis .tile { text-transform: uppercase; letter-spacing: 0.14em; transition: box-shadow 0.2s, border-color 0.2s; }
body.jarvis .tile:hover { border-color: var(--accent); box-shadow: inset 0 0 26px rgba(77, 255, 160, 0.12), 0 0 14px rgba(77, 255, 160, 0.25); }
body.jarvis .tile b { font-size: 0.95rem; font-weight: 600; color: #dffff0; text-shadow: 0 0 10px rgba(77, 255, 160, 0.4); }
body.jarvis .tile span { text-transform: none; letter-spacing: 0.02em; }
body.jarvis #tile-map { background: var(--br-img), rgba(10, 40, 28, 0.7); background-size: var(--br-size); background-position: var(--br-pos); background-repeat: no-repeat; border-radius: 3px; }
body.jarvis h2, body.jarvis .cd-count, body.jarvis .sh-meta, body.jarvis .sc-lbl, body.jarvis .sc-total { letter-spacing: 0.18em; text-transform: uppercase; }
body.jarvis .cd-h, body.jarvis .cd-q, body.jarvis .sh-title { letter-spacing: 0.04em; text-shadow: 0 0 12px rgba(77, 255, 160, 0.25); }

/* controls */
body.jarvis .btn, body.jarvis .cd-btn.primary, body.jarvis .sh-actions .primary { background: rgba(77, 255, 160, 0.14); color: #dffff0; border: 1px solid var(--accent); border-radius: 3px; text-transform: uppercase; letter-spacing: 0.16em; box-shadow: 0 0 14px rgba(77, 255, 160, 0.3), inset 0 0 12px rgba(77, 255, 160, 0.12); }
body.jarvis .cd-btn, body.jarvis .sh-actions button, body.jarvis .sh-moves button, body.jarvis .chip, body.jarvis .sh-open, body.jarvis .cd-chip { border-radius: 3px; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; }
body.jarvis .seg, body.jarvis .seg button, body.jarvis .mf-x, body.jarvis .fab { border-radius: 3px; }
body.jarvis .seg button { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; }
body.jarvis .seg button[aria-pressed="true"] { background: rgba(77, 255, 160, 0.18); color: #dffff0; box-shadow: 0 0 12px rgba(77, 255, 160, 0.35); }
body.jarvis .mf-x { border-color: var(--line); color: var(--accent); background: rgba(8, 24, 17, 0.8); }
body.jarvis .fab { background: rgba(10, 40, 28, 0.9); color: var(--accent); border: 1px solid var(--accent); box-shadow: 0 0 20px rgba(77, 255, 160, 0.45); }
body.jarvis textarea { background: rgba(4, 14, 10, 0.85); border-color: var(--line); border-radius: 3px; color: #dffff0; }
body.jarvis #qlog { background: rgba(2, 8, 5, 0.7); }

/* scoreboard */
body.jarvis .sc-flame { border-radius: 50%; }
body.jarvis .sc-flame.on { box-shadow: 0 0 22px rgba(77, 255, 160, 0.6), inset 0 0 12px rgba(77, 255, 160, 0.25); }
body.jarvis .sc-dot { border-radius: 3px; }
body.jarvis .sc-day.on .sc-dot { box-shadow: 0 0 12px var(--done); }
body.jarvis .sc-pts b { color: #dffff0; text-shadow: 0 0 14px rgba(77, 255, 160, 0.55); }

/* the Map */
body.jarvis #map-svg .edge { stroke: rgba(77, 255, 160, 0.38); stroke-width: 1.2; stroke-dasharray: 2 6; animation: jv-flow 2.4s linear infinite; }
body.jarvis #map-svg .edge.fade { animation: jv-flow 2.4s linear infinite, edgefade 0.5s ease 0.3s both; }
@keyframes jv-flow { to { stroke-dashoffset: -16; } }
body.jarvis #map-svg .nd circle:not(.hit), body.jarvis #map-svg .nd rect:not(.hit) { fill: rgba(6, 20, 14, 0.92); stroke-width: 2; }
body.jarvis #map-svg .nd.open circle, body.jarvis #map-svg .nd.open rect:not(.hit) { filter: drop-shadow(0 0 4px rgba(77, 255, 160, 0.6)); }
body.jarvis #map-svg .nd.soon circle, body.jarvis #map-svg .nd.soon rect:not(.hit) { fill: rgba(77, 255, 160, 0.1); filter: drop-shadow(0 0 5px rgba(77, 255, 160, 0.7)); }
body.jarvis #map-svg .nd.today circle, body.jarvis #map-svg .nd.today rect:not(.hit) { fill: rgba(255, 200, 97, 0.1); filter: drop-shadow(0 0 6px rgba(255, 200, 97, 0.8)); }
body.jarvis #map-svg .nd.event circle, body.jarvis #map-svg .nd.event rect:not(.hit) { filter: drop-shadow(0 0 6px rgba(110, 168, 254, 0.8)); }
body.jarvis #map-svg .nd.done circle, body.jarvis #map-svg .nd.done rect:not(.hit) { fill: rgba(77, 255, 160, 0.85); filter: drop-shadow(0 0 9px rgba(77, 255, 160, 0.95)); animation: jv-pulse 3s ease-in-out infinite; }
@keyframes jv-pulse { 50% { filter: drop-shadow(0 0 3px rgba(77, 255, 160, 0.6)); } }
body.jarvis #map-svg .nd.area circle { fill: rgba(77, 255, 160, 0.1); filter: drop-shadow(0 0 7px rgba(77, 255, 160, 0.6)); }
body.jarvis #map-svg .nd.sel circle, body.jarvis #map-svg .nd.sel rect:not(.hit) { stroke-width: 3.5; }
body.jarvis #map-svg .nd text { fill: #bfe8d0; font-size: 10.5px; letter-spacing: 0.03em; }
body.jarvis #map-svg .nd .cnt { fill: #dffff0; }
body.jarvis #map-svg .nd.done .cnt { fill: #02130a; }
body.jarvis #map-svg .nd.hubnode text { fill: #dffff0; letter-spacing: 0.3em; text-shadow: 0 0 10px rgba(77, 255, 160, 0.7); }
body.jarvis #map-svg .nd.hubnode .chip { fill: rgba(5, 20, 13, 0.97); stroke: var(--accent); stroke-width: 1.5; filter: drop-shadow(0 0 12px rgba(77, 255, 160, 0.6)); }
body.jarvis #map-svg .nd.hubnode .tick { fill: none; stroke: var(--accent); stroke-width: 1.5; }
body.jarvis #map-svg .ring { fill: none; stroke: rgba(77, 255, 160, 0.16); stroke-width: 1; stroke-dasharray: 2 7; }
body.jarvis #map-svg .ring.spin { transform-origin: 180px 215px; animation: jv-spin 90s linear infinite; }
body.jarvis #map-svg .ring.spin2 { transform-origin: 180px 215px; animation: jv-spin 140s linear infinite reverse; stroke-dasharray: 1 10; }
@keyframes jv-spin { to { transform: rotate(360deg); } }
body.jarvis .mf-legend { letter-spacing: 0.16em; text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) { body.jarvis #map-svg .edge, body.jarvis #map-svg .ring, body.jarvis #map-svg .nd.done circle { animation: none; } }
body.jarvis #map-svg .nd.hubnode text { letter-spacing: 0.2em; }
body.jarvis #map-svg .nd.hubnode .sub { letter-spacing: 0.06em; font-size: 8px; fill: var(--muted); text-shadow: none; }
body.jarvis #map-svg .nd:focus, body.jarvis #map-svg .nd:focus-visible, body.jarvis #map-svg .hub:focus { outline: none; }
body.jarvis #map-svg .nd:focus-visible .chip { stroke-width: 2.5; }
