@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/IBMPlexSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Snug Serif"; src: url("fonts/serif.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ink: #1D1B20;
  --graphite: #5C5862;
  --muted: #8B8691;
  --paper: #F5F1E8;
  --bg: #F6F3EC;
  --surface: #FFFFFF;
  --tint: #F2EEE7;
  --panel: #FAF8F4;
  --line: #E7E1D6;
  --stone: #D8D2C6;
  --accent: #7A2A25;
  --accent-hover: #66221E;
  --accent-soft: #F6ECE9;
  --accent-line: #EAD3CE;
  --accent-ring: rgba(122, 42, 37, .22);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(29, 27, 32, .05), 0 12px 32px -16px rgba(29, 27, 32, .16);
  --shadow-lg: 0 2px 6px rgba(29, 27, 32, .06), 0 26px 50px -18px rgba(29, 27, 32, .26);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: "Snug Serif", "TeX Gyre Pagella", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --sans: "Plex", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .86em; letter-spacing: 0; }
button { font: inherit; }
.inline { display: inline; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--graphite); }
.pre { white-space: pre-line; }
.dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--stone); flex: none; }

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(150%) blur(14px); backdrop-filter: saturate(150%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1260px; height: 64px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-logo { height: 17px; width: auto; display: block; }
.brand-mark { display: none; width: 26px; height: 26px; }
.brand-sep { width: 1px; height: 18px; background: var(--stone); }
.brand-tag { font-weight: 500; font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--graphite); font-weight: 500; font-size: 14px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--tint); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; border-radius: 2px; background: var(--accent); transform-origin: left; animation: grow .5s var(--ease) both; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 9px; border: 1px solid transparent; font: 500 14px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .18s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s, opacity .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .steps button:focus-visible, .segmented button:focus-visible, .nav a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-primary { background: var(--accent); color: #FFFFFF; box-shadow: 0 1px 2px rgba(122, 42, 37, .25), inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(122, 42, 37, .6); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--stone); }
.btn-ghost:hover { background: var(--tint); border-color: #CAC2B3; transform: translateY(-1px); }
.btn-danger { background: var(--surface); color: var(--accent); border-color: var(--accent-line); }
.btn-danger:hover { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.is-busy { pointer-events: none; opacity: .92; }
.btn.is-busy .ico { display: none; }
.btn.is-busy::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--graphite); cursor: pointer; transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--tint); color: var(--ink); }
.icon-btn.is-copied { color: var(--accent); }

.page { flex: 1; width: 100%; max-width: 1260px; margin: 0 auto; padding: 42px 28px 64px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.head-compact { margin-bottom: 24px; }
.kicker { margin: 0 0 8px; font-weight: 500; font-size: 11.5px; line-height: 1.4; letter-spacing: .17em; text-transform: uppercase; color: var(--accent); }
.display { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1.06; letter-spacing: -.005em; }
.display-sm { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.12; }
.title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.2; }
.title-sm { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.25; }
.lead { margin-top: 12px; max-width: 660px; font-size: 16px; color: var(--graphite); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: 13.5px; font-weight: 500; color: var(--graphite); text-decoration: none; transition: color .2s; }
.back:hover { color: var(--ink); }
.back .ico { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.back:hover .ico { transform: translateX(-3px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--stone); }
.stat.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.stat-icon { grid-row: 1 / span 2; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-num { font-family: var(--serif); font-size: 32px; line-height: 1; }
.stat-label { margin-top: 4px; font-size: 13px; color: var(--graphite); }

.list-card { overflow: hidden; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 9px; height: 40px; min-width: min(360px, 100%); padding: 0 12px; background: var(--surface); border: 1px solid var(--stone); border-radius: 9px; color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--stone); background: var(--surface); color: var(--graphite); font: 500 13px var(--sans); cursor: pointer; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--graphite); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rows { list-style: none; margin: 0; padding: 0; }
.row-item + .row-item { border-top: 1px solid var(--line); }
.row-item.is-hidden { display: none; }
.row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto auto 156px 18px; align-items: center; gap: 16px; padding: 16px 20px; text-decoration: none; transition: background .2s; }
.row:hover { background: var(--panel); }
.row:hover .row-go { transform: translateX(3px); color: var(--accent); }
.row-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--tint); color: var(--ink); transition: background .2s, color .2s; }
.row:hover .row-icon { background: var(--accent-soft); color: var(--accent); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; font-size: 15px; }
.row-sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--graphite); }
.row-ref { font-size: 12.5px; color: var(--graphite); }
.row-date { font-size: 12.5px; text-align: right; color: var(--muted); }
.row-go { color: var(--muted); transition: transform .25s var(--ease), color .2s; }
.badge { padding: 5px 7px; border-radius: 6px; background: var(--tint); color: var(--graphite); font: 600 11px/1 var(--sans); letter-spacing: .08em; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 11px; border-radius: 999px; font: 500 12.5px/1 var(--sans); white-space: nowrap; }
.pill .ico { width: 14px; height: 14px; }
.pill-draft { background: #EEEAE2; color: var(--graphite); }
.pill-sent { background: var(--accent-soft); color: var(--accent); }
.pill-signed { background: #EAE2D3; color: var(--ink); }
.pill-final { background: var(--ink); color: var(--paper); }
.pill-cancelled { background: #F1F0EE; color: var(--muted); }
.empty-filter { padding: 28px; text-align: center; color: var(--graphite); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 24px; text-align: center; }
.empty .muted { max-width: 520px; margin-bottom: 8px; }
.empty-mark { width: 52px; height: 52px; margin-bottom: 6px; opacity: .9; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin: 0 0 20px; padding: 0; border: 0; }
.doc-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 196px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.doc-card input { position: absolute; opacity: 0; pointer-events: none; }
.doc-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); }
.doc-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow); }
.doc-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--tint); color: var(--ink); transition: background .25s, color .25s, transform .35s var(--ease); }
.doc-icon .ico { width: 22px; height: 22px; }
.doc-card:hover .doc-icon { transform: scale(1.05); }
.doc-card:has(input:checked) .doc-icon { background: var(--accent); color: #FFFFFF; }
.doc-title { font-family: var(--serif); font-size: 19.5px; line-height: 1.25; }
.doc-pitch { font-size: 13.5px; color: var(--graphite); }
.doc-check { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #FFFFFF; transform: scale(0); transition: transform .3s var(--ease); }
.doc-check .ico { width: 15px; height: 15px; }
.doc-card:has(input:checked) .doc-check { transform: scale(1); }
.new-bottom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px; padding: 22px 24px; }
.new-fields { flex: 1; display: flex; flex-wrap: wrap; gap: 24px; }

.segmented { display: inline-flex; gap: 4px; padding: 4px; background: var(--tint); border: 1px solid var(--line); border-radius: 11px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span, .segmented button { display: block; padding: 8px 16px; border: 0; border-radius: 8px; background: transparent; color: var(--graphite); font: 500 14px var(--sans); cursor: pointer; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.segmented span:hover, .segmented button:hover { color: var(--ink); }
.segmented input:checked + span, .segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(29, 27, 32, .14); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }
.segmented-sm span, .segmented-sm button { padding: 6px 12px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field.grow { flex: 1; min-width: 260px; }
.field-label { font-weight: 500; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.field-label em { margin-left: 6px; font-style: normal; font-weight: 400; color: var(--muted); }
.field-hint { font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="password"], textarea, select { width: 100%; padding: 10px 12px; font: 15px/1.45 var(--sans); color: var(--ink); background: #FCFBF8; border: 1px solid var(--stone); border-radius: 9px; transition: border-color .2s, box-shadow .2s, background .2s; }
input[type="text"]:hover, input[type="password"]:hover, textarea:hover, select:hover { border-color: #C7BFB0; }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus { outline: none; background: #FFFFFF; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--graphite) 50%), linear-gradient(135deg, var(--graphite) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.wizard-grid { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 28px; align-items: start; }
.steps { position: sticky; top: 88px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steps button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--graphite); text-align: left; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.steps button:hover { background: rgba(255, 255, 255, .75); color: var(--ink); }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--stone); color: var(--graphite); font: 600 12.5px var(--sans); transition: all .3s var(--ease); }
.step-num .ico { width: 14px; height: 14px; }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-kicker { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.step-title { font-weight: 500; font-size: 14px; line-height: 1.3; }
.steps li.is-done .step-num { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.steps li.is-current button { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.steps li.is-current .step-num { background: var(--accent); border-color: var(--accent); color: #FFFFFF; box-shadow: 0 0 0 4px var(--accent-soft); }
.wizard-card { position: relative; overflow: hidden; padding: 36px 40px 26px; }
.progress { position: absolute; top: 0; left: 0; width: 100%; height: 3px; border: 0; background: var(--tint); -webkit-appearance: none; appearance: none; }
.progress::-webkit-progress-bar { background: var(--tint); }
.progress::-webkit-progress-value { background: var(--accent); transition: width .6s var(--ease); }
.progress::-moz-progress-bar { background: var(--accent); }
.wizard-title { margin-bottom: 26px; }
.step-count { margin-top: 6px; font-size: 13px; color: var(--muted); }
.intro-text { margin: -10px 0 22px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.fields > .field-wide, .fields > .choice, .fields > .check, .fields > .table-field { grid-column: 1 / -1; }
.field.is-off { display: none; }
.field.is-shown { animation: rise .35s var(--ease) both; }

.check { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.check:hover { border-color: var(--stone); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; display: grid; place-items: center; background: #FFFFFF; border: 1.5px solid #BDB5A6; color: #FFFFFF; transition: all .22s var(--ease); }
.check-box .ico { width: 14px; height: 14px; transform: scale(0); transition: transform .25s var(--ease); }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check:has(input:checked) .check-box { background: var(--accent); border-color: var(--accent); }
.check:has(input:checked) .check-box .ico { transform: scale(1); }
.check:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }
.check-text { font-size: 14.5px; line-height: 1.5; }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.choice-item:hover { border-color: var(--stone); }
.choice-item input { position: absolute; opacity: 0; }
.choice-dot { position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; border: 1.5px solid #BDB5A6; transition: border-color .2s; }
.choice-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .25s var(--ease); }
.choice-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-item:has(input:checked) .choice-dot { border-color: var(--accent); }
.choice-item:has(input:checked) .choice-dot::after { transform: scale(1); }
.choice-item:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }
.choice-text { font-size: 14.5px; }

.table-field { overflow-x: auto; }
.tbl { display: grid; gap: 6px; min-width: 580px; }
.tbl-row { display: grid; gap: 6px; align-items: center; }
.tbl.cols-3 .tbl-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tbl.cols-4 .tbl-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tbl.cols-5 .tbl-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tbl.cols-6 .tbl-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tbl.has-labels.cols-5 .tbl-row { grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); }
.tbl.has-labels.cols-6 .tbl-row { grid-template-columns: 1.5fr repeat(5, minmax(0, 1fr)); }
.tbl-head span { padding: 0 2px 2px; font: 500 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); }
.tbl input[type="text"] { padding: 8px 10px; font-size: 14px; }
.tbl-label { font-size: 14px; font-weight: 500; }
.tbl-row.is-hidden { display: none; }
.tbl-row.is-shown { animation: rise .3s var(--ease) both; }
.table-field [data-add-row] { align-self: flex-start; margin-top: 6px; }

.signers { display: grid; gap: 16px; }
.signer-card { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: opacity .3s, border-color .3s, background .3s; }
.signer-card.is-optional:not(.is-on) { opacity: .7; background: transparent; border-style: dashed; }
.signer-card.is-optional:not(.is-on) .signer-fields { display: none; }
.signer-card.is-on .signer-fields { animation: rise .35s var(--ease) both; }
.signer-head { display: flex; align-items: center; gap: 14px; }
.signer-icon { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.signer-id .kicker { margin: 0; }
.signer-party { margin-top: 2px; font-family: var(--serif); font-size: 19px; line-height: 1.2; }
.signer-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-top: 16px; }
.signer-fields .note { grid-column: 1 / -1; margin: 0; }
.switch { position: relative; margin-left: auto; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #D6CFC2; transition: background .25s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); transition: transform .3s var(--ease); }
.switch:has(input:checked) .switch-track { background: var(--accent); }
.switch:has(input:checked) .switch-thumb { transform: translateX(18px); }
.switch:has(input:focus-visible) .switch-track { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch-label { font-size: 13.5px; font-weight: 500; }

.note { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: var(--tint); color: var(--graphite); font-size: 13.5px; }
.note .ico { margin-top: 1px; width: 16px; height: 16px; }
.callout { display: flex; gap: 12px; margin: 18px 0; padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 14px; }
.callout > .ico { margin-top: 2px; color: var(--accent); }
details summary { margin-top: 6px; color: var(--accent); font-weight: 500; cursor: pointer; }
details ul { margin: 8px 0 0; padding-left: 18px; }

.recap { display: grid; gap: 16px; }
.recap-block { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.recap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.recap-head .kicker { margin-bottom: 2px; font-size: 10.5px; }
.recap-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 18.5px; }
.recap-list { margin: 0; padding: 4px 18px 12px; }
.recap-item { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; padding: 9px 0; border-top: 1px solid #F0ECE4; }
.recap-item:first-child { border-top: 0; }
.recap-item dt { font-size: 13.5px; color: var(--graphite); }
.recap-item dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.recap-item .muted { font-style: italic; }
.recap-table { margin: 0; padding-left: 18px; }

.wizard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.saved-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.saved-hint .ico { width: 14px; height: 14px; }

.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--graphite); }
.meta-row .pill { margin-left: 6px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 24px; padding: 22px 24px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tl-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.tl-step::before, .tl-step::after { content: ""; position: absolute; top: 20px; left: calc(-50% + 24px); right: calc(50% + 24px); height: 2px; border-radius: 2px; }
.tl-step::before { background: var(--line); }
.tl-step::after { background: var(--ink); transform: scaleX(0); transform-origin: left; }
.tl-step:first-child::before, .tl-step:first-child::after { display: none; }
.tl-step.is-done::after, .tl-step.is-now::after { animation: grow .7s var(--ease) both; }
.tl-step:nth-child(2)::after { animation-delay: .15s; }
.tl-step:nth-child(3)::after { animation-delay: .3s; }
.tl-step:nth-child(4)::after { animation-delay: .45s; }
.tl-step:nth-child(5)::after { animation-delay: .6s; }
.tl-dot { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--stone); color: var(--muted); transition: all .3s; }
.tl-step.is-done .tl-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tl-step.is-now .tl-dot { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); animation: pulse 2.6s ease-in-out infinite; }
.tl-label { font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--muted); }
.tl-step.is-done .tl-label, .tl-step.is-now .tl-label { color: var(--ink); }

.dossier-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 24px; align-items: start; }
.dossier-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.dossier-main > *, .dossier-side > * { min-width: 0; }
.dossier-side { position: sticky; top: 88px; display: grid; gap: 16px; }
.stage { padding: 26px 28px; }
.stage-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.stage-head .kicker { margin-bottom: 4px; }
.stage-icon { flex: none; width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stage-icon .ico { width: 22px; height: 22px; }
.stage-icon-ink { background: var(--ink); color: var(--paper); }
.stage-final { border-color: #D9D2C4; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.platform { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: transform .22s var(--ease), border-color .2s, background .2s, box-shadow .2s; }
.platform:hover { transform: translateY(-1px); border-color: var(--stone); }
.platform input { position: absolute; opacity: 0; }
.platform-name { padding-right: 26px; font-weight: 600; font-size: 15px; }
.platform-note { font-size: 12.5px; line-height: 1.45; color: var(--graphite); }
.platform-check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #FFFFFF; transform: scale(0); transition: transform .25s var(--ease); }
.platform-check .ico { width: 13px; height: 13px; }
.platform:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.platform:has(input:checked) .platform-check { transform: scale(1); }
.platform:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }
.howto { list-style: none; display: grid; gap: 10px; margin: 18px 0 0; padding: 0; }
.howto > li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; font-size: 14.5px; }
.howto-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 600 12.5px var(--sans); }
.order { display: grid; gap: 6px; margin: 10px 0 0; padding-left: 20px; }
.order li span + span { margin-left: 8px; font-size: 13px; }
.upload-form { margin-top: 4px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px 20px; background: var(--panel); border: 1.5px dashed #C9C1B2; border-radius: 14px; text-align: center; cursor: pointer; transition: border-color .25s, background .25s; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; border-color: var(--ink); background: var(--surface); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--accent); transition: transform .35s var(--ease); }
.drop.is-over .drop-icon, .drop:hover .drop-icon { transform: translateY(-4px); }
.drop-title { font-weight: 500; }
.drop-sub { font-size: 13px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 18px 0 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 12px; }
.facts > div { padding: 12px 16px; background: var(--surface); }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.facts dd { margin: 4px 0 0; font-size: 14.5px; }
.hash { display: flex; align-items: center; gap: 8px; }
.hash code { word-break: break-all; font-size: 12.5px; }
.warn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.warn .ico { width: 16px; height: 16px; }
.pop { animation: pop .7s var(--ease) both .25s; }
.preview-card { padding: 22px 24px 18px; }
.strip { display: flex; gap: 16px; overflow-x: auto; padding: 16px 4px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.sheet { flex: none; width: 150px; scroll-snap-align: start; text-decoration: none; }
.sheet img { display: block; width: 150px; height: auto; aspect-ratio: 210 / 297; background: #FFFFFF; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 2px rgba(29, 27, 32, .06), 0 8px 20px -10px rgba(29, 27, 32, .22); transition: transform .3s var(--ease), box-shadow .3s; }
.sheet:hover img { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.sheet.is-sign img { outline: 2px solid var(--accent); outline-offset: 3px; }
.sheet-num { display: block; margin-top: 8px; text-align: center; font-size: 12px; color: var(--muted); }
.side-card { padding: 18px 20px; }
.side-card .kicker { margin-bottom: 12px; }
.people { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.people li { display: flex; align-items: center; gap: 12px; }
.people strong { display: block; font-weight: 500; font-size: 14.5px; }
.people .muted { display: block; font-size: 12.5px; }
.person-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); }
.person-icon .ico { width: 16px; height: 16px; }
.lang-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.history { display: grid; gap: 12px; max-height: 340px; margin: 0; padding: 0 4px 0 0; overflow-y: auto; list-style: none; }
.history li { display: flex; gap: 12px; }
.history-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.history strong { display: block; font-weight: 500; font-size: 13.5px; line-height: 1.45; }
.history .muted { display: block; font-size: 12px; }
.autosave-state { margin-top: 6px; font-size: 12px; transition: color .25s; }
.autosave-state.is-saved { color: var(--ink); }
.danger { border-color: #EADBD7; }
.delete-form { display: grid; gap: 10px; margin-top: 12px; }
.delete-form .field-label { font-weight: 400; font-size: 12.5px; color: var(--graphite); }

.blank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.blank-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; transition: transform .25s var(--ease), box-shadow .25s; }
.blank-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.blank-card .doc-icon { margin-bottom: 6px; }
.blank-card .muted { font-size: 13.5px; }
.blank-card .actions { margin-top: auto; padding-top: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.settings-card { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.settings-card .kicker { margin-bottom: -10px; }
.error-card { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 560px; margin: 40px auto; padding: 48px 32px; text-align: center; }
.error-card .muted { margin-bottom: 10px; }

.toasts { position: fixed; top: 78px; right: 24px; z-index: 50; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 14px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .5s var(--ease) both; }
.toast > span { flex: 1; }
.toast-error { background: var(--accent); color: #FFFFFF; }
.toast-info { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.toast-close { padding: 0; border: 0; background: transparent; color: inherit; opacity: .7; cursor: pointer; }
.toast-close .ico { width: 16px; height: 16px; }
.toast.is-leaving { animation: toastOut .35s ease-in both; }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(29, 27, 32, .44); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .25s ease both; }
.modal-card { position: relative; width: min(470px, 100%); padding: 28px; background: var(--surface); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: modalIn .4s var(--ease) both; }
.modal-icon { width: 48px; height: 48px; margin-bottom: 14px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.modal-title { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 23px; }
.modal-text { margin-bottom: 22px; color: var(--graphite); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.auth-body { background: var(--surface); }
.auth-page { max-width: none; padding: 0; display: flex; }
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 56px 64px; overflow: hidden; background: var(--paper); border-right: 1px solid var(--line); }
.auth-side::after { content: ""; position: absolute; right: -140px; bottom: -150px; width: 460px; height: 460px; background: url("brand/Mark_Ink.svg") no-repeat center / contain; opacity: .05; pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.auth-logo { width: 150px; height: auto; }
.auth-copy .display { max-width: 470px; font-size: 50px; }
.auth-steps { display: flex; flex-wrap: wrap; gap: 22px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; font-weight: 500; color: var(--graphite); }
.auth-steps li { display: flex; align-items: center; gap: 8px; }
.auth-steps .ico { color: var(--accent); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-card .kicker { margin-bottom: -10px; }
.auth-card .title { font-size: 32px; }
.auth-card .muted { margin-top: -8px; font-size: 14px; }
.form-error { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 14px; animation: shake .45s ease both; }
.auth-legal { margin-top: 36px; font-size: 12px; letter-spacing: .04em; color: var(--muted); }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 26px 20px 34px; font-size: 12px; letter-spacing: .02em; color: var(--muted); }
.foot-mark { width: 16px; height: 16px; opacity: .7; }

.reveal { animation: rise .6s var(--ease) both; }
.d1 { animation-delay: .06s; }
.d2 { animation-delay: .12s; }
.d3 { animation-delay: .18s; }
.d4 { animation-delay: .24s; }
.d5 { animation-delay: .3s; }
.d6 { animation-delay: .36s; }
.d7 { animation-delay: .42s; }
.step-enter { animation: stepIn .5s var(--ease) both; }
.step-enter.from-left { animation-name: stepInLeft; }
.step-leave { animation: stepOut .22s ease-in both; }
.step-leave.to-right { animation-name: stepOutRight; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(122, 42, 37, .2); } 50% { box-shadow: 0 0 0 9px rgba(122, 42, 37, 0); } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes stepIn { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes stepInLeft { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes stepOut { to { opacity: 0; transform: translateX(-22px); } }
@keyframes stepOutRight { to { opacity: 0; transform: translateX(22px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes drift { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(3deg) translateY(-16px); } }

@media (max-width: 1100px) {
  .dossier-grid { grid-template-columns: minmax(0, 1fr); }
  .dossier-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 42px minmax(0, 1fr) auto 18px; }
  .row-ref, .row .badge, .row-date { display: none; }
}
@media (max-width: 900px) {
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .nav span, .topbar-actions .btn span, .brand-sep, .brand-tag { display: none; }
  .wizard-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { position: static; }
  .steps ol { flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .steps .step-text { display: none; }
  .steps button { padding: 6px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields, .signer-fields { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .display { font-size: 36px; }
  .dossier-side { grid-template-columns: minmax(0, 1fr); }
  .timeline { padding: 18px 12px; }
  .tl-label { font-size: 11.5px; }
}
@media (max-width: 600px) {
  .page { padding: 26px 16px 48px; }
  .head { flex-direction: column; align-items: flex-start; }
  .wizard-card { padding: 26px 18px 20px; }
  .stage { padding: 22px 18px; }
  .recap-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .platforms { grid-template-columns: minmax(0, 1fr); }
  .tl-dot { width: 32px; height: 32px; }
  .tl-step::before, .tl-step::after { top: 16px; left: calc(-50% + 20px); right: calc(50% + 20px); }
  .tl-label { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .search { min-width: 100%; }
  .brand-logo { display: none; }
  .brand-mark { display: block; }
  .nav { margin-left: 0; }
  .nav a { padding: 8px 10px; }
  .topbar-actions .btn { width: 40px; padding: 0; }
  .row { grid-template-columns: 42px minmax(0, 1fr) 18px; grid-template-rows: auto auto; row-gap: 6px; padding: 14px 16px; }
  .row-icon { grid-row: 1 / span 2; }
  .row-main { grid-column: 2; grid-row: 1; }
  .row .pill { grid-column: 2; grid-row: 2; justify-self: start; }
  .row-go { grid-column: 3; grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
