:root {
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-deep: #3730a3;
  --accent-soft: #e0e7ff;
  --accent-glow: rgba(79, 70, 229, .28);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 130%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);
  --ink: #0f1330;
  --ink-2: #2b3155;
  --muted: #6b7196;
  --line: #e6e8f3;
  --line-2: #d4d8ea;
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #f8f9fe;
  --danger: #e11d48;
  --ok: #059669;
  --warn: #d97706;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 19, 48, .04), 0 8px 24px -8px rgba(15, 19, 48, .12);
  --shadow-lg: 0 24px 60px -20px rgba(15, 19, 48, .35);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at -10% -10%, rgba(99, 102, 241, .16) 0%, transparent 60%),
    radial-gradient(700px 400px at 110% 0%, rgba(219, 39, 119, .10) 0%, transparent 55%),
    radial-gradient(600px 400px at 50% 120%, rgba(16, 185, 129, .08) 0%, transparent 60%);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 26px; font-weight: 800; position: relative; padding-bottom: 10px; margin-bottom: 16px; }
h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 42px; height: 4px; border-radius: 4px; background: var(--grad); }
h2 { font-size: 18px; font-weight: 700; } h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .8em; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
pre { background: #0f1330; color: #dfe3ff; padding: 14px 16px; border-radius: var(--radius-sm); overflow: auto; font-size: 12px; line-height: 1.55; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
pre code { background: none; border: 0; color: inherit; padding: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .12s, box-shadow .15s; }
.btn:hover { background: var(--panel-2); border-color: #b9bfdc; transform: translateY(-1px); box-shadow: 0 4px 12px -6px rgba(15, 19, 48, .25); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--grad); background-size: 160% 160%; border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px var(--accent-glow); }
.btn.primary:hover { background-position: 100% 50%; box-shadow: 0 10px 24px -8px var(--accent-glow); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fff1f2; border-color: #fecdd3; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(79, 70, 229, .08); transform: none; box-shadow: none; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.btn svg { width: 16px; height: 16px; }

/* Forms */
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=tel], select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; color: var(--ink); width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(99, 102, 241, .18); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.error { color: var(--danger); font-size: 13px; }
.notice { padding: 11px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-deep); font-size: 13px; border-left: 4px solid var(--accent-2); }
.notice.warn { background: #fef3c7; color: #92400e; border-left-color: #f59e0b; }
.notice.ok { background: #d1fae5; color: #065f46; border-left-color: #10b981; }
.notice.err { background: #ffe4e6; color: #9f1239; border-left-color: #f43f5e; }

/* Layout */
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 58px; background: linear-gradient(90deg, #0f1330 0%, #1a1f4d 60%, #2a1b5e 100%); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 8px 30px -12px rgba(15, 19, 48, .6); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); opacity: .9; }
.topbar .muted { color: #b8bce0; }
.topbar .btn.ghost { color: #e6e8ff; border-color: rgba(255,255,255,.14); }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.1); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -.3px; }
.topbar .brand { color: #fff; }
.brand img { width: 28px; height: 28px; filter: drop-shadow(0 2px 6px rgba(99, 102, 241, .5)); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 7px 12px; border-radius: 8px; color: #c7cbee; font-weight: 600; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; animation: rise .35s ease-out both; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title h2 { margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click td { transition: background .15s; }
.table tr.click:hover td { background: #f3f4fd; }
.table tr.click td:first-child { border-left: 3px solid transparent; transition: border-color .15s; }
.table tr.click:hover td:first-child { border-left-color: var(--accent-2); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e9ebf7; color: #3f4670; letter-spacing: .01em; }
.pill.ok { background: #d1fae5; color: #065f46; }
.pill.pending { background: #fef3c7; color: #92400e; }
.pill.void { background: #ffe4e6; color: #9f1239; }
.pill.tag { background: var(--accent-soft); color: var(--accent-deep); }
.pill.tag.click { cursor: pointer; border: 0; font: inherit; font-size: 11px; font-weight: 700; line-height: 1.6; transition: background .15s, color .15s, transform .12s; }
.pill.tag.click:hover { background: #c7d2fe; transform: translateY(-1px); }
.pill.tag.active, .pill.tag.active:hover { background: var(--grad); color: #fff; box-shadow: 0 4px 12px -4px var(--accent-glow); }
.pill.tag .x { border: 0; background: transparent; color: inherit; cursor: pointer; margin-left: 4px; padding: 0; font-size: 13px; line-height: 1; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px; }
.tabs.doc-tabs { margin: 0; display: inline-flex; flex-wrap: wrap; }
.tabs.doc-tabs button { flex: 0 0 auto; padding: 7px 13px; }
.tabs button .count { font-weight: 600; color: var(--muted); margin-left: 6px; font-size: 11px; background: rgba(15, 19, 48, .06); padding: 1px 6px; border-radius: 999px; }
.tabs button.active .count { background: var(--accent-soft); color: var(--accent-deep); }
.tagbar, .tag-list, .row-tags, .doc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag-list { min-height: 24px; margin: 8px 0 12px; }
.row-tags { margin-top: 5px; }
.doc-tags { display: inline-flex; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty img { width: 60px; opacity: .8; margin-bottom: 12px; animation: float 4s ease-in-out infinite; }

/* Auth screen */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(800px 500px at 15% 0%, rgba(99, 102, 241, .28) 0%, transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(219, 39, 119, .18) 0%, transparent 60%),
    linear-gradient(180deg, #f6f6fd 0%, #eef0fa 100%); }
.auth::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(79, 70, 229, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 70, 229, .06) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(60% 60% at 50% 40%, #000 30%, transparent 100%); pointer-events: none; }
.auth .card { width: 100%; max-width: 410px; padding: 30px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); border-radius: 18px; animation: rise .4s ease-out both; }
.auth .card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--grad); }
.auth .brand { justify-content: center; font-size: 24px; margin-bottom: 4px; }
.auth .brand img { width: 40px; height: 40px; }
.tabs { display: flex; gap: 4px; background: #e9ebf7; padding: 4px; border-radius: 10px; margin: 14px 0; }
.tabs button { flex: 1; padding: 7px; border: 0; background: transparent; border-radius: 7px; font: inherit; font-weight: 700; color: #5b6289; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: #fff; color: var(--accent-deep); box-shadow: 0 1px 3px rgba(15, 19, 48, .12); }

/* Dropzone */
.drop { border: 2px dashed #c7cbee; border-radius: var(--radius); padding: 34px 20px; text-align: center; background: linear-gradient(180deg, #fff 0%, #f7f8ff 100%); transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--accent-2); background: var(--grad-soft); transform: translateY(-2px); box-shadow: 0 16px 40px -20px var(--accent-glow); }
.drop img { width: 46px; margin-bottom: 10px; transition: transform .2s; }
.drop:hover img, .drop.over img { transform: translateY(-3px) scale(1.06); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 19, 48, .5); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s ease-out; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }
.modal header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; flex: 1; font-size: 16px; }
.modal .body { padding: 18px 20px; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 16px 16px; }
.modal.wide { max-width: 760px; }

/* ---------- Developers ---------- */
.lead { font-size: 15px; color: var(--ink-2); max-width: 760px; margin-bottom: 18px; }
.subnav { display: inline-flex; gap: 4px; background: #e9ebf7; padding: 4px; border-radius: 10px; margin: 0 0 18px; }
.subnav-link { padding: 7px 14px; border-radius: 7px; font-weight: 700; color: #5b6289; }
.subnav-link:hover { text-decoration: none; color: var(--ink); }
.subnav-link.active { background: #fff; color: var(--accent-deep); box-shadow: 0 1px 3px rgba(15, 19, 48, .12); }
.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 16px; }
.way { display: block; position: relative; padding: 22px 22px 18px 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.way:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 20px 44px -22px rgba(15, 19, 48, .4); border-color: #c7cbee; }
.way::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--grad); }
.way:nth-child(2)::before { background: linear-gradient(180deg, #0ea5e9, #059669); }
.way h3 { margin: 6px 0 6px; font-size: 16px; }
.way p { color: var(--ink-2); margin: 0 0 8px; }
.way ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.way li { margin: 2px 0; }
.way-num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); box-shadow: 0 8px 16px -8px var(--accent-glow); }
.way:nth-child(2) .way-num { background: linear-gradient(135deg, #0ea5e9, #059669); box-shadow: 0 8px 16px -8px rgba(5, 150, 105, .6); }
.compare-ways td:first-child { font-weight: 600; }
.keys .key-row { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.keys .key-row:first-of-type { border-top: 0; }
.keys .key-label { font-weight: 700; }
.keys input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.section-h { display: flex; align-items: center; gap: 12px; font-size: 21px; margin: 34px 0 10px; scroll-margin-top: 72px; }
.section-h .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; background: var(--grad); flex: none; }
.steps-list { margin: 0 0 12px; padding-left: 20px; }
.steps-list li { margin: 6px 0; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 18px; }
.flow-step { display: flex; gap: 10px; padding: 14px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.flow-step h3 { font-size: 14px; margin: 0 0 4px; }
.flow-step code { font-size: 11px; }
.flow-num { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #0ea5e9, #059669); }
.cta-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--grad-soft); }
.method { display: inline-block; min-width: 58px; text-align: center; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; }
.method.get { background: #059669; } .method.post { background: #2563eb; } .method.put { background: #d97706; } .method.patch { background: #7c3aed; } .method.delete { background: #e11d48; }
.docs { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.docs-nav { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.docs-nav a { padding: 7px 10px; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.docs-nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--accent-deep); }
.docs-body section { scroll-margin-top: 72px; margin-bottom: 30px; }
.docs-body section > h2 { font-size: 20px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.docs-body h3 { margin-top: 16px; }
.endpoint { padding: 16px 18px; }
.endpoint + .endpoint { margin-top: 12px; }
.endpoint-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.endpoint-head .path { font-size: 13px; font-weight: 700; background: transparent; border: 0; padding: 0; color: var(--ink); }
.endpoint p { margin: 0 0 10px; }
.ex-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 12px 0 6px; }
.params td, .params th { padding: 8px 8px; font-size: 13px; }
.params code { white-space: nowrap; }
@media (max-width: 900px) {
  .ways, .flow { grid-template-columns: 1fr; }
  .keys .key-row { grid-template-columns: 1fr; gap: 6px; }
  .docs { grid-template-columns: 1fr; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

.site-footer { max-width: 1100px; margin: 0 auto; padding: 10px 20px 40px; font-size: 13px; color: var(--muted); }

/* Toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; z-index: 200; box-shadow: 0 12px 32px rgba(15, 19, 48, .35); animation: toast .25s ease-out; border-left: 4px solid var(--accent-2); }
.toast.err { background: var(--danger); border-left-color: #fda4af; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Designer ---------- */
.designer { display: grid; grid-template-rows: auto 1fr; height: calc(100vh - 58px); }
.designer.embedded { height: 100vh; }
.designer .toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.designer .toolbar .docname { font-weight: 700; font-size: 15px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.designer .work { display: grid; grid-template-columns: 190px 1fr 280px; min-height: 0; }
.designer .palette { background: var(--panel); border-right: 1px solid var(--line); padding: 12px; overflow: auto; }
.designer .palette h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 8px; }
.designer .palette h3.section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.tool { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; cursor: pointer; margin-bottom: 6px; font-weight: 600; user-select: none; transition: border-color .15s, background .15s, transform .12s, box-shadow .15s; }
.tool:hover { border-color: var(--line-2); background: var(--panel-2); transform: translateX(2px); }
.tool.active { border-color: var(--f-color, var(--accent)); background: color-mix(in srgb, var(--f-color, var(--accent)) 10%, #fff); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--f-color, var(--accent)) 18%, transparent); }
.tool .sw { width: 12px; height: 12px; border-radius: 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--f-color, var(--accent)) 22%, transparent); }
.designer .canvas { overflow: auto; padding: 22px; background: #d9dcef; background-image: radial-gradient(#a3a8cc .7px, transparent .7px); background-size: 18px 18px; }
.designer .canvas.drawing { cursor: crosshair; }
.designer .props { background: var(--panel); border-left: 1px solid var(--line); padding: 14px; overflow: auto; }
.designer .props h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 8px; }
.props .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fieldlist { list-style: none; margin: 0; padding: 0; }
.fieldlist li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: background .12s; }
.fieldlist li:hover { background: var(--panel-2); }
.fieldlist li.active { background: var(--accent-soft); }
.fieldlist li .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.fieldlist li .k { font-weight: 600; }
.fieldlist li .pg { margin-left: auto; color: var(--muted); font-size: 11px; }

.pdfpage { position: relative; margin: 0 auto 22px; background: #fff; box-shadow: 0 2px 4px rgba(15, 19, 48, .08), 0 16px 40px -12px rgba(15, 19, 48, .3); border-radius: 2px; }
.pdfpage canvas { display: block; }
.pdfpage .overlay { position: absolute; inset: 0; }
.pdfpage .pgnum { position: absolute; right: -2px; top: -22px; font-size: 11px; color: #4b5280; font-weight: 700; }

.fbox { position: absolute; border: 1.5px solid var(--f-color, #4f46e5); background: color-mix(in srgb, var(--f-color, #4f46e5) 14%, transparent); border-radius: 3px; cursor: move; font-size: 11px; color: var(--f-color, #3730a3); overflow: hidden; user-select: none; }
.fbox .lbl { position: absolute; left: 3px; top: 1px; right: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; pointer-events: none; opacity: .9; }
.fbox.selected { border-width: 2px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--f-color, #4f46e5) 30%, transparent); z-index: 2; }
.fbox .hnd { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: #fff; border: 2px solid var(--f-color, #4f46e5); border-radius: 2px; cursor: nwse-resize; }
.fbox.drawing { pointer-events: none; }
.f-text { --f-color: #2563eb; } .f-name { --f-color: #7c3aed; } .f-address { --f-color: #0891b2; } .f-phone { --f-color: #0d9488; }
.f-email { --f-color: #4f46e5; } .f-date { --f-color: #d97706; } .f-signature { --f-color: #db2777; } .f-initials { --f-color: #be185d; } .f-checkbox { --f-color: #16a34a; }

/* ---------- Signer ---------- */
.sign-top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; box-shadow: 0 6px 24px -16px rgba(15, 19, 48, .4); }
.sign-top .title { font-weight: 700; }
.progress { height: 7px; background: #e6e8f3; border-radius: 4px; width: 160px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #059669); width: 0; transition: width .25s; }
.sign-wrap { padding: 24px 12px 80px; }
.sinput { position: absolute; display: flex; align-items: center; font-family: var(--font); }
.sinput input, .sinput textarea { width: 100%; height: 100%; border: 1.5px solid #f59e0b; background: rgba(254, 243, 199, .55); border-radius: 3px; padding: 0 4px; font: inherit; font-size: inherit; color: #111; resize: none; line-height: 1.2; }
.sinput textarea { padding-top: 2px; }
.sinput input:focus, .sinput textarea:focus { outline: none; border-color: var(--accent-2); background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, .3); }
.sinput.done input, .sinput.done textarea { border-color: #10b981; background: rgba(209, 250, 229, .35); }
.sinput.locked { background: rgba(224, 231, 255, .5); border: 1.5px dashed #a5b4fc; border-radius: 3px; padding: 0 4px; color: #111; overflow: hidden; white-space: pre-wrap; line-height: 1.2; }
.sinput.chk { justify-content: center; }
.sinput.chk input { width: 90%; height: 90%; padding: 0; margin: 0; cursor: pointer; accent-color: var(--ok); }
.sinput.sig { border: 1.5px dashed #db2777; background: rgba(252, 231, 243, .6); border-radius: 4px; cursor: pointer; justify-content: center; color: #9d174d; font-weight: 700; transition: background .12s, box-shadow .12s; }
.sinput.sig:hover { background: rgba(252, 231, 243, .95); box-shadow: 0 0 0 3px rgba(219, 39, 119, .18); }
.sinput.sig.done { border-style: solid; border-color: #10b981; background: rgba(255,255,255,.7); }
.sinput.sig img { max-width: 96%; max-height: 92%; object-fit: contain; }
.sigpad { border: 1px solid var(--line-2); border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 180px; display: block; background-image: linear-gradient(transparent 70%, rgba(79, 70, 229, .08) 70%, rgba(79, 70, 229, .08) calc(70% + 1px), transparent calc(70% + 1px)); }
.sigtype { font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", "Apple Chancery", cursive; font-size: 40px; }
.done-screen { max-width: 520px; margin: 60px auto; text-align: center; animation: rise .4s ease-out both; }
.done-screen .big { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; display: grid; place-items: center; margin: 0 auto 18px; font-size: 34px; box-shadow: 0 12px 30px -10px rgba(5, 150, 105, .5); }

/* Embed */
.embed-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.embed-top .brand { font-size: 14px; } .embed-top .brand img { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .designer .work { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .designer .palette { display: flex; gap: 6px; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .designer .palette h3, .designer .palette .hint { display: none; }
  .tool { margin: 0; white-space: nowrap; }
  .tool:hover { transform: none; }
  .designer .props { border-left: 0; border-top: 1px solid var(--line); max-height: 40vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
