:root {
  color-scheme: dark;
  --ink: #eef8f3;
  --muted: #94aaa2;
  --bg: #04100e;
  --panel: rgba(8, 28, 24, .88);
  --panel-2: #0b2520;
  --line: rgba(139, 207, 177, .16);
  --green: #75e6ad;
  --green-2: #20aa74;
  --amber: #ffca72;
  --red: #ff8b82;
  --blue: #89bbff;
  --shadow: 0 20px 60px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background:
  radial-gradient(circle at 78% 8%, rgba(33, 170, 116, .15), transparent 28rem),
  radial-gradient(circle at 10% 72%, rgba(37, 117, 93, .12), transparent 24rem), var(--bg); }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; padding: 36px 28px; border-right: 1px solid var(--line); background: rgba(3, 14, 12, .82); backdrop-filter: blur(18px); }
.holo-core { position: relative; width: 220px; height: 220px; margin: 0 auto 28px; }
.holo-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid transparent; }
.holo-ring-1 { border-top-color: var(--green); border-right-color: rgba(117,230,173,.35); animation: holo-spin 6s linear infinite; }
.holo-ring-2 { inset: 13px; border: 1px dashed rgba(117,230,173,.4); animation: holo-spin-reverse 9s linear infinite; }
@keyframes holo-spin { to { transform: rotate(360deg); } }
@keyframes holo-spin-reverse { to { transform: rotate(-360deg); } }

/* Koro as a real ball of light, not a face - Koro's own words 2026-08-24
   after the old tamoko-face graphic was removed: "no face a ball of light
   that lights up when it talks." Idle is a soft warm breathing glow;
   listening tints blue; thinking pulses faster; speaking flares bright -
   driven by the same real body[data-voice-state] signal set from
   setVoiceState() in app.js, not a decorative idle-only loop. */
.light-orb {
  position: absolute;
  inset: 55px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8e6, var(--amber) 45%, rgba(255, 202, 114, .15) 75%, transparent 100%);
  box-shadow: 0 0 24px 6px rgba(255, 202, 114, .45), 0 0 60px 20px rgba(255, 202, 114, .18);
  animation: light-orb-breathe 3.2s ease-in-out infinite;
}
@keyframes light-orb-breathe { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.03); filter: brightness(1.08); } }
body[data-voice-state="listening"] .light-orb { animation: none; box-shadow: 0 0 26px 8px rgba(137, 187, 255, .5), 0 0 70px 24px rgba(137, 187, 255, .2); }
body[data-voice-state="thinking"] .light-orb { animation: light-orb-pulse 1s ease-in-out infinite; }
@keyframes light-orb-pulse { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.06); filter: brightness(1.15); } }
body[data-voice-state="speaking"] .light-orb { animation: light-orb-talk .35s ease-in-out infinite; }
@keyframes light-orb-talk {
  0%, 100% { transform: scale(1); filter: brightness(1); box-shadow: 0 0 24px 6px rgba(255, 202, 114, .45), 0 0 60px 20px rgba(255, 202, 114, .18); }
  50% { transform: scale(1.12); filter: brightness(1.4); box-shadow: 0 0 40px 14px rgba(255, 202, 114, .75), 0 0 90px 30px rgba(255, 202, 114, .35); }
}

.eyebrow { margin: 0 0 8px; color: var(--green); font-size: .73rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rail h1 { margin: 0; font-size: 2.8rem; letter-spacing: .16em; }
.mission { color: var(--muted); line-height: 1.55; }
nav { margin: 36px 0; display: grid; gap: 8px; }
nav a { padding: 10px 12px; color: #c4d9d1; text-decoration: none; border-radius: 8px; }
nav a:hover, nav a:focus-visible { background: rgba(117,230,173,.09); color: var(--green); outline: none; }
.truth-card { position: absolute; bottom: 30px; left: 28px; right: 28px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13, 44, 37, .58); }
.truth-card strong { color: var(--green); }
.truth-card p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
main { width: min(1460px, 100%); padding: 32px clamp(22px, 4vw, 66px) 48px; }
.topbar, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar { margin-bottom: 26px; }
.topbar h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.5rem); }
.core-badge { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 99px; background: rgba(8, 24, 21, .76); }
.core-badge span { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); }
.core-badge.online span { background: var(--green); box-shadow: 0 0 12px var(--green); }
.core-badge.attention span { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.status-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.status-grid article, .panel, .command-panel, .roadmap-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.status-grid article { min-height: 118px; padding: 18px; display: grid; gap: 7px; }
.status-grid span, .status-grid small { color: var(--muted); }
.status-grid strong { font-size: 1.5rem; }
.command-panel, .roadmap-panel { padding: clamp(20px, 3vw, 34px); margin-bottom: 32px; }
.section-heading { margin-bottom: 18px; }
.section-heading.compact { align-items: flex-start; }
.section-heading h3 { margin: 0; font-size: 1.35rem; }
.section-note { max-width: 420px; color: var(--muted); font-size: .88rem; text-align: right; }
.privacy-pill { display: inline-flex; padding: 7px 10px; border: 1px solid rgba(117,230,173,.25); border-radius: 99px; color: var(--green); background: rgba(117,230,173,.08); font-size: .76rem; font-weight: 750; }
.privacy-pill.amber { color: var(--amber); border-color: rgba(255,202,114,.25); background: rgba(255,202,114,.08); }
.voice-turn-row { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.voice-talk-button {
  padding: 16px 28px; border-radius: 99px; border: 1px solid rgba(117,230,177,.35);
  background: rgba(117,230,173,.10); color: var(--green); font-weight: 800; font-size: 1rem;
  letter-spacing: .02em; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; outline: none;
  transition: background .15s, transform .1s, border-color .15s;
}
.voice-talk-button:active { transform: scale(.97); }
.voice-talk-button[data-state="listening"] { background: var(--green); color: #04100e; border-color: var(--green); box-shadow: 0 0 22px rgba(117,230,173,.45); }
.voice-talk-button[data-state="thinking"] { background: rgba(255,202,114,.16); color: var(--amber); border-color: rgba(255,202,114,.4); }
.voice-talk-button[data-state="speaking"] { background: rgba(137,187,255,.16); color: var(--blue); border-color: rgba(137,187,255,.4); }
.voice-talk-button:disabled { cursor: default; }
.voice-talk-hint { color: var(--muted); font-size: .85rem; }
label { display: block; margin-bottom: 7px; color: #cfe3db; font-size: .86rem; font-weight: 700; }
textarea, input { width: 100%; padding: 13px 14px; color: var(--ink); background: #061714; border: 1px solid rgba(139,207,177,.24); border-radius: 10px; outline: none; resize: vertical; }
textarea:focus, input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(32,170,116,.13); }
.command-row { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: stretch; }
.primary, .secondary { border-radius: 10px; padding: 11px 15px; border: 1px solid transparent; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; }
.primary { color: #032117; background: linear-gradient(135deg, var(--green), #45c98e); }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { color: var(--ink); background: rgba(117,230,173,.07); border-color: var(--line); }
.command-result { margin-top: 16px; padding: 16px; border-left: 3px solid var(--green); border-radius: 8px; background: rgba(117,230,173,.07); white-space: pre-wrap; line-height: 1.55; }
.command-result.error { border-color: var(--red); background: rgba(255,139,130,.08); }
.chat-log-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-log { margin-top: 10px; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.chat-entry { padding: 10px 14px; border-radius: 10px; line-height: 1.5; white-space: pre-wrap; max-width: 100%; align-self: flex-start; }
.chat-entry.chat-you { background: rgba(137,187,255,.12); border: 1px solid rgba(137,187,255,.3); }
.chat-entry.chat-koro { background: rgba(117,230,173,.08); border: 1px solid rgba(117,230,173,.25); }
.chat-entry .chat-label { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; opacity: .7; }
.chat-entry.chat-you .chat-label { color: var(--blue); }
.chat-entry.chat-koro .chat-label { color: var(--green); }
.source-list { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: .83rem; }
.function-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 32px; }
.function-card {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head button" "desc desc" "meta meta";
  align-items: center; gap: 6px 18px;
  padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(90deg, rgba(12,43,36,.92), rgba(6,23,20,.92));
  transition: border-color .2s, box-shadow .2s;
}
.function-card:hover { border-color: rgba(117,230,173,.4); box-shadow: 0 0 18px rgba(117,230,173,.08); }
.function-head { grid-area: head; display: flex; align-items: center; gap: 10px; }
.function-card h4 { margin: 0; font-size: 1.02rem; white-space: nowrap; }
.function-card p { grid-area: desc; min-height: 0; margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.function-card button { grid-area: button; width: auto; margin-top: 0; white-space: nowrap; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: .68rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; background: rgba(148,170,162,.12); color: #c7d5d0; white-space: nowrap; }
.status.working { color: var(--green); background: rgba(117,230,173,.11); }
.status.failed, .status.interrupted { color: var(--red); background: rgba(255,139,130,.1); }
.status.approval-required { color: var(--amber); background: rgba(255,202,114,.1); }
.status.completed { color: var(--blue); background: rgba(137,187,255,.1); }
.function-meta { min-height: 44px; color: #b7ccc4; font-size: .78rem; line-height: 1.45; }
.function-card button { width: 100%; margin-top: 12px; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.panel { min-height: 300px; padding: 22px; overflow: hidden; }
.task-list { display: grid; gap: 8px; max-height: 480px; overflow-y: auto; }
.task-row { width: 100%; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 11px; text-align: left; color: inherit; border: 1px solid transparent; border-radius: 9px; background: rgba(255,255,255,.025); }
.task-row:hover, .task-row.selected { border-color: var(--line); background: rgba(117,230,173,.06); }
.task-row b { color: var(--green); }
.task-row strong { display: block; font-size: .86rem; }
.task-row small { color: var(--muted); }
.task-detail h4 { margin-bottom: 7px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.detail-meta span { padding: 5px 7px; border-radius: 6px; background: rgba(255,255,255,.04); color: var(--muted); font-size: .73rem; }
.timeline { margin: 14px 0; padding: 0; list-style: none; display: grid; gap: 9px; max-height: 220px; overflow: auto; }
.timeline li { padding-left: 13px; border-left: 2px solid var(--line); font-size: .8rem; color: #c7d8d2; }
.timeline time { display: block; color: var(--muted); font-size: .68rem; }
.artifact-link { display: inline-flex; margin: 5px 5px 0 0; color: var(--green); }
.empty { color: var(--muted); font-size: .86rem; }
.approval { padding: 13px; border: 1px solid rgba(255,202,114,.18); border-radius: 10px; background: rgba(255,202,114,.05); }
.approval p { color: var(--muted); font-size: .82rem; }
.approval-actions { display: flex; gap: 8px; }
.skill-list { display: grid; gap: 8px; }
.skill { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.skill strong { font-size: .87rem; }
.skill span { color: var(--muted); font-size: .75rem; }
.roadmap { margin: 20px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 9px; overflow-x: auto; }
.roadmap li { min-height: 168px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.roadmap li.current { border-color: rgba(117,230,173,.42); background: rgba(117,230,173,.07); }
.roadmap b { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 28px; border-radius: 50%; background: rgba(117,230,173,.1); color: var(--green); }
.roadmap strong { display: block; font-size: .85rem; }
.roadmap span { display: block; margin-top: 8px; color: var(--muted); font-size: .74rem; line-height: 1.45; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 12px 2px; color: var(--muted); font-size: .78rem; }
dialog { width: min(560px, calc(100% - 28px)); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; background: #08201b; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
dialog form { position: relative; padding: 10px; }
dialog h3 { margin: 0 0 8px; }
dialog p:not(.eyebrow) { color: var(--muted); }
.dialog-close { position: absolute; right: 0; top: -4px; color: var(--muted); background: transparent; border: 0; font-size: 1.8rem; }
#dialogFields { display: grid; gap: 12px; margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: relative; height: auto; padding: 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail nav { display: flex; flex-wrap: wrap; margin: 18px 0 0; }
  .truth-card { display: none; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .function-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  main { padding: 24px 14px 40px; }
  .topbar, .section-heading { align-items: flex-start; flex-direction: column; }
  .status-grid, .function-grid, .split-grid { grid-template-columns: 1fr; }
  .command-row { grid-template-columns: 1fr; }
  .holo-core { width: 140px; height: 140px; }
  .command-row button { min-height: 50px; }
  .section-note { text-align: left; }
  footer { flex-direction: column; }
}
