/* Enerthon Hub screens. Colours, fonts, .holo frames and the reactor come from the shared /hud/hud.css. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: radial-gradient(ellipse at 50% 0%, var(--bg2), var(--bg) 70%); color: var(--text);
  font-family: var(--font-body); font-size: 16px; overflow: hidden; }
[hidden] { display: none !important; }
.fx-bg { width: 100%; height: 100%; }
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select { background: rgba(3, 14, 24, .8); border: 1px solid var(--line-strong); padding: 8px 10px;
  outline: none; min-width: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--glow); box-shadow: 0 0 0 1px var(--glow), 0 0 14px rgba(51, 214, 255, .25); }
select option { background: #061424; }
code { font-family: var(--font-mono); font-size: 13px; color: var(--glow-soft); background: rgba(51, 214, 255, .08);
  padding: 1px 5px; overflow-wrap: anywhere; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(90, 210, 255, .25); }

.btn { background: rgba(10, 34, 52, .8); border: 1px solid var(--line-strong); color: var(--glow-soft); cursor: pointer;
  font-family: var(--font-hud); font-size: 11px; letter-spacing: .18em; padding: 9px 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--glow); box-shadow: 0 0 12px rgba(51, 214, 255, .3); }
.btn:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
.btn.primary { background: rgba(51, 214, 255, .16); border-color: var(--glow); color: #fff; }
.btn.danger { color: #ffb3bb; border-color: rgba(255, 77, 94, .5); }
.btn.danger:hover { border-color: var(--red); box-shadow: 0 0 12px rgba(255, 77, 94, .35); }
.btn.small { padding: 6px 9px; font-size: 10px; }
.btn.link { background: none; border: 0; color: var(--muted); letter-spacing: .1em; font-family: var(--font-body); font-size: 14px; }
.btn.on { background: var(--glow); color: #02111b; border-color: var(--glow); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* ------------------------------------------------------------------ sign in */
.gate { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; overflow: auto; }
.gate-box { width: min(400px, 100%); padding: 30px 28px 22px; display: flex; flex-direction: column; gap: 14px; }
.gate-logo { font-family: var(--font-hud); font-weight: 900; font-size: 24px; letter-spacing: .3em; color: var(--glow-soft);
  text-shadow: 0 0 18px var(--glow); text-align: center; }
.gate-sub { text-align: center; color: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.gate-err { color: #ff9aa5; min-height: 20px; font-size: 15px; }

/* ------------------------------------------------------------------ shell */
.shell { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 16, 28, .9), rgba(4, 16, 28, .5)); flex-wrap: wrap; }
.brand-name { font-family: var(--font-hud); font-weight: 900; font-size: 17px; letter-spacing: .32em; color: var(--glow-soft);
  text-shadow: 0 0 14px var(--glow); }
.brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin: 0 auto; }
.nav button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer;
  font-family: var(--font-hud); font-size: 12px; letter-spacing: .26em; padding: 9px 14px; }
.nav button:hover { color: var(--glow-soft); }
.nav button.on { color: #fff; border-bottom-color: var(--glow); text-shadow: 0 0 10px var(--glow); }
.nav button:focus-visible { outline: 2px solid var(--glow); }
.me { display: flex; align-items: center; gap: 12px; }
.clock { font-family: var(--font-mono); color: var(--glow-soft); font-size: 15px; }
.who { color: var(--text); font-weight: 600; }
main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; padding: 14px 18px 18px; display: grid; gap: 14px; }
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel.grow { flex: 1; }
.pad { padding: 12px 16px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.pad p { margin: 0; color: var(--text); line-height: 1.45; }
.lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input, .row > code { flex: 1; }
.row > code { padding: 8px 10px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); z-index: 50; opacity: 0; pointer-events: none;
  background: rgba(4, 20, 34, .96); border: 1px solid var(--glow); padding: 10px 18px; transition: opacity .2s, transform .2s;
  max-width: min(560px, 92vw); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--red); color: #ffc2c8; }

/* ------------------------------------------------------------------ jarvis */
.v-jarvis { grid-template-columns: minmax(320px, 1fr) minmax(340px, 460px) minmax(250px, 320px); }
.j-core { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 0; min-width: 0; }
.j-reactor { position: relative; width: min(50vh, 88%); max-width: 470px; flex: none; }
.j-globe { position: absolute; inset: 21.5%; width: 57%; height: 57%; }  /* the Earth sits inside the rings */
.j-cards { position: relative; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.j-cards .jc-stage { overflow-y: auto; min-height: 0; padding: 2px 4px 2px 0; scroll-behavior: smooth; }
.j-hint { margin: auto 0; padding: 22px 20px; border: 1px dashed var(--line-strong); text-align: center; color: var(--muted); }
.j-hint-t { font-family: var(--font-hud); font-weight: 700; letter-spacing: .3em; color: var(--glow-soft); font-size: 14px; }
.j-hint p { margin: 8px 0 14px; }
.j-asks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.j-asks button { background: rgba(99, 168, 109, .1); border: 1px solid var(--line-strong); color: var(--text); padding: 7px 12px;
  border-radius: 999px; cursor: pointer; font-size: 14.5px; }
.j-asks button:hover { border-color: var(--glow); background: rgba(99, 168, 109, .22); }
body.has-cards .j-hint, .j-cards.used .j-hint { display: none; }
.j-state { font-family: var(--font-hud); font-size: 12px; letter-spacing: .4em; color: var(--glow); transition: color .4s; }
.j-caption { min-height: 56px; max-width: 640px; text-align: center; font-size: 19px; line-height: 1.4; color: var(--muted);
  opacity: 0; transition: opacity .3s; padding: 0 10px; }
.j-caption.on { opacity: 1; }
.j-caption span.now { color: #fff; text-shadow: 0 0 10px var(--glow); }
.j-caption span.done { color: var(--glow-soft); }
.j-caption.heard { color: var(--text); font-style: italic; }
.j-input { display: flex; gap: 8px; width: min(640px, 100%); }
.j-input input { flex: 1; font-size: 17px; }
.btn.icon { min-width: 58px; }
.btn.icon.live { background: var(--glow); color: #02111b; animation: blink 1s infinite; }
.j-toggles { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 15px; }
.j-toggles label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.j-note { color: var(--amber); }
.j-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.j-side .panel:last-child { max-height: 42%; }
.log, .feed { overflow-y: auto; padding: 10px 14px 12px 20px; display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.msg { line-height: 1.4; }
.msg .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); display: block; }
.msg.j .k { color: var(--glow); }
.msg .items { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.item { text-align: left; background: rgba(4, 16, 28, .7); border: 1px solid var(--line); border-left: 2px solid var(--glow);
  padding: 5px 9px; color: var(--text); cursor: pointer; font-size: 14.5px; }
.item b { color: var(--glow-soft); font-weight: 600; }
.item:hover { border-color: var(--glow); }
.item.static { cursor: default; }
.act { font-size: 14.5px; line-height: 1.35; }
.act b { color: var(--glow-soft); font-weight: 600; }
.act .via { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: .08em; margin-left: 4px; }
.act .via.claude { color: var(--violet); }
.act .via.jarvis { color: var(--green); }
.empty { color: var(--muted); font-size: 14.5px; }

/* ------------------------------------------------------------------ notes */
.v-notes { grid-template-columns: 260px minmax(0, 1fr) 220px; }
.n-tools { display: flex; gap: 6px; padding: 10px 12px 8px 16px; }
.n-tools input { flex: 1; }
.n-items { overflow-y: auto; padding: 0 8px 10px 12px; }
.n-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent;
  padding: 7px 8px; cursor: pointer; }
.n-item:hover { background: rgba(51, 214, 255, .06); }
.n-item.on { border-left-color: var(--glow); background: rgba(51, 214, 255, .1); }
.n-item .t { color: var(--text); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n-item .s { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n-edit { padding: 14px 16px 14px 20px; }
.n-empty { margin: auto; color: var(--muted); max-width: 420px; text-align: center; line-height: 1.5; }
.n-doc { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
.n-head { display: flex; gap: 6px; align-items: center; }
.n-head input { flex: 1; font-family: var(--font-hud); font-size: 17px; letter-spacing: .06em; color: var(--glow-soft); }
.n-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.n-doc textarea { flex: 1; resize: none; font-family: var(--font-mono); font-size: 14.5px; line-height: 1.55; min-height: 0; }
.md { flex: 1; overflow-y: auto; line-height: 1.55; font-size: 17px; padding-right: 6px; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { font-family: var(--font-hud); color: var(--glow-soft); letter-spacing: .06em; margin: 16px 0 6px; }
.md h1 { font-size: 21px; } .md h2 { font-size: 17px; } .md h3 { font-size: 14px; }
.md p { margin: 8px 0; } .md ul, .md ol { margin: 6px 0; padding-left: 24px; }
.md pre { background: rgba(2, 10, 18, .85); border: 1px solid var(--line); padding: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 8px 0; padding-left: 12px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.md a { color: var(--glow); }
.md .wl { color: var(--glow-soft); border-bottom: 1px dashed var(--glow); cursor: pointer; background: none; border-top: 0;
  border-left: 0; border-right: 0; padding: 0; font: inherit; }
.md .wl.missing { color: var(--amber); border-bottom-color: var(--amber); }
.md hr { border: 0; border-top: 1px solid var(--line); }
.n-links { overflow-y: auto; }
.chips { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 14px 18px; }
.chip { text-align: left; background: rgba(4, 16, 28, .7); border: 1px solid var(--line); color: var(--glow-soft); padding: 5px 8px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--glow); }
.chip.missing { color: var(--amber); border-style: dashed; }

/* ------------------------------------------------------------------ graph */
.v-graph { padding: 0; }
.v-graph canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.g-info { position: absolute; left: 18px; right: 18px; bottom: 12px; display: flex; gap: 18px; justify-content: space-between;
  flex-wrap: wrap; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); pointer-events: none; }
.g-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 10px; vertical-align: -1px; }
.k-note { background: var(--glow); box-shadow: 0 0 6px var(--glow); }
.k-ghost { border: 1.5px dashed var(--amber); }
.g-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 20px; text-align: center; }

/* ------------------------------------------------------------------ tasks */
.v-tasks { grid-template-rows: auto minmax(0, 1fr); }
.t-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.t-add input[type=text], .t-add #t-title { flex: 1; min-width: 200px; }
.t-mine { color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.t-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; min-height: 0; }
.t-col { overflow-y: auto; padding: 10px 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.task { background: rgba(4, 16, 28, .75); border: 1px solid var(--line); border-left: 2px solid var(--glow); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px; }
.task.doing { border-left-color: var(--amber); }
.task.done { border-left-color: var(--green); opacity: .7; }
.task.done .tt { text-decoration: line-through; }
.task .tt { line-height: 1.3; overflow-wrap: anywhere; }
.task .tr { display: flex; gap: 5px; align-items: center; }
.task select { padding: 3px 5px; font-size: 13.5px; flex: 1; }
.task .by { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

/* ------------------------------------------------------------------ team */
.v-team { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-content: start; overflow-y: auto; }
.members { padding: 8px 16px 8px 20px; display: flex; flex-direction: column; }
.mem { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mem .n { font-weight: 600; } .mem .e { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.mem .role { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--glow); text-transform: uppercase; }
.toks { display: flex; flex-direction: column; gap: 5px; }
.tok { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); padding: 5px 8px; }
.tok .d { color: var(--muted); font-size: 13.5px; margin-left: auto; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100%; }
  main { position: static; }
  .view { position: static; padding: 12px; }
  .v-jarvis, .v-notes, .v-team, .t-cols { grid-template-columns: minmax(0, 1fr); }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .nav button { padding: 8px 10px; letter-spacing: .16em; }
  .me { margin-left: auto; }
  .j-reactor { width: min(70vw, 300px); }
  .j-side .panel:last-child { max-height: none; }
  .log, .feed, .n-items, .t-col { max-height: 320px; }
  .n-doc textarea, .md { min-height: 50vh; }
  .v-graph { position: relative; height: 75vh; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
