/* OracleNest — dark starfield, neon-green panels (design language per SPEC) */
* { box-sizing: border-box; }
body {
  margin: 0; color: #c9ffd9; font-family: "Segoe UI", system-ui, sans-serif;
  background: #020604;
  min-height: 100vh;
}
canvas#starfield {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
header.top, .wrap { position: relative; z-index: 1; }
a { color: #57ff8f; }
/* A wire headline with no matched source article: same colour as
   a linked headline, so the table reads consistently — it is
   plain text, not a broken link (Phase 2.8.4). */
.wire-plain { color: #57ff8f; }
header.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; border-bottom: 1px solid #123d24;
  background: rgba(2, 20, 10, .75);
}
.brand { font-size: 20px; letter-spacing: 2px; color: #57ff8f; font-weight: 700; }
.brand small { color: #8fd9a8; letter-spacing: 0; font-weight: 400; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 18px; }
.panel {
  border: 1px solid #1d5c36; border-radius: 10px; padding: 16px 18px;
  background: rgba(3, 26, 13, .82); margin-bottom: 18px;
  box-shadow: 0 0 18px rgba(30, 255, 120, .07);
}
.panel h2 { margin: 0 0 10px; font-size: 16px; color: #57ff8f; letter-spacing: 1px; }
.portfolio { display: flex; gap: 34px; flex-wrap: wrap; align-items: center; }
.portfolio .big { font-size: 30px; color: #eafff1; font-weight: 700; }
.portfolio .lbl { font-size: 12px; text-transform: uppercase; color: #8fd9a8; letter-spacing: 1px; }
.toggle { margin-left: auto; display: flex; border: 1px solid #1d5c36; border-radius: 20px; overflow: hidden; }
.toggle a { padding: 8px 16px; text-decoration: none; color: #8fd9a8; font-size: 14px; }
.toggle a.on { background: #14532d; color: #eafff1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #123d24; }
th { color: #8fd9a8; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
td:first-child, th:first-child { text-align: left; }
.pos { color: #57ff8f; } .neg { color: #ff6b6b; }
.tag-red { display: inline-block; background: #7f1d1d; color: #fecaca;
  padding: 3px 10px; border-radius: 4px; font-size: 12px; margin-bottom: 10px; }
button.exec {
  background: #14b8a6; color: #04241f; border: 0; border-radius: 6px;
  padding: 7px 16px; font-weight: 700; cursor: pointer; letter-spacing: 1px;
}
button.exec:hover { background: #2dd4bf; }
button.exit { background: transparent; color: #ff9d9d; border: 1px solid #7f1d1d;
  border-radius: 6px; padding: 5px 12px; cursor: pointer; }
button.plain { background: #14532d; color: #eafff1; border: 0; border-radius: 6px;
  padding: 9px 18px; cursor: pointer; font-weight: 600; }
.flash { background: #14532d; border: 1px solid #1d5c36; color: #eafff1;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
/* Phase 2.8.1: inline form errors — the notice sits beside the
   field it belongs to, on the same screen, entries kept. */
.field-error { color: #ff9d9d; font-size: 13px; margin: -6px 0 10px; }
.warn { color: #fbbf24; font-size: 13px; }
.muted { color: #8fd9a8; font-size: 13px; }
.conf { cursor: help; border-bottom: 1px dotted #57ff8f; }
/* The modal MUST outrank .wrap (z-index 1): without its own z-index the
   dashboard painted over it and ate its clicks (Jim, Nov 15, 2026). */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.72);
  align-items: center; justify-content: center; z-index: 60; }
.modal.open { display: flex; }
body.modal-open { overflow: hidden; }
.modal .box { background: #03150b; border: 1px solid #1d5c36; border-radius: 10px;
  padding: 22px; width: 320px; box-shadow: 0 18px 60px rgba(0,0,0,.8), 0 0 24px rgba(30,255,120,.12); }
.modal input { width: 100%; padding: 10px; font-size: 16px; border-radius: 6px;
  border: 1px solid #1d5c36; background: #02120a; color: #eafff1; margin: 10px 0; }
.login-box { max-width: 360px; margin: 12vh auto; }
.login-box input { width: 100%; padding: 11px; margin: 6px 0 12px; border-radius: 6px;
  border: 1px solid #1d5c36; background: #02120a; color: #eafff1; font-size: 15px; }
.avatar {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 8px;
  border: 2px solid #57ff8f; box-shadow: 0 0 24px rgba(87,255,143,.5), inset 0 0 18px rgba(87,255,143,.35);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 30px; color: #b8ffd2; background: radial-gradient(circle at 35% 30%, #14532d, #02120a);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------- Titan's presence ----------------
   A living portrait, not a thumbnail: a slow ring of green flame
   circles him, the glow breathes, the face itself is the generated
   loop. Sizes: hero (Converse), strip (dashboard), login. */
nav.mainnav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
nav.mainnav a { padding: 8px 15px; border-radius: 20px; text-decoration: none;
  color: #8fd9a8; font-size: 14px; border: 1px solid transparent; }
nav.mainnav a:hover { border-color: #1d5c36; color: #eafff1; }
nav.mainnav a.active { background: #14532d; color: #eafff1; border-color: #1d5c36; }
.titan-orb { position: relative; border-radius: 50%; flex: none; }
.titan-orb .ring { position: absolute; inset: -9px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 38%, rgba(87,255,143,.9) 50%, transparent 62% 100%);
  animation: orb-spin 14s linear infinite; filter: blur(1px); pointer-events: none; }
.titan-orb .face { position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  border: 2px solid #57ff8f; background: radial-gradient(circle at 35% 30%, #14532d, #02120a);
  box-shadow: 0 0 34px rgba(87,255,143,.45), inset 0 0 22px rgba(87,255,143,.3);
  animation: orb-breathe 6s ease-in-out infinite; }
.titan-orb video, .titan-orb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.titan-hero { width: 300px; height: 300px; margin: 8px auto 16px; }
.titan-strip-orb { width: 88px; height: 88px; }
.titan-login { width: 150px; height: 150px; margin: 0 auto 12px; }
/* Titan talking (Phase 1.6): while his voice plays, the Converse hero
   is driven by the audio itself — app.js feeds the real volume into
   --talk (0..1), which opens the mouth overlay, swells the portrait
   and brightens the flame ring. The mouth sits on his lips by
   measurement of the portrait: left 49.8%, top 69.5%. */
.titan-orb { --talk: 0; }
.titan-orb .mouth { position: absolute; left: 49.8%; top: 69.5%;
  width: 13%; height: 1.2%; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at center, rgba(3,14,8,.9) 0%,
    rgba(3,14,8,.5) 55%, transparent 78%);
  opacity: 0; filter: blur(1.5px); }
.titan-orb.speaking .mouth { opacity: calc(.2 + var(--talk) * .8);
  height: calc(1.2% + var(--talk) * 4.8%); }
.titan-orb.speaking video { transform: scale(calc(1 + var(--talk) * .03)); }
.titan-orb.speaking .ring { filter: blur(1px) brightness(calc(1 + var(--talk) * 1.1)); }
.titan-strip { display: flex; gap: 20px; align-items: center; }
.titan-strip .who { font-size: 19px; letter-spacing: 3px; color: #57ff8f; font-weight: 700; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.briefing { display: flex; gap: 14px; align-items: flex-start;
  background: rgba(20, 83, 45, .35); border: 1px solid #1d5c36;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.briefing p { margin: 4px 0 0; line-height: 1.55; }
.b-orb { width: 52px; height: 52px; }
@media (prefers-reduced-motion: reduce) {
  .titan-orb .ring, .titan-orb .face { animation: none; }
  .titan-orb .mouth { display: none; }
  .titan-orb.speaking video { transform: none; }
}
.chatlog { height: 46vh; overflow-y: auto; padding: 6px; }
.msg { margin: 8px 0; padding: 10px 14px; border-radius: 10px; max-width: 82%; line-height: 1.45; }
.msg.titan { background: rgba(20, 83, 45, .55); }
.msg.user { background: rgba(20, 184, 166, .18); margin-left: auto; }
.chatbar { display: flex; gap: 8px; }
.chatbar input { flex: 1; padding: 11px; border-radius: 6px; border: 1px solid #1d5c36;
  background: #02120a; color: #eafff1; font-size: 15px; }

/* ---------------- Mobile web app (Phase 1.7) ----------------
   Jim's ruling (Nov 15, 2026): NO native app, no app-store gate —
   OracleNest is a mobile web app. One site for iOS Safari, Android
   Chrome and everything else, installable to the home screen via
   the manifest (Android) and apple-touch-icon (iOS). Desktop layout
   above is untouched; everything below only narrows the small
   screen. */
body { min-height: 100dvh; }   /* mobile Safari/Chrome true height */
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tblwrap table { min-width: 560px; }
.tblwrap th, .tblwrap td { white-space: nowrap; }
.tblwrap td:first-child, .tblwrap th:first-child {
  white-space: normal; min-width: 130px; }
@media (max-width: 760px) {
  .wrap { padding: 12px 10px; }
  header.top { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .brand { font-size: 17px; }
  nav.mainnav a { padding: 11px 13px; }        /* ~44px touch target */
  .panel { padding: 13px 12px; margin-bottom: 12px; }
  .portfolio { gap: 16px 20px; }
  .portfolio .big { font-size: 24px; }
  .toggle { margin-left: 0; }
  .toggle a { padding: 10px 16px; }
  .titan-hero { width: min(300px, 80vw); height: min(300px, 80vw); }
  .titan-strip { gap: 12px; }
  .titan-strip-orb { width: 64px; height: 64px; }
  .chatlog { height: 52dvh; }
  .chatbar input { font-size: 16px; }   /* iOS zooms on focus < 16px */
  .login-box { margin: 6vh auto; }
  .login-box input { font-size: 16px; }
  .modal .box { width: min(320px, 92vw); padding: 18px; }
  button.exec { padding: 10px 16px; }
  button.exit { padding: 9px 14px; }
  button.plain { padding: 11px 18px; }
  .msg { max-width: 92%; }
}

/* Print (Phase 1.8, for the P&L report): paper gets ink-friendly
   output — no starfield, no nav, no buttons, black on white. */
@media print {
  body { background: #fff; color: #111; min-height: 0; }
  canvas#starfield, header.top nav, .noprint { display: none !important; }
  header.top { border-bottom: 1px solid #999; background: #fff; }
  .brand, .panel h2, .portfolio .big, th { color: #111; }
  .panel { background: #fff; border-color: #999; box-shadow: none; }
  .muted, .portfolio .lbl, td, .warn { color: #333; }
  .pos { color: #067647; } .neg { color: #b42318; }
  .tblwrap { overflow: visible; }
  .tblwrap table { min-width: 0; }
  .tblwrap th, .tblwrap td { white-space: normal; }
  a { color: #111; text-decoration: none; }
}

/* Feedback board (Phase 2.2) */
.feedback-form select, .feedback-form textarea, .feedback-form input {
  width: 100%; padding: 11px; margin: 6px 0 12px; border-radius: 6px;
  border: 1px solid #1d5c36; background: #04120b; color: #e7f6ec;
  font-size: 16px;
}
.fb-post { border-top: 1px solid rgba(45, 212, 191, .25); padding: 12px 0; }
.tag { display: inline-block; font-size: 11px; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 8px; border: 1px solid #2dd4bf;
  color: #2dd4bf; margin-right: 6px; text-transform: uppercase; }
.tag.bug { border-color: #f87171; color: #f87171; }
.tag.suggestion { border-color: #fbbf24; color: #fbbf24; }
.tag.closed { border-color: #6b7280; color: #9ca3af; }

/* Phase 2.3 — Record page stats + arc, dashboard world panel */
.statgrid {display:flex; flex-wrap:wrap; gap:10px; margin-top:12px}
.stat {background:#0a1f18; border:1px solid #1d3a33; border-radius:8px;
  padding:10px 14px; min-width:118px}
.stat .sv {font-size:20px; font-weight:700; color:#e8f5f0}
.stat .sl {font-size:12px; color:#9db8b0; margin-top:2px}
svg.arc {width:100%; height:140px; background:#0a1512;
  border:1px solid #1d3a33; border-radius:8px}
.wpgrid {display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}
.wpitem {background:#0a1f18; border:1px solid #1d3a33; border-radius:8px;
  padding:8px 12px; min-width:126px}
.wpitem .wl {font-size:12px; color:#9db8b0}
.wpitem .wv {font-size:16px; font-weight:700; color:#e8f5f0}

/* ---------------- Light mode (Phase 2.8.1) ----------------
   The switch sits on the home page — and on the sign-in page,
   the home a visitor reaches first — open to EVERY visitor and
   member, never an admin/operator extra. Once flipped, light
   applies across the whole site and is remembered on the device
   (localStorage + cookie, applied by an inline snippet as each
   page opens, so nothing flashes the wrong theme). Dark stays
   the default — light is chosen, never imposed. For readers
   with astigmatism, bright text on black blooms; this theme is
   near-black text on a soft off-white ground, strong contrast
   throughout, the house green/teal carried over as accents. */
.theme-toggle { background: transparent; border: 1px solid #1d5c36;
  color: #8fd9a8; border-radius: 20px; padding: 8px 15px;
  font-size: 14px; cursor: pointer; }
body.light { background: #f5f2ea; color: #131a15; }
body.light canvas#starfield { display: none; }
body.light a { color: #0b6e35; }
body.light .wire-plain { color: #0b6e35; }
body.light header.top { background: rgba(255,253,246,.94);
  border-bottom-color: #b9cfbc; }
body.light .brand { color: #0b6e35; }
body.light .brand small { color: #3f5d49; }
body.light .theme-toggle { border-color: #a7c3ac; color: #43584a; }
body.light .panel { background: #fffdf6; border-color: #a7c3ac;
  box-shadow: 0 1px 6px rgba(20,60,35,.10); }
body.light .panel h2 { color: #0b6e35; }
body.light .muted { color: #43584a; }
body.light .portfolio .big { color: #0d1f13; }
body.light .portfolio .lbl { color: #43584a; }
body.light th { color: #43584a; }
body.light th, body.light td { border-bottom-color: #cfdccf; }
body.light .toggle { border-color: #a7c3ac; }
body.light .toggle a { color: #43584a; }
body.light .toggle a.on { background: #0b6e35; color: #fff; }
body.light nav.mainnav a { color: #43584a; }
body.light nav.mainnav a:hover { border-color: #a7c3ac; color: #0d1f13; }
body.light nav.mainnav a.active { background: #0b6e35; color: #fff;
  border-color: #0b6e35; }
body.light button.plain { background: #0b6e35; color: #fff; }
body.light button.exec { background: #0f766e; color: #fff; }
body.light button.exec:hover { background: #14b8a6; color: #04241f; }
body.light button.exit { color: #b42318; border-color: #b42318; }
body.light .flash { background: #e2f2e4; border-color: #a7c3ac;
  color: #0d1f13; }
body.light .field-error { color: #b42318; }
body.light .warn { color: #92580a; }
body.light .pos { color: #0b7a35; }
body.light .neg { color: #b42318; }
body.light .modal .box { background: #fffdf6; border-color: #a7c3ac;
  box-shadow: 0 18px 60px rgba(20,40,25,.35); }
body.light .modal input, body.light .login-box input,
body.light .chatbar input, body.light .feedback-form select,
body.light .feedback-form textarea, body.light .feedback-form input {
  background: #fff; border-color: #a7c3ac; color: #131a15; }
body.light .briefing { background: #e9f4ea; border-color: #a7c3ac; }
body.light .msg.titan { background: #e2f2e4; }
body.light .msg.user { background: rgba(15,118,110,.16); }
body.light .stat, body.light .wpitem { background: #fbfaf4;
  border-color: #c3d4c6; }
body.light .stat .sv, body.light .wpitem .wv { color: #0d1f13; }
body.light .stat .sl, body.light .wpitem .wl { color: #43584a; }
body.light svg.arc { background: #fbfaf4; border-color: #c3d4c6; }
body.light .titan-strip .who { color: #0b6e35; }
body.light .conf { border-bottom-color: #0b6e35; }
body.light .tag { border-color: #0f766e; color: #0f766e; }
body.light .tag.bug { border-color: #d92d20; color: #d92d20; }
body.light .tag.suggestion { border-color: #b54708; color: #b54708; }
body.light .fb-post { border-top-color: rgba(15,118,110,.35); }

/* Phase 2.8.5 (Jim, Nov 19, 2026): the TRADE SUGGESTIONS frame
   must never scroll sideways — at phone or desktop widths. The
   generic table wrapper scrolls horizontally by design (other
   tables keep that); the suggestions frame overrides it: no
   horizontal overflow, no 560px floor forcing one, and cells
   wrap instead of running off the edge. A vertical slider is
   fine and unchanged. */
.suggwrap { overflow-x: hidden; }
.suggwrap table { min-width: 0; }
.suggwrap th, .suggwrap td { white-space: normal; }
.suggwrap td:first-child, .suggwrap th:first-child { min-width: 0; }
@media (max-width: 760px) {
  .suggwrap th, .suggwrap td { padding: 6px 6px; font-size: 0.82rem; }
}

/* Phase 2.8.5 — Titan's Oracle Ball (Jim's idea, IP-clean: NOT
   Mattel's name, NOT a black ball with a white circle-8 — an
   OracleNest green-glass orb with a pale window). The shake is
   a CSS keyframe run; the answer surfaces in the window when
   the house serves one (app.js). */
.oracle-ball { width: 92px; height: 92px; margin: 14px auto 4px;
  border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 34% 30%, #7fe3b0 0%,
    #1f9d63 34%, #0c5c39 68%, #063d26 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,.45),
    inset 0 -10px 18px rgba(0,0,0,.35),
    0 0 22px rgba(46,204,133,.35);
  display: flex; align-items: center; justify-content: center; }
.ob-window { width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #eafff3,
    #b9f2d2 70%, #8fe0b6);
  box-shadow: inset 0 2px 8px rgba(4,60,35,.45);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 6px; }
.ob-window span { font-size: .68rem; font-weight: 700;
  color: #06402a; line-height: 1.25; }
.oracle-ball.shaking { animation: ob-shake .9s ease-in-out; }
@keyframes ob-shake {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  15% { transform: translate(-7px,3px) rotate(-7deg); }
  30% { transform: translate(6px,-4px) rotate(6deg); }
  45% { transform: translate(-6px,-3px) rotate(-5deg); }
  60% { transform: translate(5px,4px) rotate(4deg); }
  75% { transform: translate(-3px,2px) rotate(-2deg); } }
.ob-caption { text-align: center; color: #9fb4a6;
  font-size: .8rem; margin: 2px 0 10px; }
@media (prefers-reduced-motion: reduce) {
  .oracle-ball.shaking { animation-duration: .01s; } }
