/* Memriva owner viewer. Tokens copied from the public site (a9fab276); local system fonts only. */
:root {
  color-scheme: dark;
  --night: #0f1726;
  --night-2: #131d30;
  --night-3: #1a263d;
  --night-4: #23324d;
  --line-n: rgba(166, 186, 220, .16);
  --line-n2: rgba(166, 186, 220, .28);
  --on-n: #e9eef7;
  --muted-n: #a8b4c8;
  --faint-n: #8d9ab0;
  --link-n: #a9c8ff;
  --focus: #6db9ff;
  --t-project: #f3b94d;
  --t-person: #5fd6a9;
  --t-organization: #f29cc6;
  --t-meeting: #6db9ff;
  --t-commitment: #ff8e6f;
  --t-decision: #baa4ff;
  --t-daily: #dfe4ec;
  --t-source: #8e9bb2;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "SF Pro Display", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  font: 400 16px/1.55 var(--sans);
  background: var(--night);
  color: var(--on-n);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
html, body { height: 100% }
body {
  margin: 0; min-width: 0; overflow-x: clip;
  background: radial-gradient(1100px 600px at 78% 0%, rgba(109, 185, 255, .08), transparent 60%), radial-gradient(900px 600px at 0% 100%, rgba(186, 164, 255, .06), transparent 60%), var(--night);
  display: flex; flex-direction: column;
}
h1, h2, h3, h4, p, ol, ul { margin-top: 0 }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; letter-spacing: -.02em; font-weight: 640 }
p, li { text-wrap: pretty }
a { color: var(--link-n); text-decoration-thickness: 1px; text-underline-offset: 3px }
button, input { font: inherit; color: inherit }
button { cursor: pointer; touch-action: manipulation }
button:disabled { cursor: not-allowed; opacity: .55 }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.skip { position: absolute; left: 16px; top: -100px; background: #fff; color: var(--night); padding: 10px 14px; border-radius: 8px; z-index: 100 }
.skip:focus { top: 12px }
.muted { color: var(--muted-n) }
.fine { font-size: 14px; color: var(--muted-n); margin: 6px 0 12px }

/* Header */
.vh { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 10px 20px; min-height: 60px; border-bottom: 1px solid var(--line-n); background: rgba(15, 23, 38, .9) }
.vh-brand { display: flex; align-items: center; gap: 10px; min-width: 0 }
.vh-brand img { flex: none; display: block }
.vh-name { font-family: var(--display); font-weight: 680; font-size: 20px; letter-spacing: -.02em }
.vh-tag { font-size: 13px; color: var(--muted-n); border: 1px solid var(--line-n2); border-radius: 999px; padding: 3px 9px; white-space: nowrap }
.vh-session { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end }
.vh-owner { font-size: 14px; color: var(--muted-n); margin-right: 6px; overflow-wrap: anywhere }
.vh-btn { min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-n2); background: transparent; font-size: 14px; font-weight: 600; transition: background-color .15s, border-color .15s }
.vh-btn:hover { background: var(--night-3) }
.vh-btn[aria-expanded="true"] { background: #e9eef7; color: var(--night) }
.vh-quiet { border-color: transparent; color: var(--muted-n) }
.vh-quiet.is-armed { border-color: #ff8e6f; color: #ffc2b1 }

main { flex: 1; min-height: 0; display: flex; flex-direction: column }
main:focus { outline: none }
.center-view { flex: 1; display: grid; place-items: center; padding: 32px 16px }

/* Sign in */
.auth-card { width: min(100%, 460px); background: var(--night-2); border: 1px solid var(--line-n); border-radius: 18px; padding: 32px 28px; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8) }
.auth-card h1 { font-size: 28px; line-height: 1.15; margin-bottom: 10px }
.auth-lead { color: #cdd6e4; margin-bottom: 18px }
.auth-status { min-height: 1.5em; font-size: 15px; color: #f8d48d; margin-bottom: 12px }
.auth-status.is-ok { color: #9ae7c8 }
.auth-status:empty { min-height: 0; margin: 0 }
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 16px; transition: background-color .15s, transform .12s var(--ease-out) }
.btn-primary { background: #f2f5fb; color: var(--night); border: 0 }
.btn-primary:hover { background: #fff }
.btn-secondary { background: transparent; border: 1px solid var(--line-n2); color: var(--on-n); margin-top: 6px }
.btn-primary:active, .btn-secondary:active { transform: scale(.98) }
.enroll { margin-top: 22px; border-top: 1px solid var(--line-n); padding-top: 14px }
.enroll summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center }
.field-label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 6px }
.field { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-n2); background: var(--night); color: var(--on-n); font-size: 16px }
.field::placeholder { color: var(--faint-n) }
.field:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent }
#enroll-code { font-family: var(--mono); font-size: 14px }

/* App */
#view-app { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px 16px; gap: 12px }
.overview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; color: var(--muted-n) }
.ov-item { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow-wrap: anywhere }
.ov-item strong { color: var(--on-n); font-weight: 650; font-variant-numeric: tabular-nums }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--t-person); flex: none }
.ov-dot.is-warn { background: #f3b94d }
.ov-dot.is-off { background: #8d9ab0 }
.workspace { position: relative; flex: 1; min-height: 520px; display: grid; grid-template-columns: 292px minmax(0, 1fr) 400px; background: var(--night-2); border: 1px solid var(--line-n); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8) }
.ws-side { border-right: 1px solid var(--line-n); display: flex; flex-direction: column; min-height: 0 }
.side-top { padding: 16px 16px 12px }
.side-top .field-label { margin-top: 0 }
.folders { display: flex; flex-wrap: wrap; gap: 6px }
.folder { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-n2); background: transparent; font-size: 13px; transition: opacity .15s, background-color .15s }
.folder .count { color: var(--faint-n); font-variant-numeric: tabular-nums }
.folder[aria-pressed="false"] { opacity: .55; border-style: dashed }
.folder[aria-pressed="false"] .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c) }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c, var(--t-source)) }
.t-project { --c: var(--t-project) } .t-person { --c: var(--t-person) } .t-organization { --c: var(--t-organization) } .t-meeting { --c: var(--t-meeting) }
.t-commitment { --c: var(--t-commitment) } .t-decision { --c: var(--t-decision) } .t-daily { --c: var(--t-daily) } .t-source { --c: var(--t-source) }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 16px 6px; border-top: 1px solid var(--line-n) }
.list-head h2 { font-size: 14px; margin: 0; letter-spacing: 0; font-family: var(--sans); font-weight: 600 }
.list-head p { margin: 0; font-size: 13px; color: var(--faint-n); font-variant-numeric: tabular-nums }
.note-list { overflow: auto; padding: 0 8px 8px; min-height: 0; flex: 1; overscroll-behavior: contain; scrollbar-width: thin }
.note-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 8px; min-height: 44px; border-radius: 8px; font-size: 14px }
.note-row:hover { background: rgba(166, 186, 220, .07) }
.note-row[aria-current="true"] { background: rgba(109, 185, 255, .16) }
.note-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.note-kind { font-size: 12px; color: var(--faint-n); white-space: nowrap }
.empty { color: var(--muted-n); font-size: 14px; padding: 10px 8px; margin: 0 }
.list-more { margin: 4px 16px 14px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-n2); background: none; font-weight: 600 }

/* Graph */
.ws-graph { position: relative; min-width: 0; min-height: 0; background: radial-gradient(70% 60% at 50% 45%, #18243a 0%, #111a2b 70%, #0f1726 100%) }
.graph-stage { position: absolute; inset: 0; overflow: hidden }
.graph-stage:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px }
#graph { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab }
#graph.over-node { cursor: pointer }
.is-dragging #graph { cursor: grabbing }
.edge { stroke: rgba(170, 188, 220, .3); stroke-width: .9px; fill: none; transition: opacity .14s ease }
.edge.suggested { stroke-dasharray: 3 3 }
.node { fill: var(--c); stroke: #0f1726; stroke-width: 1.2px; transition: opacity .14s ease }
.node.is-stale { fill: transparent; stroke: var(--c); stroke-width: 1.4px }
.label { fill: #dce3ee; font-family: var(--sans); font-weight: 500; paint-order: stroke; stroke: rgba(15, 23, 38, .92); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none }
.halo { fill: var(--c); opacity: .22; pointer-events: none }
.has-focus .node { opacity: .16 }
.has-focus .node.is-near { opacity: 1 }
.has-focus .edge { opacity: .12 }
.has-focus .edge.is-near { opacity: 1; stroke: #dce3ee; stroke-width: 1.4px }
.node.is-focus, .node.is-selected { stroke: #fff; stroke-width: 2px }
.is-filtered .node.is-out, .is-filtered .label.is-out { opacity: .08 }
.is-filtered .edge.is-out { opacity: .04 }
.graph-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 32px; text-align: center; color: var(--muted-n); max-width: 52ch; margin-inline: auto }
.graph-caption { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 24px); margin: 0; font-size: 13px; color: var(--muted-n); background: rgba(15, 23, 38, .72); border: 1px solid var(--line-n); padding: 6px 10px; border-radius: 10px; pointer-events: none }
.graph-caption:empty { display: none }
.graph-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; border: 1px solid var(--line-n2); border-radius: 12px; overflow: hidden; background: rgba(15, 23, 38, .82) }
.graph-zoom button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; line-height: 1 }
.graph-zoom button + button { border-top: 1px solid var(--line-n) }
.graph-zoom .fit-btn { font-size: 12px; font-weight: 600 }
.graph-toggle { display: none }

/* Note panel */
.ws-note { border-left: 1px solid var(--line-n); display: flex; flex-direction: column; min-height: 0; background: var(--night-2) }
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line-n); min-height: 56px }
.panel-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted-n); font-family: var(--sans); letter-spacing: 0 }
.panel-close { min-height: 40px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-n2); background: none; font-size: 14px }
.note-body, .activity-body { padding: 18px 18px 28px; overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; scrollbar-width: thin }
.n-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-n); margin-bottom: 8px }
.n-title { font-size: 23px; line-height: 1.22; margin-bottom: 10px; overflow-wrap: anywhere }
.n-title:focus { outline: none }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; background: var(--night-4); color: var(--on-n); white-space: nowrap }
.chip.is-owner { background: rgba(95, 214, 169, .15); color: #9ae7c8 }
.chip.is-agent { background: rgba(109, 185, 255, .14); color: #b9dcff }
.chip.is-stale { background: rgba(243, 185, 77, .16); color: #f8d48d }
.n-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13px; color: var(--muted-n); margin: 0 0 14px }
.n-meta dt { color: var(--faint-n) }
.n-meta dd { margin: 0; color: #ccd5e3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.n-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px }
.n-link { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-n2); color: var(--on-n); text-decoration: none; font-size: 14px; font-weight: 600; background: none }
.vault-setup { margin: 0 0 16px; font-size: 14px }
.vault-setup summary { cursor: pointer; color: var(--link-n); min-height: 40px; display: inline-flex; align-items: center }
.vault-form { display: grid; gap: 6px; margin-top: 6px; padding: 12px; border-radius: 12px; background: var(--night-3) }
.props-wrap { margin: 0 0 14px; font-size: 13px; color: var(--muted-n) }
.props-wrap summary { cursor: pointer; min-height: 36px; display: inline-flex; align-items: center }
.vault-form .field { min-height: 40px }
.page { font-size: 15px; line-height: 1.6; color: #dbe2ee; overflow-wrap: anywhere }
.page p { margin: 0 0 10px; white-space: pre-wrap }
.page .h { font-family: var(--display); font-weight: 640; color: var(--on-n); margin: 16px 0 6px; letter-spacing: -.01em }
.page .h1 { font-size: 20px } .page .h2 { font-size: 18px } .page .h3 { font-size: 16px }
.page ul { padding-left: 20px; margin: 0 0 10px }
.page .props { font-family: var(--mono); font-size: 12px; color: var(--muted-n); background: var(--night-3); border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere }
.wikilink { border: 0; background: none; padding: 0; color: var(--link-n); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer }
.wikilink-dead { color: var(--muted-n) }
.note-body h3 { font-size: 13px; font-weight: 600; color: var(--muted-n); margin: 22px 0 8px; letter-spacing: .01em; font-family: var(--sans) }
.history, .evidence, .backlinks, .events { list-style: none; padding: 0; margin: 0 }
.history li { display: grid; gap: 2px; padding: 7px 0 7px 14px; border-left: 2px solid var(--line-n2); font-size: 14px; overflow-wrap: anywhere }
.history li.is-current { border-color: var(--t-person) }
.when { font-size: 12px; color: var(--faint-n); font-variant-numeric: tabular-nums }
.evidence li { padding: 10px 12px; border-radius: 10px; background: var(--night-3); margin-bottom: 8px; font-size: 14px; overflow-wrap: anywhere }
.evidence .ev-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--faint-n); margin: 0 0 4px }
.evidence .ev-text { margin: 0; color: #ccd5e3; white-space: pre-wrap }
.backlinks li + li { margin-top: 2px }
.events li { padding: 10px 0; border-bottom: 1px solid var(--line-n); font-size: 14px; overflow-wrap: anywhere }
.events .ev-line { margin: 0 }
.events .ev-note { margin: 2px 0 0; font-size: 12px; color: var(--faint-n) }
.activity { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 5; border-left: 1px solid var(--line-n2); background: var(--night-2); display: flex; flex-direction: column; box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .7) }
@starting-style { .activity { transform: translateX(16px); opacity: 0 } }
.activity { transition: transform .22s var(--ease-drawer), opacity .22s }

/* Narrow layouts: list first, graph on request, note as a sheet */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 260px minmax(0, 1fr) 340px }
}
@media (max-width: 900px) {
  #view-app { padding: 10px 10px 14px }
  .vh { padding: 8px 12px }
  .vh-tag { display: none }
  .workspace { display: flex; flex-direction: column; min-height: 0; border-radius: 14px; overflow: visible }
  .ws-side { border-right: 0 }
  .note-list { overflow: visible; flex: none }
  .ws-side { flex: none }
  .ws-graph { display: none; flex: none; height: min(62svh, 520px); border-bottom: 1px solid var(--line-n); order: -1; border-radius: 14px 14px 0 0; overflow: hidden }
  .ov-checked { display: none }
  .workspace.show-graph .ws-graph { display: block }
  .graph-toggle { display: inline-flex; align-self: flex-start; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-n2); background: none; font-weight: 600 }
  #graph { touch-action: pan-y }
  .ws-note { position: fixed; inset: 0; z-index: 20; border: 0; display: none }
  .ws-note.is-open { display: flex }
  @starting-style { .ws-note.is-open { transform: translateY(24px); opacity: 0 } }
  .ws-note { transition: transform .26s var(--ease-drawer), opacity .2s }
  .activity { position: fixed; inset: 0; width: auto; z-index: 21 }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important }
}
