/* Tack: square, quiet, with depth. */
:root {
  --font: "Ubuntu", "Ubuntu Sans", system-ui, sans-serif;
  --mono: "Ubuntu Mono", ui-monospace, monospace;

  --backdrop: #e8e7e2;
  --dots: rgba(40, 38, 30, .085);
  --glow-a: rgba(255, 255, 255, .95);
  --glow-b: rgba(208, 200, 186, .55);
  --panel: rgba(250, 250, 247, .55);
  --paper: #fcfcfa;
  --ink: #1a1a18;
  --ink-2: #57574f;
  --ink-3: #96968d;
  --line: rgba(26, 26, 20, .08);
  --line-2: rgba(26, 26, 20, .16);
  --hover: rgba(26, 26, 20, .05);
  --sel: rgba(26, 26, 20, .08);
  --danger: #c9372c;
  --focus: #2f5bea;
  --hi: inset 0 1px 0 rgba(255, 255, 255, .85);
  --lift-1: 0 0 0 1px rgba(26,26,20,.06), 0 1px 1px rgba(26,26,20,.04), 0 3px 6px -2px rgba(26,26,20,.07), 0 12px 22px -12px rgba(26,26,20,.16);
  --lift-2: 0 0 0 1px rgba(26,26,20,.08), 0 2px 4px rgba(26,26,20,.05), 0 14px 26px -10px rgba(26,26,20,.2), 0 28px 50px -20px rgba(26,26,20,.16);
  --lift-3: 0 0 0 1px rgba(26,26,20,.1), 0 10px 20px rgba(26,26,20,.1), 0 30px 60px -12px rgba(26,26,20,.32);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --c-red: #fbe0da; --c-orange: #fce5cd; --c-yellow: #f9eebc; --c-green: #def0d3; --c-teal: #d1ebe5;
  --c-blue: #d8e6f7; --c-indigo: #dfe0f8; --c-purple: #eadef5; --c-pink: #f8deea; --c-brown: #ebe1d4; --c-gray: #e5e5e0;
  --d-red: #e5484d; --d-orange: #f76b15; --d-yellow: #e2a500; --d-green: #30a46c; --d-teal: #12a594;
  --d-blue: #0090ff; --d-indigo: #3e63dd; --d-purple: #8e4ec6; --d-pink: #d6409f; --d-brown: #a18072; --d-gray: #8b8d98;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --backdrop: #121211; --dots: rgba(255, 255, 255, .04); --glow-a: rgba(255, 255, 255, .045); --glow-b: rgba(120, 110, 90, .08);
    --panel: rgba(28, 28, 26, .55); --paper: #1d1d1b; --ink: #ecebe5; --ink-2: #a3a39b; --ink-3: #6b6b64;
    --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.14); --hover: rgba(255,255,255,.055); --sel: rgba(255,255,255,.08);
    --focus: #7f9cff; --hi: inset 0 1px 0 rgba(255,255,255,.045);
    --lift-1: 0 0 0 1px rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.25), 0 12px 24px -12px rgba(0,0,0,.6);
    --lift-2: 0 0 0 1px rgba(255,255,255,.09), 0 4px 8px rgba(0,0,0,.3), 0 20px 40px -14px rgba(0,0,0,.7);
    --lift-3: 0 0 0 1px rgba(255,255,255,.12), 0 12px 24px rgba(0,0,0,.4), 0 32px 64px -12px rgba(0,0,0,.8);
    --c-red: #3a2421; --c-orange: #392a1c; --c-yellow: #36301b; --c-green: #21301e; --c-teal: #1a312e;
    --c-blue: #1b293a; --c-indigo: #22253c; --c-purple: #2c223c; --c-pink: #38212d; --c-brown: #312921; --c-gray: #292927;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 400 14px/1.5 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased;
  background-color: var(--backdrop);
  background-image:
    radial-gradient(var(--dots) 1px, transparent 1.3px),
    radial-gradient(1400px 760px at 18% -12%, var(--glow-a), transparent 62%),
    radial-gradient(1100px 900px at 105% 110%, var(--glow-b), transparent 60%);
  background-size: 22px 22px, auto, auto;
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
input, textarea, select { background: transparent; border: 0; outline: none; }
::placeholder { color: var(--ink-3); opacity: 1; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
textarea:focus-visible, input:focus-visible { outline: none; }
::selection { background: color-mix(in srgb, var(--focus) 22%, transparent); }
/* Scrollbars: square, thin, quiet; they darken when you reach for them. */
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--ink-3); border-width: 2px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; } }
input::-ms-reveal, input::-ms-clear { display: none; }
input[type=search]::-webkit-search-cancel-button { display: none; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--dot, var(--ink-2)); }
svg.i.sm { width: 15px; height: 15px; }
.mono { font-family: var(--mono); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

/* colour tokens */
[data-color="red"]    { --tint: var(--c-red);    --dot: var(--d-red); }
[data-color="orange"] { --tint: var(--c-orange); --dot: var(--d-orange); }
[data-color="yellow"] { --tint: var(--c-yellow); --dot: var(--d-yellow); }
[data-color="green"]  { --tint: var(--c-green);  --dot: var(--d-green); }
[data-color="teal"]   { --tint: var(--c-teal);   --dot: var(--d-teal); }
[data-color="blue"]   { --tint: var(--c-blue);   --dot: var(--d-blue); }
[data-color="indigo"] { --tint: var(--c-indigo); --dot: var(--d-indigo); }
[data-color="purple"] { --tint: var(--c-purple); --dot: var(--d-purple); }
[data-color="pink"]   { --tint: var(--c-pink);   --dot: var(--d-pink); }
[data-color="brown"]  { --tint: var(--c-brown);  --dot: var(--d-brown); }
[data-color="gray"]   { --tint: var(--c-gray);   --dot: var(--d-gray); }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 0 12px;
  background: var(--panel); backdrop-filter: blur(22px) saturate(1.15); -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border-right: 1px solid var(--line); z-index: 10;
}
.side-scroll { flex: 1; overflow-y: auto; padding-bottom: 12px; }
main { min-width: 0; padding: 0 40px 120px; }

/* ---------------------------------------------------------------- sidebar */
.ws-btn {
  display: flex; align-items: center; gap: 11px; width: calc(100% - 20px); margin: 0 10px 14px; padding: 6px 8px;
  text-align: left; font-weight: 500; font-size: 15px;
}
.ws-btn:hover { background: var(--hover); }
.ws-btn .chev { margin-left: auto; color: var(--ink-3); }
.mark {
  width: 28px; height: 28px; display: grid; place-items: center; font-size: 15px; flex: none;
  background: var(--paper); box-shadow: var(--lift-1);
}
.mark[data-color] { background: var(--tint); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 18px; color: var(--ink-2);
  text-decoration: none; width: 100%; text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.active { color: var(--ink); font-weight: 500; background: var(--sel); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; background: var(--ink); }
.nav-item .ico { width: 18px; }
.nav-item .ico svg.i { width: 17px; height: 17px; }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font: 12px var(--mono); color: var(--ink-3); }
.nav-item .more { display: none; color: var(--ink-3); width: 22px; height: 22px; place-items: center; margin-right: -4px; }
.nav-item:hover .more { display: grid; }
.nav-item:hover .more + .count { display: none; }
.nav-item .more:hover { color: var(--ink); background: var(--hover); }
@media (hover: none) { .nav-item .more { display: grid; } }
.tags-nav .ico:not([data-color]) { color: var(--ink-3); }

/* tags: quiet badges, tinted by the tag's colour */
.tag {
  display: inline-flex; align-items: center; gap: 2px; height: 19px; padding: 0 6px; max-width: 100%;
  font-size: 11.5px; line-height: 19px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink-2); background: color-mix(in srgb, var(--ink) 6.5%, transparent); transition: background .12s;
}
.tag[data-color] { color: color-mix(in srgb, var(--dot) 78%, var(--ink)); background: color-mix(in srgb, var(--dot) 15%, transparent); }
.tag[data-act] { cursor: pointer; }
.tag[data-act]:hover { background: color-mix(in srgb, var(--ink) 11%, transparent); }
.tag[data-color][data-act]:hover { background: color-mix(in srgb, var(--dot) 26%, transparent); }
.tag mark { margin: 0; padding: 0; }
.meta .tags { gap: 4px; flex-wrap: wrap; white-space: normal; }
.hint .tok.tags { gap: 4px; }
.prop-tags { flex: 1 1 240px; height: auto; min-height: 32px; min-width: 0; }
.ed-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; flex: 1; padding: 4px 0; }
.ed-tags .chips { display: contents; }
.ed-tags .tag { height: 22px; line-height: 22px; font-size: 12.5px; padding-right: 2px; }
.ed-tags .tag .x { display: grid; place-items: center; width: 18px; height: 18px; color: inherit; opacity: .55; }
.ed-tags .tag .x:hover { opacity: 1; }
.ed-tags .tag .x svg.i { width: 12px; height: 12px; }
.prop .ed-tag-in[type=text] { width: 90px; flex: 1; min-width: 70px; }
.tag-rows { max-height: 260px; overflow: auto; }
@media (pointer: coarse) {
  .ed-tags .tag { height: 30px; line-height: 30px; font-size: 13.5px; padding-left: 9px; }
  .ed-tags .tag .x { width: 30px; height: 30px; }
}
.pop-note { padding: 8px 10px; color: var(--ink-3); font-size: 13px; }
.nav-item.sorting { background: var(--paper); box-shadow: var(--lift-3); z-index: 5; color: var(--ink); }
.section {
  display: flex; align-items: center; justify-content: space-between; height: 30px; margin-top: 16px; padding: 0 12px 0 18px;
  font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.section button { color: var(--ink-3); width: 24px; height: 24px; display: grid; place-items: center; }
.section button:hover { color: var(--ink); background: var(--hover); }
.dot { width: 8px; height: 8px; background: var(--dot, var(--ink-3)); flex: none; margin: 0 5px; }
.new-project { padding: 4px 10px; }
.new-project input { width: 100%; height: 32px; padding: 0 10px; background: var(--paper); box-shadow: var(--lift-1); }
.side-foot { display: flex; gap: 2px; padding: 10px 12px 0; border-top: 1px solid var(--line); }
.side-foot a {
  flex: 1; height: 38px; display: grid; place-items: center; color: var(--ink-3); position: relative; transition: background .12s, color .12s;
}
.side-foot a:hover { color: var(--ink); background: var(--hover); }
.side-foot a.active { color: var(--ink); background: var(--sel); }
.side-foot a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--ink); }
.side-foot .sync { flex: 1; height: 38px; display: flex; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); transition: background .12s, color .12s; }
.side-foot .sync:hover { color: var(--ink); background: var(--hover); }
.side-foot .sync.off { color: var(--ink-2); }
.side-foot .sync.warn { color: var(--danger); }
.side-foot .sync .n { font: 11px var(--mono); }
.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sync-info { padding: 6px 6px 2px; width: 280px; }
.sync-info .big { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 8px; }
.sync-info .kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; color: var(--ink-2); }
.sync-info .kv span:last-child { color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.sync-info .rej { font-size: 13px; padding: 4px 0; color: var(--danger); display: flex; justify-content: space-between; gap: 8px; }
.sync-info .rej span { color: var(--ink-3); font: 11px var(--mono); white-space: nowrap; }

/* drop targets while dragging a card */
body.is-dragging [data-drop] { transition: background .12s, color .12s, box-shadow .12s; }
[data-drop].drop-hover { background: var(--ink) !important; color: var(--paper) !important; }
[data-drop].drop-hover .count, [data-drop].drop-hover .ico { color: var(--paper); }

/* ---------------------------------------------------------------- topbar */
.topbar { display: flex; align-items: center; gap: 10px; height: 76px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 .ico svg.i { width: 22px; height: 22px; }
.topbar h1 .dot { width: 10px; height: 10px; margin: 0 2px; }
.topbar h1 svg.i { width: 20px; height: 20px; color: var(--ink-2); }
.search {
  margin-left: auto; display: flex; align-items: center; height: 38px; color: var(--ink-2);
  transition: width .25s var(--ease), background .2s, box-shadow .2s; width: 38px; overflow: hidden;
}
.search > button { width: 38px; height: 38px; display: grid; place-items: center; flex: none; }
.search input { flex: 1; min-width: 0; color: var(--ink); padding-right: 12px; }
.search.open { width: min(380px, 56vw); background: var(--paper); box-shadow: var(--lift-1); }
.search.open:focus-within { box-shadow: inset 0 -2px 0 var(--d-yellow), var(--lift-2, var(--lift-1)); }
.search:not(.open):hover { background: var(--hover); color: var(--ink); }
.search > button.clear { width: 32px; color: var(--ink-3); }
.search > button.clear:hover { color: var(--ink); }
.search > button.clear[hidden] { display: none; }

/* search results */
mark { background: color-mix(in srgb, var(--d-yellow) 32%, transparent); color: inherit; box-shadow: 0 1px 0 color-mix(in srgb, var(--d-yellow) 70%, transparent);
  padding: 0 1px; margin: 0 -1px; animation: mark-in .28s var(--ease); }
@keyframes mark-in { from { background: transparent; box-shadow: none; } }
.masonry > .card.entering { opacity: 0; scale: .96; transition: none; }
.masonry > .card { transition: transform .26s var(--ease), box-shadow .2s, opacity .2s, scale .22s var(--ease); }
.masonry > .card.leaving { opacity: 0; scale: .96; pointer-events: none; }
.masonry > .card:focus-visible { outline: 2px solid var(--d-yellow); outline-offset: 2px; }
.results-label { min-height: 18px; }
.search-empty .search-tips { margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.search-empty code { font: 12px var(--mono); background: var(--hover); padding: 1px 5px; margin: 0 2px; color: var(--ink-2); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; color: var(--ink-2); flex: none; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.on { color: var(--ink); }
.menu-btn { display: none; margin-left: -8px; }

/* ---------------------------------------------------------------- composer */
.composer { max-width: 620px; margin: 4px auto 40px; background: var(--paper); box-shadow: var(--hi), var(--lift-1); transition: box-shadow .2s; }
.composer:focus-within { box-shadow: var(--hi), var(--lift-2); }
.composer textarea { display: block; width: 100%; resize: none; padding: 16px 18px; font-size: 15px; line-height: 1.5; max-height: 50vh; }
.composer .hint {
  display: none; align-items: center; gap: 14px; padding: 0 18px 12px; margin-top: -4px;
  font: 12.5px var(--mono); color: var(--ink-3); flex-wrap: wrap;
}
.composer:focus-within .hint, .composer .hint.live { display: flex; }
.hint .tok { color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.hint .tok svg.i { width: 13px; height: 13px; }
.hint .arrow { color: var(--ink-3); }

/* ---------------------------------------------------------------- board */
.group-label {
  display: flex; align-items: center; gap: 6px; margin: 0 0 12px; height: 20px;
  font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
button.group-label:hover { color: var(--ink); }
.masonry { position: relative; margin-bottom: 36px; min-height: 40px; }
.masonry > .card { position: absolute; top: 0; left: 0; transition: transform .26s var(--ease), box-shadow .2s, opacity .2s; will-change: transform; }
.masonry.no-anim > .card, .masonry.no-anim > .slot { transition: none; }
.slot { position: absolute; top: 0; left: 0; border: 1.5px dashed var(--line-2); background: var(--hover); transition: transform .26s var(--ease), height .2s; pointer-events: none; }
/* the dock that rises while a card is dragged */
.dock {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 90; translate: -50% 0;
  display: flex; background: var(--paper); box-shadow: var(--hi), var(--lift-3); animation: dock-in .22s var(--ease);
}
.dock.leaving { animation: dock-out .18s ease-in forwards; }
@keyframes dock-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes dock-out { to { opacity: 0; transform: translateY(16px); } }
.dock-t {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 92px; height: 68px;
  color: var(--ink-2); font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.dock-t + .dock-t { border-left: 1px solid var(--line); }
.dock-t svg.i { width: 19px; height: 19px; }
/* a removed card fading where it lay */
.card.ghost { position: fixed; z-index: 4; margin: 0; pointer-events: none; }
.ctx-anchor { position: fixed; width: 0; height: 0; pointer-events: none; }
.card .pin:disabled { cursor: default; }
@media (pointer: coarse) { .card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }

.card {
  --card: var(--paper);
  background: var(--card); padding: 14px 16px 6px; box-shadow: var(--hi), var(--lift-1); cursor: default;
  overflow-wrap: anywhere; touch-action: manipulation;
}
.card[data-color] { --card: var(--tint); box-shadow: inset 0 3px 0 var(--dot), var(--lift-1); }
.card:hover { box-shadow: var(--hi), var(--lift-2); }
.card[data-color]:hover { box-shadow: inset 0 3px 0 var(--dot), var(--lift-2); }
.card.dragging {
  position: fixed !important; z-index: 100; pointer-events: none; transition: box-shadow .2s, opacity .2s !important;
  box-shadow: var(--hi), var(--lift-3);
}
.card.dragging[data-color] { box-shadow: inset 0 3px 0 var(--dot), var(--lift-3); }
.card.dropping { transition: transform .22s var(--ease), opacity .22s !important; opacity: 0; }
.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; line-height: 1.4; }
.card-title .ico { margin-right: 8px; vertical-align: -3px; }
.card-title .ico svg.i { width: 17px; height: 17px; }
.card-body > .ico { margin-right: 6px; vertical-align: -3px; }
.card-body > .ico svg.i { width: 16px; height: 16px; }
.card.done .card-title, .card.done .card-body { color: var(--ink-3); }
.card.done .card-title .t { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.card-body { white-space: pre-wrap; margin-top: 6px; color: var(--ink); font-size: 14px; max-height: 15em; overflow: hidden; }
.card-body.long { -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.card.untitled .card-body { margin-top: 0; padding-right: 24px; }
.card-body a { color: var(--focus); text-decoration: none; }
.card-body a:hover { text-decoration: underline; }
.card-body code, .ed-body code { font: 13px var(--mono); background: var(--hover); padding: 0 4px; }

.pin { color: var(--ink-3); opacity: 0; width: 22px; height: 22px; display: grid; place-items: center; margin: -2px -6px 0 0; flex: none; transition: opacity .12s; }
.card:hover .pin, .pin.on { opacity: 1; }
.pin:hover { color: var(--ink); }
.pin.on { color: var(--ink); }
.pin.on svg.i { fill: currentColor; }
.card.untitled .card-head { position: absolute; top: 12px; right: 14px; }
.card.untitled .card-title { display: none; }

.cl { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cl li { display: flex; align-items: flex-start; gap: 9px; line-height: 1.4; }
.box {
  width: 14px; height: 14px; flex: none; margin-top: 2.5px; border: 1.5px solid var(--ink-3); display: grid; place-items: center;
  color: transparent; transition: all .12s;
}
.box:hover { border-color: var(--ink); }
.box svg.i { width: 10px; height: 10px; stroke-width: 3.2; }
.done > .box { background: var(--ink-2); border-color: var(--ink-2); color: var(--card, var(--paper)); }
.cl li.done span { text-decoration: line-through; color: var(--ink-3); }
.cl .more-items { color: var(--ink-3); font: 12.5px var(--mono); padding-left: 23px; }

.card-foot { display: flex; align-items: center; gap: 12px; min-height: 28px; margin-top: 4px; }
.meta { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; min-width: 0; font-size: 12.5px; color: var(--ink-3); }
.meta span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.meta svg.i { width: 13px; height: 13px; }
.meta .dot { width: 7px; height: 7px; margin: 0; }
.meta .late { color: var(--danger); }
.meta .agent { color: color-mix(in srgb, var(--d-purple) 75%, var(--ink-2)); }
.card-actions { margin-left: auto; display: flex; opacity: 0; transition: opacity .14s; margin-right: -8px; }
.card.bare { padding-bottom: 14px; }
.card.bare .card-foot { position: absolute; right: 16px; bottom: 6px; margin: 0; min-height: 0; }
.card.bare:not(.untitled) .card-foot { right: 40px; }  /* beside the pin, which shares the title's row */
.card.bare .card-actions { background: var(--card); box-shadow: -14px 0 12px -4px var(--card); }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }
.card-actions .icon-btn { width: 30px; height: 30px; color: var(--ink-3); }
.card-actions .icon-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.card-actions svg.i { width: 16px; height: 16px; }
/* Touch has no hover: cards stay clean, and long-press (the card menu) or tapping (the editor) offers
   every action. Only a pinned card's pin shows. */
@media (hover: none) {
  .card-actions { display: none; }
  .pin:not(.on) { display: none; }
}

.empty { text-align: center; color: var(--ink-3); padding: 90px 20px; }
.empty .glyph { margin-bottom: 14px; opacity: .7; }
.empty .glyph svg.i { width: 30px; height: 30px; stroke-width: 1.5; }

/* ---------------------------------------------------------------- popovers */
#layer { position: relative; z-index: 50; }
.pop {
  position: fixed; z-index: 60; background: var(--paper); box-shadow: var(--hi), var(--lift-3); padding: 6px; min-width: 200px;
  animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.pop .row { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; text-align: left; }
.pop .row:hover { background: var(--hover); }
.pop .row.active { font-weight: 500; }
.key-icon-pop .row.active::after, .ctx .row.active::after { content: ""; width: 6px; height: 6px; margin-left: auto; background: var(--ink); }
.pop .row .end { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px -6px; }
.pop .field input { width: 100%; height: 36px; padding: 0 10px; background: var(--hover); }
.pop .danger { color: var(--danger); }
.pop-title { font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 8px 6px 4px; }
.swatches { display: grid; grid-template-columns: repeat(6, 28px); gap: 6px; padding: 6px; }
.swatch { width: 28px; height: 28px; background: var(--tint, var(--paper)); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center; color: var(--ink-3); position: relative; }
.swatch[data-color]::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--dot); }
.swatch:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.swatch.on { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.icon-search { display: flex; align-items: center; gap: 8px; height: 36px; margin: 2px 6px 4px; padding: 0 10px; background: var(--hover); color: var(--ink-3); }
.icon-search input { flex: 1; min-width: 0; color: var(--ink); }
.icon-grid { display: grid; grid-template-columns: repeat(8, 34px); grid-auto-rows: 34px; gap: 2px; padding: 4px 6px 6px; height: 222px; overflow-y: auto; align-content: start; }
.icon-grid button { display: grid; place-items: center; color: var(--ink-2); transition: background .1s, color .1s; }
.icon-grid button:hover { background: var(--sel); color: var(--ink); }
.icon-grid button.on { background: var(--ink); color: var(--paper); }
.icon-none { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--ink-3); }
.mark .ico svg.i { width: 16px; height: 16px; }
.mark.small { width: 24px; height: 24px; font-size: 12px; }
.mark.small .ico svg.i { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- controls (ui.js) */
.sel { display: inline-flex; align-items: center; gap: 8px; min-width: 0; text-align: left; transition: background .12s; }
.sel .v { display: inline-flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel .caret { color: var(--ink-3); transition: transform .18s var(--ease); }
.sel[aria-expanded=true] .caret { transform: rotate(180deg); }
.sel .ph { color: var(--ink-3); }
.sel:disabled { cursor: default; }
.sel:disabled .caret { display: none; }
.form .sel.in { height: 36px; padding: 0 10px 0 12px; background: var(--hover); }
.form .sel.in:hover { background: var(--sel); }
.prop-sel, .prop-btn { color: var(--ink); font-size: 13.5px; height: 28px; padding: 0 6px; margin-left: -6px; }
.prop-sel:hover:not(:disabled), .prop-btn:hover:not(:disabled) { background: var(--hover); }
.prop-btn.empty { color: var(--ink-3); }
.prop-btn:disabled { cursor: default; }
.opts { display: flex; flex-direction: column; max-height: min(320px, 60vh); overflow-y: auto; }
.opts .row:focus-visible, .opts .row.hl { background: var(--sel); outline: none; }
.opts .row .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opts .row .end svg.i { color: var(--ink); }
.ac-pop { padding: 4px; min-width: 160px; }
.ac-pop .row { height: 32px; font-size: 13.5px; }

/* date picker */
.dp-pop { padding: 10px; }
.dp { width: 272px; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.dp-quick button { height: 28px; padding: 0 10px; background: var(--hover); font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.dp-quick button:hover { background: var(--sel); color: var(--ink); }
.dp-quick .clear { margin-left: auto; background: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; height: 34px; margin-bottom: 4px; }
.dp-title { font-weight: 500; }
.dp-nav { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-2); }
.dp-nav:hover { background: var(--hover); color: var(--ink); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { font: 11px var(--mono); color: var(--ink-3); text-align: center; height: 24px; line-height: 24px; text-transform: uppercase; }
.dp-day { height: 36px; display: grid; place-items: center; font-size: 13.5px; position: relative; transition: background .1s; }
.dp-day:hover { background: var(--hover); }
.dp-day.out { color: var(--ink-3); }
.dp-day.past:not(.sel) { color: color-mix(in srgb, var(--ink-3) 80%, transparent); }
.dp-day.today { font-weight: 700; }
.dp-day.today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 14px; height: 2px; margin-left: -7px; background: var(--d-yellow); }
.dp-day.sel { background: var(--ink); color: var(--paper); }
.dp-day.sel::after { background: var(--paper); }
.dp-day:focus-visible { outline: 2px solid var(--d-yellow); outline-offset: -2px; }

/* bottom sheets (popovers on phones) */
.pop-scrim { position: fixed; inset: 0; z-index: 59; background: rgba(12, 12, 10, .32); animation: fade .18s ease-out; }
.pop.sheet {
  left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; min-width: 0 !important; max-height: 82vh; overflow-y: auto;
  padding: 6px 12px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: sheet .24s var(--ease);
}
@keyframes sheet { from { transform: translateY(100%); } }
.pop.sheet .grabber { width: 36px; height: 4px; background: var(--line-2); margin: 4px auto 10px; }
.pop.sheet .row { height: 46px; font-size: 15px; }
.pop.sheet .dp { width: 100%; }
.pop.sheet .dp-day { height: 44px; font-size: 15px; }
.pop.sheet .opts { max-height: none; }
.pop.sheet .icon-grid { grid-template-columns: repeat(auto-fill, 40px); grid-auto-rows: 40px; justify-content: space-between; height: 240px; }
.pop.sheet .swatches { grid-template-columns: repeat(6, 1fr); }
.pop.sheet .swatch { width: auto; height: 40px; }
.pop.sheet .sync-info { width: auto; }

/* confirm dialog */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--backdrop) 50%, rgba(10,10,8,.4)); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .14s ease-out; }
.modal { width: min(400px, 100%); background: var(--paper); box-shadow: var(--hi), var(--lift-3); padding: 22px 22px 16px; animation: rise .18s var(--ease); }
.modal h3 { margin: 0 0 8px; font-size: 17px; font-weight: 500; }
.modal p { margin: 0; color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 20px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { opacity: .88; }

/* tooltips */
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.3;
  padding: 5px 8px; max-width: 260px; box-shadow: var(--lift-2); animation: tip .12s ease-out; }
@keyframes tip { from { opacity: 0; transform: translateY(-2px); } }

/* mobile sidebar backdrop */
.scrim { display: none; }

/* ---------------------------------------------------------------- editor */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: start center; padding: 10vh 16px 16px; overflow-y: auto;
  background: color-mix(in srgb, var(--backdrop) 55%, rgba(10,10,8,.35)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.editor {
  --card: var(--paper);
  width: min(640px, 100%); background: var(--card); box-shadow: var(--hi), var(--lift-3); display: flex; flex-direction: column;
  max-height: 82vh; animation: rise .2s var(--ease);
}
.editor[data-color] { --card: var(--tint); box-shadow: inset 0 3px 0 var(--dot), var(--lift-3); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.ed-scroll { overflow-y: auto; overflow-x: hidden; padding: 20px 22px 8px; min-width: 0; }
.ed-title, .cl-row input { width: 0; }
.ed-head { display: flex; align-items: center; gap: 8px; margin-left: -6px; }
.ed-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.ed-icon .ico svg.i { width: 22px; height: 22px; }
.ed-icon:hover { background: var(--hover); color: var(--ink-2); }
.ed-title { flex: 1; min-width: 0; font-size: 21px; font-weight: 500; letter-spacing: -.01em; padding: 4px 0; }
.ed-body { display: block; width: 100%; resize: none; min-height: 72px; margin-top: 8px; font-size: 15px; line-height: 1.6; }
.ed-checklist { position: relative; display: flex; flex-direction: column; margin: 4px 0 8px -22px; }
.cl-row { display: flex; align-items: flex-start; gap: 10px; padding: 3px 0; background: var(--card); }
.cl-row .grip { width: 14px; height: 22px; display: grid; place-items: center; color: var(--ink-3); opacity: 0; cursor: grab; flex: none; touch-action: none; }
.cl-row:hover .grip { opacity: 1; }
.cl-row .grip svg.i { width: 14px; height: 14px; }
.cl-row input { flex: 1; min-width: 0; line-height: 1.5; }
.cl-row.done input { text-decoration: line-through; color: var(--ink-3); }
.cl-row .del { color: var(--ink-3); opacity: 0; width: 22px; height: 22px; display: grid; place-items: center; }
.cl-row:hover .del, .cl-row:focus-within .del { opacity: 1; }
.cl-row .del:hover { color: var(--ink); }
.cl-row.add { padding-left: 24px; }
.cl-row.add .plus { width: 14px; display: grid; place-items: center; color: var(--ink-3); margin-top: 3px; }
.cl-row.sorting { box-shadow: var(--lift-3); z-index: 3; position: relative; }
.ed-props { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 12px 0 6px; border-top: 1px solid var(--line); margin-top: 8px; }
.prop { display: inline-flex; align-items: center; gap: 7px; height: 32px; color: var(--ink-3); font-size: 13.5px; }
.prop:focus-within, .prop:hover { color: var(--ink-2); }
.prop input { color: var(--ink); min-width: 0; font-size: 13.5px; }
.prop input[type=text] { width: 96px; }
.ed-foot { display: flex; align-items: center; gap: 2px; padding: 8px 10px 10px 14px; }
.ed-foot .meta-line { font: 12.5px var(--mono); color: var(--ink-3); margin: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.btn { height: 34px; padding: 0 16px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; transition: background .12s, opacity .12s; }
.btn:hover { background: var(--hover); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.ink:hover { opacity: .86; }
.btn.subtle { color: var(--ink-2); }
.history { border-top: 1px solid var(--line); max-height: 240px; overflow-y: auto; padding: 4px 8px; }

/* ---------------------------------------------------------------- activity */
.log { max-width: 760px; margin: 0 auto; }
.log-day { font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 8px; }
.log-day:first-child { margin-top: 0; }
.log-list { background: var(--paper); box-shadow: var(--hi), var(--lift-1); }
.ev { display: flex; align-items: center; gap: 14px; padding: 0 12px 0 16px; min-height: 44px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev:hover { background: var(--hover); }
.ev .when { font: 12.5px var(--mono); color: var(--ink-3); flex: none; min-width: 40px; }
.ev .who { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12.5px; color: var(--ink-2); min-width: 78px; }
.ev .who svg.i { width: 14px; height: 14px; }
.ev .who.agent { color: color-mix(in srgb, var(--d-purple) 75%, var(--ink-2)); }
.ev .what { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.ev .what b { font-weight: 500; color: var(--ink); }
.ev .what a { color: inherit; text-decoration: none; cursor: pointer; }
.ev .what a:hover b { text-decoration: underline; text-decoration-color: var(--ink-3); }
.ev .seq { font: 12px var(--mono); color: var(--ink-3); flex: none; }
.ev .undo { opacity: 0; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; font-size: 12.5px; color: var(--ink-2); flex: none; }
.ev:hover .undo { opacity: 1; }
.ev .undo:hover { background: var(--sel); color: var(--ink); }
.ev .undo svg.i { width: 14px; height: 14px; }
.ev.reverted .what, .ev.reverted .what b { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.history .ev { border-top: 0; padding: 0 6px; min-height: 36px; }

/* ---------------------------------------------------------------- keys */
.panel { max-width: 760px; margin: 0 auto; }
.lead { color: var(--ink-2); margin: 0 0 22px; max-width: 60ch; }
.sheet { background: var(--paper); box-shadow: var(--hi), var(--lift-1); }
.form { padding: 14px; margin-bottom: 28px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form .in { height: 36px; padding: 0 12px; background: var(--hover); }
.form select.in { padding-right: 8px; }
.form select.in option { background: var(--paper); }
.token { flex-basis: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--c-green); margin-top: 6px; }
.token code { flex: 1; font: 14px var(--mono); word-break: break-all; }
.token-note { flex-basis: 100%; font-size: 12.5px; color: var(--ink-3); margin: 2px 2px 0; }
.form .grow { flex: 1; min-width: 160px; }
.form .break { flex-basis: 100%; height: 0; }
.keyrow { display: flex; align-items: flex-start; gap: 14px; padding: 14px 14px 14px 16px; border-top: 1px solid var(--line); }
.keyrow:first-child { border-top: 0; }
.keyrow.revoked { opacity: .5; }
.keyrow .k-ico { color: var(--ink-3); padding-top: 2px; }
.keyrow button.k-ico { display: grid; place-items: center; width: 32px; height: 32px; margin: -5px -7px 0; padding: 0;
  color: color-mix(in srgb, var(--d-purple) 75%, var(--ink-2)); border: 1px solid transparent; transition: background .12s, border-color .12s; }
.keyrow button.k-ico:hover, .keyrow button.k-ico[aria-expanded=true] { background: var(--hover); border-color: var(--line); }
.keyrow button.k-ico.none { color: var(--ink-4, var(--ink-3)); border: 1px dashed var(--line); }
.keyrow button.k-ico.none svg { opacity: .55; }
.keyrow .k-main { flex: 1; min-width: 0; }
.keyrow .k-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.keyrow .name { font-weight: 500; margin-right: 2px; }
.keyrow .k-facts { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; overflow-wrap: anywhere; }
.keyrow code { font: 12.5px var(--mono); color: var(--ink-3); }
.badge { font: 11px var(--mono); letter-spacing: .04em; padding: 2px 6px; background: var(--sel); color: var(--ink-2); white-space: nowrap; }
.badge.soft { background: var(--hover); }
.badge.ink { background: var(--ink); color: var(--paper); }
/* a key's access level, switchable in place */
.keyrow .k-acc { height: 21px; padding: 0 3px 0 7px; gap: 3px; font: 11px var(--mono); letter-spacing: .04em; color: var(--ink-2); background: var(--sel); }
.keyrow .k-acc:hover, .keyrow .k-acc[aria-expanded=true] { background: color-mix(in srgb, var(--ink) 13%, transparent); color: var(--ink); }
.keyrow .k-acc svg.caret { width: 12px; height: 12px; }
@media (pointer: coarse) { .keyrow .k-acc { height: 30px; padding: 0 6px 0 10px; } }
button.link { text-decoration: underline; color: var(--ink); font-size: inherit; padding: 0; }

/* ---------------------------------------------------------------- toast */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 70;
  display: flex; align-items: center; gap: 18px; height: 46px; padding: 0 6px 0 18px; white-space: nowrap;
  background: var(--ink); color: var(--paper); box-shadow: var(--lift-3); transition: opacity .2s, transform .25s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { height: 34px; padding: 0 12px; color: var(--paper); font-weight: 500; }
#toast button:hover { background: color-mix(in srgb, var(--paper) 15%, transparent); }
#toast:not(:has(button)) { padding-right: 18px; }

/* ---------------------------------------------------------------- sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(420px, 100%); background: var(--paper); box-shadow: var(--hi), var(--lift-3); padding: 32px; }
.login h2 { margin: 0 0 8px; font-weight: 500; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.login .logo { width: 26px; height: 26px; }
.login p { color: var(--ink-2); margin: 0 0 18px; }
.login code { font: 13px var(--mono); background: var(--hover); padding: 1px 5px; }
.login label { display: block; font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.login input { display: block; width: 100%; height: 42px; padding: 0 12px; margin-top: 6px; background: var(--hover); font: 14px var(--mono); letter-spacing: 0; text-transform: none; color: var(--ink); }
.login .err { color: var(--danger); margin: 0 0 14px; }
.login .btn { width: 100%; justify-content: center; height: 42px; margin-top: 4px; }
.login .btn:disabled { opacity: .6; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }

/* ---------------------------------------------------------------- conflicts */
.ed-conflicts { padding: 4px 22px 8px; display: grid; gap: 8px; }
.conflict { background: var(--hover); box-shadow: inset 3px 0 0 var(--ink-3); padding: 8px 10px 10px 14px; }
.conflict .c-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.conflict .c-head span { flex: 1; }
.conflict .btn { height: 28px; padding: 0 10px; }
.conflict pre { margin: 6px 0 0; font: 13px/1.45 var(--font); white-space: pre-wrap; max-height: 160px; overflow: auto; color: var(--ink); }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 84vw); transform: translateX(-100%); transition: transform .26s var(--ease), box-shadow .26s; background: var(--backdrop); z-index: 30; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--lift-3); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(12, 12, 10, .3); opacity: 0; pointer-events: none; transition: opacity .26s; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body:has(.app.nav-open), body:has(.overlay) { overflow: hidden; }
  .nav-item, .side-foot a, .side-foot .sync { min-height: 44px; }
  main { padding: 0 16px 100px; }
  .menu-btn { display: inline-grid; width: 40px; height: 40px; }
  .topbar { height: 64px; gap: 6px; }
  .topbar h1 { font-size: 19px; white-space: nowrap; overflow: hidden; }
  .topbar:has(.search.open) h1 { display: none; }
  .search.open { width: auto; flex: 1; }

  .composer { margin-bottom: 28px; }
  #toast { bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
}
@media (max-width: 600px) {
  .dock { left: 12px; right: 12px; translate: none; }
  .dock-t { flex: 1; width: auto; }
  /* the editor becomes a full-screen sheet */
  .overlay { padding: 0; place-items: stretch; grid-template-columns: minmax(0, 1fr); background: var(--backdrop); backdrop-filter: none; }
  .editor { min-width: 0; width: 100%; max-height: none; height: 100dvh; box-shadow: none; animation: sheet .26s var(--ease); }
  .ed-scroll { flex: 1; padding: 16px 16px 8px; }
  .ed-foot { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
  .ed-foot .meta-line { display: none; }
  .ed-foot .btn.ink { margin-left: auto; height: 42px; padding: 0 20px; }
  .ed-foot .icon-btn { width: 42px; height: 42px; }
  .ed-props { gap: 6px 16px; }
  .prop input[type=text] { width: 120px; }
  .ed-title { font-size: 19px; }
  .ed-body { font-size: 16px; }  /* 16px stops iOS from zooming in on focus */
  .composer textarea, .search input, .login input, .form .in, .prop input, .pop .field input, .icon-search input { font-size: 16px; }
  .form { padding: 12px; }
  .form .sel.in, .form .btn { flex: 1 1 100%; justify-content: space-between; }
  .form .btn { justify-content: center; }
  .keyrow { flex-wrap: wrap; }
  .keyrow > .btn { margin-left: 30px; }
  .keyrow button.k-ico { width: 44px; height: 44px; margin: -11px -10px -11px -14px; }
  .modal-wrap { place-items: end stretch; padding: 0; }
  .modal { width: 100%; padding: 22px 18px calc(16px + env(safe-area-inset-bottom)); animation: sheet .24s var(--ease); }
  .modal-actions .btn { flex: 1; justify-content: center; height: 44px; }
}
