/* ---------- fonts (all SIL Open Font License, see fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Jakarta"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Jakarta"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format("woff2-variations");
  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: "Bricolage"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-display: swap; font-weight: 400;
  src: url(/static/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); }

/* ---------- tokens: "Blush" (light) ---------- */
:root {
  --sans: "Jakarta", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --display: "Bricolage", "Jakarta", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;

  --bg: #efdbe6;
  --orb1: #cdb3ec; --orb2: #ffc2a6; --orb3: #f4a9c0;
  --glass: rgb(255 255 255 / .38);
  --glass-2: rgb(255 255 255 / .58);
  --glass-3: rgb(255 255 255 / .82);
  --glass-border: rgb(255 255 255 / .62);
  --line: rgb(70 25 70 / .09);
  --text: #26122c; --muted: #6e5674; --faint: #a3889f;
  --ink: #1d1326; --ink-fg: #fff;            /* inverse pill (CTA, active tab) */
  --dock: rgb(29 19 38 / .86); --dock-fg: #d9cbe0; --dock-active: #fff; --dock-active-fg: #1d1326;
  --sunset: linear-gradient(135deg, #ffa25e 0%, #ff5f7e 52%, #a855f7 110%);
  --accent: #ff6a3d; --accent-soft: rgb(255 106 61 / .14);
  --ok: #18b26b; --danger: #e5484d;
  --shadow: 0 24px 60px -28px rgb(80 20 70 / .45), 0 2px 8px -2px rgb(80 20 70 / .08);
  --shadow-lg: 0 40px 90px -30px rgb(80 20 70 / .55);
  --blur: blur(26px) saturate(1.5);
  --side: 312px; --panel: 392px;
  --wave: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2290%22%20height%3D%2222%22%20viewBox%3D%220%200%2090%2022%22%3E%3Crect%20x%3D%220%22%20y%3D%227.0%22%20width%3D%223.2%22%20height%3D%228%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%226%22%20y%3D%224.0%22%20width%3D%223.2%22%20height%3D%2214%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2212%22%20y%3D%221.0%22%20width%3D%223.2%22%20height%3D%2220%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2218%22%20y%3D%225.5%22%20width%3D%223.2%22%20height%3D%2211%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2224%22%20y%3D%222.5%22%20width%3D%223.2%22%20height%3D%2217%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2230%22%20y%3D%220.0%22%20width%3D%223.2%22%20height%3D%2222%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2236%22%20y%3D%226.5%22%20width%3D%223.2%22%20height%3D%229%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2242%22%20y%3D%223.5%22%20width%3D%223.2%22%20height%3D%2215%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2248%22%20y%3D%221.5%22%20width%3D%223.2%22%20height%3D%2219%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2254%22%20y%3D%225.0%22%20width%3D%223.2%22%20height%3D%2212%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2260%22%20y%3D%227.5%22%20width%3D%223.2%22%20height%3D%227%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2266%22%20y%3D%223.0%22%20width%3D%223.2%22%20height%3D%2216%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2272%22%20y%3D%220.5%22%20width%3D%223.2%22%20height%3D%2221%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2278%22%20y%3D%224.5%22%20width%3D%223.2%22%20height%3D%2213%22%20rx%3D%221.6%22/%3E%3Crect%20x%3D%2284%22%20y%3D%226.0%22%20width%3D%223.2%22%20height%3D%2210%22%20rx%3D%221.6%22/%3E%3C/svg%3E");
  color-scheme: light;
}
/* ---------- tokens: "Dusk" (dark) ---------- */
:root[data-theme="dark"] {
  --bg: #0b0810;
  --orb1: #5b21b6; --orb2: #f9733a; --orb3: #be185d;
  --glass: rgb(255 255 255 / .045);
  --glass-2: rgb(255 255 255 / .075);
  --glass-3: rgb(255 255 255 / .12);
  --glass-border: rgb(255 255 255 / .09);
  --line: rgb(255 255 255 / .07);
  --text: #f7eff8; --muted: #b4a5bb; --faint: #7c6d85;
  --ink: #ffffff; --ink-fg: #140d1a;
  --dock: rgb(14 10 19 / .82); --dock-fg: #b4a5bb; --dock-active: #fff; --dock-active-fg: #140d1a;
  --accent: #ff8a4c; --accent-soft: rgb(255 138 76 / .16);
  --shadow: 0 30px 70px -30px rgb(0 0 0 / .85), 0 1px 0 rgb(255 255 255 / .04) inset;
  --shadow-lg: 0 40px 100px -30px rgb(0 0 0 / .9);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; flex-direction: column; background: var(--bg); color: var(--text); overflow: hidden;
  font: 500 14.5px/1.5 var(--sans); letter-spacing: -.006em; -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
input, textarea { background: var(--glass-2); border: 1px solid var(--glass-border); border-radius: 14px; padding: 9px 13px; transition: border-color .15s, box-shadow .15s, background .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { outline: none; background: var(--glass-3); border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: inherit; }
.ico { flex: none; display: block; }
i[data-icon] { display: inline-flex; }
.muted { color: var(--muted); font-size: 12.5px; }
::selection { background: rgb(255 106 61 / .3); }
* { scrollbar-width: thin; scrollbar-color: var(--glass-3) transparent; }

/* ---------- ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .9; animation: drift 26s ease-in-out infinite alternate; }
.o1 { width: 62vmax; height: 62vmax; left: -18vmax; top: -24vmax; background: var(--orb1); }
.o2 { width: 52vmax; height: 52vmax; right: -16vmax; bottom: -22vmax; background: var(--orb2); animation-delay: -9s; }
.o3 { width: 38vmax; height: 38vmax; left: 38%; top: 30%; background: var(--orb3); opacity: .55; animation-delay: -17s; }
:root[data-theme="dark"] .orb { opacity: .5; }
:root[data-theme="dark"] .o3 { opacity: .28; }
.grain { position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }

.glass { background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text);
  font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: background .18s, border-color .18s, transform .1s, box-shadow .18s, color .18s, filter .18s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.icon { width: 42px; padding: 0; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.sm.icon { width: 34px; padding: 0; }
.btn.grow { flex: 1; }
.glass-btn { background: var(--glass-2); border-color: var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.glass-btn:hover:not(:disabled) { background: var(--glass-3); }
.btn.ghost { color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--glass-2); color: var(--text); }
.btn.ink { background: var(--ink); color: var(--ink-fg); box-shadow: 0 12px 28px -12px rgb(29 19 38 / .7); }
.btn.ink:hover:not(:disabled) { filter: brightness(1.15); }
.btn.sunset { color: #fff; background: var(--sunset); box-shadow: 0 14px 30px -12px rgb(255 95 126 / .8), inset 0 1px 0 rgb(255 255 255 / .35); }
.btn.sunset:hover:not(:disabled) { filter: brightness(1.06) saturate(1.1); }
.btn.danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); flex: none; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); } }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  background: var(--glass-2); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); }

/* ---------- mascot "Vizi" ---------- */
.mascot-slot { display: inline-flex; }
.mascot { display: block; overflow: visible; filter: drop-shadow(0 10px 18px rgb(255 95 126 / .35)); }
.mascot .eye { transform-box: fill-box; transform-origin: center; animation: blink 5.2s infinite; }
.mascot .eyes { transition: transform .12s ease-out; }
.mascot .antenna { transform-box: fill-box; transform-origin: 50% 100%; animation: bob 3.6s ease-in-out infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes bob { 50% { transform: rotate(-8deg) translateY(-1px); } }

/* ---------- top bar ---------- */
.topbar { position: relative; z-index: 25; flex: none; display: flex; align-items: center; gap: 14px; padding: 14px 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: 4px; }
.wordmark { font: 700 23px/1 var(--display); letter-spacing: -.045em; }
.wordmark b { font-weight: 800; background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { position: relative; flex: 1; max-width: 580px; margin: 0 auto; }
.search input { width: 100%; height: 48px; border-radius: 999px; padding: 0 48px 0 46px; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.search input::-webkit-search-cancel-button { display: none; }
.s-ico { position: absolute; left: 17px; top: 15.5px; color: var(--muted); pointer-events: none; }
.s-kbd { position: absolute; right: 14px; top: 13px; height: 22px; min-width: 22px; padding: 0 6px; display: grid; place-items: center; font: 700 12px var(--sans);
  color: var(--muted); background: var(--glass-2); border: 1px solid var(--glass-border); border-radius: 7px; pointer-events: none; }
.search input:focus ~ .s-kbd, .search input:not(:placeholder-shown) ~ .s-kbd { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--sunset); color: #fff; font: 800 13px var(--display); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-text small { font-size: 11px; color: var(--muted); font-weight: 600; }
.user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13.5px; }
.only-narrow { display: none; }

.results { position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 40; max-height: 64vh; overflow: auto; padding: 8px;
  background: var(--glass-3); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border: 1px solid var(--glass-border); border-radius: 26px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
:root[data-theme="dark"] .results { background: rgb(26 18 32 / .92); }
.result { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 18px; cursor: pointer; }
.result:hover, .result:focus-visible { background: var(--glass-2); }
.r-tile { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: var(--c, var(--ink)); box-shadow: 0 6px 16px -6px var(--c, #000); }
.r-body { min-width: 0; flex: 1; }
.r-main { font-weight: 550; }
.result small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.result mark { background: rgb(255 176 64 / .5); color: inherit; border-radius: 5px; padding: 0 2px; }
.kind { float: right; margin-left: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-border); color: var(--muted); }
.no-results { padding: 18px; color: var(--muted); text-align: center; }

/* ---------- layout ---------- */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--side) 1fr; gap: 14px; padding: 0 16px 16px; position: relative; }
.sidebar { display: flex; flex-direction: column; min-height: 0; border-radius: 30px; }
.side-head { display: flex; gap: 8px; padding: 14px 14px 8px; }
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 4px 22px; font: 700 11.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.side-label-actions { display: flex; gap: 2px; }
.tree { flex: 1; overflow: auto; padding: 4px 10px 18px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: 21px; padding-left: 6px; border-left: 1px dashed var(--line); }
.row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 10px 5px 4px; margin: 1px 0; border-radius: 16px; cursor: pointer; user-select: none; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.row:hover { background: var(--glass-2); }
.row.selected { background: var(--glass-3); border-color: var(--glass-border); box-shadow: 0 10px 24px -16px rgb(80 20 70 / .5); }
:root[data-theme="dark"] .row.selected { background: rgb(255 255 255 / .1); }
.row.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.chev { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--faint); cursor: pointer; border-radius: 7px; transition: transform .18s; }
.chev:hover { color: var(--text); background: var(--glass-2); }
.chev.open { transform: rotate(90deg); }
.chev.none { visibility: hidden; }
.tile-ico { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--glass-2); border: 1px solid var(--glass-border); color: var(--text); }
.row.selected .tile-ico { background: var(--ink); color: var(--ink-fg); border-color: transparent; }
.tile-ico.root { background: var(--sunset); color: #fff; border: 0; }
.thumb { width: 32px; height: 32px; border-radius: 11px; object-fit: cover; flex: none; background: var(--glass-2); box-shadow: 0 0 0 1px var(--glass-border); }
.row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: 14px; }
.row .count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--glass-2); border: 1px solid var(--glass-border); padding: 0 8px; border-radius: 999px; line-height: 20px; }
.selbar { margin: 0 12px 12px; padding: 12px; border-radius: 22px; background: var(--glass-2); border: 1px solid var(--glass-border); animation: rise .2s ease-out; }
.selbar-name { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; font-size: 12.5px; font-weight: 650; min-width: 0; color: var(--muted); }
.selbar-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selbar-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.selbar-actions .btn { flex: 1 1 calc(33% - 6px); min-width: 0; padding: 0 8px; }
.selbar-actions .btn[hidden] + .btn, .selbar-actions #shareBtn { flex-basis: calc(50% - 6px); }
.selbar-actions #shareBtn { flex-grow: 1; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 14px; }

/* ---------- home dashboard ---------- */
.home { position: relative; flex: 1; min-height: 0; overflow: auto; border-radius: 30px; padding: 30px clamp(18px, 4vw, 52px) 120px; }
.home > * { position: relative; z-index: 1; }
.home .bigword { z-index: 0; }
.hello { margin: 16px 0 6px; font: 300 clamp(36px, 5vw, 60px)/1.02 var(--display); letter-spacing: -.05em; }
.hello b { font-weight: 750; }
.hello em, .login h1 em { font: italic 400 1.08em/1 var(--serif); letter-spacing: -.02em; background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.sentence { margin: 0 0 26px; font: 400 clamp(19px, 2.2vw, 25px)/1.35 var(--display); letter-spacing: -.03em; color: var(--muted); max-width: 640px; }
.sentence b { color: var(--text); font-weight: 750; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; max-width: 900px; }
.stat { padding: 16px 16px 14px; border-radius: 24px; animation: rise .4s ease-out backwards; }
.stat .tile-ico { margin-bottom: 14px; color: #fff; border: 0; background: var(--c); box-shadow: 0 10px 22px -10px var(--c); }
.stat b { display: block; font: 750 32px/1 var(--display); letter-spacing: -.04em; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 4px 12px; max-width: 900px; }
.sec-head h3 { margin: 0; font: 700 13px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.list { border-radius: 28px; padding: 6px; max-width: 900px; margin-bottom: 30px; }
.li { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; border: 0; border-radius: 22px; background: none; text-align: left; cursor: pointer; transition: background .15s; animation: rise .4s ease-out backwards; }
.li + .li { box-shadow: 0 -1px 0 var(--line); }
.li:hover { background: var(--glass-2); box-shadow: none; }
.li:hover + .li { box-shadow: none; }
.li-tile { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff; font: 800 15px var(--display);
  background: var(--c); box-shadow: 0 10px 24px -10px var(--c), inset 0 1px 0 rgb(255 255 255 / .35); }
.li-body { flex: 1; min-width: 0; }
.li-body b { display: block; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-body span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { flex: none; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-border); color: var(--muted); white-space: nowrap; }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; max-width: 900px; }
.pic { position: relative; border-radius: 26px; padding: 8px 8px 12px; border: 1px solid var(--glass-border); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; animation: rise .45s ease-out backwards; }
.pic:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-lg); }
.pic img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 19px; display: block; background: var(--glass-2); }
.pic b { display: block; margin: 10px 6px 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pic small { display: block; margin: 0 6px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pic .pill { position: absolute; top: 16px; right: 16px; background: rgb(20 13 26 / .62); color: #fff; border-color: rgb(255 255 255 / .2); backdrop-filter: blur(10px); }
.starter { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 900px; margin-bottom: 28px; }
.start-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px; border-radius: 28px; text-align: left; cursor: pointer; color: inherit; font: inherit; transition: transform .2s; }
.start-card:hover { transform: translateY(-3px); }
.start-card b { font: 700 20px/1.15 var(--display); letter-spacing: -.03em; }
.start-card span { color: var(--muted); }
.start-card.hot { background: var(--sunset); color: #fff; border: 0; box-shadow: 0 30px 60px -26px rgb(255 95 126 / .85); }
.start-card.hot span { color: rgb(255 255 255 / .85); }
.start-card .tile-ico { width: 46px; height: 46px; border-radius: 16px; }
.start-card.hot .tile-ico { background: rgb(255 255 255 / .22); border-color: rgb(255 255 255 / .35); color: #fff; }
.steps { display: flex; flex-wrap: wrap; gap: 10px; max-width: 900px; }
.step { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; font-weight: 650; }
.step i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 800 13px var(--display); color: #fff; background: var(--c); box-shadow: 0 0 14px -2px var(--c); }

.bigword { position: absolute; left: 50%; bottom: -0.2em; transform: translateX(-50%); pointer-events: none; user-select: none; white-space: nowrap;
  font: 800 clamp(120px, 22vw, 360px)/1 var(--display); letter-spacing: -.07em; color: rgb(255 255 255 / .34); }
:root[data-theme="dark"] .bigword { color: rgb(255 255 255 / .035); }

/* ---------- viewer ---------- */
.viewer { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.v-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 2px 6px 14px; }
.v-title { min-width: 0; }
.crumbs { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 3px 12px 3px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--muted);
  background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.crumbs .crumb-home { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--ink); color: var(--ink-fg); border-radius: 999px; padding: 3px 10px 3px 7px; font: inherit; font-weight: 700; cursor: pointer; }
.crumbs svg { opacity: .55; }
.v-title h2 { margin: 10px 0 0; font: 700 clamp(24px, 2.6vw, 34px)/1.05 var(--display); letter-spacing: -.045em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.canvas-area { position: relative; flex: 1; min-height: 0; display: flex; }
.canvas-wrap { flex: 1; min-height: 0; display: flex; overflow: auto; padding: 26px 26px 96px; border-radius: 30px;
  background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow);
  background-image: radial-gradient(color-mix(in srgb, var(--text) 13%, transparent) 1px, transparent 1.4px); background-size: 22px 22px; }
.stage { position: relative; flex: none; margin: auto; line-height: 0; touch-action: pan-x pan-y pinch-zoom; }
.stage img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; border-radius: 18px; box-shadow: 0 34px 70px -30px rgb(40 10 50 / .6), 0 0 0 1px rgb(255 255 255 / .35); }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stage.drawing svg { cursor: crosshair; touch-action: none; }
.stage.drawing .shape { pointer-events: none; }
.shape { fill: var(--c); fill-opacity: .2; stroke: var(--c); stroke-width: 2.2; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill-opacity .2s; filter: drop-shadow(0 0 4px var(--c)); }
.shape:hover { fill-opacity: .32; }
.shape.sel { fill-opacity: .34; stroke-width: 3; filter: drop-shadow(0 0 10px var(--c)) drop-shadow(0 0 2px var(--c)); stroke-dasharray: none; }
.draft { fill: rgb(255 255 255 / .18); stroke: #fff; stroke-width: 2; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgb(255 95 126 / .9)); animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -14; } }
.pin { position: absolute; transform: translate(-34%, -34%); min-width: 26px; height: 26px; padding: 0 8px; line-height: 22px; text-align: center; border-radius: 13px; font: 800 12.5px var(--display);
  color: #fff; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent), 0 6px 14px rgb(0 0 0 / .3); pointer-events: none; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.pin.sel { transform: translate(-34%, -34%) scale(1.28); }

.dock { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px;
  background: var(--dock); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 24px 50px -16px rgb(0 0 0 / .6), inset 0 1px 0 rgb(255 255 255 / .08); z-index: 5; }
.dock .tool { display: inline-flex; align-items: center; gap: 8px; height: 44px; min-width: 44px; justify-content: center; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--dock-fg); font-weight: 700; font-size: 13.5px; cursor: pointer; transition: background .2s, color .2s, padding .2s; }
.dock .tool:hover { color: #fff; background: rgb(255 255 255 / .08); }
.dock .tool span { display: none; }
.dock .tool.active { background: var(--dock-active); color: var(--dock-active-fg); padding: 0 16px 0 13px; }
.dock .tool.active span { display: inline; }
.dock .zoom-label span { display: inline; font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 38px; }
.dock-sep { width: 1px; height: 22px; background: rgb(255 255 255 / .14); margin: 0 4px; }
.tool-hint { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 9px 16px; border-radius: 999px; font-weight: 650; font-size: 13px;
  color: #fff; background: var(--sunset); box-shadow: 0 16px 34px -14px rgb(255 95 126 / .9); pointer-events: none; animation: rise .22s ease-out; white-space: nowrap; z-index: 5; }
.tool-hint kbd { font: 700 11px var(--sans); padding: 1px 6px; border-radius: 6px; background: rgb(255 255 255 / .25); }

/* ---------- regions panel ---------- */
.panel { flex: none; width: 100%; max-height: 46%; overflow: auto; border-radius: 30px; padding: 20px 18px 26px; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 14px; }
.p-head h3 { margin: 0; font: 700 22px/1 var(--display); letter-spacing: -.04em; }
.p-head h3 b { background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.region-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 6px; border: 1px solid var(--glass-border); border-radius: 999px; background: var(--glass-2); font-weight: 650; font-size: 13px; cursor: pointer; transition: all .18s; }
.chip:hover { background: var(--glass-3); }
.chip i { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font: 800 11px/24px var(--display); text-align: center; font-style: normal; box-shadow: 0 0 10px -1px var(--c); }
.chip .n { font-size: 11px; color: var(--muted); font-weight: 700; }
.chip.sel { background: var(--ink); color: var(--ink-fg); border-color: transparent; box-shadow: 0 12px 24px -12px rgb(29 19 38 / .7); }
.chip.sel .n { color: inherit; opacity: .7; }
.hint-card { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1.5px dashed var(--glass-border); border-radius: 24px; color: var(--muted); background: var(--glass); }
.hint-card b { color: var(--text); display: block; }
.region-card { border-radius: 26px; padding: 14px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.rc-head { display: flex; align-items: center; gap: 10px; }
.rc-tile { width: 44px; height: 44px; flex: none; border-radius: 15px; background: var(--c); box-shadow: 0 0 22px -4px var(--c), inset 0 1px 0 rgb(255 255 255 / .4); display: grid; place-items: center; color: #fff; font: 800 16px var(--display); }
.rc-label { flex: 1; min-width: 0; font: 700 19px var(--display); letter-spacing: -.035em; border-color: transparent; background: transparent; padding: 6px 10px; }
.rc-label:hover { background: var(--glass); }
.presets { display: flex; align-items: center; gap: 6px; margin: 14px 2px 4px; flex-wrap: wrap; }
.presets small { font-size: 12px; font-weight: 650; color: var(--muted); margin-right: 4px; }
.dot { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--c); box-shadow: 0 0 10px -3px var(--c); transition: transform .15s; }
.dot:hover { transform: scale(1.15); }
.dot.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c), 0 0 16px var(--c); }
.dot.custom { background: conic-gradient(#ff5f7e, #ffb347, #ffe66d, #4ade80, #22d3ee, #6366f1, #c026d3, #ff5f7e); overflow: hidden; }
.dot.custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; width: 36px; height: 36px; padding: 0; border: 0; }
.note { margin-top: 12px; padding: 12px 12px 8px; border-radius: 22px; background: var(--glass-3); border: 1px solid var(--glass-border); transition: box-shadow .18s; }
:root[data-theme="dark"] .note { background: rgb(255 255 255 / .06); }
.note:focus-within { box-shadow: 0 0 0 4px var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.note textarea { display: block; width: 100%; min-height: 70px; max-height: 420px; resize: none; border: 0; background: transparent !important; padding: 2px 4px; line-height: 1.6; box-shadow: none !important; font-size: 14.5px; }
.note-foot { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.note-foot .status { margin-left: auto; margin-right: 6px; display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 12px; font-weight: 650; }
.atts { list-style: none; margin: 10px 0 2px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.atts > li { min-width: 0; }
.att { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 16px; }
.ext { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; font: 800 9.5px var(--sans); letter-spacing: .04em; color: #fff; background: var(--c, #6b7280); }
.att > a:not(.btn) { flex: 1; min-width: 0; text-decoration: none; font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att > a:not(.btn):hover { text-decoration: underline; }
.file-btn { cursor: pointer; }
.file-btn input { display: none; }
.add-note { width: 100%; margin-top: 12px; }

/* ---------- capture & media ---------- */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.q { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 66px; padding: 8px 4px; border-radius: 20px;
  border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font: 700 12px var(--sans); cursor: pointer; transition: transform .1s, background .15s; }
.q:hover { background: var(--glass-3); }
.q:active { transform: scale(.95); }
.q .ico { color: var(--accent); }
.q.ink { background: var(--ink); color: var(--ink-fg); border-color: transparent; box-shadow: 0 12px 28px -12px rgb(29 19 38 / .7); }
.q.ink .ico { color: inherit; }
.note-tools { display: flex; gap: 0; }
.progress { position: relative; height: 30px; margin-top: 10px; border-radius: 999px; overflow: hidden; background: var(--glass); border: 1px solid var(--glass-border); }
.progress span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--sunset); transition: width .25s; }
.progress em { position: relative; display: block; padding: 0 14px; line-height: 28px; font-style: normal; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; margin-top: 10px; }
.shot { position: relative; aspect-ratio: 1; border-radius: 15px; overflow: hidden; background: var(--glass); box-shadow: 0 0 0 1px var(--glass-border); }
.shot a, .shot img { display: block; width: 100%; height: 100%; }
.shot img { object-fit: cover; transition: transform .25s; }
.shot:hover img { transform: scale(1.06); }
.shot .x { position: absolute; top: 5px; right: 5px; width: 26px !important; min-height: 26px; height: 26px; color: #fff; background: rgb(20 13 26 / .55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .15s; }
.shot:hover .x, .shot:focus-within .x { opacity: 1; }
@media (hover: none) { .shot .x { opacity: 1; } }
.media-video { flex-direction: column; align-items: stretch; padding: 6px; }
.media-video video { display: block; width: 100%; max-height: 300px; border-radius: 12px; background: #000; }
.att-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; min-width: 0; }
.att-row > a:not(.btn) { flex: 1; min-width: 0; text-decoration: none; font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.play { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: var(--sunset); cursor: pointer;
  box-shadow: 0 8px 18px -8px rgb(255 95 126 / .9), inset 0 1px 0 rgb(255 255 255 / .35); transition: transform .1s; }
.play:active { transform: scale(.92); }
.p-main { flex: 1; min-width: 0; }
.p-name { display: block; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { position: relative; display: block; height: 22px; margin-top: 2px; cursor: pointer; background: color-mix(in srgb, var(--text) 20%, transparent);
  -webkit-mask: var(--wave) repeat-x left center / 90px 100%; mask: var(--wave) repeat-x left center / 90px 100%; }
.track .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--sunset); }
.time { flex: none; font: 700 12px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* rich text editor */
.rte { position: relative; }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .2s, opacity .15s, margin .2s; }
.rte.editing .rte-bar, .rte.pop-open .rte-bar { max-height: 90px; opacity: 1; margin-bottom: 8px; }
.rte-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.rte-btn:hover:not(:disabled) { background: var(--glass-2); color: var(--text); }
.rte-btn.on { background: var(--ink); color: var(--ink-fg); }
.rte-btn:disabled { opacity: .35; cursor: default; }
.rte-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.rte-body { min-height: 70px; max-height: 480px; overflow: auto; padding: 2px 4px; outline: none; line-height: 1.6; font-size: 14.5px; overflow-wrap: anywhere; }
.rte-body.empty::before { content: attr(data-placeholder); position: absolute; color: var(--faint); pointer-events: none; }
.rte-body > :first-child { margin-top: 0; }
.rte-body p { margin: 0 0 .55em; }
.rte-body > :last-child { margin-bottom: 0; }
.rte-body h2 { margin: .5em 0 .3em; font: 700 20px/1.25 var(--display); letter-spacing: -.03em; }
.rte-body h3 { margin: .5em 0 .25em; font: 700 16.5px/1.3 var(--display); letter-spacing: -.02em; }
.rte-body ul, .rte-body ol { margin: .3em 0 .55em; padding-left: 1.4em; }
.rte-body li { margin: .1em 0; }
.rte-body blockquote { margin: .4em 0 .6em; padding: 4px 12px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--glass); color: var(--muted); }
.rte-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; cursor: pointer; }
.rte-body code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 5px; border-radius: 6px; background: var(--glass-2); }
.rte-body pre { padding: 10px 12px; border-radius: 12px; background: var(--glass-2); white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; }
.rte.readonly .rte-body { min-height: 0; }
.rte-pop { position: absolute; z-index: 12; display: flex; align-items: center; gap: 4px; max-width: min(340px, 100%); padding: 5px 5px 5px 12px; border-radius: 14px;
  background: var(--ink); color: var(--ink-fg); box-shadow: var(--shadow-lg); font-size: 12.5px; font-weight: 650; animation: pop .14s ease-out; }
.rte-pop a { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.rte-pop a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rte-pop a:hover span { text-decoration: underline; }
.rte-pop button { flex: none; border: 0; border-radius: 9px; padding: 5px 10px; background: rgb(255 255 255 / .14); color: inherit; font: 700 12px var(--sans); cursor: pointer; }
:root[data-theme="dark"] .rte-pop button { background: rgb(0 0 0 / .08); }
.rte-pop button:hover { background: var(--accent); color: #fff; }
.form-stack { display: grid; gap: 14px; }
.form-stack label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.form-stack input, .form-stack select { width: 100%; height: 48px; font-size: 15.5px; }

/* transcripts */
.media-audio { flex-direction: column; align-items: stretch; }
.media-audio .att-row { margin-top: 0; }
.tx { margin: 8px 2px 2px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent); }
.tx-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tx-head .pill { padding: 1px 7px; font-size: 10.5px; }
.tx-head .btn { margin-left: auto; text-transform: none; letter-spacing: 0; min-height: 28px; color: var(--text); }
.tx .rte { margin-top: 6px; }
.tx .rte-body { min-height: 0; font: italic 400 17px/1.4 var(--serif); letter-spacing: 0; padding: 0; }
.tx .rte-body p { margin: 0 0 .35em; }
.tx-hint { font-size: 10.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--faint); }
.tx:focus-within .tx-hint { display: none; }
.tx.quiet { display: flex; align-items: center; gap: 8px; border-style: solid; background: var(--glass); border-color: var(--glass-border); color: var(--muted); font-size: 12.5px; font-weight: 650; }
.tx.quiet .btn { margin-left: auto; min-height: 28px; }
.tx.err { color: var(--danger); }
.tx.pending { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--accent);
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--accent) 14%, transparent) 50%, transparent 80%) 0 0 / 220% 100%, color-mix(in srgb, var(--accent) 6%, transparent);
  animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0, 0 0; } }
.tx-dots { display: inline-flex; gap: 3px; }
.tx-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: hop 1s ease-in-out infinite; }
.tx-dots i:nth-child(2) { animation-delay: .15s; } .tx-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.tx-btn { margin: 6px 0 0 2px; color: var(--accent); }
.rec-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* voice recorder sheet */
dialog.rec { width: min(380px, 92vw); padding: 26px 22px 22px; text-align: center; }
.rec-orb { position: relative; width: 160px; height: 160px; margin: 0 auto 4px; display: grid; place-items: center; }
.rec-ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgb(255 95 126 / .4), rgb(255 95 126 / 0) 68%);
  transform: scale(calc(.7 + var(--lvl, 0) * .7)); transition: transform .08s linear; }
.rec-ring::before, .rec-ring::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 2px solid rgb(255 95 126 / .55); animation: ripple 1.8s ease-out infinite; }
.rec-ring::after { animation-delay: -.9s; }
@keyframes ripple { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.rec .mascot-slot { position: relative; }
.rec-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blinkdot 1s steps(2) infinite; }
@keyframes blinkdot { 50% { opacity: .2; } }
dialog.rec h3 { margin: 12px 0 0; font-size: 22px; }
.rec-time { font: 700 40px/1.1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 54px; margin: 10px 0 20px; }
.wave i { width: 4px; height: 10%; border-radius: 4px; background: var(--sunset); background-size: 1px 54px; transition: height .1s; }
.rec-actions { display: flex; gap: 10px; justify-content: center; }

/* mobile "+" menu */
.fab-wrap { position: relative; }
.fab-menu { position: absolute; right: 0; bottom: 72px; min-width: 210px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 24px;
  background: var(--glass-3); border: 1px solid var(--glass-border); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
:root[data-theme="dark"] .fab-menu { background: rgb(28 20 34 / .95); }
.fab-menu button { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 0; border-radius: 18px; background: transparent; color: var(--text); font-weight: 700; text-align: left; cursor: pointer; }
.fab-menu button:hover { background: var(--glass-2); }
.fab-menu .ico { color: var(--accent); }

/* ---------- workspaces ---------- */
.ws-switch { position: relative; padding: 12px 12px 0; }
.ws-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 20px; border: 1px solid var(--glass-border);
  background: var(--glass-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.ws-btn:hover { background: var(--glass-3); }
.ws-btn > .ico { color: var(--muted); }
.ws-ava { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; font: 800 13px var(--display); background: var(--c); box-shadow: 0 8px 18px -10px var(--c); }
.ws-ava.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11.5px; }
.ws-ava.lg { width: 46px; height: 46px; border-radius: 15px; font-size: 16px; }
.ws-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ws-txt b { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-txt small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ws-menu { position: absolute; z-index: 40; left: 12px; right: 12px; top: calc(100% + 6px); padding: 6px; border-radius: 22px; border: 1px solid var(--glass-border);
  background: var(--glass-3); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); box-shadow: var(--shadow-lg); animation: pop .15s ease-out; }
:root[data-theme="dark"] .ws-menu { background: rgb(28 20 34 / .96); }
.ws-menu-head { padding: 6px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.ws-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.ws-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 15px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ws-item:hover, .ws-item.on { background: var(--glass-2); }
.ws-item > .ico { color: var(--accent); }
.ws-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.lock { display: inline-flex; color: var(--faint); }
.row.selected .lock { color: var(--accent); }
.btn:disabled { opacity: .4; }

/* sheets (workspace settings, sharing) */
dialog.sheet { width: min(640px, 94vw); max-height: min(88vh, 860px); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
dialog.sheet[open] { display: flex; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h3 { margin: 0; font: 700 22px/1.15 var(--display); letter-spacing: -.035em; }
.sheet-title small { color: var(--muted); font-weight: 600; font-size: 13px; }
dialog.sheet > div { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 22px; }
.sheet-body { display: grid; gap: 10px; }
.sheet-tabs { display: inline-flex; gap: 4px; margin: 4px 0 14px; padding: 5px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.sheet-tabs .tool { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 999px; font: 700 13.5px var(--sans); cursor: pointer; transition: background .15s, color .15s; }
.sheet-tabs .tool:hover { color: var(--text); }
.sheet-tabs .tool.active { background: var(--ink); color: var(--ink-fg); }
.ws-name-in { width: 100%; height: 46px; margin-bottom: 12px; font: 700 17px var(--display); }
.sheet-sub { margin: 14px 2px 2px; font: 700 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.people { display: grid; gap: 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; }
.person:hover { background: var(--glass); }
.person.pending { opacity: .85; }
.person-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-txt b { display: flex; align-items: center; gap: 6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-txt small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--glass-2); color: var(--muted); }
.ava-mini { width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font: 800 11.5px var(--display); color: #fff; background: var(--sunset); }
.ava-mini img { width: 100%; height: 100%; object-fit: cover; }
.ava-mini.mail { background: var(--glass-2); color: var(--muted); border: 1px dashed var(--glass-border); }
.seat { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.seat.paid { color: var(--accent); background: var(--accent-soft); }
.seat.free { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.role-select { height: 36px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass-2); color: var(--text); font: 650 13px var(--sans); cursor: pointer;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.role-select:disabled { opacity: .5; cursor: default; }
.grow-sel { flex: 1; min-width: 0; }
.spacer-34 { width: 34px; flex: none; }
.grant-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; background: var(--glass-2); color: var(--muted); }
.invite-row { display: flex; gap: 8px; align-items: center; }
.invite-row input { flex: 1; min-width: 0; height: 44px; }
.invite-row .btn { flex: none; }
.role-hint { display: grid; gap: 4px; padding: 10px 12px; border-radius: 16px; background: var(--glass); font-size: 12.5px; color: var(--muted); }
.role-hint b { color: var(--text); }
.invite-done { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; color: var(--ok); }
.invite-done b { display: block; color: var(--text); }
.invite-done small { color: var(--muted); }
.copy-box { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 6px 6px 12px; border-radius: 16px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.copy-box > .ico { color: var(--accent); }
.copy-box input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 6px 2px; font: 600 12.5px ui-monospace, Menlo, monospace; }
.role-key { margin-top: 12px; border-radius: 16px; background: var(--glass); padding: 4px 14px; }
.role-key summary { cursor: pointer; padding: 8px 0; font-weight: 700; font-size: 13.5px; }
.role-key ul { margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.role-key b { color: var(--text); margin-right: 6px; }
.plan-card { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px; border-radius: 20px; background: var(--sunset); color: #fff; }
.plan-name { font: 800 26px var(--display); letter-spacing: -.04em; }
.plan-card small { opacity: .9; font-weight: 600; }
.meter-row { padding: 10px 2px 4px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.meter-top span { color: var(--muted); font-weight: 600; }
.meter { height: 9px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-border); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--sunset); min-width: 4%; }
.danger-zone { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.danger-zone > div { flex: 1; } .danger-zone b { display: block; } .danger-zone small { color: var(--muted); }
.pad { padding: 14px 4px; } .pad0 { margin: 0; }
.switch-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--glass-2); border: 1px solid var(--glass-border); cursor: pointer; }
.switch-row.off { opacity: .6; cursor: default; }
.switch-row b { display: block; } .switch-row small { color: var(--muted); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: inherit; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--glass-3); border: 1px solid var(--glass-border); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .25); transition: transform .2s; }
.switch input:checked + i { background: var(--sunset); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.login-invite { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; padding: 12px; border-radius: 18px; text-align: left; background: var(--glass-2); border: 1px solid var(--glass-border); }
.login-invite b { display: block; font-size: 14px; } .login-invite small { color: var(--muted); }

/* authorship & read-only */
.byline { display: flex; align-items: center; gap: 7px; margin: -2px 0 8px; font-size: 12px; color: var(--muted); }
.byline .ava-mini { width: 20px; height: 20px; font-size: 8.5px; }
.byline b { color: var(--text); font-weight: 700; }
.note.ro { padding-bottom: 12px; }
.rc-label.ro { margin: 0; padding: 6px 10px; }
.ro-pill { display: inline-flex; align-items: center; gap: 5px; }
body.read-only .dock .tool[data-tool="rect"], body.read-only .dock .tool[data-tool="ellipse"], body.read-only .dock .dock-sep { display: none; }
@media (max-width: 600px) {
  .invite-row { flex-wrap: wrap; } .invite-row input, .invite-row .grow-sel { flex-basis: 100%; }
  .person { flex-wrap: wrap; } .person-txt { flex-basis: calc(100% - 50px); }
  dialog.sheet { width: 100vw; max-height: 92vh; border-radius: 28px 28px 0 0; margin-bottom: 0; }
}

/* ---------- mobile bottom nav ---------- */
.bottom-nav { display: none; }

/* ---------- dialogs & toast ---------- */
dialog { border: 1px solid var(--glass-border); border-radius: 30px; color: var(--text); padding: 24px; width: min(450px, 92vw); box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
  background: var(--glass-3); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); }
:root[data-theme="dark"] dialog { background: rgb(28 20 34 / .94); }
dialog::backdrop { background: rgb(20 8 24 / .35); backdrop-filter: blur(6px); }
dialog h3 { margin: 0 0 16px; font: 700 24px var(--display); letter-spacing: -.04em; }
dialog input[type=text] { width: 100%; height: 50px; font-size: 16px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.pick { max-height: 42vh; overflow: auto; border-radius: 20px; padding: 6px; background: var(--glass); border: 1px solid var(--glass-border); }
.pick label { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 14px; cursor: pointer; font-weight: 650; }
.pick label:hover { background: var(--glass-2); }
.pick input { accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; max-width: 90vw; padding: 12px 20px; border-radius: 999px; font-weight: 650; font-size: 13.5px;
  color: var(--ink-fg); background: var(--ink); box-shadow: var(--shadow-lg); animation: rise .25s ease-out; }
.scrim { display: none; }

/* ---------- sign-in ---------- */
.login { position: relative; flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 20px 24px 60px; }
.login-grid { position: relative; z-index: 1; width: min(1060px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.login h1 { margin: 22px 0 18px; font: 700 clamp(44px, 6.4vw, 84px)/.98 var(--display); letter-spacing: -.055em; }
.login h1 em { display: inline-block; margin-top: .06em; }
.lede { margin: 0; max-width: 470px; color: var(--muted); font-size: 17.5px; line-height: 1.55; font-weight: 500; }
.login-card { border-radius: 34px; padding: 22px 18px 18px; animation: rise .5s ease-out; }
.login-hero { display: grid; place-items: center; height: 150px; margin-bottom: 8px; border-radius: 26px;
  background: radial-gradient(60% 70% at 50% 60%, rgb(255 255 255 / .55), transparent 70%); }
:root[data-theme="dark"] .login-hero { background: radial-gradient(60% 70% at 50% 60%, rgb(255 138 76 / .18), transparent 70%); }
.feature-list { list-style: none; margin: 0 0 18px; padding: 6px; border-radius: 24px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.feature-list li { display: flex; align-items: center; gap: 12px; padding: 10px; }
.feature-list li + li { border-top: 1px solid var(--line); }
.feature-list .tile { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--glass-3); border: 1px solid var(--glass-border); }
.feature-list div { flex: 1; min-width: 0; }
.feature-list b { display: block; font-size: 14.5px; }
.feature-list small { color: var(--muted); font-size: 12.5px; }
.gwrap { display: flex; justify-content: center; }
.gbtn { display: flex; justify-content: center; min-height: 44px; min-width: 260px; border-radius: 999px; }
.gbtn:empty { background: var(--ink); opacity: .12; }
.login-msg { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; font-size: 13px; font-weight: 650; text-align: center; }
.fine { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.login .bigword { position: fixed; }
body.signed-out .layout, body.signed-out .search, body.signed-out .user, body.signed-out #menuBtn, body.signed-out .bottom-nav { display: none !important; }
body.signed-out .brand { visibility: hidden; }

@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translate(var(--tx, 0), 12px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
.toast, .tool-hint { --tx: -50%; }

/* ---------- responsive ---------- */
@media (min-width: 1100px) {
  .main { display: grid; grid-template-columns: 1fr var(--panel); }
  .home { grid-column: 1 / -1; }
  .viewer { grid-column: 1; }
  .panel { grid-column: 2; max-height: none; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .only-narrow { display: inline-flex; }
  .layout { grid-template-columns: 1fr; padding: 0 10px 10px; }
  .sidebar { position: fixed; z-index: 30; top: 10px; bottom: 10px; left: 10px; width: min(86vw, 350px); padding-top: env(safe-area-inset-top);
    transform: translateX(-110%); transition: transform .3s cubic-bezier(.2, .9, .2, 1); background: var(--glass-3); }
  :root[data-theme="dark"] .sidebar { background: rgb(22 16 28 / .92); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 28; background: rgb(20 8 24 / .35); backdrop-filter: blur(4px); }
  .login-grid { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .lede { margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* phones/tablets: one natural scrolling column, controls pinned to the screen bottom */
  body:not(.signed-out) { height: auto; min-height: 100%; }
  .layout, .main, .viewer, .canvas-area { display: block; }
  .home { overflow: visible; padding: 18px 8px 130px; border-radius: 0; }
  .canvas-wrap { display: flex; overflow: auto; padding: 14px; border-radius: 24px; min-height: 200px; }
  .panel { max-height: none; margin-top: 12px; margin-bottom: 96px; padding: 18px 14px 22px; }
  .dock { position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .tool-hint { position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .v-head { padding: 0 4px 10px; }
  body.at-home .bottom-nav { display: flex; position: fixed; z-index: 26; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); align-items: center; gap: 10px; }
  .bn-pill { display: flex; gap: 4px; padding: 6px; border-radius: 999px; background: var(--dock); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 24px 50px -16px rgb(0 0 0 / .6); }
  .bn { display: inline-flex; align-items: center; gap: 7px; height: 46px; min-width: 46px; justify-content: center; padding: 0 13px; border: 0; border-radius: 999px; background: transparent; color: var(--dock-fg); font-weight: 700; font-size: 13.5px; cursor: pointer; }
  .bn span { display: none; }
  .bn.active { background: var(--dock-active); color: var(--dock-active-fg); padding: 0 16px 0 13px; }
  .bn.active span { display: inline; }
  .fab { width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: var(--sunset); box-shadow: 0 18px 34px -12px rgb(255 95 126 / .9), inset 0 1px 0 rgb(255 255 255 / .4); cursor: pointer; }
}
@media (max-width: 700px) {
  .topbar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .brand { flex: 1; }
  .wordmark { font-size: 21px; }
  .search { order: 5; flex: 1 0 100%; max-width: none; margin: 0; }
  .user-text, .s-kbd { display: none; }
  .user { padding: 3px; gap: 4px; }
  .dock .tool.active span { display: none; }
  .dock .tool.active { padding: 0 13px; }
  .li .pill { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.pad0 .ico, .muted .ico { display: inline-block; vertical-align: -2px; }

/* ---------- activity ---------- */
.pill-btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700; }
.pill-btn:hover { background: var(--glass-3); color: var(--text); }
.pill-btn.ink { background: var(--ink); color: var(--ink-fg); border-color: transparent; }
.pill-btn.ink:hover { filter: brightness(1.15); color: var(--ink-fg); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: 700 13px var(--sans); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.act-top { display: flex; justify-content: space-between; gap: 10px; max-width: 900px; }
.act-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; max-width: 900px; margin: 8px 0 16px; }
.act-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.act-filters .chip { padding: 0 14px; }
.act-list { padding: 4px 6px; }
.act-list.in-sheet { display: grid; }
.act { display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px; border-radius: 18px; animation: rise .35s ease-out backwards; }
.act + .act { box-shadow: 0 -1px 0 var(--line); }
.act.go:hover { background: var(--glass-2); box-shadow: none; }
.act.go:hover + .act { box-shadow: none; }
.act-ava { position: relative; flex: none; }
.act-kind { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); box-shadow: 0 0 0 2px var(--bg); }
.ava-mini.sys { background: var(--glass-3); color: var(--accent); border: 1px solid var(--glass-border); }
.act-body { flex: 1; min-width: 0; }
.act-body p { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.act-body p b { font-weight: 700; }
.act-who { font-weight: 800 !important; }
.act-body small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.act-day { margin: 14px 10px 4px; font: 700 11.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.act-day:first-child { margin-top: 6px; }
.act-day + .act { box-shadow: none; }
.act-quote { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 4px 12px 12px 4px; background: var(--glass-2); color: var(--muted); font-size: 13.5px; white-space: pre-wrap; max-height: 9.5em; overflow: hidden; }
.act-diff { margin-top: 6px; }
.act-diff summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 12.5px; width: fit-content; }
.diff { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--glass-2); font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff ins { text-decoration: none; background: color-mix(in srgb, #34d399 28%, transparent); border-radius: 4px; padding: 0 2px; }
.diff del { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border-radius: 4px; padding: 0 2px; }
.more-btn { display: block; margin: 14px 0 0; }
.warn-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 20px; max-width: 900px; margin: 10px 0 14px;
  background: color-mix(in srgb, #facc15 16%, var(--glass)); border: 1px solid color-mix(in srgb, #f59e0b 45%, transparent); }
.warn-card > .ico { color: #d97706; flex: none; margin-top: 2px; }
.warn-card b { display: block; }
.warn-card small { color: var(--muted); }
.hint-card.soft { border-style: solid; }

/* ---------- public links ---------- */
.link-card { padding: 10px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); }
.link-card.expired { opacity: .6; }
.link-card .copy-box { margin-top: 0; }
.link-name { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.link-name .ico { color: var(--accent); }
.link-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 6px; padding-left: 4px; }
.link-meta small { flex: 1; min-width: 160px; color: var(--muted); font-size: 12px; }
.link-meta .btn { text-decoration: none; }

/* ---------- billing ---------- */
.billing-box { display: grid; gap: 10px; margin-top: 6px; padding: 16px; border-radius: 22px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.billing-box .sheet-sub { margin-top: 0; }
.billing-box .sheet-tabs { margin: 0; width: fit-content; }
.seat-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seat-row > span { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.seat-row small { color: var(--muted); font-size: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.seat-in { width: 64px; height: 36px; text-align: center; font-weight: 800; -moz-appearance: textfield; }
.seat-in::-webkit-inner-spin-button, .seat-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.price-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 4px; }
.price-total b { font: 800 30px/1 var(--display); letter-spacing: -.04em; }
.price-total span { color: var(--muted); font-weight: 700; }
.price-total small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.billing-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.billing-actions small { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
@media (max-width: 560px) {
  .act-top .btn, .act-bar .role-select { font-size: 13px; }
  .act-bar { flex-direction: column; align-items: stretch; }
  .act { gap: 10px; padding: 10px 4px; }
  .link-meta small { flex-basis: 100%; }
}

/* ---------- sharing in the folder pane ---------- */
.row-share { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.row:hover .row-share, .row.selected .row-share, .row-share:focus-visible { opacity: 1; }
.row-share:hover { background: var(--glass-3); color: var(--accent); }
@media (pointer: coarse) { .row-share { opacity: .75; } }
.share-badges { display: inline-flex; gap: 3px; flex: none; }
.sb { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px; border-radius: 999px; font: 800 10.5px var(--sans); color: #fff; }
.sb.edit { background: #f59e0b; }
.sb.view { background: #6366f1; }
.sb.link { background: #0ea5b7; padding: 0 5px; }
.sb.people { background: var(--glass-3); color: var(--muted); border: 1px solid var(--glass-border); }
.sb-pill { display: inline-flex; align-items: center; gap: 5px; }
.sb-pill.edit { color: #b45309; border-color: color-mix(in srgb, #f59e0b 45%, transparent); background: color-mix(in srgb, #f59e0b 14%, var(--glass-2)); }
.sb-pill.view { color: #4f46e5; border-color: color-mix(in srgb, #6366f1 40%, transparent); background: color-mix(in srgb, #6366f1 12%, var(--glass-2)); }
.sb-pill.link { color: #0e7490; border-color: color-mix(in srgb, #0ea5b7 40%, transparent); background: color-mix(in srgb, #0ea5b7 12%, var(--glass-2)); }
:root[data-theme="dark"] .sb-pill.edit { color: #fbbf24; }
:root[data-theme="dark"] .sb-pill.view { color: #a5b4fc; }
:root[data-theme="dark"] .sb-pill.link { color: #67e8f9; }

/* ---------- backups ---------- */
.backup-card { display: grid; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); }
.backup-card.bad { opacity: .6; }
.bk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bk-top .pill { display: inline-flex; align-items: center; gap: 6px; }
.dot-c { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.bk-note { color: var(--text); font-size: 12.5px; }
.bk-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.bk-actions code { flex: 1; min-width: 0; font: 600 11.5px ui-monospace, Menlo, monospace; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }

/* ---------- backups: off-site state ---------- */
.bk-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill.ok { display: inline-flex; align-items: center; gap: 4px; color: #047857; background: color-mix(in srgb, #10b981 14%, var(--glass-2)); border-color: color-mix(in srgb, #10b981 40%, transparent); }
.pill.bad { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--glass-2)); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
:root[data-theme="dark"] .pill.ok { color: #6ee7b7; }

/* ---------- trial ---------- */
.trial-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 900px; margin: 10px 0 14px; padding: 14px 16px; border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, #ffa25e 18%, var(--glass)), color-mix(in srgb, #a855f7 14%, var(--glass))); border: 1px solid var(--glass-border); }
.trial-card > .ico { color: var(--accent); flex: none; }
.trial-card > div { flex: 1; min-width: 200px; }
.trial-card b { display: block; }
.trial-card small { color: var(--muted); }
.trial-price { font-size: 12.5px; font-weight: 700; opacity: .85; margin-top: 4px; }
.start-card:disabled { opacity: .55; cursor: default; transform: none !important; }
.fine-line { display: flex; align-items: center; gap: 6px; max-width: 900px; margin: 6px 0 24px; font-size: 13px; }
.code-in { letter-spacing: .35em; font: 800 24px var(--display); text-align: center; height: 52px; }

.move-row { padding: 12px 16px; border-radius: 22px; background: var(--glass-2); border: 1px solid var(--glass-border); margin-top: 8px; }
.move-sum { display: grid; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.move-sum small, .change-result small { color: var(--muted); }
.move-sum .warn, .change-result .warn-card { color: inherit; }
.change-result { display: grid; gap: 6px; }
.field { display: grid; gap: 6px; }


/* ---------- phones and touch screens ---------- */
.stage { touch-action: pan-x pan-y; }                      /* pinch is handled by the app (touch.js), not the browser */
.row { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.edit-box { position: absolute; border: 2px dashed #fff; border-radius: 4px; cursor: move; touch-action: none; box-shadow: 0 0 0 1px var(--c); }
.edit-box.active { border-style: solid; }
.edit-handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; touch-action: none; cursor: nwse-resize; }
.edit-handle.ne, .edit-handle.sw { cursor: nesw-resize; }
.edit-handle i { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid var(--c); box-shadow: 0 1px 6px rgb(0 0 0 / .45); }
.loupe { position: fixed; z-index: 80; width: 112px; height: 112px; border-radius: 50%; border: 3px solid #fff; background-color: #222; background-repeat: no-repeat; pointer-events: none; opacity: 0;
  box-shadow: 0 10px 30px rgb(0 0 0 / .5); transition: opacity .1s; }
.loupe.on { opacity: 1; }
.loupe-cross { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background:
  linear-gradient(#ff5f7e, #ff5f7e) center / 2px 100% no-repeat, linear-gradient(#ff5f7e, #ff5f7e) center / 100% 2px no-repeat; }
.action-list { display: grid; gap: 6px; padding-bottom: 6px; }
.action-row { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; border: 0; border-radius: 18px; background: var(--glass-2); color: var(--text); font: 700 15px var(--sans); cursor: pointer; text-align: left; }
.action-row.danger { color: var(--danger); }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--sunset); color: #fff; font: 700 12.5px var(--sans); cursor: pointer; }
.btn.big { height: 60px; font-size: 17px; width: 100%; }
.ptr { position: fixed; z-index: 70; left: 50%; top: 0; width: 38px; height: 38px; margin-left: -19px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-3);
  box-shadow: var(--shadow-lg); transform: translate(-50%, -60px); pointer-events: none; transition: transform .2s; }
.ptr.ready { background: var(--sunset); color: #fff; }
.ptr.spin svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

@media (pointer: coarse) {
  html { overscroll-behavior-y: contain; }
  input, select, textarea, [contenteditable] { font-size: 16px !important; }       /* iOS zooms into smaller fields */
  .btn.icon, .btn.icon.sm, .tool, .bn, .chev, .row-share, .btn.sm { min-width: 44px; min-height: 44px; }
  .tree .row { min-height: 46px; }
  .chev { display: grid; place-items: center; }
  .row-share { opacity: .85; width: 44px; height: 44px; }
  .pill-btn, .ws-item, .pick label, .seg .tool { min-height: 44px; }
  .rec-actions .btn { min-height: 56px; font-size: 16px; }
  .dock { gap: 6px; }
  .pin { min-width: 30px; height: 30px; line-height: 26px; }
}

@media (max-width: 600px) { dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; } }
