/* Юрдок — внутрішній інструмент юрвідділу Майкредит.
   Ідея: робочий стіл юриста (холодний сірий) + аркуш листа (білий) + чорнило печатки (синій). */
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --desk: #E7EBEF;        /* фон-стіл */
  --panel: #F7F9FA;       /* ліва панель */
  --paper: #FFFFFF;
  --ink: #16202C;         /* основний текст */
  --ink-2: #536172;       /* другорядний */
  --rule: #D2D9E0;
  --rule-2: #E4E9EE;
  --stamp: #2B45B0;       /* чорнило печатки — дії, вибір */
  --stamp-ink: #fff;
  --stamp-soft: #E5E9F8;
  --ok: #1D7A4E; --ok-soft: #E2F2EA;
  --warn: #8F5600; --warn-soft: #FBF0DA;
  --bad: #B3261E; --bad-soft: #FBE7E5;
  --font: 'Plex', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 15px/1.5 var(--font); }
h1 { font-size: 22px; line-height: 1.25; font-weight: 600; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 16px; font-weight: 600; margin: 0; }
a { color: var(--stamp); }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===================== шапка ===================== */
.top { height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #8FA3E8; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #fff; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.brand-org { color: #9AA7B6; font-size: 13px; padding-left: 10px; border-left: 1px solid #3A4757; }
.fresh { font-size: 13px; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.top .fresh.ok { color: #BFE6D0; background: rgba(29,122,78,.25); }
.top .fresh.warn { color: #FFE2A8; background: rgba(176,110,0,.35); }
.top .fresh.stale { color: #fff; background: var(--bad); font-weight: 500; }
.fresh.ok { color: var(--ok); background: var(--ok-soft); } .fresh.warn { color: var(--warn); background: var(--warn-soft); } .fresh.stale { color: var(--bad); background: var(--bad-soft); }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; color: #fff; font: inherit; cursor: pointer; padding: 4px 6px; border-radius: var(--r); }
.user-btn:hover { background: rgba(255,255,255,.08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #3A4E7A; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.user-btn .who { text-align: left; line-height: 1.2; } .user-btn .who small { display: block; color: #9AA7B6; font-size: 12px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(22,32,44,.18); min-width: 230px; padding: 6px; z-index: 40; }
.menu a, .menu button { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 8px 10px; border-radius: 5px; cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--desk); }
.menu .sep { height: 1px; background: var(--rule-2); margin: 6px 4px; }
.menu .cap { font-size: 12px; color: var(--ink-2); padding: 6px 10px 2px; }

/* ===================== робоче місце (генерація) ===================== */
.workspace { display: grid; grid-template-columns: minmax(400px, 500px) 1fr; min-height: calc(100vh - 56px); }
.desk { background: var(--panel); border-right: 1px solid var(--rule); padding: 22px 22px 40px; }
.sheet-area { padding: 22px 28px 40px; display: flex; flex-direction: column; min-width: 0; }

.step { position: relative; padding: 0 0 22px 40px; }
.step::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 1px; background: var(--rule); }
.step:last-child::before { display: none; }
.step-n { position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; border: 1.5px solid var(--rule); background: var(--panel);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.step.active .step-n { border-color: var(--stamp); color: var(--stamp); }
.step.done .step-n { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.step.locked { opacity: .45; } .step.locked .step-body { display: none; }
.step-title { font-weight: 600; font-size: 16px; line-height: 27px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.step-title small { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.link-btn { background: none; border: 0; color: var(--stamp); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.search { position: relative; }
.search input { font-size: 16px; padding: 11px 12px 11px 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23536172' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 12px 50% no-repeat; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(22,32,44,.14); z-index: 10; max-height: 380px; overflow: auto; padding: 4px; }
.suggest .it { padding: 8px 10px; border-radius: 5px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.suggest .it:hover, .suggest .it.hl { background: var(--stamp-soft); }
.suggest .it small { color: var(--ink-2); font-size: 13px; }
.suggest .grp { font-size: 12px; color: var(--ink-2); padding: 8px 10px 2px; }
.suggest .empty { padding: 10px; color: var(--ink-2); font-size: 14px; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.recent span { font-size: 13px; color: var(--ink-2); margin-right: 2px; }
.pill { font: inherit; font-size: 13px; background: #fff; border: 1px solid var(--rule); border-radius: 99px; padding: 3px 10px; cursor: pointer; color: var(--ink); }
.pill:hover { border-color: var(--stamp); color: var(--stamp); }

.client { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; }
.client-name { font-size: 18px; font-weight: 600; line-height: 1.3; }
.client-meta { color: var(--ink-2); font-size: 14px; margin-top: 4px; display: grid; gap: 1px; }
.client .tags { margin-top: 8px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--rule-2); color: var(--ink-2); white-space: nowrap; }
.tag.alert { background: var(--bad-soft); color: var(--bad); } .tag.info { background: var(--stamp-soft); color: var(--stamp); }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); }

.loans { border: 1px solid var(--rule); border-radius: var(--r); background: #fff; overflow: hidden; }
.loan { display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--rule-2); }
.loan:first-child { border-top: 0; }
.loan.pick { cursor: pointer; } .loan.pick:hover { background: #F4F6FC; } .loan.on { background: var(--stamp-soft); }
.loan input { margin: 0; accent-color: var(--stamp); }
.loan-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.loan-sub { grid-column: 2; font-size: 13px; color: var(--ink-2); }
.loan-r { grid-row: 1 / span 2; grid-column: 3; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.loan-r b { display: block; font-size: 14px; font-weight: 500; color: var(--ink); }
.loan.all { background: #FAFBFC; }

.tpl-chosen { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; }
.tpl-chosen b { font-weight: 600; }

.fields { display: grid; gap: 12px; }
.f { display: flex; flex-direction: column; gap: 4px; }
.f > label, label.f > span { font-size: 14px; font-weight: 500; }
.f label b, .req { color: var(--bad); font-weight: 600; }
.f small { color: var(--ink-2); font-size: 13px; }
.fe { color: var(--bad); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: #fff; align-self: flex-start; }
.seg label { padding: 7px 16px; cursor: pointer; font-weight: 500; font-size: 14px; border-right: 1px solid var(--rule); }
.seg label:last-child { border-right: 0; } .seg input { display: none; } .seg label.on { background: var(--stamp); color: #fff; }

/* аркуш */
.sheet-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sheet-bar h2 { margin: 0 auto 0 0; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.sheet-status { font-size: 13px; color: var(--ink-2); }
.sheet-wrap { flex: 1; display: flex; justify-content: center; align-items: flex-start; }
.paper { background: var(--paper); width: 100%; max-width: 794px; aspect-ratio: 210 / 297; box-shadow: 0 1px 2px rgba(22,32,44,.08), 0 8px 28px rgba(22,32,44,.12);
  position: relative; overflow: hidden; }
.paper-empty { position: absolute; inset: 0; padding: 9% 8%; }
.paper-empty .line { height: 9px; background: var(--rule-2); border-radius: 2px; margin-bottom: 14px; }
.paper-empty .msg { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); text-align: center; color: var(--ink-2); width: 70%; font-size: 15px; background: #fff; padding: 12px; }
.paper-doc { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.paper-doc .docx-wrapper { background: none !important; padding: 0 !important; }
.paper-doc section.docx { box-shadow: none !important; margin: 0 !important; }
.paper.loading::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.5); }
.done-note { margin-top: 12px; color: var(--ok); font-size: 14px; text-align: center; }

/* ===================== кнопки, поля ===================== */
input, select, textarea { font: inherit; font-size: 15px; padding: 8px 11px; border: 1px solid var(--rule); border-radius: var(--r); width: 100%; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--stamp); box-shadow: 0 0 0 3px var(--stamp-soft); }
input.invalid, select.invalid { border-color: var(--bad); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--stamp); }
.btn { font: inherit; font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--rule); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #AEB9C5; }
.btn.primary { background: var(--stamp); border-color: var(--stamp); color: var(--stamp-ink); }
.btn.primary:hover { background: #22398F; }
.btn.big { padding: 11px 20px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--rule-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; } .btn.xs { padding: 2px 7px; font-size: 12px; }
.err { color: var(--bad); margin: 8px 0 0; font-size: 14px; } .ok-t { color: var(--ok); }
.muted { color: var(--ink-2); } .small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
code { background: var(--rule-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: var(--mono); }
.nowrap { white-space: nowrap; } .c { text-align: center; } .r { text-align: right; }
.mt { margin-top: 14px; } .mt-xs { margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin: 3px 0; }
.bad-t { color: var(--bad); }

/* ===================== адміністрування ===================== */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.admin.solo { grid-template-columns: 1fr; }
.side { background: var(--panel); border-right: 1px solid var(--rule); padding: 22px 12px; }
.side h2 { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0 10px 8px; }
.side a { display: block; color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 5px; font-size: 15px; }
.side a:hover { background: var(--rule-2); } .side a.on { background: var(--stamp-soft); color: var(--stamp); font-weight: 500; }
.content { padding: 24px 28px 60px; min-width: 0; max-width: 1180px; }
.card { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; }
.lbl { font-weight: 600; font-size: 15px; margin-bottom: 10px; display: block; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; } .cols > .card { margin-bottom: 0; }
.narrow { max-width: 620px; }
.back { margin: -6px 0 6px -10px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--rule-2); text-align: left; vertical-align: middle; }
.grid th { background: #F5F7F9; font-size: 13px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.grid th.r, .grid td.r { text-align: right; }
.grid tr:last-child td { border-bottom: 0; }
.grid.compact td, .grid.compact th { padding: 5px 8px; }
.grid a { text-decoration: none; }
.grid input, .grid select { padding: 6px 8px; font-size: 14px; }
.grid tr.miss td { background: var(--bad-soft); } .grid tr.dim td { opacity: .55; }
.fieldsgrid td:nth-child(2) { min-width: 180px; } .fieldsgrid td:nth-child(3) { min-width: 150px; } .fieldsgrid td:nth-child(6) { min-width: 220px; }
.drop { border: 1.5px dashed #B9C3CE; border-radius: 8px; padding: 18px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 2px; margin-top: 10px; background: #FAFBFC; }
.drop:hover, .drop.over { border-color: var(--stamp); background: var(--stamp-soft); }
.note { border: 1px solid var(--rule); background: #FAFBFC; border-radius: var(--r); padding: 12px 14px; margin-top: 10px; }
.note.bad { border-color: #EFC2BE; background: var(--bad-soft); } .note.okn { border-color: #B6DEC8; background: var(--ok-soft); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule-2); }
.list-plain li:last-child { border-bottom: 0; }
.steps-help { margin: 0 0 10px; padding-left: 20px; }
.impfile { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; margin-top: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filters .f { min-width: 140px; } .filters .grow { flex: 1; min-width: 200px; }
.chip { font: 13px var(--mono); background: var(--stamp-soft); color: var(--stamp); border: 0; padding: 3px 8px; border-radius: 5px; cursor: pointer; }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 9px 0; border-top: 1px solid var(--rule-2); font-size: 14px; }
.doclist li small { color: var(--ink-2); font-size: 13px; }
.doclist a { align-self: center; font-size: 13px; text-decoration: none; }
.section-h { font-size: 14px; font-weight: 600; margin: 26px 0 4px; }

/* діалоги, тости */
.dlg { border: 0; border-radius: 10px; padding: 20px; width: min(440px, 92vw); box-shadow: 0 24px 64px rgba(22,32,44,.3); color: var(--ink); }
.dlg.wide { width: min(760px, 94vw); max-height: 86vh; }
.dlg::backdrop { background: rgba(22,32,44,.45); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; transition: .2s; z-index: 99;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 14px; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.bad { background: var(--bad); }

/* вхід */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--desk); }
.login-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side .brand { margin: 0; }
.login-side p { color: #B5C0CC; max-width: 34ch; font-size: 17px; line-height: 1.5; margin: 0; }
.login-main { display: grid; place-items: center; padding: 24px; }
.login { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 1fr; }
  .desk { border-right: 0; border-bottom: 1px solid var(--rule); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top { padding: 0 12px; gap: 10px; } .brand-org, .user-btn .who, .top .fresh { display: none; }
  .desk, .sheet-area, .content { padding-left: 16px; padding-right: 16px; }
  .admin { grid-template-columns: 1fr; } .side { border-right: 0; border-bottom: 1px solid var(--rule); padding: 8px; display: flex; overflow-x: auto; gap: 2px; }
  .side h2 { display: none; } .side a { white-space: nowrap; }
  .login-page { grid-template-columns: 1fr; } .login-side { padding: 24px; gap: 16px; }
}

/* кнопка генерації з меню форматів */
.split { position: relative; display: inline-flex; }
.split #genBtn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split .caret { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,.35); padding-left: 12px; padding-right: 12px; }
.split .menu { top: calc(100% + 6px); }
.menu button:disabled { color: var(--ink-2); cursor: not-allowed; background: none; }
.done-note a, .doclist .dl a, .grid td a { margin-right: 6px; }
.doclist .dl { align-self: center; font-size: 13px; white-space: nowrap; }

/* договір → шаблон */
.nocontract { margin-top: 8px; font-size: 13px; }
.nocontract.on { color: var(--ok); font-weight: 500; }
.suggest .it.off { cursor: not-allowed; opacity: .5; }
.suggest .it.off:hover { background: none; }
.tpl-chosen small { flex-basis: 100%; }
.tpl-chosen { flex-wrap: wrap; }

/* ===================== вхід: ілюстрація, швидкий вхід ===================== */
.login-side { position: relative; overflow: hidden; }
.login-side .side-note { color: #7D8A98; display: block; margin-top: 10px; }
.hero-art { width: min(440px, 100%); height: auto; align-self: center; margin: 12px 0; }
.accounts { display: grid; gap: 8px; }
.acc-cap { font-size: 13px; color: var(--ink-2); }
.acc, .chosen-acc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--rule);
  border-radius: 8px; cursor: pointer; text-align: left; }
.acc:hover, .acc:focus-visible { border-color: var(--stamp); }
.acc .avatar, .chosen-acc .avatar { background: var(--stamp); color: #fff; flex: none; width: 36px; height: 36px; font-size: 13px; }
.acc-who { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.acc-who small { color: var(--ink-2); font-size: 13px; }
.acc-x { background: none; border: 0; color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.acc-x:hover { background: var(--rule-2); color: var(--bad); }
.chosen-acc { background: var(--stamp-soft); border-color: transparent; }
.chosen-acc::after { content: 'змінити'; font-size: 13px; color: var(--stamp); margin-left: auto; }

/* анімація ілюстрації: стос → аркуш → рядки тексту → печатка вдавлюється (один раз) */
@keyframes sheetIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes linesIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes stampDown {
  0% { transform: translateY(-60px); opacity: 0; }
  35% { transform: translateY(-60px); opacity: 1; }
  60% { transform: translateY(80px); }
  70% { transform: translateY(84px) scaleY(.94); }
  100% { transform: translateY(-70px); opacity: 0; }
}
@keyframes markIn { 0%, 62% { opacity: 0; transform: scale(1.15); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: .92; } }
.art-stack { animation: sheetIn .6s ease-out both; }
.art-sheet { animation: sheetIn .7s .15s ease-out both; }
.art-lines { animation: linesIn .5s .7s ease-out both; }
.art-stamp { animation: stampDown 1.6s .9s cubic-bezier(.5,0,.3,1) both; transform-box: fill-box; }
.art-stamp-mark { animation: markIn 1.6s .9s ease-out both; transform-origin: 252px 252px; transform-box: view-box; }
.login { animation: sheetIn .45s ease-out both; }
body.leaving .login { opacity: 0; transform: translateY(-6px); transition: .2s; }

/* робоче місце: аркуш «оновлюється», печатка після збереження */
@keyframes sheetFresh { from { opacity: .55; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.paper.fresh-sheet .paper-doc { animation: sheetFresh .35s ease-out; }
.paper { transition: height .25s ease; }
.saved-stamp { position: absolute; right: 9%; top: 30%; width: 150px; height: 150px; border: 4px double #2B45B0; border-radius: 50%;
  display: grid; place-items: center; text-align: center; color: #2B45B0; font-weight: 700; letter-spacing: .06em;
  transform: rotate(-14deg); pointer-events: none; z-index: 5; background: rgba(255,255,255,.35); font-size: 13px; line-height: 1.3; }
.saved-stamp small { display: block; font-weight: 500; letter-spacing: 0; font-size: 12px; }
@keyframes stampHit { 0% { opacity: 0; transform: rotate(-14deg) scale(1.6); } 55% { opacity: 1; transform: rotate(-14deg) scale(.96); }
  70% { transform: rotate(-14deg) scale(1); } 100% { opacity: 1; transform: rotate(-14deg) scale(1); } }
@keyframes stampFade { to { opacity: 0; } }
.saved-stamp { animation: stampHit .45s cubic-bezier(.3,1.4,.5,1) both, stampFade .6s 2.6s ease-in forwards; }
@keyframes stepIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.step.active .step-body, .step.done .step-body { animation: stepIn .25s ease-out; }
@media (prefers-reduced-motion: reduce) { .art-stamp { display: none; } .art-stamp-mark { opacity: .92; } }
@media (max-width: 760px) { .hero-art { width: 240px; } }

.client-src { margin-top: 8px; font-size: 12.5px; }
.client-src.live { color: var(--ok); } .client-src.stale { color: var(--warn); }

/* інтеграція */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.way { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.way a { font-size: 14px; margin-top: auto; text-decoration: none; }
pre.json { max-height: 320px; overflow: auto; background: #F5F7F9; border: 1px solid var(--rule-2); border-radius: 6px; padding: 10px; font: 12px/1.45 var(--mono); }
textarea.mono { font-size: 13px; }
@media (max-width: 1000px) { .ways { grid-template-columns: 1fr; } }
