/* plv-vault: the soft look of the task tracker — grey ground, white rounded cards, Rubik,
   a mint highlighter for the one thing that matters on a screen. */
/* Fonts are ours to serve (src/ui/fonts, SIL Open Font License): opening the password manager tells no third party.
   Variable fonts, one file per script; the browser fetches only the scripts a page uses. */
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/rubik-cyrillic.woff2?v=bdb2b33ab9") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/rubik-latin.woff2?v=691cd1d9b4") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-cyrillic.woff2?v=d274604c40") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin.woff2?v=18be452724") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f2f2f7;
  --sheet: #ffffff;
  --sheet-2: #f7f7fb;
  --ink: #1d1b2e;
  --ink-2: #45435a;
  --muted: #6c6a80;
  --rule: #ebeaf2;
  --rule-strong: #d6d4e3;
  --marker: #c9f0de;      /* mint highlighter: our accent, distinct from the tracker's peach */
  --marker-soft: #eefaf4;
  --marker-ink: #0b5a40;
  --ok: #0e7490;          /* success leans teal so it does not blend with the mint accent */
  --ok-soft: #dcf1f6;
  --ok-ink: #0b5566;
  --warn: #a8670a;
  --warn-soft: #fbf0dc;   /* needs attention: amber, so it reads apart from the mint accent and the teal "in order" */
  --danger: #c62f35;
  --link: #4b3fd1;
  --blue-soft: #e3f0fc;
  --blue-ink: #1f5f99;
  --scrim: rgba(29, 27, 46, 0.32);
  --shadow: 0 1px 2px rgba(29, 27, 46, 0.06), 0 12px 32px -18px rgba(29, 27, 46, 0.25);
  --shadow-lift: 0 1px 2px rgba(29, 27, 46, 0.08), 0 18px 40px -18px rgba(29, 27, 46, 0.35);
  --shadow-pop: 0 30px 80px -20px rgba(29, 27, 46, 0.5);
  --f-body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 3vw, 32px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.hl {
  background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 94%, transparent 94%);
  padding: 0 3px;
}

/* ---------- buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 22px;
  background: var(--ink); color: #fff; font-weight: 500; white-space: nowrap;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.lg { height: 50px; border-radius: 25px; width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sheet-2); }
.btn.line { background: var(--sheet); color: var(--ink); border: 1px solid var(--rule-strong); }
.btn.line:hover { border-color: var(--muted); }
.btn.peach { background: var(--marker); color: var(--marker-ink); }
.btn.danger { background: var(--danger); }
.btn.dline { background: var(--sheet); color: var(--danger); border: 1px solid #f0c9cb; }

.icon {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border: 0; border-radius: 18px;
  background: transparent; color: var(--ink-2);
}
.icon:hover { background: var(--paper); color: var(--ink); }
.icon.on { background: var(--marker); color: var(--marker-ink); }
.icon.filled { background: var(--paper); }
.icon svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-2); }
.input {
  height: 46px; padding: 0 16px; width: 100%;
  border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--sheet);
  outline: 0; transition: border-color .12s;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
textarea.input { height: auto; min-height: 88px; padding: 12px 16px; resize: vertical; line-height: 1.45; }
.input.mono { font-family: var(--f-mono); font-size: 14px; }
select.input { appearance: none; background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2345435a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--rule-strong); border-radius: 18px; background: var(--sheet);
  color: var(--ink-2); font-size: 14px;
}
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 10px;
  background: var(--paper); color: var(--ink-2); white-space: nowrap;
}
.chip.tag { background: var(--blue-soft); color: var(--blue-ink); }
.chip.peach { background: var(--marker); color: var(--marker-ink); }
.chip button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; line-height: 1; }

.note {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px;
  background: var(--sheet-2); color: var(--ink-2); font-size: 14px;
}
.note.peach { background: var(--marker-soft); color: var(--marker-ink); }
.note.ok { background: var(--ok-soft); color: var(--ok-ink); }
.note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.note b { color: inherit; font-weight: 600; }

.ava {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); color: var(--ink-2);
  font: 600 12px/1 var(--f-body); text-transform: uppercase;
}
.ava.lg { width: 44px; height: 44px; font-size: 15px; }
.tile {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  font: 600 15px/1 var(--f-body); color: var(--ink);
}
.tile { position: relative; overflow: hidden; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.tile img.small { object-fit: contain; padding: 22%; box-shadow: inset 0 0 0 1px var(--rule); border-radius: inherit; }
.tile.lg { width: 52px; height: 52px; border-radius: 16px; font-size: 20px; }
.tile.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.tile.sm.mark { width: 28px; height: 28px; font-size: 10.5px; font-weight: 600; letter-spacing: -0.01em; } /* a vault's two letters */

/* ---------- centered screens: sign-in, setup, unlock ---------- */
.center {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 48px var(--gutter);
}
.card {
  width: min(440px, 100%); background: var(--sheet); border-radius: 22px; padding: 32px;
  box-shadow: var(--shadow-lift); display: flex; flex-direction: column; gap: 18px;
}
.card.wide { width: min(560px, 100%); }
.card h1 { margin: 0; font: 600 24px/1.2 var(--f-body); }
.card p { margin: 0; }
.logo { font: 700 22px/1 var(--f-body); letter-spacing: -0.02em; color: var(--ink); }
.logo.big { font-size: 44px; letter-spacing: -0.03em; }
.split {
  min-height: 100vh; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 48px 96px; padding: 48px var(--gutter);
}
.pitch { width: min(440px, 100%); display: flex; flex-direction: column; gap: 20px; }
.pitch p { margin: 0; font-size: 20px; line-height: 1.4; color: var(--ink-2); }
.pitch ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); }
.pitch li { display: flex; gap: 12px; align-items: center; }
.pitch li span { width: 32px; height: 32px; border-radius: 10px; background: var(--sheet); display: grid; place-items: center; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.err { color: var(--danger); font-size: 14px; }
.meter { display: flex; gap: 4px; }
.meter i { flex: 1; height: 4px; border-radius: 2px; background: var(--rule); }
.steps { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; flex-wrap: wrap; justify-content: center; }
.steps .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); font-size: 13px; }
.steps .dot.done { background: var(--ink); color: #fff; }
.steps .dot.now { background: var(--marker); color: var(--marker-ink); font-weight: 600; }
.steps .bar { width: 32px; height: 2px; background: var(--rule-strong); }

/* ---------- app shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.top .brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); text-decoration: none !important; }
.top .brand b { font: 700 19px/1 var(--f-body); letter-spacing: -0.015em; }
.top .brand span { font-size: 12px; color: var(--muted); }
.search {
  flex: 1 1 320px; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
  background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow);
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.search kbd { font: 500 12px/1 var(--f-mono); color: var(--muted); padding: 4px 7px; border-radius: 6px; background: var(--paper); }
.me { position: relative; }
/* something waits on the admin pages */
.me.attn::after { content: ""; position: absolute; top: 0; right: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); border: 2px solid var(--paper); pointer-events: none; }
.me > button { width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--marker); color: var(--marker-ink); font: 600 14px/1 var(--f-body); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px;
  background: var(--sheet); border-radius: 18px; box-shadow: var(--shadow-lift); border: 1px solid var(--rule);
  padding: 6px; display: flex; flex-direction: column;
}
.menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.menu .who b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; }
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 12px;
  background: transparent; text-align: left; color: var(--ink); font-size: 14px; text-decoration: none !important;
}
.menu button:hover, .menu a:hover { background: var(--sheet-2); }
.menu .danger { color: var(--danger); }

/* Columns depend only on the window width, never on whether a record is open, so the list does not jump.
   Wide: sidebar | list | record. Medium: the same three, tighter. Narrow: the sidebar slides in from a button
   in the header that names where you are. Phone: one column, the record replaces the list.
   The sidebar is never a rail of initials: a dozen vaults cannot be told apart by one letter. */
.layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 12px var(--gutter) 32px; align-items: start;
  transition: grid-template-columns .28s cubic-bezier(.2, .7, .2, 1); animation: fade .25s ease;
}
.layout.has-detail { grid-template-columns: 240px minmax(0, 1fr) minmax(380px, 460px); }
.menubtn, .veil { display: none; }
@media (max-width: 1299px) {
  .layout { grid-template-columns: 216px minmax(0, 1fr); gap: 20px; }
  /* the record gives up width in step with the window, so the list keeps room for a title and a login */
  .layout.has-detail { grid-template-columns: 216px minmax(0, 1fr) clamp(320px, 34vw, 380px); }
}
@media (max-width: 1199px) { .has-detail .row .when, .has-detail .row .chips { display: none; } }
@media (max-width: 999px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout.has-detail { grid-template-columns: minmax(0, 1fr) clamp(320px, 40vw, 400px); }
  .top .brand { display: none; }
  .menubtn {
    display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; max-width: 42vw; height: 44px; padding: 0 16px 0 12px;
    border: 0; border-radius: 22px; background: var(--sheet); box-shadow: var(--shadow); color: var(--ink); font: 500 15px/1 var(--f-body);
  }
  .menubtn .where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side {
    position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); padding: 20px 14px 24px; overflow-y: auto;
    background: var(--paper); box-shadow: var(--shadow-lift);
    transform: translateX(-104%); visibility: hidden; /* hidden, so Tab does not wander into a closed menu */
    transition: transform .25s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .25s;
  }
  .layout.menu-open .side { transform: none; visibility: visible; transition-delay: 0s; }
  .veil { display: block; position: fixed; inset: 0; z-index: 39; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .layout.menu-open ~ .veil { opacity: 1; pointer-events: auto; }
  .search { flex-basis: 180px; }
}
/* the header stays one line as long as it can: first "Добавить" becomes a plus, then the search takes its own row */
@media (max-width: 719px) {
  .top > .btn { width: 44px; padding: 0; justify-content: center; }
  .top > .btn .t, .search kbd { display: none; }
}
@media (max-width: 519px) {
  .menubtn { flex: 1 1 0; max-width: none; justify-content: flex-start; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
}
@media (max-width: 899px) {
  .layout.has-detail { grid-template-columns: minmax(0, 1fr); }
  .layout.has-detail:not(.open) .detail { display: none; }
  .layout.open .main { display: none; }
  .layout.has-detail .detail { position: static; height: auto; }
}
.side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.side h6 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 4px 14px 8px; }
.side h6 + * { margin-top: 0; }
.side .gap { height: 14px; }
.nav {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 14px;
  color: var(--ink-2); text-decoration: none !important; border: 0; background: transparent; text-align: left; width: 100%;
}
.nav:hover { background: color-mix(in srgb, var(--sheet) 60%, transparent); color: var(--ink); }
.nav[aria-current="page"] { background: var(--sheet); color: var(--ink); font-weight: 500; box-shadow: var(--shadow); }
/* a long vault name takes a second line rather than losing its end: "PLAYVISION LIMI…" says too little */
.nav .lbl { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; overflow-wrap: anywhere; }
.nav .n { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }
.nav .n.attn { background: var(--marker); color: var(--marker-ink); border-radius: 10px; padding: 1px 8px; font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav.add { border: 1px dashed var(--rule-strong); color: var(--muted); margin-top: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 4px 4px 2px; }
.head h1 { margin: 2px 0 0; font: 700 30px/1.15 var(--f-body); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.head .sub { font-size: 13px; color: var(--muted); }
.head .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags .pill { height: 32px; font-size: 13px; padding: 0 12px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px;
  border: 0; border-radius: 18px; text-align: left; background: var(--sheet); box-shadow: 0 1px 2px rgba(29,27,46,0.06);
  transition: box-shadow .15s, transform .15s, outline-color .15s;
}
.row:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.row:active { transform: scale(.995); }
.list.enter .row { animation: rise .28s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 22ms); }
.row[aria-current="true"] { outline: 2px solid var(--ink); outline-offset: -2px; }
.row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .when { font-size: 13px; color: var(--muted); width: 96px; text-align: right; flex: none; }
.row .chips { display: flex; gap: 4px; flex: none; }
@media (max-width: 640px) { .row .when, .row .chips { display: none; } }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); background: var(--sheet); border-radius: 22px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty b { color: var(--ink); font-size: 18px; font-weight: 600; }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--marker-soft); color: var(--marker-ink); }
.banner span { flex: 1 1 300px; }

/* ---------- item panel ---------- */
.detail {
  min-width: 0; background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow);
  padding: 28px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 80px;
  height: calc(100vh - 100px); overflow: auto;
}
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--muted); }
.placeholder b { color: var(--ink); font-size: 17px; font-weight: 600; }
.placeholder kbd { font: 500 12px/1 var(--f-mono); padding: 3px 6px; border-radius: 6px; background: var(--sheet); border: 1px solid var(--rule); }
.refs { display: flex; flex-direction: column; gap: 6px; }
.refchip {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px; margin-top: 2px;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--sheet); text-align: left; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.refchip:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); }
.refchip:hover > :last-child { transform: translateX(2px); }
.refchip > :last-child { color: var(--muted); transition: transform .15s; }
.refchip .tile { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
.refchip .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.refchip .rt b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refchip .rt span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail > * { flex-shrink: 0; }
.detail .hd a.small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail .hd { display: flex; align-items: flex-start; gap: 16px; }
.detail .hd > div { flex: 1; min-width: 0; }
.detail h2 { margin: 2px 0 4px; font: 600 22px/1.25 var(--f-body); overflow-wrap: break-word; }
/* In a narrow panel the title gets a line of its own under the tile and the buttons, instead of breaking mid-word. */
.detail { container-type: inline-size; }
@container (max-width: 379px) {
  .detail .hd { flex-wrap: wrap; row-gap: 14px; }
  .detail .hd > .tile { margin-right: auto; }
  .detail .hd > div { order: 5; flex: 1 0 100%; }
}
.fields { display: flex; flex-direction: column; border-radius: 16px; background: var(--sheet-2); overflow: hidden; }
.fv { display: flex; align-items: center; gap: 6px; padding: 14px 12px 14px 18px; border-bottom: 1px solid var(--rule); }
.fv:last-child { border-bottom: 0; }
.fv .k { flex: 1; min-width: 0; }
.fv .l { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.fv .v { font: 500 14px/1.45 var(--f-mono); overflow-wrap: anywhere; white-space: pre-wrap; }
.fv .v.plain { font-family: var(--f-body); font-weight: 400; }
.fv .v.dots { letter-spacing: 0.12em; }
.fv .v.code { font-size: 20px; letter-spacing: 0.08em; }
.fv .timer { font-size: 13px; color: var(--muted); width: 44px; text-align: right; }
.fv .timer.low { color: var(--danger); }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec > .l { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.meta { padding-top: 14px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.stack { display: flex; }
.stack .ava { border: 2px solid var(--sheet); margin-left: -8px; }
.stack .ava:first-child { margin-left: 0; }
.acts-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- dialogs and drawers ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade .15s ease;
}
.dialog {
  width: min(600px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow-pop);
  padding: 28px; display: flex; flex-direction: column; gap: 20px;
  animation: pop .18s ease;
}
.dialog.sm { width: min(440px, 100%); }
.scrim.drawer { justify-content: flex-end; align-items: stretch; }
.scrim.drawer .dialog { width: min(620px, 100%); max-height: none; padding: 0; gap: 0; animation: slide .2s ease; }
.dialog .dh { display: flex; align-items: flex-start; gap: 12px; }
.dialog .dh > div { flex: 1; min-width: 0; }
.dialog .dh .sub { font-size: 13px; color: var(--muted); }
.dialog h2 { margin: 2px 0 0; font: 600 22px/1.25 var(--f-body); overflow-wrap: anywhere; }
.drawer .dh { padding: 22px 28px 14px; }
.drawer .db { flex: 1; overflow: auto; padding: 4px 28px 20px; display: flex; flex-direction: column; gap: 16px; }
.drawer .df { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 28px 22px; border-top: 1px solid var(--rule); }
.drawer .df .grow { flex: 1; font-size: 13px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slideOut { to { transform: translateX(40px); opacity: 0; } }
@keyframes check { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
.scrim.out { animation: fadeOut .18s ease forwards; pointer-events: none; }
.scrim.out .dialog { animation: popOut .18s ease forwards; }
.scrim.drawer.out .dialog { animation: slideOut .18s ease forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* editor */
.ef { display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px 10px 10px; border-radius: 16px; background: var(--sheet-2); }
.ef .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ef .lab { display: flex; align-items: center; gap: 8px; }
.ef .lab input { border: 0; background: transparent; outline: 0; font-size: 13px; color: var(--ink-2); padding: 2px 0; flex: 1; min-width: 0; }
.ef .lab input:focus { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); }
.ef .kind { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--rule); color: var(--ink-2); }
.ef .val { display: flex; gap: 6px; align-items: center; }
.ef .val .input { height: 42px; border-radius: 12px; }
.ef .order { display: flex; flex-direction: column; }
.ef .order .icon { width: 28px; height: 22px; border-radius: 6px; }
.ef .order .icon svg { width: 14px; height: 14px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; padding: 8px; border-radius: 18px; border: 1px solid var(--rule); box-shadow: var(--shadow-lift); background: var(--sheet); }
.types button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.types button:hover { background: var(--sheet-2); }
.types .g { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--paper); display: grid; place-items: center; font: 600 12px/1 var(--f-mono); color: var(--ink-2); }
.types .n { display: flex; flex-direction: column; line-height: 1.3; }
.types .n b { font-size: 14px; font-weight: 500; }
.types .n i { font-style: normal; font-size: 12px; color: var(--muted); }
.addf { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 1px dashed #b9b7c8; border-radius: 14px; background: transparent; font-weight: 500; }
.gen { border: 1px solid var(--rule-strong); border-radius: 16px; overflow: hidden; }
.gen .out { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; font: 500 15px/1.5 var(--f-mono); word-break: break-all; }
.gen .out span { flex: 1; }
.gen .bar { height: 4px; background: var(--rule); }
.gen .bar i { display: block; height: 100%; }
.gen .opts { padding: 14px 16px 16px; background: var(--sheet-2); display: flex; flex-direction: column; gap: 12px; }
.gen .opt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gen .opt > span:first-child { font-size: 13px; color: var(--ink-2); width: 64px; }
.gen input[type="range"] { flex: 1; accent-color: var(--ink); }

/* members / links */
.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.person .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.person .who span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.person select.input { width: auto; height: 36px; border-radius: 18px; font-size: 14px; background-color: var(--paper); border-color: transparent; }
.suggest { border-radius: 14px; background: var(--sheet-2); padding: 6px; display: flex; flex-direction: column; }
.suggest button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.suggest button:hover, .suggest button.on { background: var(--sheet); }
.linkbox { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--marker-soft); }
.linkbox .url { flex: 1; min-width: 0; font: 500 13px/1.4 var(--f-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.mode { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--rule-strong); background: var(--sheet); text-align: left; display: flex; flex-direction: column; gap: 2px; }
.mode[aria-pressed="true"] { border: 2px solid var(--ink); padding: 11px 13px; }
.mode b { font-weight: 500; }
.mode span { font-size: 13px; color: var(--muted); }

/* tables (admin) */
.panel { background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow); padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.panel h3 { margin: 0; font: 600 18px/1.3 var(--f-body); }
/* a folded how-to inside a panel */
.howto { border-top: 1px solid var(--rule); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.howto:first-of-type { border-top: 0; padding-top: 0; }
.howto summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.howto[open] summary { margin-bottom: 10px; }
.howto ol { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.howto code, .panel code { font: 500 13px/1.4 var(--f-mono); background: var(--sheet-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.tbl { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }

/* toast */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; box-shadow: var(--shadow-lift); animation: pop .18s ease; }
.toast.bad { background: var(--danger); }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.fv a.v { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- motion details ---------- */
.nav, .pill, .chip, .icon, .mode, .types button, .suggest button, .menu button, .menu a { transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s; }
.icon:active { transform: scale(.92); }
.icon.done { color: var(--ok); background: var(--ok-soft); }
.icon.done svg { animation: check .25s cubic-bezier(.2, .9, .3, 1.4); }
.menu { animation: pop .14s ease; transform-origin: top right; }
.types { animation: rise .18s ease; }
.ef { transition: background .15s; }
.ef.new { animation: rise .25s cubic-bezier(.2, .7, .2, 1); }
.gen { animation: rise .2s ease; }
.tile img { animation: fade .3s ease; }
.toast.out { animation: popOut .2s ease forwards; }
.card, .pitch { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
.panel { animation: rise .3s ease both; }
.back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: -8px 0 -8px -6px;
  padding: 6px 12px 6px 8px; border: 0; border-radius: 16px; background: var(--paper); color: var(--ink-2); font-size: 13px;
  transition: background .15s, color .15s;
}
.back:hover { background: var(--rule); color: var(--ink); }
.back span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back svg { width: 15px; height: 15px; }
.detail .hd .icon + .icon { margin-left: -6px; }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 16px; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.slider { width: 100%; accent-color: var(--ink); margin: 6px 0 0; }
.scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.scale b { color: var(--ink); font-size: 14px; }
.refsuggest { padding: 4px; }
.refsuggest button { width: 100%; }
.refsuggest .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.refsuggest .rt b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refsuggest .rt span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refsuggest .tile, .ef .refchip .tile { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
