/* DocFila Forms — landing, dashboard and builder. */

/* ── App palette ─────────────────────────────
   The Forms app (home + builder) is a clean, cool workspace: white canvas,
   one confident blue, bold sans headings. Published forms keep their own
   theme (--f-* vars) and are not affected. */
:root {
  --paper: #F7F9FC; --paper-2: #EEF2F8; --surface: #FFFFFF; --surface-2: #F8FAFD;
  --ink: #0E1726; --ink-2: #334155; --muted: #64748B; --faint: #94A3B8;
  --line: rgba(15, 23, 42, 0.08); --line-2: rgba(15, 23, 42, 0.14);
  --fill: rgba(15, 23, 42, 0.035); --fill-2: rgba(15, 23, 42, 0.06);
  --accent: #1A6AF4; --accent-ink: #1456CC; --accent-soft: rgba(26, 106, 244, 0.09); --accent-line: rgba(26, 106, 244, 0.32);
  --on-accent: #FFFFFF; --signature: linear-gradient(135deg, #2F7BFF 0%, #1A6AF4 55%, #1457D6 100%);
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-2: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 28px -12px rgba(15, 23, 42, .16);
  --shadow-3: 0 24px 64px -20px rgba(15, 23, 42, .28), 0 8px 22px -10px rgba(15, 23, 42, .14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B0F17; --paper-2: #101622; --surface: #121927; --surface-2: #172031;
    --ink: #E8EDF6; --ink-2: #BAC4D5; --muted: #8592A8; --faint: #5B677C;
    --line: rgba(232, 237, 246, 0.08); --line-2: rgba(232, 237, 246, 0.15);
    --fill: rgba(232, 237, 246, 0.04); --fill-2: rgba(232, 237, 246, 0.07);
    --accent: #5B9BFF; --accent-ink: #8DB8FF; --accent-soft: rgba(91, 155, 255, 0.14); --accent-line: rgba(91, 155, 255, 0.4); --on-accent: #08101F;
  }
}
:root[data-theme="dark"] {
  --paper: #0B0F17; --paper-2: #101622; --surface: #121927; --surface-2: #172031;
  --ink: #E8EDF6; --ink-2: #BAC4D5; --muted: #8592A8; --faint: #5B677C;
  --line: rgba(232, 237, 246, 0.08); --line-2: rgba(232, 237, 246, 0.15);
  --fill: rgba(232, 237, 246, 0.04); --fill-2: rgba(232, 237, 246, 0.07);
  --accent: #5B9BFF; --accent-ink: #8DB8FF; --accent-soft: rgba(91, 155, 255, 0.14); --accent-line: rgba(91, 155, 255, 0.4); --on-accent: #08101F;
}
body { background: var(--paper); }
.h1, .h2 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.028em; }
.h2 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.15; }
.serif-em, .display em { font-family: inherit; font-style: normal; font-weight: inherit; letter-spacing: inherit; }
.btn { border-radius: 10px; }
.btn-primary { --bg: var(--accent); --fg: var(--on-accent); --bd: var(--accent); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -8px var(--accent-line); }
.btn-primary:hover, :root[data-theme="dark"] .btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary:hover { background: var(--accent-ink); } }
.brand-mark { border-radius: 9px; background: var(--signature); box-shadow: 0 4px 12px -4px rgba(26,106,244,.55), inset 0 1px 0 rgba(255,255,255,.25); }
.brand-product { font-family: var(--sans); font-style: normal; font-weight: 500; font-size: 15.5px; color: var(--muted); margin-left: 0; }

/* ── Home ──────────────────────────────────── */
.hm { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.svg { display: inline-grid; place-items: center; }
.svg svg { width: 100%; height: 100%; }

.hm-bar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px) minmax(0, 1fr); align-items: center; gap: 20px; height: 84px; padding: 0 clamp(16px, 3vw, 36px); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); border-bottom: 1px solid var(--line); }
.hm-bar-l { display: flex; align-items: center; gap: 18px; min-width: 0; }
.hm-bar-r { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.hm-icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; flex: none; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.hm-icon-btn:hover { background: var(--fill-2); color: var(--ink); }
.hm-icon-btn.sm { width: 34px; height: 34px; }
.hm-brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.hm-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--signature); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px -6px rgba(26,106,244,.6), inset 0 1px 0 rgba(255,255,255,.28); }
.hm-logo .svg { width: 59%; height: 59%; }
.hm-word { font-size: 26px; letter-spacing: -0.03em; white-space: nowrap; line-height: 1; }
.hm-word b { font-weight: 700; color: var(--ink); }
.hm-word span { font-weight: 500; color: #4E6A93; }
:root[data-theme="dark"] .hm-word span { color: #8FA7CC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hm-word span { color: #8FA7CC; } }

.hm-search { position: relative; display: flex; align-items: center; height: 54px; border-radius: 999px; background: #EEF2F8; border: 1px solid transparent; padding: 0 12px 0 20px; gap: 14px; transition: background var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); cursor: text; }
:root[data-theme="dark"] .hm-search { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hm-search { background: var(--surface-2); } }
.hm-search:focus-within { background: var(--surface); border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.hm-search-ico { width: 22px; height: 22px; color: var(--muted); flex: none; }
.hm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 16.5px; color: var(--ink); }
.hm-search input::placeholder { color: #6B7A90; }
.hm-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hm-search input:focus-visible { box-shadow: none; }
.hm-kbd { font: 600 12.5px/1 var(--sans); color: var(--muted); padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); flex: none; }
.hm-help { width: 30px; height: 30px; }
.hm-account { display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 3px 6px 3px 3px; border-radius: 999px; color: var(--ink-2); }
.hm-account:hover { background: var(--fill-2); }
.hm-avatar { width: 50px; height: 50px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 18px; box-shadow: 0 0 0 1px var(--line); flex: none; }
.hm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hm-avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.hm-signin { height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--accent-ink); font-weight: 600; font-size: 15px; transition: background var(--t), border-color var(--t); }
.hm-signin:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.hm-pop-wrap { position: relative; }
.hm-help-pop { right: 0; top: 54px; width: 300px; }
.hm-sc { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; font-size: 13.5px; color: var(--ink-2); }
.hm-acct-pop { right: 0; top: 62px; width: 280px; }
.hm-acct-who { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.hm-acct-who > span:last-child { display: grid; min-width: 0; }
.hm-acct-who b { font-weight: 650; font-size: 14px; }
.hm-acct-who small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hm-main { width: 100%; max-width: 1440px; margin: 0 auto; padding: clamp(28px, 4vw, 52px) clamp(16px, 3vw, 52px) 40px; flex: 1; }
.hm-sec { display: grid; gap: 26px; }
.hm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hm-h { margin: 0; font: 700 clamp(26px, 2.4vw, 36px)/1.1 var(--sans); letter-spacing: -0.03em; color: var(--ink); }
.hm-h.sm { font-size: 24px; }
.hm-outline { display: inline-flex; align-items: center; gap: 12px; height: 54px; padding: 0 24px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--accent); font-weight: 600; font-size: 17px; box-shadow: var(--shadow-1); transition: background var(--t), border-color var(--t), box-shadow var(--t), transform var(--t-fast); }
.hm-outline:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.hm-outline:active { transform: translateY(1px); }
.hm-rule { border: 0; height: 1px; background: var(--line); margin: clamp(30px, 3.4vw, 44px) 0 clamp(36px, 3.6vw, 48px); }
.hm-none { margin: 0; color: var(--muted); }
.hm-link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hm-note { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* New-form cards */
.nf-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.nf { display: grid; gap: 16px; align-content: start; text-decoration: none; color: var(--ink); border: 0; background: none; padding: 0; text-align: left; font: inherit; }
.nf-thumb { display: block; aspect-ratio: 1 / 1.2; border-radius: 16px; padding: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s; }
.nf:hover .nf-thumb { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--accent-line); }
.nf:focus-visible { box-shadow: none; }
.nf:focus-visible .nf-thumb { box-shadow: var(--ring); }
.nf-name { font-weight: 550; font-size: 18px; letter-spacing: -0.015em; padding-left: 4px; }
.nf-blurb { margin-top: -10px; padding-left: 4px; color: var(--muted); font-size: 13.5px; }

/* Illustrations */
.art { position: relative; display: block; width: 100%; height: 100%; border-radius: 11px; overflow: hidden; isolation: isolate; --a1: #DDF2E4; --a2: #F4FBF6; --b1: #BFE7CC; --b2: #CFEFDA; --ico: #7A8AA0; }
.art-blob { position: absolute; border-radius: 50%; z-index: -1; }
.art-blob.a { width: 46%; aspect-ratio: 1; right: -8%; top: 4%; background: var(--b1); opacity: .85; }
.art-blob.b { width: 16%; aspect-ratio: 1; left: 10%; top: 16%; background: var(--b2); }
.art { background: linear-gradient(160deg, var(--a1) 0%, var(--a2) 100%); }
.art-green { --a1: #D8F0DF; --a2: #EEF9F1; --b1: #B9E4C6; --b2: #C9EBD3; }
.art-peach { --a1: #F6D9CC; --a2: #FCEEE7; --b1: #EFC2AE; --b2: #F5D3C4; }
.art-blue  { --a1: #CFE0FB; --a2: #EEF4FE; --b1: #B4CEF7; --b2: #C9DBFA; }
.art-lilac { --a1: #DDDAF8; --a2: #F1EFFD; --b1: #C9C3F2; --b2: #D7D2F7; }
.art-amber { --a1: #F8E6C2; --a2: #FDF5E5; --b1: #F2D594; --b2: #F6E1B4; }
.art-rose  { --a1: #F7D4E2; --a2: #FDEEF4; --b1: #EFB8CD; --b2: #F4CADA; }
.art-blue .art-blob.a { width: 130%; height: 60%; aspect-ratio: auto; right: -40%; top: -28%; border-radius: 0 0 50% 50%; transform: rotate(-12deg); }
.art-lilac .art-blob.a { width: 120%; height: 55%; aspect-ratio: auto; right: -55%; top: -6%; transform: rotate(-24deg); border-radius: 50%; }
.art-peach .art-blob.a { width: 34%; aspect-ratio: .5; right: 6%; top: 8%; border-radius: 40% 40% 12% 12%; opacity: .9; }
.art-peach .art-blob.b { width: 22%; aspect-ratio: .7; right: 32%; top: 18%; border-radius: 40% 40% 10% 10%; }
.art-badge { position: absolute; left: 9%; top: 8%; width: 30px; height: 30px; border-radius: 9px; padding: 6px; color: #fff; background: rgba(255,255,255,.55); }
.art-peach .art-badge { color: #E28A63; background: rgba(255,255,255,.7); }
.art-blue .art-badge { color: #fff; background: #4C8DF6; box-shadow: 0 6px 14px -6px rgba(26,106,244,.7); }
.art-lilac .art-badge { color: #7F72E3; background: rgba(255,255,255,.85); }
.art-amber .art-badge { color: #C98A10; background: rgba(255,255,255,.8); }
.art-rose .art-badge { color: #D4558A; background: rgba(255,255,255,.8); }
.art-leaf { position: absolute; right: -4%; bottom: 12%; width: 34%; color: #7FC796; opacity: .85; transform: rotate(-12deg); }

.art-panel { position: absolute; left: 7%; right: 7%; top: 24%; bottom: -4%; background: rgba(255,255,255,.96); border-radius: 10px 10px 0 0; box-shadow: 0 8px 24px -10px rgba(15,23,42,.18); padding: 9% 8% 0; display: flex; flex-direction: column; gap: 6.5%; }
.art-k-contact .art-panel { top: 25%; }
.art i { display: block; font-style: normal; }
.sk { height: 6px; border-radius: 4px; background: #C9D1DD; flex: none; }
.sk.lt { background: #DCE2EA; }
.w35 { width: 35%; } .w40 { width: 40%; } .w45 { width: 45%; } .w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; } .w70 { width: 70%; }
.in { height: 14%; max-height: 22px; min-height: 12px; border: 1.5px solid #E1E6EE; border-radius: 6px; background: #fff; flex: none; position: relative; }
.in.tall { height: 22%; max-height: 40px; }
.in.sel::after { content: ""; position: absolute; right: 8px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid #8C99AC; border-bottom: 1.5px solid #8C99AC; transform: translateY(-70%) rotate(45deg); }
.hr { height: 1px; background: #E8ECF2; flex: none; }
.btn-sk { height: 12%; max-height: 22px; min-height: 12px; width: 55%; border-radius: 6px; background: #1A6AF4; flex: none; margin-top: 2%; }
.btn-sk.sm { width: 45%; }
.ap-head { display: flex; align-items: center; gap: 10px; flex: none; }
.ap-ico { width: 14px; height: 14px; color: #8E9AAD; flex: none; }
.ap-head .sk { flex: 1; }
.ap-opt { display: flex; align-items: center; gap: 9px; flex: none; }
.rd { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #9AA6B8; flex: none; }
.ap-faces { display: flex; justify-content: space-between; gap: 4%; flex: none; }
.face { width: 17%; max-width: 30px; aspect-ratio: 1; }
.face svg { width: 100%; height: 100%; }
.ap-stars { display: flex; gap: 6%; flex: none; }
.ap-stars i { width: 12%; aspect-ratio: 1; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 78%, 20% 100%, 30% 60%, 0 38%, 38% 35%); background: #F2C14E; }
.ap-stars i:not(.on) { background: #DCE2EA; }

.art-blank { background: linear-gradient(165deg, #F3F6FB 0%, #F8FAFD 55%, #EBF1FA 100%); display: grid; place-items: center; }
.art-blank .art-blob.a { width: 120%; height: 50%; aspect-ratio: auto; left: -30%; right: auto; top: auto; bottom: -22%; background: #E3EBF7; border-radius: 50%; transform: rotate(14deg); opacity: .7; }
.art-blank .art-blob.b { width: 90%; height: 40%; aspect-ratio: auto; left: 30%; top: auto; bottom: -26%; background: #E9EFF9; border-radius: 50%; }
.blank-plus { width: 40%; max-width: 98px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: #E4EDFB; color: var(--accent); box-shadow: 0 10px 26px -14px rgba(26,106,244,.55); transition: transform .35s var(--ease-out), background .3s; }
.blank-plus .ico-wrap svg { stroke-width: 2.2; }
.nf:hover .blank-plus { transform: scale(1.06); background: #D9E6FB; }

/* Dark-mode illustrations: same scenes, dimmer light. */
:root[data-theme="dark"] .art { filter: saturate(.85) brightness(.82); }
:root[data-theme="dark"] .art-panel { background: rgba(255,255,255,.93); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .art { filter: saturate(.85) brightness(.82); } }

/* Recent forms */
.hm-tools { display: flex; align-items: center; gap: 18px; }
.hm-views { display: inline-flex; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.hm-views button { width: 58px; height: 50px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; transition: background var(--t), color var(--t); }
.hm-views button + button { border-left: 1px solid var(--line-2); }
.hm-views button .svg { width: 24px; height: 24px; }
.hm-views button.on { background: var(--accent-soft); color: var(--accent); }
.hm-views button:not(.on):hover { background: var(--fill); }
.hm-sort { position: relative; }
.hm-select { display: inline-flex; align-items: center; gap: 22px; height: 50px; padding: 0 16px 0 20px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 15.5px; font-weight: 500; transition: border-color var(--t); }
.hm-select:hover { border-color: var(--ink-2); }
.hm-sort-pop { right: 0; top: 56px; min-width: 200px; }

.rf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(14px, 1.6vw, 22px); }
@media (min-width: 1200px) { .rf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rf { position: relative; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow-1); transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s; }
.rf:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.rf-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.rf-hit:focus-visible { box-shadow: var(--ring); border-radius: 16px; }
.rf-thumb { position: relative; display: block; height: 180px; }
.rf-thumb > .rf-st { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.92); box-shadow: 0 1px 2px rgba(15,23,42,.08); color: #334155; }
.rf-thumb > .rf-st.live { color: #16855B; }
.rf-thumb > .rf-st.closed { color: #B26A00; }
.rf-thumb .art { border-radius: 10px; }
.art-compact .art-panel { left: 9%; right: 9%; top: 22%; padding: 7% 7% 0; gap: 9%; }
.art-compact .art-badge { left: 18%; top: 34%; width: 24px; height: 24px; padding: 4px; z-index: 2; background: transparent; box-shadow: none; }
.art-compact.art-k-event .art-badge { color: #E28A63; }
.art-compact .art-panel { padding-left: 7%; }
.art-compact.art-k-event .art-panel, .art-compact.art-k-feedback .art-panel, .art-compact.art-k-application .art-panel { padding-top: 15%; }
.rf-meta { padding: 18px 44px 8px 10px; display: grid; gap: 12px; }
.rf-title { margin: 0; font-weight: 550; font-size: 17px; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-sub { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; min-width: 0; flex-wrap: wrap; row-gap: 6px; }
.rf-ico { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.rf-ico .svg { width: 18px; height: 18px; }
.rf-ico.lg { width: 34px; height: 34px; border-radius: 9px; }
.rf-when { white-space: nowrap; }
.rf-st { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--fill-2); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rf-st.live { background: var(--good-soft); color: var(--good); }
.rf-st.closed { background: var(--warn-soft); color: var(--warn); }
.rf-more { position: absolute; right: 10px; bottom: 16px; z-index: 2; }
.rf-pop { right: 0; bottom: 42px; top: auto; }
.pop-item.danger { color: var(--bad); }
.pop-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.rf-skel { pointer-events: none; gap: 14px; }
.rf-skel-art { height: 180px; border-radius: 10px; }
.rf-skel-l { height: 14px; width: 60%; } .rf-skel-s { height: 12px; width: 40%; margin-bottom: 10px; }

.rf-list { display: grid; border: 1px solid var(--line); border-radius: 16px; overflow: visible; background: var(--surface); }
.rr { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 200px 40px; align-items: center; gap: 16px; padding: 12px 12px 12px 16px; }
.rr + .rr { border-top: 1px solid var(--line); }
.rr:hover { background: var(--surface-2); }
.rr:first-child { border-radius: 16px 16px 0 0; } .rr:last-child { border-radius: 0 0 16px 16px; }
.rr-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-when { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; }
.rr .rf-more { position: relative; right: auto; bottom: auto; }
.rr .rf-pop { top: 40px; bottom: auto; }

.hm-empty { display: flex; align-items: center; gap: 22px; padding: 22px; border: 1px dashed var(--line-2); border-radius: 16px; background: var(--surface-2); }
.hm-empty-art { width: 140px; height: 104px; flex: none; }
.hm-empty-t { margin: 0 0 4px; font-weight: 650; font-size: 17px; }
.hm-empty-s { margin: 0; color: var(--muted); max-width: 52ch; }

.hm-foot { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 22px 16px 30px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.hm-foot a { color: var(--muted); text-decoration: none; }
.hm-foot a:hover { color: var(--ink); }

/* Drawer + gallery */
.hm-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.32); backdrop-filter: blur(3px); animation: fade-in var(--t) var(--ease); }
.hm-drawer { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: var(--surface); box-shadow: var(--shadow-3); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; animation: drawer-in .32s var(--ease-out); }
@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.hm-drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 14px; }
.hm-drawer .hm-logo { width: 36px; height: 36px; border-radius: 10px; }
.hm-drawer .hm-word { font-size: 21px; }
.hm-dl { display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 14px; border: 0; border-radius: 0 999px 999px 0; background: transparent; color: var(--ink-2); font-size: 15px; font-weight: 550; text-decoration: none; text-align: left; margin-left: -12px; padding-left: 26px; }
.hm-dl:hover { background: var(--fill-2); color: var(--ink); }
.hm-dl.on { background: var(--accent-soft); color: var(--accent-ink); }
.hm-dsep { height: 1px; background: var(--line); margin: 10px 4px; }
.hm-dfoot { margin-top: auto; display: flex; gap: 14px; flex-wrap: wrap; padding: 12px 10px 4px; }
.hm-dfoot a { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.hm-gallery { width: min(1080px, 100%); padding: 26px 28px 30px; }
.hm-gal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.hm-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 18px; }
.hm-gal-grid .nf-thumb { aspect-ratio: 1 / 1.1; }
.hm-gal-grid .nf-name { font-size: 15.5px; }

@media (max-width: 1100px) {
  .hm-bar { grid-template-columns: auto minmax(0, 1fr) auto; height: 72px; gap: 14px; }
  .hm-word { font-size: 22px; } .hm-logo { width: 40px; height: 40px; }
  .hm-kbd { display: none; }
  .nf-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 10px; margin: -4px -4px -10px; scrollbar-width: none; }
  .nf-row::-webkit-scrollbar { display: none; }
  .nf-row .nf { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .hm-bar { grid-template-columns: auto 1fr auto; grid-template-rows: 64px auto; height: auto; padding-bottom: 12px; row-gap: 4px; }
  .hm-search { grid-column: 1 / -1; grid-row: 2; height: 46px; }
  .hm-bar-l { gap: 8px; } .hm-icon-btn { width: 40px; height: 40px; }
  .hm-word { font-size: 20px; } .hm-logo { width: 36px; height: 36px; border-radius: 10px; } .hm-brand { gap: 10px; }
  .hm-bar-r { gap: 4px; } .hm-avatar { width: 38px; height: 38px; font-size: 15px; } .hm-help { width: 26px; height: 26px; }
  .hm-signin { height: 38px; padding: 0 14px; font-size: 14px; }
  .hm-h { font-size: 24px; }
  .hm-outline { height: 42px; padding: 0 14px; font-size: 14.5px; border-radius: 11px; gap: 8px; }
  .nf-row { grid-auto-columns: 46%; }
  .nf-name { font-size: 15.5px; }
  .hm-views button { width: 46px; height: 42px; } .hm-select { height: 42px; gap: 10px; padding: 0 12px 0 14px; font-size: 14px; }
  .hm-tools { gap: 10px; }
  .rr { grid-template-columns: auto minmax(0, 1fr) 40px; row-gap: 4px; }
  .rr .rf-st { grid-column: 2; grid-row: 2; justify-self: start; }
  .rr-when { grid-column: 2; grid-row: 3; text-align: left; font-size: 13px; }
  .rr .rf-more { grid-column: 3; grid-row: 1 / span 3; }
  .hm-empty { flex-direction: column; align-items: flex-start; }
  .hm-gallery { padding: 20px 16px 22px; }
  .hm-gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
}
@media (max-width: 359px) { .hm-word span { display: none; } }

/* Gate + sign in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { max-width: 460px; display: grid; gap: 12px; text-align: center; justify-items: center; }
.gate-card .h2 { margin: 0; }
.signin { display: grid; gap: 14px; text-align: center; justify-items: center; max-width: 400px; margin: 0 auto; }
.signin .h2 { margin: 4px 0 0; }
.signin > p { margin: 0 0 8px; }
.signin-mark .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.signin-mark .brand-mark svg { width: 24px; height: 24px; }
.signin-google { gap: 10px; }
.signin-or { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--faint); font-size: 12px; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin-email { display: grid; grid-template-columns: 1fr auto; gap: 8px; width: 100%; }
.signin-email .btn { height: 44px; }
.signin-sent { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 16px; border-radius: var(--r); background: var(--good-soft); color: var(--ink); }
.signin-sent p { margin: 0; }
.signin-legal { margin-top: 6px; }
.signin-modal { position: relative; padding: 36px 30px 26px; }
.modal-x { position: absolute; right: 14px; top: 14px; }

/* ── Builder ───────────────────────────────── */
.bd { min-height: 100vh; display: flex; flex-direction: column; }
.bd-top { position: sticky; top: 0; z-index: 40; height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 14px; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.bd-top-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bd-top-r { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.bd-home { display: inline-flex; border-radius: 9px; }
.bd-crumb-sep { color: var(--faint); }
.bd-crumb { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.bd-save { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bd-save .chip { height: 22px; font-size: 11.5px; }
.bd-save.is-error { color: var(--bad); }
.bd-tabs button { position: relative; }
.bd-count { margin-left: 6px; font: 600 10.5px/1 var(--mono); padding: 2px 5px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.bd-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); }
.bd-main.is-wide { grid-template-columns: minmax(0, 1fr) 452px; }
.bd-canvas { padding: clamp(24px, 4vw, 56px) 16px 160px; min-width: 0; }
.bd-preview { position: sticky; top: 58px; height: calc(100vh - 58px); border-left: 1px solid var(--line); background: var(--paper-2); display: flex; flex-direction: column; }
.bd-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; }
.bd-preview-bar .eyebrow { display: inline-flex; align-items: center; gap: 7px; }
.bd-phone { flex: 1; padding: 4px 18px 18px; min-height: 0; }
.bd-phone-screen { position: relative; height: 100%; border-radius: 26px; overflow: auto; border: 1px solid var(--line); box-shadow: var(--shadow-2); background: var(--surface); contain: layout paint; }
.bd-phone-screen .fr-classic { padding: 36px 14px 90px; }
.bd-phone-screen .fr-title { font-size: 30px; }
.bd-phone-screen .fr-title-xl { font-size: 38px; }
.bd-phone-screen .fr-block { padding: 18px 16px; }
.bd-phone-screen .fr-card .q-title { font-size: 22px; }
.bd-phone-screen .f-nps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bd-phone-screen .f-matrix-scroll { display: none; }
.bd-phone-screen .f-matrix-stack { display: block; }
.bd-phone-screen .fr-focus { padding: 56px 16px 90px; }
.bd-phone-screen .fr-yesno, .bd-phone-screen .f-yesno { grid-template-columns: 1fr 1fr; }

.bd-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 0 0 24px; border-radius: var(--r); background: var(--bad-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); animation: rise .3s var(--ease-out); }
.bd-alert > .ico-wrap { color: var(--bad); margin-top: 1px; }
.bd-alert > div { flex: 1; }
.bd-alert ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.bd-alert .f-link-btn { color: var(--ink); font-weight: 500; text-align: left; }

.sheet { max-width: 760px; margin: 0 auto; }
.sheet-title { display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent; padding: 0; margin: 0 0 10px; overflow: hidden; font: 400 clamp(38px, 5vw, 58px)/1.04 var(--serif); letter-spacing: -0.025em; color: var(--ink); }
.sheet-title::placeholder { color: var(--faint); }
.sheet-desc { display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent; padding: 0; margin: 0 0 36px; overflow: hidden; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.sheet-desc::placeholder { color: var(--faint); }
.sheet-blocks { display: grid; }
.bk-slot { position: relative; padding: 5px 0; }
.bk-insert { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); z-index: 3; width: 100%; height: 18px; border: 0; background: transparent; display: grid; place-items: center; opacity: 0; transition: opacity .15s var(--ease); }
.bk-insert::before { content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 1.5px; background: var(--accent); border-radius: 2px; transform: scaleX(.3); transition: transform .25s var(--ease-out); }
.bk-insert span { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px -3px var(--accent-line); }
.bk-slot:hover > .bk-insert, .bk-insert:focus-visible { opacity: 1; }
.bk-slot:hover > .bk-insert::before, .bk-insert:focus-visible::before { transform: scaleX(1); }
.bk-slot:first-child > .bk-insert { top: -12px; }

.bk { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease); cursor: pointer; }
.bk:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.bk.is-sel { cursor: default; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-2); }
.bk.is-sel::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.bk-rail { display: flex; justify-content: center; padding-top: 18px; }
.bk-grip { color: var(--faint); opacity: 0; cursor: grab; transition: opacity .15s; }
.bk:hover .bk-grip { opacity: 1; }
.bk-body { padding: 16px 20px 16px 2px; min-width: 0; }
.bk-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.bk-type { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bk-num { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: var(--fill-2); color: var(--ink-2); font-size: 10.5px; }
.bk-flag { height: 20px; font-size: 11px; }
.bk-title { width: 100%; border: 0; outline: none; background: transparent; padding: 2px 0; font-size: 19px; font-weight: 600; letter-spacing: -0.018em; color: var(--ink); }
.bk-title::placeholder { color: var(--faint); font-weight: 500; }
.bk-help { width: 100%; border: 0; outline: none; background: transparent; resize: none; padding: 4px 0; font-size: 14.5px; color: var(--ink-2); overflow: hidden; min-height: 28px; }
.bk-help::placeholder { color: var(--faint); }
.bk-title-ro { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.bk-title-ro.is-empty { color: var(--faint); font-weight: 500; }
.bk-help-ro { margin: 4px 0 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.bk-note code { font-family: var(--mono); font-size: 12px; background: var(--fill-2); padding: 2px 6px; border-radius: 5px; }
.bk-statement .bk-title { font: 400 26px/1.15 var(--serif); letter-spacing: -0.02em; }
.bk-statement .bk-title-ro { font: 400 24px/1.15 var(--serif); }
.bk-glimpse { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bk-gl-opt { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 9px; border-radius: 9px; border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.bk-gl-mark { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.bk-gl-mark.sq { border-radius: 3px; }
.bk-gl-mark.ok { border-color: var(--good); background: var(--good); }
.bk-gl-more { font-size: 13px; color: var(--muted); align-self: center; }
.bk-gl-line { display: block; width: min(340px, 100%); padding: 8px 0; border-bottom: 1.5px dashed var(--line-2); color: var(--faint); font-size: 14px; }
.bk-gl-stars { color: var(--faint); gap: 3px; }
.bk-gl-scale span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.bk-foot { display: flex; align-items: center; gap: 4px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bk-foot-sp, .bd-foot-sp { flex: 1; }
.bk-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.bk-req { font-size: 13.5px; font-weight: 500; margin-right: 4px; }
.bk-typeswitch { position: relative; }
.bk-sub { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.bk-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.bk-row .bk-sub { margin: 0; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.bk-grid .input, .bk-grid .select { min-height: 38px; font-size: 14px; padding: 7px 12px; }
.bk-grid .select { padding-right: 34px; }
.bk-matrix-ed { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.bk-opts { margin-top: 12px; }
.bk-opt-tools { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.bk-inline { display: inline-flex; align-items: center; gap: 6px; }
.bk-num-in { width: 70px; min-height: 32px; padding: 4px 8px; font-size: 13.5px; }

.le { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.le-item { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 0; border-radius: 9px; transition: background .15s; }
.le-item:hover { background: var(--fill); }
.le-item.is-drag { background: var(--accent-soft); }
.le-grip { color: var(--faint); cursor: grab; opacity: 0; transition: opacity .15s; display: inline-flex; }
.le-item:hover .le-grip { opacity: 1; }
.le-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 600 10px/1 var(--mono); color: var(--muted); }
.le-mark.sq { border-radius: 5px; }
.le-mark.num { border: 0; background: var(--fill-2); border-radius: 5px; }
.le-mark.ok { border-color: var(--good); background: var(--good); }
.le-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 7px 4px; font-size: 15px; color: var(--ink); border-bottom: 1px solid transparent; }
.le-input:focus { border-bottom-color: var(--accent); }
.le-input::placeholder { color: var(--faint); }
.le-x, .le-correct { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--faint); border-radius: 7px; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.le-item:hover .le-x, .le-item:focus-within .le-x, .le-item:hover .le-correct, .le-item:focus-within .le-correct, .le-correct.is-on { opacity: 1; }
.le-x:hover:not([disabled]) { background: var(--bad-soft); color: var(--bad); }
.le-x[disabled] { display: none; }
.le-correct:hover { background: var(--good-soft); color: var(--good); }
.le-correct.is-on { color: var(--good); background: var(--good-soft); }
.le-add { display: flex; align-items: center; gap: 10px; padding-left: 22px; margin-top: 2px; }
.le-add-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 6px; color: var(--accent-ink); font-weight: 550; font-size: 14px; border-radius: 7px; }
.le-add-btn:hover { background: var(--accent-soft); }
.le-tip { font-size: 12px; color: var(--faint); }

.bk-page { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; }
.bk-page-line { flex: 1; height: 0; border-top: 1.5px dashed var(--line-2); }
.bk-page-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); font: 500 12px/1 var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.bk-page.is-sel .bk-page-chip { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-page-title { border: 0; outline: none; background: transparent; font: 500 13px/1 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); width: 180px; padding: 2px 4px; }
.bk-mini { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--fill-2); color: var(--muted); display: grid; place-items: center; }
.bk-mini:hover { background: var(--bad-soft); color: var(--bad); }

.sheet-add { margin-top: 16px; display: grid; gap: 14px; }
.add-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background: transparent; color: var(--ink-2); font-size: 15.5px; font-weight: 550; text-align: left; transition: border-color .2s, background .2s, color .2s; }
.add-btn:hover { border-color: var(--accent); color: var(--ink); background: var(--surface); }
.add-btn .add-plus { width: 30px; height: 30px; }
.add-kbd { margin-left: auto; }
.quick-add { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-chip { border: 1px solid var(--line); background: var(--surface); cursor: pointer; height: 30px; transition: border-color .15s, background .15s; }
.quick-chip:hover { border-color: var(--ink-2); }
.sheet-tips { margin: 36px 0 0; text-align: center; font-size: 12px; color: var(--faint); display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }

.block-menu { padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 420px; }
.block-menu-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.block-menu-search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 14.5px; color: var(--ink); }
.block-menu-list { overflow: auto; padding: 4px 6px 8px; }
.block-menu-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* Logic */
.logic-modal { width: min(680px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.modal-head .h2 { font-size: 30px; margin-top: 6px; }
.logic-sec { padding: 18px 0; border-top: 1px solid var(--line); display: grid; gap: 12px; justify-items: start; }
.logic-rows { display: grid; gap: 8px; width: 100%; }
.logic-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 30px; gap: 8px; align-items: center; }
.logic-row:has(.logic-if) { display: flex; flex-wrap: wrap; }
.logic-row .select, .logic-row .input { min-height: 38px; font-size: 14px; padding-top: 7px; padding-bottom: 7px; }
.logic-if { font-size: 13.5px; color: var(--muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); margin-top: 8px; }

/* Panels */
.panel { max-width: 760px; margin: 0 auto; }
.panel-title { margin: 8px 0 28px; }
.panel-sec { padding: 22px 0; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.panel-two { grid-template-columns: 1fr 1fr; }
.panel-two > div { display: grid; gap: 12px; justify-items: start; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.mode-card:hover { border-color: var(--line-2); }
.mode-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--fill-2); display: grid; place-items: center; margin-bottom: 6px; color: var(--ink-2); }
.mode-card.is-on .mode-ico { background: var(--accent); color: var(--on-accent); }
.mode-l { font-weight: 650; }
.mode-d { font-size: 13.5px; color: var(--muted); }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card { display: grid; gap: 8px; padding: 0; border: 0; background: transparent; text-align: left; }
.theme-swatch { height: 104px; border-radius: 14px; background: var(--f-bg); border: 1px solid var(--line); padding: 14px; display: grid; gap: 5px; align-content: start; transition: box-shadow .2s, transform .2s var(--ease-out); }
.theme-card:hover .theme-swatch { transform: translateY(-2px); }
.theme-card.is-on .theme-swatch { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }
.ts-title { font-family: var(--f-title-font); font-weight: var(--f-title-weight); color: var(--f-ink); font-size: 22px; line-height: 1; margin-bottom: 4px; }
.ts-line { height: 4px; width: 50%; border-radius: 2px; background: var(--f-line); }
.ts-opt { height: 12px; border-radius: calc(var(--f-radius) * .4); border: 1px solid var(--f-line); background: var(--f-surface); }
.ts-opt.on { border-color: var(--f-accent); background: var(--f-accent-soft); }
.ts-btn { height: 12px; width: 34%; border-radius: calc(var(--f-radius) * .4); background: var(--f-accent); margin-top: 2px; }
.theme-name { font-size: 13.5px; font-weight: 550; padding-left: 2px; }
.accents { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.accent-dot { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .2s var(--ease-out), box-shadow .2s; }
.accent-dot:hover { transform: scale(1.1); }
.accent-dot.is-on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--c); }
.accent-custom { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line-2); color: var(--muted); cursor: pointer; }
.accent-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.set-list { display: grid; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-title { margin: 0; font-weight: 560; }
.set-row .hint { margin: 2px 0 0; }
.set-input { width: 220px; min-height: 38px; font-size: 14px; }
.set-stack { display: grid; gap: 16px; }
.status-card { grid-template-columns: 1fr auto; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 8px; }
.status-card .h3 { margin-bottom: 2px; }

/* Preview overlay */
.pv { position: fixed; inset: 0; z-index: 90; background: var(--paper-2); display: flex; flex-direction: column; animation: fade-in .2s var(--ease); }
.pv-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.pv-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 20px; }
.pv-frame { position: relative; width: 100%; height: 100%; overflow: auto; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-3); background: var(--surface); transition: width .4s var(--ease-out); }
.pv-mobile .pv-frame { width: 390px; max-height: 844px; border-radius: 36px; }
.pv-full { padding: 0; }
.pv-full .pv-frame { border-radius: 0; border: 0; }

/* Share */
.share-modal { width: min(560px, 100%); display: grid; gap: 16px; }
.share-hero { position: relative; padding: 8px 0 4px; }
.share-hero .h2 { margin: 8px 0 0; }
.share-burst { position: absolute; right: -10px; top: -14px; width: 140px; height: 140px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
.share-tabs { justify-self: start; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.share-url { font-family: var(--mono); font-size: 13.5px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.share-code { font-family: var(--mono); font-size: 12.5px; min-height: 120px; }
.qr-wrap { display: grid; justify-items: center; gap: 14px; }
.qr-canvas { width: 220px; height: 220px; image-rendering: pixelated; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.hint code { font-family: var(--mono); font-size: 12px; background: var(--fill-2); padding: 1px 5px; border-radius: 4px; }

/* Results */
.rs { padding: clamp(20px, 3vw, 40px) 16px 120px; }
.rs-wrap { max-width: 1100px; margin: 0 auto; display: grid; gap: 16px; }
.rs-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.rs-kpis { display: flex; align-items: flex-end; gap: clamp(18px, 4vw, 44px); flex-wrap: wrap; }
.kpi { display: grid; gap: 4px; }
.kpi-n { font: 400 54px/0.9 var(--serif); letter-spacing: -0.03em; }
.kpi-n.kpi-sm { font-size: 30px; line-height: 1.3; }
.kpi-l { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rs-live { align-self: center; }
.rs-tools { display: flex; gap: 8px; align-items: center; }
.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 16px; }
.rs-card { padding: 22px 24px 24px; display: grid; gap: 18px; align-content: start; }
.rs-card-head { display: flex; gap: 14px; align-items: flex-start; }
.rs-card-head .h3 { margin-bottom: 4px; }
.rs-card-head p { margin: 0; display: flex; align-items: center; gap: 4px; }
.rs-qn { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--fill-2); font: 600 12px/1 var(--mono); color: var(--ink-2); }
.rs-none { margin: 0; }
.rs-bars { display: grid; gap: 12px; }
.rs-bar-l { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 6px; }
.rs-bar-v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.rs-bar-track { height: 10px; border-radius: 6px; background: var(--fill-2); overflow: hidden; }
.rs-bar-track span { display: block; height: 100%; border-radius: 6px; background: color-mix(in srgb, var(--accent) 55%, var(--fill-2)); transform-origin: left; transition: transform .8s var(--ease-out); }
.rs-bar.is-top .rs-bar-track span { background: var(--accent); }
.rs-other summary { cursor: pointer; font-size: 13.5px; color: var(--accent-ink); }
.rs-other ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.rs-split-bar { height: 16px; border-radius: 9px; overflow: hidden; background: var(--fill-2); }
.rs-split-bar span { display: block; height: 100%; background: var(--accent); border-radius: 9px 0 0 9px; transition: width .8s var(--ease-out); }
.rs-split-l { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.rs-dist-wrap { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: end; }
.rs-stat { display: grid; gap: 2px; }
.rs-big { font: 400 52px/0.95 var(--serif); letter-spacing: -0.03em; }
.rs-mid { font: 400 30px/1 var(--serif); letter-spacing: -0.02em; }
.rs-dist { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 5px; height: 140px; align-items: end; }
.rs-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; align-items: end; text-align: center; gap: 4px; }
.rs-col-n { font: 600 11px/1 var(--mono); color: var(--muted); }
.rs-col-bar { width: 100%; min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--accent); align-self: end; transition: height .8s var(--ease-out); }
.rs-col-bar.det { background: #E5484D; } .rs-col-bar.pas { background: #E2A336; } .rs-col-bar.pro { background: #16A06B; }
.rs-col-k { font: 500 11.5px/1 var(--mono); color: var(--muted); }
.rs-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rs-rank li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fill); }
.rs-rank-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 600 11.5px/1 var(--mono); }
.rs-rank li:nth-child(n+2) .rs-rank-n { background: var(--fill-2); color: var(--ink-2); }
.rs-rank-l { flex: 1; }
.rs-matrix { display: grid; gap: 10px; }
.rs-mx-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr; gap: 12px; align-items: center; font-size: 14px; }
.rs-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--fill-2); }
.rs-stack span, .rs-legend i { background: color-mix(in srgb, var(--accent) calc(var(--o) * 100%), transparent); }
.rs-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.rs-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.rs-sigs { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-sigs img { height: 64px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.rs-numbers { display: flex; gap: 28px; flex-wrap: wrap; align-items: end; }
.rs-numbers > div { display: grid; gap: 2px; }
.rs-text ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rs-text li { padding: 10px 14px; border-radius: 10px; background: var(--fill); font-size: 14.5px; white-space: pre-line; }
.rs-words { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rs-words .chip { border: 0; cursor: pointer; gap: 5px; }
.rs-words .chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.rs-search { margin-bottom: 10px; min-height: 38px; font-size: 14px; }
.rs-ind { padding: 0; overflow: hidden; }
.rs-ind-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rs-ind-pos { font-size: 14px; font-variant-numeric: tabular-nums; }
.rs-ind-list { margin: 0; padding: 6px 24px 20px; }
.rs-ind-row { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; }
.rs-ind-row:last-child { border-bottom: 0; }
.rs-ind-row dt { color: var(--muted); font-size: 14px; }
.rs-ind-row dd { margin: 0; font-weight: 500; white-space: pre-line; overflow-wrap: anywhere; }
.rs-ind-sig { height: 80px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.rs-table-wrap { overflow: auto; max-height: 70vh; padding: 0; }
.rs-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13.5px; }
.rs-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-table tr:hover td { background: var(--fill); }
.rs-empty { max-width: 560px; margin: clamp(40px, 10vh, 120px) auto; padding: 0 16px; text-align: center; display: grid; justify-items: center; gap: 14px; }
.rs-empty .h2, .rs-empty .lede { margin: 0; }
.rs-empty-sm { margin: 40px auto; }
.rs-empty-art { display: flex; align-items: flex-end; gap: 8px; height: 72px; margin-bottom: 10px; }
.rs-empty-art span { width: 22px; border-radius: 6px 6px 3px 3px; background: var(--signature); opacity: .85; animation: grow 1.6s var(--ease-out) infinite alternate; }
.rs-empty-art span:nth-child(1) { height: 40%; } .rs-empty-art span:nth-child(2) { height: 90%; animation-delay: .2s; } .rs-empty-art span:nth-child(3) { height: 62%; animation-delay: .4s; }
@keyframes grow { from { transform: scaleY(.6); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }

/* Responsive */
@media (max-width: 980px) {
  .bd-top { grid-template-columns: auto 1fr; grid-template-rows: 58px auto; height: auto; padding-bottom: 8px; }
  .bd-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .bd-top-r { grid-column: 2; grid-row: 1; }
  .bd-preview { top: 104px; height: calc(100vh - 104px); }
}
@media (max-width: 720px) {
  .bd-hide-sm { display: none !important; }
  .bd-crumb, .bd-crumb-sep, .bd-save-label { display: none; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-cards, .panel-two, .bk-matrix-ed { grid-template-columns: 1fr; }
  .set-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .set-input { width: 100%; }
  .bk { grid-template-columns: 10px minmax(0, 1fr); }
  .bk-grip { display: none; }
  .bk-body { padding: 14px 14px 14px 4px; }
  .logic-row { grid-template-columns: 1fr; }
  .rs-dist-wrap { grid-template-columns: 1fr; }
  .rs-ind-row { grid-template-columns: 1fr; gap: 4px; }
  .signin-email { grid-template-columns: 1fr; }
  .modal { padding: 22px; }
}
@media (max-width: 420px) {
  .bd-tabs button { padding: 0 10px; }
  .bd-top-r .btn-sm { padding: 0 10px; }
}

/* Borderless editing surfaces carry their own focus cue, not the global ring. */
.sheet-title:focus-visible, .sheet-desc:focus-visible, .bk-title:focus-visible, .bk-help:focus-visible, .le-input:focus-visible, .bk-page-title:focus-visible, .block-menu-search input:focus-visible { box-shadow: none; border-radius: 0; }
@media (hover: none) and (pointer: coarse) { .sheet-tips, .add-kbd { display: none; } .bk-insert { opacity: .55; } }
@media (max-width: 720px) { .bk-sep { display: none; } .bk-foot { gap: 2px; } .bk-foot .bk-typeswitch { flex-basis: 100%; margin-bottom: 4px; } .bk-foot-sp { display: none; } .bk-req { margin-right: auto; } }
