:root {
  --bg: #0a0c0f;
  --panel: #11151a;
  --panel-2: #161b22;
  --line: #232a33;
  --text: #e8edf2;
  --muted: #8b96a3;
  --faint: #5c6672;
  --accent: #54c7ec;
  --accent-ink: #062a36;
  --amber: #f5b041;
  --ok: #3ddc97;
  --bad: #ff6b6b;
  --radius: 14px;
  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", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, time { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 12, 15, 0.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 700; letter-spacing: 0.14em; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); box-shadow: 0 0 10px rgba(84, 199, 236, 0.55); }
nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
nav a.on { color: var(--text); background: var(--panel-2); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--amber); color: #1d1300; font-size: 12px; font-weight: 700; text-align: center; margin-left: 4px; }
.busy { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.busy .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

main { max-width: 1120px; margin: 0 auto; padding: 22px 16px 80px; }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel.tight { padding: 14px; }

/* day header */
.dayhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.dayhead .arrows a { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); color: var(--text); margin-left: 6px; }
.dayhead .arrows a:hover { text-decoration: none; background: var(--line); }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 62px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl { display: grid; grid-template-columns: 52px 22px minmax(0, 1fr); gap: 10px; padding: 7px 0; align-items: start; }
.tl time { color: var(--muted); font-size: 13px; padding-top: 3px; text-align: right; }
.tl .icon { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; position: relative; z-index: 1; }
.tl .body { min-width: 0; }
.tl .title { font-weight: 600; }
.tl .meta { color: var(--muted); font-size: 13px; }
.tl.trip .title { font-weight: 500; color: var(--muted); }
.tl.visit .icon { border-color: var(--accent); }
.tl.meeting .icon { border-color: var(--ok); }
.tl.person .icon { border-color: var(--amber); }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }

.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.strip a { flex: none; }
.strip img { height: 64px; width: auto; border-radius: 8px; display: block; border: 1px solid var(--line); }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: rgba(61, 220, 151, 0.35); }
.pill.warn { color: var(--amber); border-color: rgba(245, 176, 65, 0.35); }
.pill.bad { color: var(--bad); border-color: rgba(255, 107, 107, 0.35); }

.face { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.face.big { width: 96px; height: 96px; border-radius: 18px; }
.face.huge { width: 140px; height: 140px; border-radius: 22px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.start { align-items: flex-start; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* forms */
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; font: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(84, 199, 236, 0.15); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
button, .button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
button:hover, .button:hover { border-color: var(--faint); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); background: transparent; border-color: rgba(255, 107, 107, 0.35); }
button.small, .button.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
form.inline { display: flex; gap: 6px; align-items: center; }
form.inline input { padding: 6px 9px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
details > summary { cursor: pointer; color: var(--accent); list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* analysis */
.analysis ul { margin: 0; padding-left: 0; list-style: none; }
.analysis li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.analysis li:first-child { border-top: none; }
.analysis .section { margin-top: 16px; }
.check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--faint); background: transparent; padding: 0; flex: none; margin-top: 2px; cursor: pointer; }
.check.done { background: var(--ok); border-color: var(--ok); }
.done-text { color: var(--faint); text-decoration: line-through; }
.error { background: rgba(255, 107, 107, 0.08); border: 1px solid rgba(255, 107, 107, 0.35); color: #ffb3b3; padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: 13px; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.prompt { background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

/* people & faces */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.person-card { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--text); }
.person-card:hover { border-color: var(--faint); text-decoration: none; }
.newface { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.newface.attention { border-color: rgba(245, 176, 65, 0.4); }

/* meeting */
.seg { display: grid; grid-template-columns: 54px 90px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.seg:first-child { border-top: none; }
.seg .who { font-weight: 600; font-size: 13px; }
.seg .t { color: var(--faint); font-size: 12px; padding-top: 2px; }
.spk-S1 { color: #54c7ec; } .spk-S2 { color: #f5b041; } .spk-S3 { color: #3ddc97; } .spk-S4 { color: #c792ea; } .spk-S5 { color: #ff8a80; }
audio { width: 100%; margin: 6px 0 4px; }

/* search */
mark { background: rgba(84, 199, 236, 0.22); color: var(--text); border-radius: 3px; padding: 0 2px; }
.hit { padding: 12px 0; border-top: 1px solid var(--line); }

/* login */
.login { max-width: 360px; margin: 12vh auto; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9); display: none; place-items: center; z-index: 50; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 10px; }
