:root {
  --bg: #05090f;
  --panel: #0b1420;
  --panel-2: #0f1b2b;
  --line: #16324a;
  --text: #d8ecf7;
  --dim: #7f9bb0;
  --cyan: #5ce1ff;
  --cyan-soft: rgba(92, 225, 255, .14);
  --amber: #ffb347;
  --red: #ff6b6b;
  --green: #5fe3a1;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(92,225,255,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,179,71,.05), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button {
  background: var(--cyan-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; transition: border-color .15s, background .15s;
}
button:hover { border-color: var(--cyan); }
button.ghost { background: transparent; }
button.danger:hover { border-color: var(--red); color: var(--red); }
input[type=search], input[type=password], input[type=text] {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; width: 100%;
  outline: none;
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.dim { color: var(--dim); }
.error { color: var(--red); }
h1, h2, h3 { font-weight: 600; letter-spacing: .02em; margin: 0; }
h2 { font-size: 22px; }
h3 { font-size: 15px; color: var(--cyan); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }

/* arc reactor */
.reactor {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  background: radial-gradient(circle, #e8fbff 0 12%, var(--cyan) 22%, rgba(92,225,255,.25) 45%, transparent 70%);
  box-shadow: 0 0 24px var(--cyan), inset 0 0 12px rgba(255,255,255,.6);
  border: 2px solid rgba(92,225,255,.6); animation: pulse 3.2s ease-in-out infinite;
}
.reactor.small { width: 22px; height: 22px; margin: 0; border-width: 1px; box-shadow: 0 0 10px var(--cyan); }
@keyframes pulse { 50% { box-shadow: 0 0 36px var(--cyan), inset 0 0 16px rgba(255,255,255,.8); } }
@media (prefers-reduced-motion: reduce) { .reactor { animation: none; } }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px; width: min(360px, 100%); text-align: center;
  box-shadow: 0 0 40px rgba(92,225,255,.06);
}
.panel h1 { letter-spacing: .4em; margin-bottom: 4px; }
.panel input { margin: 16px 0 10px; }
.panel button { width: 100%; padding: 10px; }

/* layout */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; background: rgba(5,9,15,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .3em; }
.brand em { font-style: normal; color: var(--dim); letter-spacing: .1em; font-weight: 400; }
.search { flex: 1 1 260px; }
.tabs { display: flex; gap: 6px; }
.tabs button.on { border-color: var(--cyan); color: var(--cyan); }
.status { font-size: 12px; color: var(--dim); display: flex; gap: 10px; align-items: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--dim); }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

main { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 62px); }
.days { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 62px); position: sticky; top: 62px; }
.day-link {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid rgba(22,50,74,.5);
  cursor: pointer; color: inherit; text-decoration: none;
}
.day-link:hover, .day-link.on { background: var(--cyan-soft); }
.day-link img, .day-link .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--panel-2); }
.day-link b { display: block; font-size: 14px; }
.day-link small { color: var(--dim); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.view { padding: 20px 24px 60px; min-width: 0; }

/* day */
.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.entry {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px; max-width: 760px;
}
.entry h2 { margin-bottom: 8px; color: var(--cyan); }
.entry .md p { margin: 0 0 10px; }
.timeline { display: grid; gap: 12px; max-width: 900px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start;
}
.card.meeting { border-color: rgba(255,179,71,.45); }
.card .when { color: var(--cyan); font-variant-numeric: tabular-nums; font-size: 13px; }
.card .kind { display: block; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.card .body p { margin: 2px 0 6px; }
.card .photo { width: 100%; max-width: 420px; border-radius: 8px; display: block; margin-top: 6px; cursor: zoom-in; }
.card .tags { color: var(--dim); font-size: 12px; }
.card .q { color: var(--dim); font-style: italic; }
.card.faded { opacity: .45; }
.card .actions { display: flex; gap: 6px; }
.pending { color: var(--amber); font-size: 13px; }

/* meetings */
.meeting-detail { max-width: 860px; }
.meeting-detail section { margin: 18px 0; }
.meeting-detail ul { margin: 6px 0; padding-left: 20px; }
.action { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.action input { margin-top: 4px; accent-color: var(--cyan); }
.action.done span { text-decoration: line-through; color: var(--dim); }
.owner { color: var(--amber); font-size: 12px; margin-left: 6px; }
.email { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
details summary { cursor: pointer; color: var(--cyan); }
.transcript { white-space: pre-wrap; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim);
  max-height: 60vh; overflow: auto; background: var(--panel); padding: 12px; border-radius: 8px; }
audio { width: 100%; max-width: 520px; margin: 8px 0; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:hover b { color: var(--cyan); }
.hit mark, .hit .snip b { background: none; color: var(--amber); font-weight: 600; }
.empty { text-align: center; padding: 60px 0; color: var(--dim); }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: grid; place-items: center; z-index: 20; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

@media (max-width: 760px) {
  main { grid-template-columns: 1fr; }
  .days { position: static; max-height: none; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .day-link { flex-direction: column; min-width: 92px; border-bottom: 0; text-align: center; padding: 8px; }
  .day-link small { display: none; }
  .view { padding: 16px; }
  .card { grid-template-columns: 1fr; }
  .status { width: 100%; }
}
