:root {
  --bg: #f2f2f5;
  --surface: #ffffff;
  --surface-soft: #f8f8fa;
  --surface-purple: #f3f1fb;
  --ink: #171719;
  --ink-soft: #52525a;
  --muted: #65656e;
  --line: #dedee4;
  --line-strong: #c9c9d1;
  --purple: #34278f;
  --purple-dark: #261c73;
  --purple-soft: #e9e6f8;
  --red: #d8202f;
  --red-dark: #b91624;
  --red-soft: #fbe9eb;
  --green: #198754;
  --green-soft: #e7f5ed;
  --amber: #a66400;
  --amber-soft: #fff3d9;
  --blue: #2366ae;
  --blue-soft: #e9f2fb;
  --shadow-sm: 0 1px 2px rgba(21, 19, 34, .035);
  --shadow-md: 0 8px 24px rgba(25, 19, 57, .075);
  --shadow-lg: 0 24px 64px rgba(25, 19, 57, .14);
  --ease-standard: cubic-bezier(.2, .75, .25, 1);
  --ease-exit: cubic-bezier(.4, 0, 1, 1);
  --duration-fast: 140ms;
  --duration-ui: 190ms;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --sidebar: 76px;
  --content-max: 1680px;
  --control-height: 42px;
  --control-sm: 36px;
  --control-md: 42px;
  --control-lg: 48px;
  --radius-control: 7px;
  --radius-surface: 10px;
  --radius-overlay: 12px;
  --row-height-compact: 48px;
  --row-height-default: 56px;
  --z-sticky: 30;
  --z-header: 35;
  --z-backdrop: 45;
  --z-drawer: 50;
  --z-dropdown: 70;
  --z-toast: 80;
  --z-skip-link: 100;
  font-family: "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; scrollbar-gutter: stable; }
body { min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.has-open-nav { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, dl, dd, ul { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.025em; line-height: 1.18; }
h1 { font-size: clamp(22px, 2vw, 30px); }
h2 { font-size: clamp(20px, 1.8vw, 26px); }
h3 { font-size: 17px; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

::selection { color: #fff; background: var(--purple); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.sr-only { position: absolute !important; top: 0 !important; left: 0 !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: var(--z-skip-link); top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 16px; border-radius: var(--radius-sm); color: #fff; background: var(--purple); }
.skip-link:focus { transform: translateY(0); }
.mono-value { font-variant-numeric: tabular-nums; letter-spacing: .015em; }
.is-numeric { text-align: right !important; font-variant-numeric: tabular-nums; }

/* Controls */
.button { display: inline-flex; min-height: var(--control-height); align-items: center; justify-content: center; gap: var(--space-2); padding: 0 var(--space-4); border: 1px solid transparent; border-radius: var(--radius-control); cursor: pointer; font-weight: 600; line-height: 1; white-space: nowrap; transition: border-color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.button svg { width: 18px; height: 18px; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button--primary { color: #fff; background: var(--red); border-color: var(--red); }
.button--primary:hover { background: var(--red-dark); border-color: var(--red-dark); box-shadow: 0 7px 18px rgba(216, 32, 47, .16); }
.button--secondary { color: var(--purple); background: var(--surface); border-color: var(--line-strong); }
.button--secondary:hover { border-color: var(--purple); background: var(--surface-purple); box-shadow: var(--shadow-sm); }
.button--ghost { color: var(--ink-soft); background: transparent; border-color: transparent; }
.button--ghost:hover { color: var(--ink); background: #e8e8ec; }
.button--danger-ghost { color: var(--red); background: transparent; }
.button--danger-ghost:hover { background: var(--red-soft); }
.button--danger { color: #fff; background: var(--red); border-color: var(--red); }
.button--danger:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button:disabled, .button[aria-disabled="true"] { opacity: .48; cursor: not-allowed; transform: none; }
.button--small { min-height: 36px; padding-inline: 13px; font-size: 13px; }
.button--wide { width: 100%; }
.button--hero { min-width: 190px; min-height: 54px; padding-inline: 24px; border-radius: 10px; font-size: 16px; box-shadow: 0 10px 26px rgba(216, 32, 47, .2); }
.button__chevron { width: 15px !important; margin-left: 2px; }
.icon-button { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--ink-soft); background: transparent; cursor: pointer; transition: background-color var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.icon-button svg { width: 19px; height: 19px; }
.icon-button:hover { color: var(--ink); background: #ececf0; transform: translateY(-1px); }
.icon-button:active { transform: translateY(0) scale(.97); }
.icon-button.is-disabled { opacity: .35; pointer-events: none; }
.mini-button { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.mini-button:hover { color: var(--purple); background: var(--purple-soft); }
.mini-button:active { transform: scale(.96); }
.mini-button svg { width: 15px; height: 15px; }
.mini-button--danger:hover { color: var(--red); background: var(--red-soft); }
.mini-button:disabled { opacity: .35; cursor: default; pointer-events: none; }
.text-button { display: inline-flex; min-height: 32px; align-items: center; padding: 0 4px; border: 0; color: var(--purple); background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { width: 100%; min-height: var(--control-height); padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); color: var(--ink); background: #fff; transition: border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard); }
textarea { min-height: 84px; resize: vertical; }
select { padding-right: 34px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #767680; }
input:hover, select:hover, textarea:hover { border-color: #a7a7b1; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); outline: 0; box-shadow: 0 0 0 3px rgba(52, 39, 143, .1); }
input:disabled { opacity: 1; color: #55555e; background: #f3f3f6; cursor: default; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field > label, .field__label-row label { color: #4d4d54; font-size: 12px; font-weight: 600; }
.field--wide, .form-grid__wide { grid-column: 1 / -1; }
.field__label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.4; }
.field-error { color: var(--red); font-size: 11px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.required-mark, .required-note span { color: var(--red); }
.required-note { color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-6); }
.form-alert { padding: 12px 14px; border: 1px solid #efbbc1; border-radius: 7px; color: #8f1521; background: var(--red-soft); }
.form-alert ul, .errorlist { margin: 0; padding-left: 18px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Application shell */
.app-frame { min-height: 100vh; }
.sidebar { position: fixed; z-index: var(--z-drawer); inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; border-right: 1px solid #dddde4; background: #f8f8fa; }
.sidebar__head { display: flex; height: 76px; flex: 0 0 76px; align-items: center; justify-content: center; padding: 12px 8px; border-bottom: 1px solid #e6e6eb; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand__mark { width: 142px; height: 46px; object-fit: contain; object-position: left center; }
.brand__product { padding-left: 8px; border-left: 1px solid var(--line-strong); color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.sidebar .brand { width: 100%; justify-content: center; gap: 0; }
.sidebar .brand__mark { width: 56px; height: 36px; object-position: center; }
.sidebar__close { display: none; }
.sidebar__nav { display: flex; flex: 1; flex-direction: column; gap: 4px; overflow-y: auto; padding: 20px 10px; }
.sidebar__eyebrow { display: none; }
.nav-link { position: relative; display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 0; padding: 0; border-radius: 9px; color: #62626a; font-weight: 500; transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.nav-link > span:not(.nav-link__count) { display: none; }
.nav-link svg { width: 20px; height: 20px; flex: 0 0 20px; }
.nav-link:hover { color: var(--ink); background: #ededf1; transform: translateY(-1px); }
.nav-link:active { transform: translateY(0) scale(.98); }
.nav-link.is-active { color: var(--purple); background: var(--purple-soft); font-weight: 700; }
.nav-link__count { position: absolute; top: 4px; right: 3px; min-width: 16px; margin: 0; padding: 0 4px; border-radius: 20px; color: var(--purple); background: rgba(255,255,255,.9); text-align: center; font-size: 8px; line-height: 16px; font-variant-numeric: tabular-nums; }
.sidebar__foot { display: grid; gap: 6px; padding: 10px; border-top: 1px solid #e3e3e8; }
.theme-toggle { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; }
.theme-toggle__sun { display: none; }
html[data-theme="dark"] .theme-toggle__moon { display: none; }
html[data-theme="dark"] .theme-toggle__sun { display: block; }
.account-card { display: flex; align-items: center; flex-direction: column; gap: 6px; padding: 7px 0 0; }
.account-card__avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--purple); font-size: 12px; font-weight: 750; }
.account-card__text { display: none; min-width: 0; flex: 1; }
.account-card__text strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-card__text small { color: var(--muted); font-size: 10px; }
.workspace { min-width: 0; min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: var(--z-header); top: 0; display: flex; min-height: 76px; align-items: center; gap: 16px; padding: 12px clamp(20px, 2.5vw, 40px); border-bottom: 1px solid #dddde3; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px) saturate(1.1); }
.topbar__menu { display: none; }
.topbar__heading { min-width: 0; flex: 1; }
.topbar__heading > p, .topbar__heading > p a { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.topbar__heading > p a:hover { color: var(--purple); }
.topbar__heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.workspace__content { width: min(100%, var(--content-max)); margin: 0 auto; padding: clamp(var(--space-5), 2.5vw, var(--space-10)); }
.workspace__content > * { animation: content-enter 240ms var(--ease-standard) both; }
.mobile-backdrop { position: fixed; z-index: var(--z-backdrop); inset: 0; background: rgba(18, 17, 26, .42); }

.message-stack { position: fixed; z-index: var(--z-toast); right: 24px; bottom: 24px; display: grid; width: min(400px, calc(100vw - 32px)); gap: 8px; }
.message { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 14px 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); animation: message-enter 220ms var(--ease-standard) both; transition: opacity var(--duration-fast) var(--ease-exit), transform var(--duration-fast) var(--ease-exit); }
.message.is-leaving { opacity: 0; transform: translateY(8px) scale(.985); pointer-events: none; }
.message--success { border-left: 4px solid var(--green); }
.message--error { border-left: 4px solid var(--red); }
.message--warning { border-left: 4px solid var(--amber); }

/* Reusable sections */
.surface { border: 1px solid var(--line); border-radius: var(--radius-surface); background: var(--surface); box-shadow: var(--shadow-sm); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-6); }
.section-head > div:first-child { min-width: 0; }
.section-head--compact { align-items: center; margin-bottom: 16px; }
.section-head h2 { margin-top: 4px; }
.section-head p:not(.section-kicker) { margin-top: 7px; color: var(--ink-soft); }
.section-kicker { color: var(--purple); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.section-meta { display: inline-grid; min-width: 30px; height: 30px; place-items: center; padding: 0 9px; border-radius: 20px; color: var(--ink-soft); background: var(--surface-soft); font-size: 12px; font-weight: 700; }

/* Home */
.page-home .workspace__content { max-width: 1320px; }
.home-hero { display: flex; min-height: 280px; align-items: center; flex-direction: column; justify-content: center; padding: 24px 18px 30px; text-align: center; }
.home-hero__datetime { display: grid; width: min(460px, 100%); grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(135deg, #fff 0%, var(--surface-soft) 100%); box-shadow: var(--shadow-sm); text-align: left; }
.home-hero__date { display: grid; min-width: 0; gap: 3px; }
.home-hero__date-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.home-hero__date time { color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.35; text-transform: capitalize; }
.home-hero__clock { display: grid; min-width: 104px; gap: 2px; padding-left: 18px; border-left: 1px solid var(--line); }
.home-hero__clock > time { color: var(--ink); font-size: 24px; font-variant-numeric: tabular-nums; font-weight: 720; letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.home-hero__seconds { margin-left: 2px; color: var(--muted); font-size: 13px; font-weight: 650; letter-spacing: 0; }
.home-hero__timezone { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.home-hero__timezone > span { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #35a86b; box-shadow: 0 0 0 3px rgba(53, 168, 107, .1); }
.home-hero h2 { max-width: 720px; margin-top: 16px; font-size: clamp(28px, 3vw, 36px); letter-spacing: -.035em; }
.home-hero > p { max-width: 620px; margin-top: 8px; color: var(--ink-soft); font-size: 14px; }
.create-menu { position: relative; display: inline-flex; margin-top: 20px; }
.create-menu__panel { position: absolute; z-index: var(--z-dropdown); top: calc(100% + 8px); left: 50%; display: none; width: 340px; padding: 7px; border: 1px solid var(--line); border-radius: var(--radius-overlay); background: #fff; box-shadow: var(--shadow-lg); transform: translateX(-50%); text-align: left; }
.create-menu--right { margin: 0; }
.create-menu--right .create-menu__panel { right: 0; left: auto; transform: none; }
.create-menu.is-open .create-menu__panel { display: grid; }
.create-menu:not(.create-menu--right).is-open .create-menu__panel { animation: menu-enter 170ms var(--ease-standard) both; transform-origin: top center; }
.create-menu--right.is-open .create-menu__panel { animation: menu-enter-right 170ms var(--ease-standard) both; transform-origin: top right; }
.create-menu__panel a { display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: 8px; }
.create-menu__panel a:hover { background: var(--surface-purple); }
.create-menu__panel a > span:nth-child(2) { display: grid; gap: 2px; }
.menu-item-disabled { display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: 8px; color: var(--muted); background: var(--surface-soft); cursor: not-allowed; }
.menu-item-disabled > span:nth-child(2) { display: grid; gap: 2px; }
.create-menu__panel strong { font-size: 13px; }
.create-menu__panel small { color: var(--muted); font-size: 11px; }
.menu-icon { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 8px; color: var(--purple); background: var(--purple-soft); }
.menu-icon svg { width: 18px; height: 18px; }
.global-search { display: flex; width: min(820px, 100%); min-height: 54px; align-items: center; gap: 12px; margin-top: 20px; padding: 5px 6px 5px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-surface); background: #fff; box-shadow: var(--shadow-sm); }
.global-search > svg { width: 21px; height: 21px; flex: 0 0 21px; color: var(--muted); }
.global-search input { min-width: 0; min-height: 44px !important; flex: 1; padding: 0 !important; border: 0 !important; box-shadow: none !important; font-size: 15px; }
.global-search button { min-height: 42px; padding: 0 20px; border: 0; border-radius: 8px; color: #fff; background: var(--purple); cursor: pointer; font-weight: 650; }
.global-search[aria-busy="true"], .registry-search[aria-busy="true"], .registry-filter-form[aria-busy="true"] { opacity: .72; }
.home-sections { margin-top: 12px; }
.module-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.module-card { display: grid; min-width: 0; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 14px 12px; border: 1px solid var(--line); border-radius: var(--radius-surface); background: #fff; transition: border-color .18s, background-color .18s; }
.module-card:hover { border-color: #aaa5d1; background: #fbfafe; transform: none; }
.module-card__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 9px; color: var(--purple); background: var(--surface-purple); }
.module-card__icon svg { width: 21px; height: 21px; }
.module-card > span:nth-child(2) { display: grid; min-width: 0; }
.module-card strong { font-size: 13px; }
.module-card small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.module-card__count { color: var(--muted); font-size: 12px; font-weight: 700; }
.home-search-results { margin-bottom: 32px; padding: 22px; }
.quick-results { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.quick-result { display: grid; grid-template-columns: 90px 1fr 1.3fr 20px; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; }
.quick-result:hover { background: var(--surface-purple); }
.quick-result__kind { color: var(--purple); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.quick-result small { color: var(--muted); }
.quick-result svg { width: 18px; }

/* Registries and dense tables */
.registry { overflow: hidden; }
.registry__toolbar { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; }
.registry__toolbar.registry-filter-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: end; gap: 12px; }
.registry-filter-form .registry-search { width: 100%; min-width: 0; }
.registry-date-range { display: grid; min-width: 0; align-items: end; grid-template-columns: repeat(2, 128px) auto auto; gap: 8px; padding: 0; margin: 0; border: 0; }
.registry-date-field { display: grid; min-width: 0; gap: 4px; }
.registry-date-field > span { color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1; }
.registry-date-field input { min-width: 0; min-height: 42px !important; padding: 8px 9px !important; background: var(--surface-soft) !important; font-size: 12px; font-variant-numeric: tabular-nums; }
.registry-date-submit { min-height: 42px; }
.registry-filter-reset { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding-inline: 4px; color: var(--purple); font-size: 11px; font-weight: 650; white-space: nowrap; }
.registry-filter-reset:hover { text-decoration: underline; }
.registry-filter-error { grid-column: 1 / -1; margin-top: -2px; color: var(--red); font-size: 11px; line-height: 1.35; }
.registry-guidance { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-soft); background: #f7f6fc; }
.registry-guidance > svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--purple); }
.registry-guidance > div { display: grid; min-width: 0; flex: 1; gap: 2px; }
.registry-guidance strong { color: var(--ink); font-size: 13px; }
.registry-guidance span { font-size: 11px; }
.registry-filters { display: flex; align-items: center; gap: 7px; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.filter-chip { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink-soft); background: #fff; font-size: 11px; font-weight: 650; }
.filter-chip:hover { border-color: #aaa5d1; color: var(--purple); }
.filter-chip.is-active { border-color: var(--purple); color: var(--purple); background: var(--purple-soft); }
.filter-chip span { display: grid; min-width: 18px; height: 18px; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .7); font-size: 9px; }
.filter-separator { width: 1px; height: 24px; margin: 0 3px; background: var(--line); }
.registry-search { position: relative; display: flex; width: min(680px, 70%); align-items: center; }
.registry-search > svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.registry-search input { padding-left: 42px !important; padding-right: 36px !important; background: var(--surface-soft) !important; }
.registry-search__clear { position: absolute; right: 6px; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 6px; color: var(--muted); font-size: 19px; line-height: 1; }
.registry-search__clear:hover { color: var(--ink); background: #e6e6ea; }
.registry__stats { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.registry__stats strong { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 24px; padding: 0 20px; border-top: 1px solid #ececf0; border-bottom: 1px solid var(--line); }
.tab { position: relative; display: inline-flex; min-height: 48px; align-items: center; gap: 7px; color: var(--ink-soft); font-weight: 600; }
.tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--purple); content: ""; opacity: 0; }
.tab span { display: inline-grid; min-width: 22px; height: 21px; place-items: center; padding: 0 6px; border-radius: 12px; background: #ededf1; font-size: 10px; }
.tab.is-active { color: var(--purple); }
.tab.is-active::after { opacity: 1; }
.registry-selection-bar { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: #fafafc; }
.registry-selection-check, .registry-row-check { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 650; }
.registry-selection-check input, .registry-row-check input { width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--purple); cursor: pointer; }
.registry-selection-summary { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.registry-selection-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.registry-select-head, .registry-select-cell { width: 46px !important; padding-right: 4px !important; text-align: center !important; }
.registry-row-check { min-width: 32px; min-height: 32px; justify-content: center; border-radius: 6px; }
.registry-row-check:hover { background: var(--purple-soft); }
.registry-select-unavailable { color: #b1b1b8; }
.data-table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-color: #bebec7 transparent; scrollbar-width: thin; }
.data-table { width: 100%; min-width: 920px; border-collapse: collapse; border-spacing: 0; table-layout: fixed; }
.data-table--counterparties { min-width: 940px; }
.data-table--counterparties.is-selectable th:nth-child(2) { width: 24%; }
.data-table--counterparties.is-selectable th:nth-child(3) { width: 16%; }
.data-table--counterparties.is-selectable th:nth-child(4) { width: 16%; }
.data-table--counterparties.is-selectable th:nth-child(5) { width: 20%; }
.data-table--counterparties.is-selectable th:nth-child(6) { width: 9%; }
.data-table--counterparties.is-selectable th:nth-child(7) { width: 11%; }
.data-table--price { min-width: 780px; }
.data-table th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); color: #64646d; background: #fafafc; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.data-table td { height: var(--row-height-default); padding: 7px 14px; border-bottom: 1px solid #ececf0; color: #414147; vertical-align: middle; }
.data-table tbody tr { background: #fff; transition: background .13s; }
.data-table tbody tr:hover { background: #f8f7fc; }
.data-table tbody tr.is-selected { background: #f3f1ff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td small { display: block; max-width: 100%; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.data-table td a:not(.icon-button):hover { color: var(--purple); }
.data-table th.table-actions-head, .data-table td.table-actions { width: 54px; }
.data-table--compact { min-width: 620px; }
.data-table--compact td { height: var(--row-height-compact); }
.data-table--documents th:nth-child(1) { width: 17%; }
.data-table--documents th:nth-child(2) { width: 22%; }
.data-table--documents th:nth-child(3) { width: 17%; }
.data-table--documents th:nth-child(4) { width: 11%; }
.data-table--documents th:nth-child(5) { width: 15%; }
.data-table--invoice-registry.is-selectable th:nth-child(2) { width: 15%; }
.data-table--invoice-registry.is-selectable th:nth-child(3) { width: 22%; }
.data-table--invoice-registry.is-selectable th:nth-child(4) { width: 17%; }
.data-table--invoice-registry.is-selectable th:nth-child(5) { width: 10%; }
.data-table--invoice-registry.is-selectable th:nth-child(6) { width: 14%; }
.data-table--invoice-registry.is-selectable th:nth-child(7) { width: 12%; }
.data-table--counterparties th:nth-child(1) { width: 26%; }
.data-table--counterparties th:nth-child(2) { width: 14%; }
.data-table--counterparties th:nth-child(3) { width: 15%; }
.data-table--counterparties th:nth-child(4) { width: 20%; }
.data-table--price th:nth-child(1) { width: 21%; }
.data-table--price th:nth-child(2) { width: 14%; }
.data-table--price th:nth-child(3) { width: 9%; }
.data-table--price th:nth-child(4) { width: 12%; }
.data-table--price th:nth-child(5) { width: 15%; }
.data-table--price th:nth-child(6) { width: 18%; }
.data-table--price th:nth-child(7) { width: 11%; }
.table-primary { display: block; overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.table-link { color: var(--purple); }
.table-actions { text-align: right; }
.table-actions .icon-button { margin-left: auto; }
.truncate-cell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border-radius: 6px; color: #4f4f57; background: #ededf1; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status--paid, .status--active, .status--success { color: #116c42; background: var(--green-soft); }
.status--unpaid, .status--cancelled { color: #a21927; background: var(--red-soft); }
.status--approval, .status--warning { color: #805000; background: var(--amber-soft); }
.status--issued { color: #1c5792; background: var(--blue-soft); }
.status--inactive { color: #5f5f68; background: #ececf0; }
.pagination { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); }
.pagination__summary { color: var(--muted); font-size: 11px; }
.pagination__controls { display: flex; align-items: center; gap: 5px; }
.pagination__current { display: grid; min-width: 36px; height: 36px; place-items: center; border-radius: 7px; color: #fff; background: var(--purple); font-size: 12px; font-weight: 700; }
.registry-empty { display: flex; min-height: 190px; align-items: center; justify-content: center; gap: 14px; padding: 28px; text-align: left; }
.registry-empty__icon { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 10px; color: var(--purple); background: var(--purple-soft); }
.registry-empty__icon svg { width: 22px; }
.registry-empty p, .empty-inline { margin-top: 3px; color: var(--muted); font-size: 12px; }
.registry-empty .button { margin-left: 10px; }

/* General editors and details */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 20px; }
.form-surface { padding: clamp(20px, 2.4vw, 32px); }
.counterparty-fields { display: grid; min-width: 0; gap: 18px; }
.counterparty-fields [hidden] { display: none !important; }
.party-kind { min-width: 0; margin: 0; padding: 0; border: 0; }
.party-kind legend { margin-bottom: 8px; color: #4d4d54; font-size: 12px; font-weight: 650; }
.party-kind__switch { display: grid; width: min(100%, 430px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #f1f1f4; }
.party-kind__option { position: relative; min-width: 0; cursor: pointer; }
.party-kind__option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.party-kind__option span { display: grid; min-height: 42px; place-items: center; padding: 8px 12px; border: 1px solid transparent; border-radius: 7px; color: var(--ink-soft); text-align: center; font-size: 13px; font-weight: 690; transition: color .16s, background .16s, border-color .16s, box-shadow .16s; }
.party-kind__option input:checked + span { border-color: #d8d6e7; color: var(--purple); background: #fff; box-shadow: 0 2px 7px rgba(31, 27, 65, .08); }
.party-kind__option input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px; }
.party-fields-section { display: grid; gap: 17px; padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.party-fields-section--common { background: #fafafd; }
.party-fields-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid #ececf0; }
.party-fields-section__head strong { font-size: 14px; }
.party-fields-section__head span { color: var(--muted); text-align: right; font-size: 11px; }
.party-passport { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fafafd; }
.party-passport > summary { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px; cursor: pointer; list-style: none; }
.party-passport > summary::-webkit-details-marker { display: none; }
.party-passport > summary span:first-child { display: grid; gap: 3px; }
.party-passport > summary strong { font-size: 14px; }
.party-passport > summary small { color: var(--muted); font-size: 11px; }
.party-passport__chevron { color: var(--muted); font-size: 20px; transition: transform .16s; }
.party-passport[open] .party-passport__chevron { transform: rotate(180deg); }
.party-passport__body { padding: 19px; border-top: 1px solid var(--line); background: #fff; }
.privacy-note { margin: 0; padding: 0 19px 17px; color: var(--muted); background: #fff; font-size: 11px; }
.editor-aside, .detail-aside { display: grid; gap: 14px; }
.aside-card { padding: 20px; }
.aside-card h3 { margin-top: 5px; }
.aside-card > p:not(.section-kicker) { margin-top: 9px; color: var(--ink-soft); font-size: 12px; }
.upd-confirmation-card { padding: 15px; }
.upd-confirmation-control { display: grid; min-width: 0; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 10px; color: var(--ink); cursor: pointer; }
.upd-confirmation-control input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--purple); cursor: pointer; }
.upd-confirmation-control span { display: grid; min-width: 0; gap: 3px; }
.upd-confirmation-control strong { font-size: 12px; line-height: 1.4; }
.upd-confirmation-control small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.upd-confirmation-card .field-error { display: block; margin: 9px 0 0 28px; line-height: 1.4; }
.upd-confirmation-card.has-error { border-color: #efbbc1; background: var(--red-soft); }
.check-list { display: grid; gap: 10px; margin-top: 16px; padding: 0; list-style: none; color: var(--ink-soft); font-size: 12px; }
.check-list li { position: relative; padding-left: 22px; }
.check-list li::before { position: absolute; top: 1px; left: 0; display: grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); content: "✓"; font-size: 9px; font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 20px; }
.detail-main { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.detail-main > * { min-width: 0; }
.detail-card { padding: 24px; }
.detail-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.detail-card__head h2 { margin-top: 4px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.detail-list > div { min-height: 72px; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-list__wide { grid-column: 1 / -1; }
.detail-list dt, .aside-list dt, .source-document dt, .tax-policy dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; }
.detail-list dd { color: var(--ink); }
.aside-list { display: grid; gap: 0; margin-top: 14px; }
.aside-list > div { padding: 11px 0; border-bottom: 1px solid #ececf0; }
.aside-list > div:last-child { border-bottom: 0; }
.aside-list dd { overflow-wrap: anywhere; color: var(--ink); font-size: 12px; }
.aside-list dd a { color: var(--purple); }

/* Dialog */
.dialog { width: min(650px, calc(100vw - 28px)); max-height: min(820px, calc(100dvh - 28px)); padding: 0; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: var(--radius-overlay); background: transparent; box-shadow: var(--shadow-lg); }
.dialog--counterparty { width: min(780px, calc(100vw - 28px)); }
.dialog--calculator { width: min(980px, calc(100vw - 28px)); }
.dialog[open] { animation: dialog-enter 200ms var(--ease-standard) both; }
.dialog[open]::backdrop { background: rgba(17, 16, 25, .48); animation: backdrop-enter 180ms ease-out both; backdrop-filter: blur(2px); }
.dialog.is-closing { animation: dialog-exit 140ms var(--ease-exit) both; }
.dialog.is-closing::backdrop { animation: backdrop-exit 140ms var(--ease-exit) both; }
.dialog__card { padding: 24px; border-radius: var(--radius-overlay); background: #fff; }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog__head h2 { margin-top: 4px; }
.dialog__head p:not(.section-kicker) { margin-top: 5px; color: var(--muted); font-size: 12px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog--counterparty .dialog__actions { position: sticky; z-index: var(--z-sticky); bottom: 0; margin-inline: -24px; margin-bottom: -24px; padding: 16px 24px 24px; border-radius: 0 0 var(--radius-overlay) var(--radius-overlay); background: #fff; }
.calculator-dialog { min-width: 0; }
.calculator-dialog__head { margin-bottom: 18px; }
.calculator-dialog__fields { display: grid; grid-template-columns: minmax(220px, 1.7fr) minmax(120px, .7fr) minmax(190px, 1fr) minmax(120px, .62fr); gap: 12px; }
.calculator-dialog__option { display: flex; width: fit-content; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); cursor: pointer; }
.calculator-dialog__option input { flex: 0 0 auto; }
.calculator-dialog__option span { display: grid; gap: 1px; }
.calculator-dialog__option strong { font-size: 12px; }
.calculator-dialog__option small { color: var(--muted); font-size: 10px; }
.calculator-dialog__run { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: #f7f6fc; }
.calculator-dialog__status { color: var(--ink-soft); font-size: 12px; }
.calculator-dialog__status.is-error { color: var(--red); }
.calculator-dialog__status.is-success { color: #116c42; }
.calculator-result { margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.calculator-result__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fafafc; }
.calculator-result__head h3 { margin-top: 2px; font-size: 16px; }
.calculator-result__head > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 14px; color: var(--purple); background: var(--purple-soft); font-size: 11px; font-weight: 700; }
.calculator-result__table-wrap { max-height: 260px; overflow: auto; overscroll-behavior: contain; }
.calculator-result__table { width: 100%; min-width: 620px; border-collapse: collapse; }
.calculator-result__table th { position: sticky; z-index: 1; top: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fff; text-align: left; font-size: 9px; letter-spacing: .03em; text-transform: uppercase; }
.calculator-result__table td { padding: 9px 12px; border-bottom: 1px solid #ececf0; font-size: 12px; }
.calculator-result__table tr:last-child td { border-bottom: 0; }
.calculator-result__table td strong, .calculator-result__table td small { display: block; }
.calculator-result__table td strong { max-width: 430px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calculator-result__table td small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.calculator-result__table .is-numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calculator-result__totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); background: var(--surface-soft); }
.calculator-result__totals > div { display: grid; gap: 3px; padding: 11px 13px; border-right: 1px solid var(--line); }
.calculator-result__totals > div:last-child { border-right: 0; }
.calculator-result__totals dt { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.calculator-result__totals dd { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calculator-result__totals .calculator-result__grand { color: #fff; background: var(--purple); }
.calculator-result__totals .calculator-result__grand dt { color: rgba(255, 255, 255, .72); }
.calculator-dialog__append-note { margin-top: 14px; color: var(--muted); font-size: 11px; text-align: right; }
.calculator-dialog__actions { position: sticky; z-index: var(--z-sticky); bottom: -24px; margin-inline: -24px; margin-bottom: -24px; padding: 16px 24px 24px; border-radius: 0 0 var(--radius-overlay) var(--radius-overlay); background: #fff; }

/* Invoice variant */
.variant-shell { width: min(100%, 980px); margin: 0 auto; }
.variant-intro { max-width: 680px; margin: 24px auto 32px; text-align: center; }
.variant-intro h2 { margin-top: 8px; font-size: clamp(26px, 3.2vw, 38px); }
.variant-intro p:not(.section-kicker) { margin-top: 10px; color: var(--ink-soft); }
.seller-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.seller-choice { display: flex; min-height: 240px; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); transition: border-color .18s, transform .18s, box-shadow .18s; }
.seller-choice:hover { border-color: var(--purple); box-shadow: none; transform: none; }
.seller-choice__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.seller-choice__mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 10px; color: #fff; background: var(--purple); font-size: 18px; font-weight: 800; }
.tax-badge { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border-radius: 20px; color: #55555d; background: #ececf0; font-size: 10px; font-weight: 750; }
.tax-badge--vat { color: #116c42; background: var(--green-soft); }
.seller-choice__body { display: grid; gap: 6px; margin-top: 25px; }
.seller-choice__body strong { font-size: 19px; line-height: 1.3; }
.seller-choice__body small { color: var(--muted); }
.seller-choice__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 20px; border-top: 1px solid #ececf0; color: var(--ink-soft); font-size: 11px; }
.seller-choice__foot svg { width: 18px; color: var(--purple); }
.variant-note { display: flex; align-items: flex-start; gap: 13px; margin-top: 18px; padding: 17px 19px; }
.variant-note > svg { width: 21px; flex: 0 0 21px; color: var(--purple); }
.variant-note p { margin-top: 3px; color: var(--ink-soft); font-size: 12px; }
.empty-state { grid-column: 1 / -1; padding: 44px; text-align: center; }
.empty-state p { margin: 8px auto 20px; color: var(--ink-soft); }

/* Invoice editor */
.invoice-editor { display: grid; gap: 16px; }
.invoice-meta { padding: 22px 24px 24px; }
.invoice-meta__title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.invoice-meta__title h2 { margin-top: 4px; }
.invoice-meta__title h2 span { color: var(--muted); font-size: 14px; font-weight: 500; }
.seller-pill { display: flex; min-width: 240px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.seller-pill > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 7px; color: #fff; background: var(--purple); font-size: 12px; font-weight: 800; }
.seller-pill > div { display: grid; min-width: 0; }
.seller-pill strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.seller-pill small { color: var(--muted); font-size: 10px; }
.invoice-meta__grid { display: grid; grid-template-columns: minmax(360px, 1.65fr) minmax(176px, .72fr) repeat(2, minmax(210px, 1fr)); align-items: stretch; gap: 16px; }
.invoice-meta__grid > .field { min-width: 0; align-content: start; }
.invoice-meta__grid > .field > label,
.invoice-meta__grid > .field > .field__label-row { display: flex; min-height: 32px; align-items: center; }
.invoice-meta__grid > .field > .field__label-row { width: 100%; }
.invoice-meta__grid > .field > .field-help { min-height: 15px; }
.search-picker { position: relative; width: 100%; min-width: 0; }
.search-picker > input, .search-picker > select { width: 100%; }
.combobox__list { position: absolute; z-index: var(--z-dropdown); top: calc(100% + 5px); right: 0; left: 0; max-height: min(320px, 46dvh); overflow-y: auto; padding: 5px; border: 1px solid var(--line-strong); border-radius: var(--radius-overlay); background: #fff; box-shadow: var(--shadow-lg); overscroll-behavior: contain; }
.combobox__option { display: grid; gap: 2px; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.combobox__option strong { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.combobox__option span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.combobox__option:hover, .combobox__option.is-active, .combobox__option[aria-selected="true"] { color: var(--purple); background: var(--purple-soft); }
.combobox__empty { padding: 14px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.picker-selection { display: grid; gap: 1px; margin-top: 6px; padding: 8px 10px; border-left: 2px solid var(--purple); border-radius: 0 6px 6px 0; background: #f7f6fc; }
.picker-selection strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.picker-selection span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.line-editor { min-width: 0; overflow: hidden; }
.line-editor__toolbar { display: grid; grid-template-columns: minmax(190px, 220px) minmax(0, 1fr); align-items: end; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.line-editor__toolbar h2 { margin-top: 3px; font-size: 20px; }
.line-editor__add { display: flex; width: 100%; min-width: 0; align-items: center; gap: 7px; }
.line-editor__add .search-picker--product { width: auto; min-width: 240px; flex: 1; }
.line-editor__add .button { min-height: var(--control-height); }
.button--calculator svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.line-selection-tools { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 7px 14px; border-bottom: 1px solid var(--line); background: #fafafc; }
.line-selection-check { display: inline-flex; min-height: 28px; align-items: center; gap: 8px; color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 650; }
.line-selection-check:has(input:disabled) { cursor: default; opacity: .55; }
.line-selection-check input, .line-select-checkbox { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--purple); cursor: pointer; }
.line-selection-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; color: var(--ink-soft); font-size: 11px; }
.line-selection-actions strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.line-table-wrap { position: relative; width: 100%; min-width: 0; max-width: 100%; min-height: 188px; overflow-x: auto; }
.line-table-wrap { max-height: clamp(360px, 52dvh, 620px); overflow-y: auto; }
.line-table { width: 100%; min-width: 920px; border-collapse: collapse; border-spacing: 0; table-layout: fixed; }
.line-table th { position: sticky; z-index: var(--z-sticky); top: 0; height: 40px; padding: 0 6px; border-bottom: 1px solid var(--line); color: #64646d; background: #fafafc; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.line-table td { height: 49px; padding: 5px 5px; border-bottom: 1px solid #ececf0; background: #fff; vertical-align: middle; }
.line-table tr:last-child td { border-bottom: 0; }
.line-table__number { width: 106px; }
.line-table__sku { width: 112px; }
.line-table__name { width: auto; }
.line-table__quantity { width: 78px; }
.line-table__unit { width: 58px; }
.line-table__weight { width: 96px; }
.line-table__price { width: 108px; }
.line-table__discount { width: 88px; }
.line-table__total { width: 112px; }
.line-table__actions { width: 40px; }
.line-input { min-height: 36px !important; padding: 6px 7px !important; border-color: #e1e1e7 !important; border-radius: 5px !important; background: #fbfbfc !important; }
.line-input:hover { border-color: var(--line-strong) !important; background: #fff !important; }
.line-input:focus { border-color: var(--purple) !important; background: #fff !important; }
.line-input--name { font-weight: 600; }
.line-order > div { display: flex; align-items: center; gap: 5px; }
.line-number { display: inline-grid; min-width: 20px; height: 24px; place-items: center; color: var(--ink); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.line-reorder { display: inline-flex; align-items: center; gap: 1px; }
.line-table tr.is-selected td { background: #f7f6fc; }
.line-table tr.is-selected .line-input { background: #fff !important; }
.line-total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.line-empty { position: absolute; inset: 39px 0 0; display: flex; align-items: center; flex-direction: column; justify-content: center; padding: 28px; color: var(--muted); background: #fff; text-align: center; }
.line-empty svg { width: 28px; margin-bottom: 8px; color: #aaaab3; }
.line-empty strong { color: var(--ink-soft); }
.line-empty span { margin-top: 3px; font-size: 11px; }
.invoice-workbench { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.invoice-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 390px; align-items: start; gap: 16px; }
.invoice-note-card { padding: 20px; }
.invoice-note-card textarea { margin-top: 8px; }
.invoice-note-card .field-help { display: block; margin-top: 7px; }
.invoice-note-card--collapsible { padding: 0; overflow: hidden; }
.invoice-note-card--collapsible summary { padding: 15px 18px; cursor: pointer; color: var(--ink-soft); font-weight: 650; }
.invoice-note-card--collapsible > div { padding: 0 18px 18px; }
.invoice-totals { padding: 20px; }
.invoice-totals--rail { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px 20px; }
.invoice-totals__head { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 14px; }
.invoice-totals__meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.invoice-totals__meta [data-save-state].is-dirty { color: var(--amber); font-weight: 600; }
.invoice-totals--rail dl { grid-column: 1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 16px; }
.invoice-totals--rail dl > div { align-items: flex-start; flex-direction: column; justify-content: flex-start; gap: 4px; }
.invoice-totals--rail .invoice-totals__grand { margin-top: 0; padding-top: 0; border-top: 0; }
.invoice-totals--rail .invoice-totals__grand dd { font-size: 20px; }
.invoice-totals--rail .invoice-totals__tax-note { grid-column: 1; margin: 0; }
.invoice-totals--rail > .button { grid-column: 2; grid-row: 2; min-height: 56px; align-self: center; }
.invoice-totals dl { display: grid; gap: 10px; }
.invoice-totals dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; color: var(--ink-soft); font-size: 12px; }
.invoice-totals dd { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice-totals__grand { margin-top: 5px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink) !important; font-size: 15px !important; font-weight: 700; }
.invoice-totals__grand dd { font-size: 22px; letter-spacing: -.03em; }
.invoice-totals__tax-note { margin: 13px 0 16px; padding: 9px 10px; border-radius: 6px; color: var(--ink-soft); background: var(--surface-soft); font-size: 10px; }
.invoice-preflight { grid-column: 1; min-height: 15px; color: var(--muted); font-size: 10px; }
.invoice-preflight.is-error { color: #a71927; font-weight: 650; }
.invoice-preflight.is-warning { color: #7c5200; }
.invoice-mobile-submit { display: none; margin: 0 12px 12px; width: calc(100% - 24px); }

/* Source and related documents */
.source-document { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 26px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.source-document__icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 8px; color: var(--purple); background: var(--purple-soft); }
.source-document__icon svg { width: 20px; }
.source-document dl { display: grid; min-width: 0; flex: 1; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 14px; }
.source-document dd { overflow-wrap: anywhere; font-size: 12px; }

/* Invoice document preview */
.legal-warning { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid #edc678; border-radius: 9px; color: #664000; background: var(--amber-soft); }
.legal-warning > svg { width: 22px; flex: 0 0 22px; }
.legal-warning > div { min-width: 0; flex: 1; }
.legal-warning p { margin-top: 2px; font-size: 11px; }
.legal-warning--danger { border-color: #efbbc1; color: #8f1521; background: var(--red-soft); }
.legal-warning--info { border-color: #c9c7df; color: #393365; background: #f1f0f8; }
.document-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 18px; }
.related-document-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 18px; }
.document-tools { position: sticky; top: 100px; display: grid; gap: 12px; padding: 18px; }
.document-tools__status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status-form { display: grid; gap: 7px; }
.status-form select { min-height: 38px; font-size: 12px; }
.document-tools__divider { height: 1px; background: var(--line); }
.aside-hint { padding: 10px 11px; border-radius: 7px; color: #805000; background: var(--amber-soft); font-size: 11px; }
.document-preview { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid #d7d7de; border-radius: 10px; background: #dedee3; box-shadow: inset 0 1px 5px rgba(20, 18, 31, .05); }
.preview-mobile-toolbar { display: none; }
.a4-stage { position: relative; width: 100%; height: calc(297mm + 48px); overflow: hidden; }
.a4-page { position: absolute; top: 24px; left: 50%; width: 210mm; min-height: 297mm; margin: 0; padding: 12mm; overflow: hidden; color: #111; background: #fff; box-shadow: 0 4px 24px rgba(20, 18, 31, .12); font-family: Arial, sans-serif; font-size: 10pt; line-height: 1.3; transform: translateX(-50%) scale(var(--preview-scale, 1)); transform-origin: top center; }
.a4-watermark { position: absolute; z-index: 0; top: 42%; left: 9%; width: 82%; color: rgba(199, 31, 46, .075); font-size: 29pt; font-weight: 800; letter-spacing: .08em; text-align: center; transform: rotate(-28deg); pointer-events: none; }
.a4-page > *:not(.a4-watermark) { position: relative; z-index: 1; }
.invoice-print-head { display: flex; min-height: 23mm; align-items: center; justify-content: space-between; gap: 10mm; padding-bottom: 3mm; border-bottom: .5mm solid var(--purple); }
.invoice-print-head img { width: 54mm; max-height: 20mm; object-fit: contain; object-position: left center; }
.invoice-print-head > div { display: grid; max-width: 95mm; gap: 1mm; text-align: right; }
.invoice-print-head > div strong { font-size: 9pt; }
.invoice-print-head > div span { color: #444; font-size: 7.5pt; }
.bank-table { width: 100%; margin-top: 4mm; border: .3mm solid #111; font-size: 7.8pt; }
.bank-table td { height: 9mm; padding: 1.2mm 1.8mm; border: .2mm solid #333; vertical-align: top; }
.bank-table td:first-child { width: 46%; }
.bank-table td:nth-child(2) { width: 28%; }
.bank-table span { display: block; margin-bottom: .5mm; color: #555; font-size: 6.5pt; }
.bank-table strong { font-weight: 600; }
.bank-placeholder { display: grid; place-items: center; margin-top: 4mm; padding: 4mm; border: .3mm dashed #9d2b35; color: #801c26; background: #fff7f8; text-align: center; }
.bank-placeholder span { margin-top: 1mm; font-size: 7pt; }
.invoice-print-title { margin: 6mm 0 4mm; padding-bottom: 2mm; border-bottom: .5mm solid #111; font-size: 15pt; }
.invoice-parties { display: grid; gap: 2mm; margin-bottom: 4mm; font-size: 8.5pt; }
.invoice-parties > div { display: grid; grid-template-columns: 24mm 1fr; gap: 2mm; }
.invoice-parties dt { font-weight: 700; }
.invoice-lines-print { width: 100%; table-layout: fixed; border: .3mm solid #111; font-size: 7.5pt; }
.invoice-lines-print th, .invoice-lines-print td { padding: 1.2mm 1.3mm; border: .2mm solid #333; vertical-align: middle; }
.invoice-lines-print th { background: #f0f0f2; text-align: center; font-size: 6.7pt; }
.invoice-lines-print th:nth-child(1) { width: 7mm; }
.invoice-lines-print th:nth-child(2) { width: auto; }
.invoice-lines-print th:nth-child(3) { width: 12mm; }
.invoice-lines-print th:nth-child(4) { width: 17mm; }
.invoice-lines-print th:nth-child(5) { width: 23mm; }
.invoice-lines-print th:nth-child(6) { width: 17mm; }
.invoice-lines-print th:nth-child(7) { width: 26mm; }
.invoice-lines-print td:nth-child(1), .invoice-lines-print td:nth-child(3) { text-align: center; }
.invoice-lines-print small { display: block; margin-top: .5mm; color: #666; font-size: 6pt; }
.invoice-print-summary { display: flex; justify-content: flex-end; margin-top: 3mm; }
.invoice-print-summary dl { width: 88mm; }
.invoice-print-summary dl > div { display: grid; grid-template-columns: 1fr 31mm; gap: 4mm; padding: .7mm 0; }
.invoice-print-summary dt { text-align: right; font-weight: 700; }
.invoice-print-summary dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.invoice-print-summary__total { margin-top: 1mm; padding-top: 1.8mm !important; border-top: .4mm solid #111; font-size: 11pt; }
.invoice-print-caption { margin-top: 4mm; padding-bottom: 2mm; border-bottom: .3mm solid #111; font-size: 8pt; }
.invoice-amount-words { margin-top: 1.5mm; font-size: 8pt; font-weight: 700; }
.invoice-signature { margin-top: 9mm; }
.invoice-signature > div { display: grid; grid-template-columns: 34mm 1fr 60mm; align-items: end; gap: 3mm; }
.invoice-signature i { height: 6mm; border-bottom: .2mm solid #111; }
.invoice-signature strong { font-size: 8pt; text-align: center; }
.invoice-terms { margin-top: 11mm; padding-top: 3mm; border-top: .2mm solid #aaa; font-size: 7pt; text-align: center; }
.invoice-print-foot { position: absolute !important; right: 12mm; bottom: 8mm; left: 12mm; display: flex; justify-content: space-between; padding-top: 2mm; border-top: .2mm solid #ccc; color: #777; font-size: 6pt; }
.a4-page.invoice-a4 { display: flex; min-height: 297mm; flex-direction: column; padding: 10.5mm 11.2mm 6mm; overflow: visible; border: .15mm solid #777; color: #111; font-family: Arial, sans-serif; font-size: 7.5pt; line-height: 1.15; }
.mag-invoice-header { display: grid; }
.mag-invoice-header img { width: 184mm; max-width: 100%; height: auto; margin: 0 auto; object-fit: contain; }
.mag-invoice-header > strong { margin-top: 1mm; padding-right: 8mm; font-size: 8.2pt; font-weight: 400; text-align: right; }
.mag-invoice-payment-heading { display: grid; gap: .5mm; margin-top: 1.5mm; text-align: center; }
.mag-invoice-payment-heading strong { color: #c72c35; font-size: 8pt; }
.mag-invoice-payment-heading span { font-size: 8.3pt; font-weight: 700; }
.mag-bank-grid { width: 100%; margin-top: .5mm; table-layout: fixed; border: .2mm solid #111; border-collapse: collapse; color: #111; font-size: 7.2pt; }
.mag-bank-grid td { padding: .35mm .6mm; border: .18mm solid #111; vertical-align: top; }
.mag-bank-grid td:first-child { width: 58%; }
.mag-bank-grid td:last-child { width: 42%; }
.mag-bank-grid tr:nth-child(1), .mag-bank-grid tr:nth-child(3) { height: 8.1mm; }
.mag-bank-grid tr:nth-child(2) { height: 5.9mm; }
.mag-bank-grid td > span:first-child { display: block; line-height: 1; }
.mag-bank-grid td > strong { display: block; font-size: 7.4pt; line-height: 1.05; }
.mag-bank-grid td > b { display: inline-block; min-width: 14mm; font-size: 7.3pt; }
.mag-bank-grid__value { display: inline !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mag-invoice-title { margin: 3mm 0 4mm; font-size: 12pt; font-weight: 700; line-height: 1.05; text-align: center; }
.mag-invoice-parties { display: grid; width: calc(100% - 18mm); gap: 1mm; margin: 0 auto 2.5mm; font-size: 7.8pt; }
.mag-invoice-parties > div { display: grid; grid-template-columns: 39mm minmax(0, 1fr); gap: 1mm; }
.mag-invoice-parties dt { font-weight: 700; }
.mag-invoice-parties dd { overflow-wrap: anywhere; }
.mag-invoice-lines { width: 100%; table-layout: fixed; border: .2mm solid #111; border-collapse: collapse; color: #111; font-size: 6.3pt; line-height: 1.05; }
.mag-invoice-lines th, .mag-invoice-lines td { padding: .25mm .4mm; border: .17mm solid #111; vertical-align: middle; }
.mag-invoice-lines thead th { height: 11.7mm; font-size: 6.2pt; font-weight: 700; text-align: center; }
.mag-invoice-lines tbody tr { height: 3.9mm; }
.mag-invoice-lines col:nth-child(1) { width: 9.2mm; }
.mag-invoice-lines col:nth-child(2) { width: 53.3mm; }
.mag-invoice-lines col:nth-child(3) { width: 14mm; }
.mag-invoice-lines col:nth-child(4) { width: 11.7mm; }
.mag-invoice-lines col:nth-child(5) { width: 19.8mm; }
.mag-invoice-lines col:nth-child(6) { width: 21.8mm; }
.mag-invoice-lines col:nth-child(7) { width: 14mm; }
.mag-invoice-lines col:nth-child(8) { width: 17.9mm; }
.mag-invoice-lines col:nth-child(9) { width: 25.9mm; }
.mag-invoice-lines--no-discount col:nth-child(1) { width: 9.2mm; }
.mag-invoice-lines--no-discount col:nth-child(2) { width: 90mm; }
.mag-invoice-lines--no-discount col:nth-child(3) { width: 15mm; }
.mag-invoice-lines--no-discount col:nth-child(4) { width: 18mm; }
.mag-invoice-lines--no-discount col:nth-child(5) { width: 27mm; }
.mag-invoice-lines--no-discount col:nth-child(6) { width: 28.4mm; }
.mag-invoice-lines td:first-child, .mag-invoice-lines td:nth-child(3) { text-align: center; }
.mag-invoice-lines td.is-numeric { overflow-wrap: anywhere; white-space: normal; }
.mag-invoice-lines__name { overflow-wrap: anywhere; }
.mag-invoice-totals { width: 97mm; margin: 2.4mm 1.5mm 0 auto; }
.mag-invoice-totals > div { display: grid; grid-template-columns: 67mm 28mm; gap: 2mm; min-height: 4.2mm; padding: .35mm 0; }
.mag-invoice-totals dt, .mag-invoice-totals dd { font-size: 8.2pt; font-weight: 700; text-align: right; }
.mag-invoice-totals dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mag-invoice-totals__payable dt, .mag-invoice-totals__payable dd { font-size: 9pt; }
.mag-invoice-caption { width: calc(100% - 17mm); margin: 1.6mm auto 0; font-size: 7.4pt; }
.mag-invoice-caption p { max-width: 155mm; }
.mag-invoice-caption span { display: block; margin-top: .5mm; }
.mag-invoice-signature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20mm; row-gap: 2.2mm; align-items: end; margin: 7mm 9mm 0; font-size: 8pt; }
.mag-invoice-signature strong { font-weight: 700; white-space: nowrap; }
.mag-invoice-signature p { text-align: right; }
.mag-invoice-signature--sealed {
  grid-template-columns: minmax(42mm, 1fr) 59mm minmax(50mm, 1fr);
  grid-template-rows: 8mm 8mm 39mm;
  column-gap: 3mm;
  row-gap: 0;
  min-height: 55mm;
  margin-top: 5mm;
  align-items: center;
  isolation: isolate;
  break-inside: avoid;
  page-break-inside: avoid;
}
.mag-invoice-signature--sealed .mag-invoice-signature__director-role { grid-column: 1; grid-row: 1; }
.mag-invoice-signature--sealed .mag-invoice-signature__director-name { grid-column: 3; grid-row: 1; }
.mag-invoice-signature--sealed .mag-invoice-signature__accountant-role { grid-column: 1; grid-row: 2; }
.mag-invoice-signature--sealed .mag-invoice-signature__accountant-name { grid-column: 3; grid-row: 2; }
.mag-invoice-signature__director-name,
.mag-invoice-signature__accountant-name {
  min-width: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.mag-invoice-signature__mark {
  z-index: 0;
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: start;
  justify-self: center;
  display: block;
  width: 55mm;
  max-width: 100%;
  height: auto;
  margin: 0;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.mag-invoice-terms { margin: auto 16mm 0; padding-top: 12mm; font-size: 5.8pt; line-height: 1.25; text-align: center; }
.mag-invoice-terms p + p { margin-top: 3.4mm; }
.mag-invoice-terms strong { font-size: 6.3pt; }
.related-strip { margin-top: 18px; padding: 20px; }
.related-strip--prominent { margin-top: 0; margin-bottom: 18px; }
.related-list { display: flex; flex-wrap: wrap; gap: 10px; }
.related-item { display: flex; min-width: 280px; flex: 1 1 300px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; transition: border-color .16s, background .16s; }
.related-item:hover { border-color: #aaa5d1; background: var(--surface-purple); }
.related-item.is-cancelled { opacity: .68; }
.related-item__icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 7px; color: var(--purple); background: var(--purple-soft); }
.related-item__icon svg { width: 18px; }
.related-item > div { display: grid; min-width: 0; flex: 1; }
.related-item small { color: var(--muted); font-size: 10px; }
.related-item__arrow { width: 17px; flex: 0 0 17px; color: var(--muted); }
.related-empty { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 18px; padding: 15px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-soft); }
.related-empty > div { display: grid; gap: 3px; }
.related-empty span { color: var(--muted); font-size: 11px; }
.related-print-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 6mm; border-bottom: .4mm solid #111; }
.related-print-head h2 { margin-top: 2mm; font-size: 18pt; }
.related-print-head > div > span { display: block; margin-top: 1mm; }
.relation-chain { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 4mm; margin: 7mm 0; padding: 4mm; border: .2mm solid #ccc; background: #fafafa; }
.relation-chain > div { display: grid; gap: 1mm; }
.relation-chain small { color: #777; font-size: 6.5pt; text-transform: uppercase; }
.relation-chain strong { font-size: 8pt; }
.relation-chain > span { color: #777; font-size: 14pt; }

/* 2026 paper representations: the formal EDI document remains XML 5.03. */
.a4-page.upd-a4 { width: 297mm; min-height: 210mm; padding: 6mm; font-size: 6.7pt; line-height: 1.16; page: upd-landscape; }
.upd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8mm; margin-bottom: 2mm; }
.upd-head h2 { font-size: 13pt; letter-spacing: -.02em; }
.upd-head p { margin-top: .8mm; color: #444; }
.upd-head dl { display: grid; min-width: 58mm; grid-template-columns: 1fr 1fr; border: .25mm solid #111; }
.upd-head dl > div { display: grid; grid-template-columns: auto 1fr; gap: 2mm; padding: 1.4mm 2mm; border-right: .2mm solid #111; }
.upd-head dl > div:last-child { border-right: 0; }
.upd-head dt { font-weight: 700; }
.upd-head dd { font-size: 9pt; font-weight: 800; text-align: right; }
.upd-requisites, .upd-lines, .contract-parties { width: 100%; border-collapse: collapse; }
.upd-requisites { table-layout: fixed; border: .25mm solid #111; }
.upd-requisites th, .upd-requisites td { padding: .75mm 1.1mm; border: .18mm solid #333; vertical-align: top; }
.upd-requisites th { width: 37mm; background: #f3f3f3; text-align: left; font-weight: 700; }
.upd-requisites th:nth-child(3) { width: 31mm; }
.upd-lines { margin-top: 2mm; table-layout: fixed; border: .25mm solid #111; font-size: 5.5pt; }
.upd-lines th, .upd-lines td { padding: .65mm .6mm; border: .16mm solid #333; overflow-wrap: anywhere; vertical-align: middle; }
.upd-lines th { background: #ededed; text-align: center; line-height: 1.08; }
.upd-lines th:nth-child(1) { width: 6mm; }
.upd-lines th:nth-child(2) { width: 57mm; }
.upd-lines th:nth-child(3) { width: 23mm; }
.upd-lines th:nth-child(4), .upd-lines th:nth-child(5) { width: 10mm; }
.upd-lines th:nth-child(6) { width: 14mm; }
.upd-lines th:nth-child(7), .upd-lines th:nth-child(8), .upd-lines th:nth-child(11), .upd-lines th:nth-child(12) { width: 20mm; }
.upd-lines th:nth-child(9), .upd-lines th:nth-child(10) { width: 14mm; }
.upd-lines th:nth-child(13) { width: 31mm; }
.upd-lines tfoot th, .upd-lines tfoot td { background: #f7f7f7; font-weight: 800; }
.upd-invoice-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin-top: 1.5mm; font-size: 5.8pt; }
.upd-transfer { margin-top: 2mm; border: .25mm solid #111; }
.upd-transfer > div:not(.upd-transfer__columns) { display: grid; grid-template-columns: 42mm 1fr; gap: 2mm; padding: 1.1mm 1.5mm; border-bottom: .18mm solid #333; }
.upd-transfer__columns { display: grid; grid-template-columns: 1fr 1fr; }
.upd-transfer__columns section { padding: 1.3mm 1.5mm; }
.upd-transfer__columns section + section { border-left: .18mm solid #333; }
.upd-transfer__columns p { min-height: 4.5mm; padding: .6mm 0; border-bottom: .12mm solid #aaa; }
.upd-transfer__columns p:last-child { border-bottom: 0; }
.upd-foot { display: flex; justify-content: space-between; gap: 10mm; margin-top: 2mm; color: #333; font-size: 5.8pt; }
.upd-foot span:first-child { font-weight: 700; }

.a4-page.contract-a4 { padding: 10mm 12mm; font-size: 7.4pt; line-height: 1.25; }
.contract-head { text-align: center; }
.contract-head > p { color: #555; font-size: 6.5pt; text-transform: uppercase; }
.contract-head h2 { margin-top: 1.5mm; font-size: 14pt; }
.contract-head > div { display: flex; justify-content: space-between; margin-top: 2.5mm; padding-bottom: 2mm; border-bottom: .3mm solid #111; }
.contract-preamble { margin-top: 3mm; text-align: justify; text-indent: 6mm; }
.contract-clauses { display: grid; gap: 2.2mm; margin-top: 3mm; }
.contract-clauses h3 { margin-bottom: .7mm; font-size: 8pt; text-align: center; text-transform: uppercase; }
.contract-clauses p { margin-top: .45mm; text-align: justify; }
.contract-parties { margin-top: 4mm; table-layout: fixed; border: .25mm solid #111; font-size: 6.7pt; }
.contract-parties th, .contract-parties td { width: 50%; padding: 1.8mm 2mm; border: .18mm solid #333; vertical-align: top; }
.contract-parties th { background: #f0f0f0; font-size: 7pt; }
.contract-signatures td { height: 13mm; padding-top: 8mm; text-align: center; }
.contract-foot { margin-top: 2mm; color: #555; font-size: 5.7pt; text-align: center; }

/* Server-backed cancellation confirmation */
.confirmation-layout { width: min(100%, 760px); margin: 24px auto; }
.confirmation-card { padding: clamp(24px, 4vw, 42px); }
.confirmation-card__icon { display: grid; width: 52px; height: 52px; margin-bottom: 18px; place-items: center; border-radius: 12px; color: var(--red); background: var(--red-soft); }
.confirmation-card__icon svg { width: 27px; }
.confirmation-card h2 { margin-top: 7px; }
.confirmation-card > p:not(.section-kicker) { max-width: 650px; margin-top: 12px; color: var(--ink-soft); }
.confirmation-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.confirmation-summary > div { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.confirmation-summary dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.confirmation-summary dd { margin-top: 3px; font-weight: 650; }
.blocking-alert { margin-top: 20px; padding: 15px; border: 1px solid #efbbc1; border-radius: 8px; color: #8f1521; background: var(--red-soft); }
.blocking-alert p { margin-top: 4px; font-size: 12px; }
.blocking-alert ul { margin: 10px 0 0; padding-left: 20px; }
.blocking-alert a { text-decoration: underline; }
.dialog--bulk-documents { width: min(920px, calc(100vw - 28px)); }
.bulk-document-dialog { min-width: 0; }
.bulk-document-section { margin-top: 18px; }
.bulk-document-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.bulk-document-section__head h3 { font-size: 14px; }
.bulk-document-section__head span { color: var(--muted); font-size: 11px; font-weight: 650; }
.bulk-document-table-wrap { overflow: auto; max-height: 250px; border: 1px solid var(--line); border-radius: 8px; }
.bulk-document-table { min-width: 680px; }
.bulk-document-table--related { min-width: 760px; }
.bulk-document-table th { height: 36px; padding-inline: 11px; font-size: 9px; }
.bulk-document-table td { height: 47px; padding: 7px 11px; font-size: 12px; }
.bulk-document-table th:nth-child(1) { width: 18%; }
.bulk-document-table th:nth-child(2) { width: 31%; }
.bulk-document-table th:nth-child(3) { width: 29%; }
.bulk-document-table th:nth-child(4) { width: 16%; }
.bulk-document-table--related th:nth-child(1) { width: 18%; }
.bulk-document-table--related th:nth-child(2) { width: 28%; }
.bulk-document-table--related th:nth-child(3) { width: 13%; }
.bulk-document-table--related th:nth-child(4) { width: 17%; }
.bulk-document-table--related th:nth-child(5) { width: 112px; }
.bulk-counterparty-table { min-width: 620px; }
.bulk-counterparty-table th:nth-child(1) { width: 48%; }
.bulk-counterparty-table th:nth-child(2) { width: 34%; }
.bulk-counterparty-table th:nth-child(3) { width: 18%; }
.bulk-document-blocking { margin-top: 18px; }
.bulk-document-blocking .blocking-alert { margin-top: 0; }
.bulk-document-reason { margin-top: 22px; }
.confirmation-form { margin-top: 24px; }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 20px; }
.settings-nav { position: sticky; top: 100px; display: grid; overflow: hidden; padding: 7px; }
.settings-nav a { display: grid; gap: 2px; padding: 10px 11px; border-radius: 6px; color: var(--ink-soft); font-size: 12px; }
.settings-nav a span { line-height: 1.3; }
.settings-nav a small { color: var(--ink-muted); font-size: 10px; line-height: 1.3; }
.settings-nav a:hover { background: var(--surface-soft); }
.settings-nav a.is-active { color: var(--purple); background: var(--purple-soft); font-weight: 700; }
.settings-nav a.is-active small,
.settings-nav a:hover small { color: inherit; }
body:has(.settings-section:target) .settings-nav a.is-active { color: var(--ink-soft); background: transparent; font-weight: 400; }
body:has(#organizations:target) .settings-nav a[href="#organizations"],
body:has(#bank:target) .settings-nav a[href="#bank"],
body:has(#tax:target) .settings-nav a[href="#tax"],
body:has(#access:target) .settings-nav a[href="#access"],
body:has(#system-update:target) .settings-nav a[href="#system-update"] { color: var(--purple); background: var(--purple-soft); font-weight: 700; }
.settings-security-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-main { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.settings-main > * { min-width: 0; }
.settings-main > form { display: grid; min-width: 0; gap: 18px; }
.settings-section { padding: 24px; scroll-margin-top: 100px; }
.settings-signers { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.settings-signers__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.settings-signers__head h3 { margin-top: 4px; font-size: 18px; }
.settings-signers__head > p { max-width: 440px; color: var(--muted); font-size: 13px; text-align: right; }
.settings-save-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.settings-save-panel .form-actions { margin: 0; }
.settings-save-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.user-table__actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.user-table__actions form { margin: 0; }
.data-table.user-table { min-width: 780px; }
.data-table.user-table th:nth-child(1) { width: 22%; }
.data-table.user-table th:nth-child(2) { width: 12%; }
.data-table.user-table th:nth-child(3) { width: 15%; }
.data-table.user-table th:nth-child(4) { width: 14%; }
.data-table.user-table th:nth-child(5) { width: 37%; }
.user-table th,
.user-table td { padding-right: 10px; padding-left: 10px; }
.user-table th:first-child,
.user-table td:first-child { padding-left: 14px; }
.user-table th:last-child,
.user-table td:last-child { padding-right: 14px; }
.user-editor { max-width: 980px; margin: 0 auto; }
.organization-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.organization-chip { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.organization-chip:hover { border-color: #aaa5d1; }
.organization-chip.is-active { border-color: var(--purple); background: var(--surface-purple); }
.organization-chip > span { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 8px; color: #fff; background: var(--purple); font-weight: 750; }
.organization-chip > div { display: grid; min-width: 0; }
.organization-chip strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.organization-chip small { color: var(--muted); font-size: 10px; }
.tax-policy { display: flex; align-items: center; gap: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.tax-policy__icon { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 9px; color: var(--purple); background: var(--purple-soft); }
.tax-policy__icon svg { width: 22px; }
.tax-policy dl { display: grid; min-width: 0; flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tax-policy dd { font-weight: 650; }

.settings-update { overflow: hidden; }
.settings-update__head { align-items: center; }
.settings-update__version { display: grid; min-width: 190px; gap: 2px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(135deg, var(--surface-purple), var(--surface)); }
.settings-update__version small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.settings-update__version strong { color: var(--purple); font-size: 18px; }
.settings-update__version span { color: var(--muted); font-size: 10px; }
.update-progress { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--purple) 26%, var(--line)); border-radius: 8px; background: var(--surface-purple); }
.update-progress__spinner { width: 22px; height: 22px; flex: 0 0 22px; border: 3px solid color-mix(in srgb, var(--purple) 18%, transparent); border-top-color: var(--purple); border-radius: 50%; animation: update-spinner 850ms linear infinite; }
.update-progress div { display: grid; gap: 2px; }
.update-progress small { color: var(--muted); font-size: 10px; }
@keyframes update-spinner { to { transform: rotate(360deg); } }
.update-upload { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(340px, 1.25fr); gap: 24px; margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.update-upload__copy h3 { font-size: 16px; }
.update-upload__copy p { max-width: 520px; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.update-upload__control { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.update-upload__control .form-alert { grid-column: 1 / -1; }
.update-upload input[type="file"] { padding: 7px 9px !important; cursor: pointer; }
.update-upload input[type="file"]::file-selector-button { min-height: 30px; margin-right: 10px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--purple); background: var(--surface); cursor: pointer; font-weight: 650; }
.update-history { margin-top: 24px; }
.update-history__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.update-history__title h3 { font-size: 16px; }
.update-history__title span { color: var(--muted); font-size: 10px; }
.update-history__list { display: grid; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.update-row { display: grid; min-width: 0; grid-template-columns: 100px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 13px 14px; background: var(--surface); }
.update-row + .update-row { border-top: 1px solid var(--line); }
.update-row__version { display: grid; }
.update-row__version strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.update-row__version small { color: var(--muted); font-size: 9px; }
.update-row__body { min-width: 0; }
.update-row__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: 9px; }
.update-row__body > p { margin-top: 5px; color: var(--ink-soft); font-size: 10px; }
.update-row__body .update-row__warning { color: var(--amber); font-weight: 650; }
.update-status { display: inline-flex; min-height: 23px; align-items: center; padding: 3px 8px; border-radius: 999px; color: var(--purple); background: var(--purple-soft); font-weight: 700; }
.update-status--applied { color: var(--green); background: var(--green-soft); }
.update-status--failed { color: var(--red); background: var(--red-soft); }
.update-status--applying { color: var(--amber); background: var(--amber-soft); }
.update-row__action { text-align: right; }
.update-row__done, .update-row__wait { color: var(--muted); font-size: 9px; white-space: nowrap; }
.update-row__body details { margin-top: 6px; color: var(--red); font-size: 10px; }
.update-row__body summary { cursor: pointer; font-weight: 650; }
.update-row__body pre { max-height: 150px; margin: 7px 0 0; padding: 9px; overflow: auto; border-radius: 6px; color: var(--ink-soft); background: var(--surface-soft); font: 10px/1.4 Consolas, monospace; white-space: pre-wrap; }
.update-safety-note { display: flex; gap: 9px; margin-top: 15px; padding: 11px 13px; border-left: 3px solid var(--purple); color: var(--ink-soft); background: var(--surface-purple); font-size: 10px; }
.update-safety-note strong { color: var(--purple); }

@media (max-width: 760px) {
  .settings-update__head { align-items: stretch; }
  .settings-update__version { width: 100%; min-width: 0; }
  .update-upload { grid-template-columns: 1fr; gap: 14px; }
  .update-upload__control { grid-template-columns: 1fr; align-items: stretch; }
  .update-row { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
  .update-row__action { grid-column: 1 / -1; text-align: left; }
  .update-row__action .button { width: 100%; }
}

@media (max-width: 430px) {
  .update-row { grid-template-columns: 1fr; }
  .update-row__action { grid-column: auto; }
  .update-safety-note { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .update-progress__spinner { animation-duration: 1.6s; }
}

/* Placeholder, auth and errors */
.coming-section { display: flex; min-height: 500px; align-items: center; flex-direction: column; justify-content: center; padding: 48px 24px; text-align: center; }
.coming-section__mark { display: grid; width: 62px; height: 62px; place-items: center; margin-bottom: 20px; border-radius: 15px; color: var(--purple); background: var(--purple-soft); }
.coming-section__mark svg { width: 30px; }
.coming-section h2 { max-width: 600px; margin-top: 7px; }
.coming-section > p:not(.section-kicker) { max-width: 620px; margin: 12px auto 22px; color: var(--ink-soft); }
.placeholder-note { padding: 16px 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.auth-body { background: #eceef0; }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(540px, 1.18fr) minmax(420px, .82fr); }
.auth-story { position: relative; isolation: isolate; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(30px, 4.3vw, 66px); color: #fff; background: #172a35; }
.auth-story::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, rgba(9,25,33,.88) 0%, rgba(12,29,38,.62) 48%, rgba(12,28,37,.21) 82%), linear-gradient(0deg, rgba(7,20,27,.84) 0%, transparent 48%, rgba(8,22,30,.17) 100%); }
.auth-story__image { position: absolute; z-index: -2; inset: -3%; width: 106%; height: 106%; max-width: none; object-fit: cover; object-position: 57% center; filter: saturate(.84) contrast(1.02); animation: auth-scene-drift 24s ease-in-out infinite alternate; }
.auth-story__mist { position: absolute; z-index: -1; inset: -16% -28% 30% 18%; opacity: .46; background: radial-gradient(ellipse at 40% 50%, rgba(226,238,239,.3), rgba(214,229,232,.08) 38%, transparent 70%); filter: blur(20px); animation: auth-mist-drift 18s ease-in-out infinite alternate; pointer-events: none; }
.auth-brand { position: relative; z-index: 1; display: inline-flex; width: fit-content; align-items: center; gap: 14px; color: #fff; }
.auth-brand::before { position: absolute; inset: -12px -16px; border: 1px solid rgba(255,255,255,.17); border-radius: 14px; content: ""; background: rgba(7,21,28,.25); box-shadow: 0 12px 32px rgba(4,15,20,.12); backdrop-filter: blur(8px); transition: background .2s ease, border-color .2s ease; }
.auth-brand:hover::before { border-color: rgba(255,255,255,.3); background: rgba(7,21,28,.36); }
.auth-brand__wordmark, .auth-brand__caption { position: relative; }
.auth-brand__wordmark { display: inline-flex; align-items: baseline; line-height: 1; letter-spacing: -.045em; }
.auth-brand__wordmark b { font-size: 27px; font-weight: 850; }
.auth-brand__wordmark i { margin-inline: 5px; color: rgba(255,255,255,.56); font-size: 17px; font-style: normal; font-weight: 300; }
.auth-brand__wordmark strong { font-size: 21px; font-weight: 720; letter-spacing: -.025em; }
.auth-brand__caption { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.3); color: rgba(255,255,255,.7); font-size: 8px; font-weight: 650; letter-spacing: .16em; line-height: 1.45; text-transform: uppercase; }
.auth-story__content { position: relative; z-index: 1; max-width: 690px; padding-block: 36px; }
.auth-story__kicker { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.76); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.auth-story__kicker span { width: 30px; height: 1px; background: #ecb654; }
.auth-story__content h1 { max-width: 620px; margin-top: 18px; font-size: clamp(42px, 4.4vw, 68px); font-weight: 560; letter-spacing: -.055em; text-wrap: balance; text-shadow: 0 4px 24px rgba(4,15,20,.22); }
.auth-story__content > p:not(.auth-story__kicker) { max-width: 520px; margin-top: 20px; color: rgba(255,255,255,.78); font-size: clamp(14px, 1.2vw, 17px); line-height: 1.65; text-wrap: balance; }
.auth-journey { display: flex; max-width: 600px; align-items: center; gap: 0; margin: 34px 0 0; padding: 0; list-style: none; }
.auth-journey li { position: relative; display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; color: rgba(255,255,255,.78); font-size: 11px; font-weight: 600; white-space: nowrap; }
.auth-journey li:not(:last-child)::after { height: 1px; flex: 1; margin-inline: 12px; content: ""; background: linear-gradient(90deg, rgba(255,255,255,.48), rgba(255,255,255,.08)); }
.auth-journey span { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 1px solid rgba(255,255,255,.27); border-radius: 50%; color: #fff; background: rgba(8,23,30,.27); font-size: 8px; font-variant-numeric: tabular-nums; backdrop-filter: blur(5px); }
.auth-story__brands { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; color: rgba(255,255,255,.64); font-size: 9px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.auth-story__brands span { display: inline-flex; align-items: center; gap: 24px; }
.auth-story__brands span:not(:last-child)::after { width: 3px; height: 3px; border-radius: 50%; content: ""; background: rgba(255,255,255,.42); }
.auth-panel { position: relative; display: grid; min-width: 0; place-items: center; overflow: hidden; padding: clamp(28px, 4vw, 62px); background: radial-gradient(circle at 52% 42%, #fff 0%, #f1f2f4 44%, #e8eaed 100%); }
.auth-panel::before { position: absolute; top: 9%; right: 8%; width: 190px; height: 190px; border: 1px solid rgba(52,39,143,.07); border-radius: 50%; content: ""; box-shadow: 0 0 0 54px rgba(52,39,143,.018), 0 0 0 108px rgba(52,39,143,.012); pointer-events: none; }
.auth-card { position: relative; width: min(100%, 470px); padding: clamp(30px, 3.4vw, 48px); border: 1px solid rgba(201,201,209,.86); border-radius: 22px; background: rgba(255,255,255,.95); box-shadow: 0 28px 74px rgba(26,28,39,.14), 0 4px 14px rgba(27,24,48,.05); backdrop-filter: blur(14px); }
.auth-card__head { margin-bottom: 28px; }
.auth-card__app { display: inline-flex; min-height: 31px; align-items: center; gap: 8px; margin-bottom: 23px; padding: 0 10px 0 0; border: 1px solid #dedde7; border-radius: 8px; color: var(--purple); background: #f8f7fc; font-size: 10px; letter-spacing: .08em; }
.auth-card__app span { display: grid; min-height: 31px; align-items: center; padding-inline: 9px; border-radius: 7px 0 0 7px; color: #fff; background: var(--purple); font-weight: 800; letter-spacing: -.02em; }
.auth-card__app strong { font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.auth-card__head .section-kicker { font-size: 9px; letter-spacing: .13em; }
.auth-card__head h2 { margin-top: 8px; font-size: clamp(28px, 2.5vw, 35px); letter-spacing: -.04em; }
.auth-card__head > p:last-child { max-width: 360px; margin-top: 10px; color: var(--ink-soft); line-height: 1.55; }
.auth-card .field { margin-top: 18px; }
.auth-card .field > label { color: #3f3f46; }
.auth-card input:not([type="hidden"]) { min-height: 52px; border-radius: 9px; background: #fdfdfd; }
.auth-card .password-field .icon-button { top: 7px; right: 6px; }
.auth-card > .button { min-height: 52px; margin-top: 26px; border-radius: 9px; box-shadow: 0 12px 24px rgba(216,32,47,.16); }
.auth-card__note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 19px; color: var(--muted); text-align: center; font-size: 10px; }
.auth-card__note span { color: var(--green); font-size: 7px; }
.password-field { position: relative; }
.password-field input { padding-right: 48px !important; }
.password-field .icon-button { position: absolute; top: 2px; right: 2px; }
@keyframes auth-scene-drift {
  from { transform: scale(1.01) translate3d(-.2%, 0, 0); }
  to { transform: scale(1.065) translate3d(.8%, -.5%, 0); }
}
@keyframes auth-mist-drift {
  from { transform: translate3d(-4%, 1%, 0) scale(.96); opacity: .3; }
  to { transform: translate3d(8%, -2%, 0) scale(1.08); opacity: .56; }
}
.error-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--bg); }
.error-page { display: flex; width: min(100%, 560px); align-items: center; flex-direction: column; padding: 44px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); text-align: center; }
.error-page img { width: 180px; }
.error-page__code { margin-top: 28px; color: var(--purple); font-size: 54px; font-weight: 800; letter-spacing: -.06em; }
.error-page h1 { margin-top: -5px; }
.error-page > p:not(.error-page__code) { max-width: 420px; margin: 12px auto 22px; color: var(--ink-soft); }

/* Structured price catalog */
.catalog-family-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.catalog-family-card { display: grid; min-width: 0; min-height: 92px; align-items: center; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius-surface); background: #fff; box-shadow: var(--shadow-sm); transition: border-color .18s, background .18s, box-shadow .18s; }
.catalog-family-card:hover { border-color: #bcb9d3; background: #fcfbff; }
.catalog-family-card.is-active { border-color: #9189c8; background: #f7f5ff; box-shadow: 0 5px 18px rgba(52, 39, 143, .08); }
.catalog-family-card__mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 9px; color: #fff; background: var(--purple); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.catalog-family-card:nth-child(2) .catalog-family-card__mark { background: #3d4148; }
.catalog-family-card__body { display: grid; min-width: 0; gap: 5px; }
.catalog-family-card__body strong { font-size: 17px; letter-spacing: -.01em; }
.catalog-family-card__body small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-family-card__count { display: grid; min-width: 34px; height: 30px; place-items: center; padding: 0 8px; border-radius: 15px; color: var(--purple); background: #eeebfb; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.catalog-registry { overflow: visible; }
.catalog-toolbar { border-bottom: 1px solid var(--line); }
.catalog-bulk { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 20px; border-bottom: 1px solid var(--line); background: #fafafd; }
.catalog-select-all { display: inline-flex; min-height: 38px; align-items: center; gap: 9px; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 650; }
.catalog-select-all input { width: 18px; height: 18px; accent-color: var(--purple); }
.catalog-bulk__actions { display: flex; min-width: 0; align-items: center; gap: 10px; }
.catalog-bulk__actions strong { color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.catalog-bulk__actions select { width: min(320px, 35vw); min-height: 36px; padding-block: 6px; font-size: 12px; }
.catalog-groups { display: grid; gap: 0; }
.catalog-section { min-width: 0; border-bottom: 1px solid var(--line); background: #fff; }
.catalog-section:last-child { border-bottom: 0; border-radius: 0 0 var(--radius-surface) var(--radius-surface); }
.catalog-section__head { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid #ececf0; background: #f7f7fa; }
.catalog-section__head > div:first-child { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.catalog-section__head p { color: var(--purple); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.catalog-section__head h2 { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-section__head span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.catalog-section__order, .catalog-row-order { display: flex; align-items: center; gap: 2px; }
.catalog-section__order form, .catalog-row-order form { margin: 0; }
.catalog-section__empty { min-height: 76px; padding: 26px 20px; color: var(--muted); font-size: 12px; }
.data-table--catalog { min-width: 1040px; }
.data-table--catalog th, .data-table--catalog td { padding-inline: 11px; }
.data-table--catalog .catalog-number { width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.data-table--catalog:not(.is-manageable) th:nth-child(2) { width: 30%; }
.data-table--catalog:not(.is-manageable) th:nth-child(3) { width: 12%; }
.data-table--catalog:not(.is-manageable) th:nth-child(4) { width: 12%; }
.data-table--catalog:not(.is-manageable) th:nth-child(5) { width: 10%; }
.data-table--catalog:not(.is-manageable) th:nth-child(6) { width: 13%; }
.data-table--catalog:not(.is-manageable) th:nth-child(7) { width: 18%; }
.data-table--catalog.is-manageable th:nth-child(3) { width: 27%; }
.data-table--catalog.is-manageable th:nth-child(4) { width: 11%; }
.data-table--catalog.is-manageable th:nth-child(5) { width: 11%; }
.data-table--catalog.is-manageable th:nth-child(6) { width: 9%; }
.data-table--catalog.is-manageable th:nth-child(7) { width: 12%; }
.data-table--catalog.is-manageable th:nth-child(8) { width: 15%; }
.data-table--catalog .catalog-order-head, .data-table--catalog .catalog-order-cell { width: 80px; text-align: center; }
.catalog-order-cell .catalog-row-order { justify-content: center; }
.catalog-import-note { padding: 15px 17px; border: 1px solid #dedbea; border-radius: 9px; color: var(--ink-soft); background: #f8f7fd; font-size: 12px; }
.catalog-import-note strong { display: block; margin-bottom: 6px; color: var(--ink); }
.catalog-import-note ol { margin: 0; padding-left: 19px; }
.catalog-import-note li + li { margin-top: 3px; }

/* User-selected night theme. The default theme remains light. */
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111116;
    --surface: #1a1a21;
    --surface-soft: #202029;
    --surface-purple: #27233f;
    --ink: #f3f3f5;
    --ink-soft: #c9c9d1;
    --muted: #a2a2ad;
    --line: #32323d;
    --line-strong: #4a4a58;
    --purple: #a99cf3;
    --purple-dark: #c4bcff;
    --purple-soft: #292443;
    --red: #d8202f;
    --red-dark: #bd1724;
    --red-soft: #3d2026;
    --green: #68cf9b;
    --green-soft: #183a2a;
    --amber: #efb65e;
    --amber-soft: #3b2d18;
    --blue: #82bff2;
    --blue-soft: #193149;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .42);
    background: var(--bg);
  }

  html[data-theme="dark"] body {
    color: var(--ink);
    background: var(--bg);
  }

  html[data-theme="dark"] :focus-visible {
    outline-color: #b8adff;
  }

  html[data-theme="dark"] .sidebar {
    border-color: #2b2b35;
    background: #15151b;
  }

  html[data-theme="dark"] .sidebar__head,
  html[data-theme="dark"] .sidebar__foot,
  html[data-theme="dark"] .topbar {
    border-color: #2b2b35;
  }

  html[data-theme="dark"] .nav-link {
    color: #b3b3bd;
  }

  html[data-theme="dark"] .nav-link:hover,
  html[data-theme="dark"] .button--ghost:hover,
  html[data-theme="dark"] .icon-button:hover,
  html[data-theme="dark"] .registry-search__clear:hover {
    color: var(--ink);
    background: #25252e;
  }

  html[data-theme="dark"] .nav-link.is-active {
    color: #c3baff;
    background: var(--purple-soft);
  }

  html[data-theme="dark"] .nav-link__count,
  html[data-theme="dark"] .filter-chip span {
    color: #c3baff;
    background: #343042;
  }

  html[data-theme="dark"] .theme-toggle {
    color: #d5d5dc;
  }

  html[data-theme="dark"] .button--primary,
  html[data-theme="dark"] .button--danger,
  html[data-theme="dark"] .button--hero {
    color: #fff;
  }

  html[data-theme="dark"] :is(
    .skip-link,
    .global-search button,
    .account-card__avatar,
    .pagination__current,
    .calculator-result__grand,
    .seller-choice__mark,
    .seller-pill > span,
    .organization-chip > span,
    .catalog-family-card__mark
  ) {
    color: #fff;
    background: #5e50bd;
  }

  html[data-theme="dark"] .button--secondary {
    color: #c3baff;
  }

  html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  html[data-theme="dark"] select,
  html[data-theme="dark"] textarea {
    color: var(--ink);
    border-color: var(--line-strong);
    background: #1d1d25;
  }

  html[data-theme="dark"] input::placeholder,
  html[data-theme="dark"] textarea::placeholder {
    color: #92929e;
  }

  html[data-theme="dark"] input:hover,
  html[data-theme="dark"] select:hover,
  html[data-theme="dark"] textarea:hover {
    border-color: #686878;
  }

  html[data-theme="dark"] input:focus,
  html[data-theme="dark"] select:focus,
  html[data-theme="dark"] textarea:focus {
    border-color: #a99cf3;
    box-shadow: 0 0 0 3px rgba(169, 156, 243, .16);
  }

  html[data-theme="dark"] input:disabled {
    color: #ababb5;
    background: #24242c;
  }

  html[data-theme="dark"] .field > label,
  html[data-theme="dark"] .field__label-row label,
  html[data-theme="dark"] .party-kind legend {
    color: var(--ink-soft);
  }

  html[data-theme="dark"] .party-kind__option input:checked + span {
    border-color: #5c547a;
    color: #d7d1ff;
    background: #302c47;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  }

  html[data-theme="dark"] .dialog {
    scrollbar-color: #565663 transparent;
  }

  html[data-theme="dark"] :is(
    .message,
    .create-menu__panel,
    .global-search,
    .module-card,
    .quick-result,
    .filter-chip,
    .data-table tbody tr,
    .party-fields-section,
    .party-passport__body,
    .privacy-note,
    .dialog__card,
    .dialog__actions,
    .calculator-dialog__actions,
    .seller-choice,
    .combobox__list,
    .calculator-result__table th,
    .line-table td,
    .line-empty,
    .catalog-family-card,
    .catalog-section,
    .auth-card,
    .error-page
  ) {
    background: var(--surface);
  }

  html[data-theme="dark"] :is(
    .registry-guidance,
    .registry-selection-bar,
    .data-table th,
    .party-kind__switch,
    .party-fields-section--common,
    .party-passport,
    .calculator-dialog__run,
    .calculator-result__head,
    .line-selection-tools,
    .line-table th,
    .picker-selection,
    .catalog-bulk,
    .catalog-section__head,
    .catalog-import-note
  ) {
    background: var(--surface-soft);
  }

  html[data-theme="dark"] .home-hero__datetime {
    background: linear-gradient(135deg, #1d1d25 0%, var(--surface-soft) 100%);
  }

  html[data-theme="dark"] .module-card:hover,
  html[data-theme="dark"] .data-table tbody tr:hover,
  html[data-theme="dark"] .catalog-family-card:hover {
    border-color: #5a556f;
    background: #23222c;
  }

  html[data-theme="dark"] .data-table tbody tr.is-selected,
  html[data-theme="dark"] .line-table tr.is-selected td,
  html[data-theme="dark"] .catalog-family-card.is-active {
    background: #292640;
  }

  html[data-theme="dark"] .data-table th,
  html[data-theme="dark"] .line-table th {
    color: #adadb8;
  }

  html[data-theme="dark"] .data-table td {
    color: #d6d6dc;
  }

  html[data-theme="dark"] .data-table td,
  html[data-theme="dark"] .data-table th,
  html[data-theme="dark"] .line-table td,
  html[data-theme="dark"] .line-table th,
  html[data-theme="dark"] .aside-list > div,
  html[data-theme="dark"] .party-fields-section__head,
  html[data-theme="dark"] .calculator-result__table td,
  html[data-theme="dark"] .seller-choice__foot,
  html[data-theme="dark"] .catalog-section__head {
    border-color: var(--line);
  }

  html[data-theme="dark"] .line-input,
  html[data-theme="dark"] .line-input:hover,
  html[data-theme="dark"] .line-input:focus,
  html[data-theme="dark"] .line-table tr.is-selected .line-input,
  html[data-theme="dark"] .line-table .line-input {
    color: var(--ink) !important;
    border-color: var(--line-strong) !important;
    background: #202029 !important;
  }

  html[data-theme="dark"] .status,
  html[data-theme="dark"] .tax-badge {
    color: #c7c7cf;
    background: #30303a;
  }

  html[data-theme="dark"] .status--paid,
  html[data-theme="dark"] .status--active,
  html[data-theme="dark"] .status--success,
  html[data-theme="dark"] .tax-badge--vat,
  html[data-theme="dark"] .calculator-dialog__status.is-success {
    color: #79d7a7;
    background: var(--green-soft);
  }

  html[data-theme="dark"] .status--unpaid,
  html[data-theme="dark"] .status--cancelled {
    color: #ff9da7;
    background: var(--red-soft);
  }

  html[data-theme="dark"] .status--approval,
  html[data-theme="dark"] .status--warning {
    color: #f2c778;
    background: var(--amber-soft);
  }

  html[data-theme="dark"] .status--issued {
    color: #91c9f7;
    background: var(--blue-soft);
  }

  html[data-theme="dark"] .status--inactive {
    color: #b6b6c0;
    background: #30303a;
  }

  html[data-theme="dark"] .form-alert,
  html[data-theme="dark"] .legal-warning--danger,
  html[data-theme="dark"] .blocking-alert {
    border-color: #70404a;
    color: #ffb4bc;
    background: var(--red-soft);
  }

  html[data-theme="dark"] .legal-warning,
  html[data-theme="dark"] .aside-hint {
    border-color: #70572e;
    color: #f2ca84;
    background: var(--amber-soft);
  }

  html[data-theme="dark"] .legal-warning--info {
    border-color: #514b76;
    color: #d2ccff;
    background: #26233a;
  }

  html[data-theme="dark"] .document-preview {
    border-color: #3a3a45;
    background: #24242c;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, .3);
  }

  html[data-theme="dark"] .preview-mobile-toolbar {
    background: rgba(36, 36, 44, .94);
  }

  html[data-theme="dark"] .preview-mobile-toolbar .button {
    background: var(--surface);
  }

  html[data-theme="dark"] .a4-page {
    color: #111;
    background: #fff;
  }

  html[data-theme="dark"] .registry-select-unavailable,
  html[data-theme="dark"] .line-empty svg {
    color: #777783;
  }

  html[data-theme="dark"] .data-table-wrap {
    scrollbar-color: #565663 transparent;
  }
}

/* Responsive */
@media (max-width: 1440px) {
  .document-layout, .related-document-layout { grid-template-columns: 1fr; }
  .document-tools { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .document-tools__status, .document-tools .status-form { grid-column: 1 / -1; }
  .document-tools__divider { grid-column: 1 / -1; }
  .document-tools .aside-list { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 18px; margin-top: 0; }
  .document-tools .aside-list > div { min-width: 0; }
  .document-tools > form:last-child { align-self: end; }
}

@media (max-width: 1280px) {
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .sidebar { width: min(300px, 86vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar__head { justify-content: space-between; padding: 16px 18px; }
  .sidebar .brand { width: auto; justify-content: flex-start; }
  .sidebar .brand__mark { width: 174px; height: 46px; object-position: left center; }
  .sidebar__nav { gap: 3px; padding: 22px 12px; }
  .sidebar__eyebrow { display: block; padding: 0 12px 10px; color: #70707a; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
  .nav-link { min-height: 44px; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: 8px; }
  .nav-link > span:not(.nav-link__count) { display: inline; }
  .nav-link__count { position: static; min-width: 24px; margin-left: auto; padding: 2px 6px; font-size: 10px; line-height: normal; }
  .sidebar__foot { gap: 8px; padding: 12px; }
  .account-card { align-items: center; flex-direction: row; gap: 9px; padding: 9px 5px 4px; }
  .account-card__text { display: grid; }
  .sidebar__close, .topbar__menu { display: grid; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 72px; }
}

@media (max-width: 1100px) {
  .document-layout, .related-document-layout { grid-template-columns: 1fr; }
  .document-tools { position: static; grid-template-columns: minmax(170px, .75fr) minmax(240px, 1fr) auto auto; align-items: center; }
  .document-tools .aside-list, .document-tools__divider { display: none; }
  .document-tools > form:last-child { align-self: center; }
  .detail-grid, .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .editor-aside { grid-template-columns: minmax(0, 1fr) 280px; align-items: stretch; }
  .editor-aside > .button { align-self: end; }
  .editor-aside--document .aside-card { grid-row: 1 / span 2; }
  .editor-aside--document > .button { grid-column: 2; grid-row: 1; }
  .editor-aside--document .upd-confirmation-card { grid-column: 2; grid-row: 2; }
  .invoice-meta__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .invoice-bottom { grid-template-columns: minmax(0, 1fr) 350px; }
  .settings-layout { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 930px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; overflow: visible; }
  .settings-nav a { flex: 0 0 auto; }
}

@media (max-width: 850px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 300px; padding: 26px clamp(22px, 6vw, 46px) 34px; }
  .auth-story__image { object-position: 54% 54%; }
  .auth-story__content { margin-top: auto; padding: 44px 0 0; }
  .auth-story__content h1 { max-width: 520px; margin-top: 11px; font-size: clamp(32px, 7vw, 48px); }
  .auth-story__content > p:not(.auth-story__kicker) { display: none; }
  .auth-journey { display: none; }
  .auth-story__brands { margin-top: 25px; }
  .auth-panel { min-height: auto; padding: 38px 22px 48px; overflow: visible; }
  .auth-panel::before { display: none; }
}

@media (max-width: 768px) {
  :root { --control-height: 44px; }
  .topbar { align-items: center; flex-wrap: nowrap; padding: 11px 16px; }
  .topbar__heading { flex: 1; }
  .topbar__heading h1 { font-size: 21px; }
  .topbar__actions { width: auto; flex: 0 0 auto; justify-content: flex-end; flex-wrap: nowrap; order: initial; overflow: visible; padding-bottom: 0; }
  .workspace__content { padding: 16px; }
  .home-hero { min-height: 250px; padding-top: 18px; }
  .home-hero h2 { font-size: clamp(26px, 7vw, 32px); }
  .global-search { min-height: 54px; }
  .global-search button { display: none; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-result { grid-template-columns: 80px 1fr 18px; }
  .quick-result small { display: none; }
  .registry__toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .registry__toolbar.registry-filter-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .registry-filter-form .registry-search { grid-column: 1 / -1; }
  .registry-filter-form .registry__stats { align-self: end; justify-self: end; }
  .registry-search { width: 100%; }
  .registry__stats { align-self: flex-end; }
  .registry-filters { flex-wrap: wrap; overflow: visible; }
  .tabs { flex-wrap: wrap; gap: 8px 18px; overflow: visible; }
  .filter-chip, .tab { flex: 0 0 auto; white-space: nowrap; }
  .registry-selection-bar { align-items: stretch; flex-wrap: wrap; padding: 9px 12px; }
  .registry-selection-check { min-height: 38px; }
  .registry-selection-summary { width: 100%; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }
  .data-table-wrap { overflow: visible; padding: 0 12px 12px; }
  .data-table { display: block; min-width: 0; table-layout: auto; }
  .data-table.user-table { min-width: 0; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .data-table tbody { display: grid; gap: 10px; }
  .data-table tbody tr { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .data-table td { position: relative; display: block; width: 100% !important; height: auto; min-height: 42px; padding: 10px 12px 10px 124px; overflow-wrap: anywhere; border-bottom: 1px solid #ececf0; text-align: left !important; }
  .data-table td::before { position: absolute; top: 11px; left: 12px; width: 100px; color: var(--muted); content: attr(data-label); font-size: 9px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
  .data-table td[colspan] { min-height: 0; padding: 0; border: 0; }
  .data-table td[colspan]::before { content: none; }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td small { white-space: normal; }
  .data-table .table-primary, .data-table .truncate-cell { white-space: normal; }
  .data-table td.table-actions { min-height: 46px; }
  .data-table td.table-actions .icon-button { margin-left: 0; }
  .data-table td.registry-select-cell { min-height: 48px; padding: 8px 12px !important; text-align: left !important; }
  .data-table td.registry-select-cell::before { content: none; }
  .registry-row-check { min-width: 38px; min-height: 32px; justify-content: flex-start; }
  .catalog-family-switch { grid-template-columns: 1fr; gap: 10px; }
  .catalog-family-card { min-height: 78px; padding: 12px 14px; }
  .catalog-bulk { align-items: stretch; flex-direction: column; gap: 5px; padding: 8px 12px 12px; }
  .catalog-bulk__actions { align-items: stretch; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
  .catalog-bulk__actions strong { width: 100%; }
  .catalog-bulk__actions select { width: min(100%, 420px); flex: 1; }
  .catalog-section__head { min-height: 62px; padding: 10px 14px; }
  .catalog-section__head > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .catalog-section__head p { display: none; }
  .catalog-section__head h2 { white-space: normal; }
  .catalog-section .data-table-wrap { padding-top: 12px; }
  .data-table--catalog .catalog-number { width: 100% !important; text-align: left; }
  .data-table--catalog .catalog-order-cell { width: 100% !important; text-align: left; }
  .catalog-order-cell .catalog-row-order { justify-content: flex-start; }
  .catalog-section__empty { min-height: 68px; padding: 22px 14px; }
  .bulk-document-table-wrap { max-height: 330px; padding: 10px; overflow: auto; }
  .bulk-document-table { min-width: 0; }
  .bulk-document-table tbody { gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide, .form-grid__wide { grid-column: auto; }
  .settings-signers__head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .settings-signers__head > p { max-width: none; text-align: left; }
  .party-fields-section__head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .party-fields-section__head span { text-align: left; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list__wide { grid-column: auto; }
  .detail-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seller-grid { grid-template-columns: 1fr; }
  .seller-choice { min-height: 210px; }
  .invoice-meta__title { flex-direction: column; }
  .seller-pill { width: 100%; }
  .invoice-meta__grid { grid-template-columns: 1fr; }
  .field--counterparty { grid-column: auto; }
  .invoice-meta__grid > .field > label { min-height: 20px; }
  .calculator-dialog__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-dialog__recipe { grid-column: 1 / -1; }
  .calculator-result__totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-result__totals > div:nth-child(2) { border-right: 0; }
  .calculator-result__totals > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .line-editor__toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .line-editor__add { align-items: stretch; flex-wrap: wrap; }
  .line-editor__add .search-picker--product { width: 100%; min-width: 100%; flex: 1 0 100%; }
  .line-editor__add .button { flex: 1; }
  .line-table-wrap { max-height: none; min-height: 188px; overflow: visible; }
  .line-table { display: block; min-width: 0; table-layout: auto; }
  .line-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .line-table tbody { display: grid; gap: 12px; padding: 12px; }
  .line-table tr { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .line-table td { display: block; width: auto !important; height: auto; min-width: 0; padding: 0; border: 0; }
  .line-table td::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
  .line-table td:nth-child(1) { order: -3; }
  .line-table td:nth-child(2) { order: -2; grid-column: 1 / -1; }
  .line-table td:nth-child(3) { order: -1; grid-column: 1 / -1; }
  .line-table td:nth-child(9) { grid-column: 1 / -1; }
  .line-table td:nth-child(10) { justify-self: end; order: -3; }
  .line-table td:nth-child(2)::before { content: "Артикул"; }
  .line-table td:nth-child(3)::before { content: "Наименование"; }
  .line-table td:nth-child(4)::before { content: "Количество"; }
  .line-table td:nth-child(5)::before { content: "Единица"; }
  .line-table td:nth-child(6)::before { content: "Вес / ед., кг"; }
  .line-table td:nth-child(7)::before { content: "Цена, ₽"; }
  .line-table td:nth-child(8)::before { content: "Скидка, %"; }
  .line-table td:nth-child(9)::before { content: "Итого, ₽"; }
  .line-table .line-input { min-height: 42px !important; padding-inline: 9px !important; border-color: var(--line) !important; background: #fff !important; }
  .line-table .line-total { min-height: 42px; padding: 10px 9px; border-radius: 5px; background: var(--surface-soft); }
  .line-table .line-order > div { gap: 4px; }
  .invoice-totals--rail { display: block; padding: 17px; }
  .invoice-totals--rail .invoice-totals__head { margin-bottom: 13px; }
  .invoice-totals--rail dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
  .invoice-totals--rail dl > div { align-items: baseline; flex-direction: row; justify-content: space-between; gap: 10px; }
  .invoice-totals--rail .invoice-totals__grand { grid-column: 1 / -1; margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
  .invoice-totals--rail .invoice-totals__tax-note { margin: 12px 0 8px; }
  .invoice-totals--rail .invoice-preflight { margin-bottom: 9px; }
  .invoice-mobile-submit { display: none; }
  .invoice-bottom { grid-template-columns: 1fr; }
  .source-document dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-tools { grid-template-columns: 1fr 1fr; }
  .document-tools__status { grid-column: 1 / -1; }
  .document-tools .status-form { grid-column: 1 / -1; }
  .organization-switcher { grid-template-columns: 1fr; }
  .tax-policy dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-aside { grid-template-columns: 1fr; }
  .editor-aside--document .aside-card,
  .editor-aside--document > .button,
  .editor-aside--document .upd-confirmation-card { grid-column: auto; grid-row: auto; }
}

@media (max-width: 520px) {
  body { font-size: 13px; }
  .workspace__content { padding: 12px; }
  .topbar { padding-inline: 12px; }
  .topbar__heading > p { display: none; }
  .topbar__actions .button { flex: 0 0 auto; padding-inline: 12px; font-size: 12px; }
  .topbar__actions .button svg { width: 16px; height: 16px; }
  .topbar__actions .catalog-page-action { width: 42px; padding-inline: 0; }
  .topbar__actions .catalog-page-action span { display: none; }
  .catalog-family-card__body small { white-space: normal; }
  .catalog-family-card__count { min-width: 30px; }
  .catalog-bulk__actions select, .catalog-bulk__actions .button { width: 100%; }
  .home-hero { min-height: 230px; padding-inline: 0; }
  .home-hero__datetime { gap: 12px; padding: 10px 12px; }
  .home-hero__date time { font-size: 13px; }
  .home-hero__clock { min-width: 96px; padding-left: 12px; }
  .home-hero__clock > time { font-size: 22px; }
  .home-hero > p { font-size: 13px; }
  .global-search { margin-top: 22px; padding-left: 14px; border-radius: 11px; }
  .global-search input { font-size: 13px; }
  .create-menu__panel { position: fixed; right: 12px; bottom: 12px; left: 12px; top: auto; width: auto; transform: none; }
  .create-menu--right .create-menu__panel { right: 12px; left: 12px; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 70px; }
  .home-search-results { padding: 16px; }
  .quick-result { grid-template-columns: 1fr 18px; }
  .quick-result__kind { grid-column: 1; }
  .quick-result strong { grid-column: 1; }
  .quick-result svg { grid-column: 2; grid-row: 1 / span 2; }
  .registry__toolbar { padding: 12px; }
  .registry__toolbar.registry-filter-form { grid-template-columns: minmax(0, 1fr); }
  .registry-filter-form .registry-search, .registry-filter-form .registry-date-range, .registry-filter-form .registry__stats, .registry-filter-form .registry-filter-error { grid-column: 1; }
  .registry-date-range { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .registry-date-submit { width: 100%; grid-column: 1 / -1; }
  .registry-filter-reset { min-height: 32px; grid-column: 1 / -1; justify-self: end; }
  .registry-date-field input { font-size: 16px; }
  .tabs { padding-inline: 12px; }
  .tab { min-height: 45px; }
  .pagination { padding-inline: 12px; }
  .pagination__summary { display: inline; font-size: 10px; }
  .pagination__controls { margin-left: auto; }
  .registry-empty { min-height: 170px; align-items: center; flex-direction: column; text-align: center; }
  .registry-empty .button { margin-left: 0; }
  .registry-guidance { align-items: flex-start; flex-wrap: wrap; padding: 12px; }
  .registry-guidance .button { width: 100%; }
  .registry-selection-summary { align-items: stretch; flex-direction: column; gap: 8px; }
  .registry-selection-summary .button { width: 100%; min-height: 42px; }
  .bulk-document-section__head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .form-surface, .detail-card, .settings-section { padding: 18px; }
  .party-fields-section { padding: 15px; }
  .party-kind__switch { width: 100%; }
  .party-kind__option span { min-height: 44px; padding-inline: 6px; font-size: 12px; }
  .party-passport > summary { min-height: 60px; padding-inline: 15px; }
  .party-passport__body { padding: 15px; }
  .privacy-note { padding-inline: 15px; }
  .detail-aside { grid-template-columns: 1fr; }
  .variant-intro { margin-top: 10px; }
  .variant-intro h2 { font-size: 27px; }
  .seller-choice { padding: 18px; }
  .variant-note { align-items: flex-start; }
  .invoice-meta { padding: 18px; }
  .line-editor__toolbar { padding: 16px; }
  .line-editor__add .button { padding-inline: 10px; font-size: 11px; }
  .line-selection-tools { align-items: stretch; flex-wrap: wrap; padding: 9px 12px; }
  .line-selection-check { min-height: 36px; }
  .line-selection-actions { width: 100%; justify-content: space-between; margin-left: 0; padding-top: 8px; border-top: 1px solid var(--line); }
  .line-selection-actions .button { min-height: 38px; }
  .line-select-checkbox { width: 18px; height: 18px; flex-basis: 18px; }
  .invoice-totals__grand dd { font-size: 19px; }
  .legal-warning { align-items: flex-start; flex-wrap: wrap; }
  .legal-warning .button { width: 100%; }
  .document-preview.is-zoomed { overflow: auto; overscroll-behavior: contain; }
  .preview-mobile-toolbar { position: sticky; z-index: 4; top: 0; left: 0; display: flex; width: 100%; min-width: 100%; justify-content: flex-end; padding: 8px; background: rgba(222, 222, 227, .94); backdrop-filter: blur(6px); }
  .preview-mobile-toolbar .button { min-height: 38px; background: #fff; }
  .document-tools { grid-template-columns: 1fr; }
  .document-tools__status { grid-column: auto; }
  .related-item { min-width: 100%; }
  .related-empty { align-items: stretch; flex-direction: column; }
  .related-empty .button { width: 100%; }
  .confirmation-summary { grid-template-columns: 1fr; }
  .confirmation-actions { align-items: stretch; flex-direction: column-reverse; }
  .confirmation-actions .button { width: 100%; }
  .source-document { flex-direction: column; }
  .source-document dl { width: 100%; grid-template-columns: 1fr; }
  .tax-policy { align-items: flex-start; }
  .tax-policy dl { grid-template-columns: 1fr; }
  .dialog__card { padding: 18px; }
  .dialog__actions { flex-direction: column-reverse; }
  .dialog__actions .button { width: 100%; }
  .dialog--counterparty .dialog__actions { margin-inline: -18px; margin-bottom: -18px; padding: 14px 18px 18px; }
  .calculator-dialog__fields { grid-template-columns: 1fr; }
  .calculator-dialog__recipe { grid-column: auto; }
  .calculator-dialog__run { align-items: stretch; flex-direction: column; }
  .calculator-dialog__run .button { width: 100%; }
  .calculator-result__head { align-items: flex-start; }
  .calculator-result__head h3 { font-size: 14px; }
  .calculator-result__totals { grid-template-columns: 1fr; }
  .calculator-result__totals > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .calculator-result__totals > div:last-child { border-bottom: 0; }
  .calculator-dialog__append-note { text-align: left; }
  .calculator-dialog__actions { bottom: -18px; margin-inline: -18px; margin-bottom: -18px; padding: 14px 18px 18px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { font-size: 16px; }
  .auth-panel { padding: 32px 14px 40px; }
  .auth-card { padding: 29px 24px; border-radius: 18px; }
  .error-page { padding: 32px 20px; }
}

@media (max-width: 420px) {
  .auth-story { min-height: 244px; padding: 22px 20px 27px; }
  .auth-brand::before { inset: -9px -11px; border-radius: 11px; }
  .auth-brand__wordmark b { font-size: 22px; }
  .auth-brand__wordmark strong { font-size: 18px; }
  .auth-brand__caption { font-size: 7px; }
  .auth-story__content { padding-top: 34px; }
  .auth-story__kicker { font-size: 8px; }
  .auth-story__content h1 { font-size: clamp(29px, 9vw, 37px); }
  .auth-story__brands { gap: 8px 14px; margin-top: 18px; font-size: 7px; letter-spacing: .1em; }
  .auth-story__brands span { gap: 14px; }
  .auth-panel { padding: 22px 10px 32px; }
  .auth-card { padding: 26px 19px; }
  .auth-card__app { margin-bottom: 19px; }
  .auth-card__head { margin-bottom: 23px; }
  .auth-card__head h2 { font-size: 27px; }
  .auth-card .field { margin-top: 16px; }
  .auth-card__note { line-height: 1.35; }
  .registry-date-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line-editor__add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line-editor__add .search-picker--product { width: 100%; min-width: 0; grid-column: 1 / -1; }
  .line-editor__add .button { width: 100%; }
  .line-editor__add .button--calculator { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-story__image,
  .auth-story__mist { animation: none; }
}

@media (max-width: 390px) {
  .topbar__heading h1 { font-size: 19px; }
  .home-hero__datetime { gap: 10px; }
  .home-hero__clock { min-width: 90px; padding-left: 10px; }
  .home-hero__timezone { font-size: 8px; }
  .home-hero h2 { font-size: 27px; }
  .button--hero { min-width: 170px; }
  .seller-choice__body strong { font-size: 17px; }
  .invoice-totals--rail dl { grid-template-columns: 1fr; }
  .invoice-totals--rail .invoice-totals__grand { grid-column: auto; }
}

@media (pointer: coarse) {
  .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .button--small { min-height: 44px; }
  .registry-search input { padding-right: 52px !important; }
  .registry-search__clear { right: 3px; width: 44px; height: 44px; }
}

@media (pointer: coarse) and (max-width: 768px) {
  .mini-button { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  :focus-visible { outline: 2px solid Highlight; }
  .nav-link.is-active, .filter-chip.is-active, .tab.is-active, .combobox__option.is-active { outline: 1px solid Highlight; }
  .status { border: 1px solid currentColor; }
}

/* Print stays an exact A4 document; application chrome never prints. */
@media print {
  @page upd-landscape { size: A4 landscape; margin: 0; }
  @page { size: A4 portrait; margin: 0; }
  html, body { width: auto; min-width: 0; min-height: 0; overflow: visible; background: #fff; }
  .sidebar, .topbar, .message-stack, .legal-warning, .document-tools, .related-strip, .mobile-backdrop, .preview-mobile-toolbar { display: none !important; }
  .workspace { min-height: 0; margin: 0; }
  .workspace__content { width: auto; max-width: none; margin: 0; padding: 0; }
  .document-layout, .related-document-layout { display: block; }
  .document-preview { overflow: visible; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
  .a4-stage { height: auto !important; min-height: 0; overflow: visible; }
  .a4-page { position: relative; top: auto; left: auto; width: 210mm; min-height: 297mm; margin: 0; box-shadow: none; transform: none !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .a4-page.invoice-a4 { overflow: visible; border: 0; }
  .mag-invoice-lines thead { display: table-header-group; }
  .mag-invoice-lines tr, .mag-invoice-totals, .mag-invoice-caption, .mag-invoice-signature { break-inside: avoid; page-break-inside: avoid; }
  .a4-page.upd-a4 { width: 297mm; min-height: 210mm; }
}

/* Home task focus */
.home-task-focus { width: min(1120px, 100%); margin-top: 24px; overflow: hidden; text-align: left; }
.home-task-focus__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 18px 20px 15px; }
.home-task-focus__head h3 { margin-top: 3px; font-size: 21px; letter-spacing: -.025em; }
.home-task-focus__head > div > p:last-child { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.home-task-focus__count { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--purple); background: var(--purple-soft); font-size: 10px; font-weight: 750; white-space: nowrap; }
.home-task-focus__table-wrap { max-height: 350px; overflow: auto; border-block: 1px solid var(--line); }
.home-task-focus__table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.home-task-focus__table th { position: sticky; z-index: 1; top: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface-soft); font-size: 9px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.home-task-focus__table th:first-child { width: 120px; padding-left: 20px; }
.home-task-focus__table th:nth-child(2) { width: 42%; }
.home-task-focus__table th:nth-child(3) { width: 25%; }
.home-task-focus__table th:last-child { width: 112px; }
.home-task-focus__table td { padding: 10px 12px; border-bottom: 1px solid rgba(120, 120, 130, .13); vertical-align: middle; }
.home-task-focus__table td:first-child { padding-left: 20px; box-shadow: inset 3px 0 0 transparent; }
.home-task-focus__row { cursor: pointer; }
.home-task-focus__row td { transition: filter var(--duration-ui) var(--ease-standard); }
.home-task-focus__row:hover td { filter: brightness(.975); }
.home-task-focus__row:last-child td { border-bottom: 0; }
.home-task-focus__row--burning td { background: #fff3f4; }
.home-task-focus__row--burning td:first-child { box-shadow: inset 3px 0 0 #cf3f4b; }
.home-task-focus__row--current td { background: #fff9eb; }
.home-task-focus__row--current td:first-child { box-shadow: inset 3px 0 0 #d78a17; }
.home-task-focus__row--planned td { background: #f2faf5; }
.home-task-focus__row--planned td:first-child { box-shadow: inset 3px 0 0 #2e9460; }
.home-task-focus__table time { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.home-task-focus__table time strong { font-size: 10px; }
.home-task-focus__table time span { color: var(--ink); font-size: 15px; font-weight: 750; }
.home-task-focus__task { min-width: 0; }
.home-task-focus__task .task-type { margin-right: 7px; vertical-align: middle; }
.home-task-focus__task-link { color: var(--ink); }
.home-task-focus__task-link strong { display: inline; font-size: 12px; line-height: 1.35; }
.home-task-focus__row:hover .home-task-focus__task-link,
.home-task-focus__task-link:focus-visible { color: var(--purple); }
.home-task-focus__counterparty { display: -webkit-box; overflow: hidden; font-size: 11px; font-weight: 600; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-task-focus__assignees { display: flex; flex-wrap: wrap; gap: 4px; }
.home-task-focus__assignees span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #fff; background: var(--purple); font-size: 9px; font-weight: 750; }
.home-task-focus__empty { display: flex; min-height: 96px; align-items: center; justify-content: center; gap: 10px; padding: 20px; color: var(--muted); text-align: center; }
.home-task-focus__empty > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-weight: 800; }
.home-task-focus__empty p { font-size: 11px; }
.home-task-focus__foot { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; }
.home-task-focus__foot small { color: var(--muted); font-size: 9px; }
.home-task-focus__foot .home-task-focus__all-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--purple) 80%, #fff);
  border-radius: 8px;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 5px 13px color-mix(in srgb, var(--purple) 20%, transparent);
  font-size: 11px;
  font-weight: 800;
  transition: transform var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard);
}
.home-task-focus__foot .home-task-focus__all-button:hover {
  color: #fff;
  background: color-mix(in srgb, var(--purple) 88%, #000);
  box-shadow: 0 7px 17px color-mix(in srgb, var(--purple) 28%, transparent);
  transform: translateY(-1px);
}
.home-task-focus__foot svg { width: 14px; height: 14px; }

/* Tasks */
.tasks-page { display: grid; gap: 18px; }
.task-analytics { padding: 22px 24px 24px; }
.task-month-switcher { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.task-month-switcher__arrow { border: 1px solid var(--line); background: var(--surface); }
.task-month-switcher__label { min-width: 190px; text-align: center; }
.task-month-switcher__label span { display: block; color: var(--purple); font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.task-month-switcher__label strong { display: block; margin-top: 2px; font-size: 19px; letter-spacing: -.02em; }
.task-month-switcher__label small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.task-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.task-ring-card { --task-color: var(--green); --task-track: #e3eee7; position: relative; display: flex; min-width: 0; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-surface); color: var(--ink); background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%); box-shadow: var(--shadow-sm); text-decoration: none; cursor: pointer; transition: border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), transform var(--duration-ui) var(--ease-standard); }
.task-ring-card::after { position: absolute; top: 11px; right: 11px; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; opacity: 0; color: #fff; background: var(--task-color); box-shadow: 0 5px 13px color-mix(in srgb, var(--task-color) 28%, transparent); content: "✓"; font-size: 12px; font-weight: 800; transform: scale(.72); transition: opacity var(--duration-ui) var(--ease-standard), transform var(--duration-ui) var(--ease-standard); }
.task-ring-card:hover { border-color: color-mix(in srgb, var(--task-color) 46%, var(--line)); box-shadow: 0 10px 24px color-mix(in srgb, var(--task-color) 12%, transparent); transform: translateY(-2px); }
.task-ring-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--task-color) 28%, transparent); outline-offset: 3px; }
.task-ring-card.is-active { border-color: var(--task-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--task-color) 13%, transparent), 0 10px 24px color-mix(in srgb, var(--task-color) 12%, transparent); }
.task-ring-card.is-active::after { opacity: 1; transform: scale(1); }
.task-ring-card--burning { --task-color: #cf3f4b; --task-track: #f4dade; }
.task-ring-card--current { --task-color: #d78a17; --task-track: #f7e8c9; }
.task-ring-card--planned { --task-color: #2e9460; --task-track: #d8eee1; }
.task-ring { position: relative; display: grid; width: 112px; height: 112px; flex: 0 0 112px; place-items: center; border-radius: 50%; background: conic-gradient(var(--task-color) 0 var(--task-progress), var(--task-track) var(--task-progress) 100%); animation: task-ring-enter 420ms var(--ease-standard) both; }
.task-ring::before { position: absolute; width: 78px; height: 78px; border-radius: 50%; background: var(--surface); content: ""; }
.task-ring__inside { position: relative; z-index: 1; max-width: 72px; text-align: center; }
.task-ring__inside strong { display: block; color: var(--task-color); font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.task-ring__inside span { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.15; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.task-ring-card__copy { min-width: 0; }
.task-ring-card__copy h2 { font-size: 16px; }
.task-ring-card__copy p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.task-create-launch { display: flex; justify-content: center; padding-block: 2px; }
.task-create-launch__button { min-width: 210px; min-height: 48px; box-shadow: 0 10px 24px rgba(216, 32, 47, .14); }
.task-create-launch__button:hover { box-shadow: 0 13px 28px rgba(216, 32, 47, .2); }
.task-registry { min-width: 0; overflow: hidden; }
.task-registry__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; padding: 20px 22px 16px; }
.task-registry__head h2 { margin-top: 3px; font-size: 23px; }
.task-active-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.task-active-filter span { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 8px; border-radius: 999px; color: var(--purple); background: var(--purple-soft); font-weight: 700; }
.task-active-filter a { color: var(--purple); font-weight: 700; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color var(--duration-ui) var(--ease-standard); }
.task-active-filter a:hover { text-decoration-color: currentColor; }
.task-state-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 9px; background: var(--surface-soft); }
.task-state-tabs a { min-height: 34px; padding: 8px 12px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 650; transition: color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard); }
.task-state-tabs a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 72%, transparent); }
.task-state-tabs a.is-active { color: var(--purple); background: var(--surface); box-shadow: 0 1px 4px rgba(30, 25, 58, .08); }
.task-filters { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto auto; align-items: end; gap: 10px; padding: 14px 22px; border-block: 1px solid var(--line); background: var(--surface-soft); }
.task-search { position: relative; display: block; min-width: 0; }
.task-search svg { position: absolute; z-index: 1; top: 50%; left: 13px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.task-search input { padding-left: 42px !important; }
.task-date-filters { display: grid; grid-template-columns: repeat(2, 142px); gap: 8px; }
.task-date-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.task-date-filters input { min-height: 42px; }
.task-filter-submit, .task-filter-reset { min-height: 42px; }
.task-filter-error { grid-column: 1 / -1; color: var(--red); font-size: 11px; }
.task-color-legend { display: flex; min-height: 41px; align-items: center; justify-content: flex-end; gap: 18px; padding: 8px 22px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.task-color-legend span { display: inline-flex; align-items: center; gap: 6px; }
.task-color-legend__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.task-color-legend__dot--burning { background: #cf3f4b; }
.task-color-legend__dot--current { background: #d78a17; }
.task-color-legend__dot--planned { background: #2e9460; }
.task-table-wrap { width: 100%; overflow-x: auto; }
.task-table { width: 100%; min-width: 1120px; table-layout: fixed; }
.task-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface-soft); font-size: 10px; letter-spacing: .025em; text-align: left; text-transform: uppercase; }
.task-table th:nth-child(1) { width: 132px; padding-left: 22px; }
.task-table th:nth-child(2) { width: 28%; }
.task-table th:nth-child(3) { width: 17%; }
.task-table th:nth-child(4) { width: 112px; }
.task-table th:nth-child(5) { width: 16%; }
.task-table th:nth-child(6) { width: 16%; }
.task-table th:nth-child(7) { width: 112px; }
.task-table td { padding: 13px 12px; border-bottom: 1px solid rgba(120, 120, 130, .16); vertical-align: top; transition: background-color var(--duration-ui) var(--ease-standard), filter var(--duration-ui) var(--ease-standard); }
.task-table td:first-child { padding-left: 22px; }
.task-row--burning td { background: #fff1f2; }
.task-row--current td { background: #fff8e8; }
.task-row--planned td { background: #f0faf4; }
.task-row--completed td { background: var(--surface); }
.task-row:hover td { filter: brightness(.982); }
.task-row--burning td:first-child { box-shadow: inset 3px 0 0 #cf3f4b; }
.task-row--current td:first-child { box-shadow: inset 3px 0 0 #d78a17; }
.task-row--planned td:first-child { box-shadow: inset 3px 0 0 #2e9460; }
.task-type { display: inline-flex; max-width: 100%; min-height: 27px; align-items: center; padding: 5px 8px; overflow: hidden; border: 1px solid rgba(52, 39, 143, .12); border-radius: 6px; color: var(--purple); background: rgba(255, 255, 255, .68); font-size: 10px; font-weight: 750; line-height: 1.2; text-overflow: ellipsis; text-transform: uppercase; }
.task-row__title-link { display: block; color: var(--ink); }
.task-row__title-link:hover { color: var(--purple); }
.task-row__title strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.task-row__description { display: -webkit-box; margin-top: 4px; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-created-meta, .task-completed-meta { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.task-completed-meta { color: var(--green); }
.task-assignees { display: grid; gap: 5px; }
.task-assignees > span { display: flex; min-width: 0; align-items: center; gap: 6px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.task-assignees b { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border-radius: 50%; color: #fff; background: var(--purple); font-size: 9px; }
.task-due { display: block; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.task-due b { margin-left: 3px; color: var(--purple); }
.task-due__note { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.task-counterparty { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 600; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-counterparty:hover, .task-documents a:hover { color: var(--purple); text-decoration: underline; }
.task-documents { display: grid; gap: 4px; }
.task-documents a { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-empty-value { color: var(--muted); font-size: 10px; }
.task-row__action { text-align: right; }
.task-row__action > * { margin-left: auto; }
.task-complete-button { min-width: 96px; padding-inline: 10px; }
.task-complete-button svg { width: 15px; height: 15px; }
.task-open-button { width: max-content; min-width: 82px; margin-top: 7px; }
.task-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 650; }
.task-status svg { width: 15px; height: 15px; }
.task-status--completed { color: var(--green); }
.task-empty { display: grid; min-height: 250px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.task-empty > span { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 14px; color: var(--purple); background: var(--purple-soft); }
.task-empty svg { width: 24px; height: 24px; }
.task-empty h3 { margin-top: 14px; }
.task-empty p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.dialog--task { width: min(920px, calc(100vw - 28px)); }
.task-create-form { padding-bottom: 0; }
.task-form-alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #efbbc1; border-radius: 7px; color: #8f1521; background: var(--red-soft); font-size: 12px; }
.task-form-alert .errorlist { padding-left: 18px; }
.task-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px 130px; gap: 18px; }
.task-form-grid__wide { grid-column: 1 / -1; }
.task-date-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: -7px; }
.task-date-presets > span { margin-right: 3px; color: var(--muted); font-size: 10px; font-weight: 650; }
.task-date-presets button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--surface-soft); font: inherit; font-size: 10px; font-weight: 650; cursor: pointer; transition: border-color var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.task-date-presets button:hover { border-color: rgba(52, 39, 143, .35); color: var(--purple); }
.task-date-presets button:active { transform: scale(.97); }
.task-date-presets button.is-active { border-color: rgba(52, 39, 143, .42); color: var(--purple); background: var(--purple-soft); }
.task-form-section { min-width: 0; margin: 22px 0 0; padding: 17px; border: 1px solid var(--line); border-radius: 9px; }
.task-form-section legend { padding-inline: 6px; font-size: 13px; font-weight: 700; }
.task-form-section > p { margin-bottom: 13px; color: var(--muted); font-size: 11px; }
.task-assignee-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.task-assignee-picker label { display: flex; min-width: 0; min-height: 54px; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); cursor: pointer; transition: border-color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.task-assignee-picker label:hover { border-color: rgba(52, 39, 143, .28); transform: translateY(-1px); }
.task-assignee-picker label:has(input:checked) { border-color: rgba(52, 39, 143, .42); background: var(--purple-soft); }
.task-assignee-picker input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--purple); }
.task-assignee-picker__avatar { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--purple); font-size: 10px; font-weight: 700; }
.task-assignee-picker label > span:last-child { min-width: 0; }
.task-assignee-picker strong, .task-assignee-picker small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-assignee-picker strong { font-size: 11px; }
.task-assignee-picker small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.task-link-section > .field { margin-bottom: 16px; }
.task-document-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.task-document-picker > section { min-width: 0; padding: 12px; border-radius: 8px; background: var(--surface-soft); }
.task-document-picker h3 { margin-bottom: 9px; font-size: 12px; }
.task-document-picker__list { display: grid; max-height: 210px; gap: 6px; overflow-y: auto; }
.task-document-picker__list label { display: flex; min-width: 0; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid transparent; border-radius: 6px; background: var(--surface); cursor: pointer; transition: border-color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard); }
.task-document-picker__list label:hover { border-color: var(--line); background: var(--surface-purple); }
.task-document-picker__list label:has(input:checked) { border-color: rgba(52, 39, 143, .35); background: var(--purple-soft); }
.task-document-picker__list input { width: 15px; height: 15px; flex: 0 0 15px; accent-color: var(--purple); }
.task-document-picker__list span { min-width: 0; }
.task-document-picker__list strong, .task-document-picker__list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-document-picker__list strong { font-size: 10px; }
.task-document-picker__list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.task-picker-empty { padding: 8px; color: var(--muted); font-size: 10px; }
.task-create-form__actions { position: sticky; z-index: var(--z-sticky); bottom: 0; margin-inline: -24px; margin-bottom: 0; padding: 16px 24px 24px; border-radius: 0 0 var(--radius-overlay) var(--radius-overlay); background: var(--surface); }

/* Task workspace */
.task-detail-page { display: grid; gap: 18px; }
.task-detail-hero { display: flex; min-width: 0; align-items: stretch; justify-content: space-between; gap: 26px; padding: 24px; }
.task-detail-hero__copy { min-width: 0; max-width: 920px; }
.task-detail-hero__badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.task-detail-hero__copy h2 { margin-top: 14px; font-size: clamp(24px, 2.3vw, 36px); line-height: 1.12; letter-spacing: -.035em; }
.task-detail-hero__copy > p { max-width: 860px; margin-top: 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.task-detail-muted { color: var(--muted) !important; }
.task-detail-deadline { display: grid; min-width: 190px; align-content: center; justify-items: end; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); text-align: right; }
.task-detail-deadline > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.task-detail-deadline strong { margin-top: 6px; font-size: 18px; font-variant-numeric: tabular-nums; }
.task-detail-deadline b { margin-top: 2px; color: var(--purple); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.task-detail-deadline small { margin-top: 8px; color: var(--green); font-size: 10px; font-weight: 650; }
.task-detail-deadline--burning { border-color: rgba(207, 63, 75, .25); background: #fff3f4; }
.task-detail-deadline--burning small { color: #b92d3a; }
.task-detail-deadline--current { border-color: rgba(215, 138, 23, .24); background: #fff9eb; }
.task-detail-deadline--current small { color: #aa690b; }
.task-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 330px); align-items: start; gap: 18px; }
.task-detail-main { display: grid; min-width: 0; gap: 18px; }
.task-detail-aside { position: sticky; top: 86px; display: grid; gap: 18px; }
.task-goal { padding: 24px; }
.task-goal__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.task-goal__head h2, .task-history__head h2, .task-finish-card h2, .task-context-card h2 { margin-top: 3px; font-size: 22px; }
.task-goal__head > div:first-child > p:last-child { max-width: 650px; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.task-goal-progress__value { display: grid; flex: 0 0 auto; justify-items: end; }
.task-goal-progress__value strong { color: var(--purple); font-size: 24px; font-variant-numeric: tabular-nums; }
.task-goal-progress__value > span { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.task-goal-progress__value small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.task-goal-progress { height: 7px; margin-top: 18px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.task-goal-progress > span { display: block; width: var(--task-progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--green)); transition: width 320ms var(--ease-standard); }
.task-step-add { margin-top: 22px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.task-step-add > label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.task-step-add > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.task-step-add input { background: var(--surface) !important; }
.task-steps { display: grid; gap: 8px; margin-top: 18px; }
.task-step { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 66px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); transition: border-color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.task-step--entering { animation: task-step-enter 360ms var(--ease-standard) both; }
.task-step:hover { border-color: rgba(52, 39, 143, .24); transform: translateY(-1px); }
.task-step--completed { background: color-mix(in srgb, var(--green-soft) 64%, var(--surface)); }
.task-step--just-completed { animation: task-step-complete 440ms var(--ease-standard) both; }
.task-step__check { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid var(--green); border-radius: 50%; color: #fff; background: var(--green); }
.task-step__check svg { width: 17px; height: 17px; }
.task-step__check--button { border-color: var(--line-strong); color: transparent; background: var(--surface); cursor: pointer; transition: border-color var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.task-step__check--button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); transform: scale(1.04); }
.task-step__check--empty { border-color: var(--line-strong); background: transparent; }
.task-step__copy { min-width: 0; }
.task-step__copy strong { display: block; font-size: 12px; line-height: 1.4; }
.task-step--completed .task-step__copy strong { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-soft) 45%, transparent); }
.task-step__copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.task-step__number { color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.task-steps-empty { display: grid; min-height: 190px; place-items: center; align-content: center; padding: 25px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); text-align: center; }
.task-steps-empty > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; color: var(--purple); background: var(--purple-soft); }
.task-steps-empty svg { width: 22px; height: 22px; }
.task-steps-empty strong { margin-top: 12px; color: var(--ink); font-size: 14px; }
.task-steps-empty p { max-width: 460px; margin-top: 5px; font-size: 10px; line-height: 1.5; }
.task-history { padding: 22px 24px 24px; }
.task-history__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.task-history__head > span { color: var(--muted); font-size: 10px; font-weight: 650; }
.task-timeline { display: grid; margin: 0; padding: 18px 0 0; list-style: none; }
.task-timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 11px; padding-bottom: 19px; }
.task-timeline li:not(:last-child)::after { position: absolute; top: 17px; bottom: 0; left: 5px; width: 1px; background: var(--line-strong); content: ""; }
.task-timeline__dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 3px solid var(--surface); border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 1px rgba(52, 39, 143, .25); }
.task-timeline strong { display: block; font-size: 12px; }
.task-timeline p { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.task-timeline small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.task-timeline-item--entering { animation: task-timeline-enter 320ms var(--ease-standard) both; }
.task-step-notice span { font-weight: 650; }
.dialog--task-step-confirm { width: min(520px, calc(100vw - 28px)); }
.task-step-confirm { min-width: 0; }
.task-step-confirm__head { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 14px; }
.task-step-confirm__head h2 { margin-top: 5px; font-size: 24px; line-height: 1.2; }
.task-step-confirm__head p:not(.section-kicker) { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.task-step-confirm__icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--green); background: var(--green-soft); }
.task-step-confirm__icon svg { width: 23px; height: 23px; }
.task-step-confirm__step { display: grid; gap: 4px; margin-top: 20px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.task-step-confirm__step span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.task-step-confirm__step strong { overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.task-step-confirm__actions { margin-top: 18px; }
.task-finish-card, .task-context-card { padding: 20px; }
.task-finish-card > p:not(.section-kicker), .task-finish-card__done p { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.task-finish-button { width: 100%; min-height: 46px; margin-top: 16px; }
.task-finish-card__done { text-align: center; }
.task-finish-card__done > span { display: grid; width: 50px; height: 50px; margin: 5px auto 12px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); box-shadow: 0 8px 20px rgba(46, 148, 96, .18); }
.task-finish-card__done svg { width: 24px; height: 24px; }
.task-reopen-form { display: grid; gap: 13px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.task-reopen-form__head strong { font-size: 13px; }
.task-reopen-form__head p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.task-reopen-form textarea { min-height: 88px; resize: vertical; }
.task-reopen-form__deadline { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 10px; }
.task-reopen-button { width: 100%; min-height: 42px; }
.task-detail-note { margin-top: 13px !important; padding: 10px; border-radius: 7px; background: var(--surface-soft); }
.task-context-list { display: grid; margin-top: 16px; }
.task-context-list > div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.task-context-list dt { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.task-context-list dd { min-width: 0; margin: 0; font-size: 11px; font-weight: 600; line-height: 1.4; }
.task-context-list dd > span, .task-context-list dd > small { display: block; }
.task-context-list dd > small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 400; }
.task-context-list a { color: var(--purple); }
.task-context-documents { display: grid; gap: 5px; }
.task-edit-page { width: min(1040px, 100%); margin-inline: auto; }
.task-edit-form { padding: 24px; }
.task-edit-form__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.task-edit-form__head h2 { margin-top: 4px; font-size: 24px; line-height: 1.2; }
.task-edit-form__head p:last-child { max-width: 680px; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.task-edit-form__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

html[data-theme="dark"] .task-ring-card { --task-track: #2d2d36; }
html[data-theme="dark"] .home-task-focus__row--burning td { background: rgba(127, 38, 49, .22); }
html[data-theme="dark"] .home-task-focus__row--current td { background: rgba(139, 91, 24, .19); }
html[data-theme="dark"] .home-task-focus__row--planned td { background: rgba(36, 113, 70, .18); }
html[data-theme="dark"] .task-ring-card--burning { --task-track: #3a262c; }
html[data-theme="dark"] .task-ring-card--current { --task-track: #3b3222; }
html[data-theme="dark"] .task-ring-card--planned { --task-track: #21372b; }
html[data-theme="dark"] .task-row--burning td { background: rgba(127, 38, 49, .22); }
html[data-theme="dark"] .task-row--current td { background: rgba(139, 91, 24, .19); }
html[data-theme="dark"] .task-row--planned td { background: rgba(36, 113, 70, .18); }
html[data-theme="dark"] .task-type { color: #c8c0ff; background: rgba(27, 26, 35, .7); border-color: rgba(184, 173, 255, .22); }
html[data-theme="dark"] .task-detail-deadline--burning { background: rgba(127, 38, 49, .22); }
html[data-theme="dark"] .task-detail-deadline--current { background: rgba(139, 91, 24, .19); }
html[data-theme="dark"] .task-state-tabs a.is-active { color: #c8c0ff; }
html[data-theme="dark"] .task-assignee-picker label:has(input:checked),
html[data-theme="dark"] .task-document-picker__list label:has(input:checked) { border-color: #625a84; }

@media (max-width: 1180px) {
  .task-ring-card { flex-direction: column; text-align: center; }
  .task-ring-card__copy p { max-width: 220px; }
  .task-filters { grid-template-columns: minmax(230px, 1fr) auto auto; }
  .task-filter-reset { grid-column: 3; }
  .task-detail-grid { grid-template-columns: 1fr; }
  .task-detail-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .task-analytics { padding: 18px; }
  .task-rings { gap: 9px; }
  .task-ring-card { padding: 14px 9px; }
  .task-ring { width: 94px; height: 94px; flex-basis: 94px; }
  .task-ring::before { width: 66px; height: 66px; }
  .task-ring__inside strong { font-size: 23px; }
  .task-ring-card__copy h2 { font-size: 13px; }
  .task-ring-card__copy p { font-size: 9px; }
  .task-filters { grid-template-columns: 1fr auto; }
  .task-search { grid-column: 1 / -1; }
  .task-filter-reset { grid-column: auto; }
  .task-assignee-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-form-grid { grid-template-columns: minmax(0, 1fr) 170px 120px; gap: 14px; }
}

@media (max-width: 768px) {
  .home-task-focus { margin-top: 18px; }
  .home-task-focus__head { padding: 15px 14px 13px; }
  .home-task-focus__table-wrap { max-height: 430px; padding: 10px; }
  .home-task-focus__table { table-layout: auto; }
  .home-task-focus__table thead { display: none; }
  .home-task-focus__table tbody { display: grid; gap: 8px; }
  .home-task-focus__table tr { display: grid; grid-template-columns: 104px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
  .home-task-focus__table td { display: block; min-width: 0; padding: 9px 11px; border: 0; background: transparent !important; }
  .home-task-focus__table td::before { display: block; margin-bottom: 3px; color: var(--muted); content: attr(data-label); font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .home-task-focus__table td:first-child { grid-row: 1 / span 2; padding-left: 12px; }
  .home-task-focus__task { grid-column: 2; }
  .home-task-focus__row--burning { background: #fff3f4; }
  .home-task-focus__row--current { background: #fff9eb; }
  .home-task-focus__row--planned { background: #f2faf5; }
  .home-task-focus__foot { padding-inline: 14px; }
  html[data-theme="dark"] .home-task-focus__row--burning { background: rgba(127, 38, 49, .3); }
  html[data-theme="dark"] .home-task-focus__row--current { background: rgba(139, 91, 24, .25); }
  html[data-theme="dark"] .home-task-focus__row--planned { background: rgba(36, 113, 70, .24); }
  .tasks-page { gap: 14px; }
  .task-analytics { padding: 15px 12px; }
  .task-month-switcher { margin-bottom: 15px; }
  .task-month-switcher__label { min-width: 150px; }
  .task-month-switcher__label strong { font-size: 16px; }
  .task-rings { grid-template-columns: 1fr; }
  .task-ring-card { min-height: 94px; flex-direction: row; justify-content: flex-start; padding: 12px 16px; text-align: left; }
  .task-ring { width: 72px; height: 72px; flex-basis: 72px; }
  .task-ring::before { width: 51px; height: 51px; }
  .task-ring__inside strong { font-size: 19px; }
  .task-ring__inside span { display: block; max-width: 44px; margin: 3px auto 0; font-size: 6.5px; white-space: normal; }
  .task-ring-card__copy p { max-width: none; font-size: 10px; }
  .task-create-launch__button { width: 100%; min-height: 46px; }
  .task-registry__head { align-items: stretch; flex-direction: column; gap: 12px; padding: 17px 14px 14px; }
  .task-state-tabs { width: 100%; }
  .task-state-tabs a { flex: 1; padding-inline: 5px; text-align: center; }
  .task-filters { grid-template-columns: 1fr; padding: 12px 14px; }
  .task-search, .task-date-filters, .task-filter-submit, .task-filter-reset { grid-column: 1; }
  .task-date-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-filter-submit, .task-filter-reset { width: 100%; }
  .task-color-legend { align-items: flex-start; flex-direction: column; gap: 5px; padding: 10px 14px; }
  .task-table-wrap { overflow: visible; }
  .task-table { min-width: 0; table-layout: auto; }
  .task-table thead { display: none; }
  .task-table tbody { display: grid; gap: 10px; padding: 12px; }
  .task-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
  .task-table td { display: block; min-width: 0; padding: 10px 12px; border: 0; background: transparent !important; }
  .task-table td::before { display: block; margin-bottom: 4px; color: var(--muted); content: attr(data-label); font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .task-table td:first-child { padding-left: 12px; }
  .task-row--burning { background: #fff1f2; }
  .task-row--current { background: #fff8e8; }
  .task-row--planned { background: #f0faf4; }
  .task-row--completed { background: var(--surface); }
  .task-row__title { grid-column: 1 / -1; grid-row: 1; padding-top: 13px !important; }
  .task-row__title::before { display: none !important; }
  .task-row__title strong { font-size: 14px; white-space: normal; }
  .task-row__action { display: flex !important; align-items: flex-end; justify-content: flex-end; text-align: left; }
  .task-row__action::before { margin-right: auto; }
  .task-complete-button { min-height: 38px; }
  .dialog--task { width: calc(100vw - 18px); max-height: calc(100dvh - 18px); }
  .task-create-form { padding: 18px 16px 0; }
  .task-form-grid, .task-document-picker { grid-template-columns: 1fr; }
  .task-form-grid__wide { grid-column: auto; }
  .task-assignee-picker { grid-template-columns: 1fr; }
  .task-form-section { padding: 13px; }
  .task-create-form__actions { margin-inline: -16px; padding: 14px 16px 18px; }
  .task-edit-form { padding: 18px; }
  .task-edit-form__head { flex-direction: column; gap: 12px; }
  .task-edit-form__actions { align-items: stretch; flex-direction: column-reverse; }
  .task-edit-form__actions .button { width: 100%; }
  .task-detail-hero { align-items: stretch; flex-direction: column; padding: 18px; }
  .task-detail-deadline { min-width: 0; justify-items: start; text-align: left; }
  .task-detail-aside { grid-template-columns: 1fr; }
  .task-goal, .task-history { padding: 18px; }
  .task-step-add > div { grid-template-columns: 1fr; }
  .task-step-add .button { width: 100%; }
  html[data-theme="dark"] .task-row--burning { background: rgba(127, 38, 49, .3); }
  html[data-theme="dark"] .task-row--current { background: rgba(139, 91, 24, .25); }
  html[data-theme="dark"] .task-row--planned { background: rgba(36, 113, 70, .24); }
}

@media (max-width: 430px) {
  .home-task-focus__head { align-items: stretch; flex-direction: column; gap: 9px; }
  .home-task-focus__count { align-self: flex-start; }
  .home-task-focus__table-wrap { padding-inline: 8px; }
  .home-task-focus__table tr { grid-template-columns: 88px minmax(0, 1fr); }
  .home-task-focus__table td:nth-child(3), .home-task-focus__table td:nth-child(4) { grid-column: 1 / -1; }
  .home-task-focus__foot { align-items: flex-start; flex-direction: column; gap: 6px; }
  .task-month-switcher { gap: 7px; }
  .task-month-switcher__label { min-width: 136px; }
  .task-ring-card { gap: 13px; padding-inline: 12px; }
  .task-state-tabs a { font-size: 10px; }
  .task-table tbody { padding-inline: 8px; }
  .task-table tr { grid-template-columns: 1fr; }
  .task-row__title, .task-row__action { grid-column: auto; }
  .task-row__action { align-items: stretch; flex-direction: column; }
  .task-row__action::before { margin-right: 0; }
  .task-row__action form, .task-complete-button { width: 100%; }
  .task-row__action .task-open-button { width: 100%; }
  .task-goal__head, .task-history__head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .task-goal-progress__value { justify-items: start; }
  .task-step { grid-template-columns: 36px minmax(0, 1fr); }
  .task-step__number { display: none; }
  .task-context-list > div { grid-template-columns: 1fr; gap: 5px; }
  .task-reopen-form__deadline { grid-template-columns: 1fr; }
}

@keyframes content-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes message-enter {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes task-step-enter {
  from { opacity: 0; transform: translateY(-7px) scale(.992); }
  60% { border-color: color-mix(in srgb, var(--purple) 32%, var(--line)); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes task-step-complete {
  0% { transform: scale(.992); box-shadow: 0 0 0 0 rgba(46, 148, 96, 0); }
  45% { transform: scale(1); box-shadow: 0 0 0 4px rgba(46, 148, 96, .10); }
  100% { box-shadow: 0 0 0 0 rgba(46, 148, 96, 0); }
}

@keyframes task-timeline-enter {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes menu-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px) scale(.985); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes menu-enter-right {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes menu-enter-fixed {
  from { opacity: 0; transform: translateY(7px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(9px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialog-exit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(7px) scale(.99); }
}

@keyframes backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdrop-exit {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes task-ring-enter {
  from { opacity: .35; transform: scale(.94) rotate(-5deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

html.theme-transition,
html.theme-transition body,
html.theme-transition .sidebar,
html.theme-transition .topbar,
html.theme-transition .surface,
html.theme-transition .dialog__card,
html.theme-transition input,
html.theme-transition select,
html.theme-transition textarea {
  transition: color 220ms var(--ease-standard), background-color 220ms var(--ease-standard), border-color 220ms var(--ease-standard);
}

/* Compact home workspace and advanced global search */
.page-home .workspace__content {
  padding: clamp(14px, 1.5vw, 24px) clamp(16px, 2vw, 32px) 20px;
}
.home-topbar-datetime {
  display: grid;
  width: min(430px, 38vw);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-soft) 100%);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.home-topbar-datetime .home-hero__date time { font-size: 12px; }
.home-topbar-datetime .home-hero__clock {
  min-width: 92px;
  gap: 1px;
  padding-left: 14px;
}
.home-topbar-datetime .home-hero__clock > time { font-size: 21px; }
.home-topbar-datetime .home-hero__seconds { font-size: 11px; }
.page-home .home-hero {
  min-height: 0;
  justify-content: flex-start;
  padding: 2px 12px 8px;
}
.page-home .home-hero h2 {
  margin-top: 0;
  font-size: clamp(28px, 2.7vw, 36px);
}
.page-home .home-hero > p { margin-top: 5px; }
.page-home .create-menu { margin-top: 14px; }
.page-home .button--hero { min-height: 52px; }

.global-search {
  position: relative;
  display: block;
  width: min(920px, 100%);
  min-height: 0;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  text-align: left;
}
.global-search__bar {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard);
}
.global-search:focus-within .global-search__bar,
.global-search.is-open .global-search__bar {
  border-color: color-mix(in srgb, var(--purple) 44%, var(--line-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple-soft) 72%, transparent), var(--shadow-sm);
}
.global-search .global-search__filter-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.global-search .global-search__filter-toggle:hover,
.global-search.is-open .global-search__filter-toggle {
  color: var(--purple);
  background: var(--purple-soft);
}
.global-search .global-search__filter-toggle svg { width: 21px; height: 21px; }
.global-search__bar > input {
  min-width: 0;
  min-height: 42px !important;
  flex: 1;
  padding: 0 4px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px;
}
.global-search .global-search__submit {
  min-height: 42px;
  padding: 0 21px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--purple);
  cursor: pointer;
  font-weight: 700;
}
.global-search__filters {
  position: absolute;
  z-index: var(--z-dropdown);
  top: calc(100% + 9px);
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr) auto;
  align-items: end;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  visibility: hidden;
  opacity: 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  transform: translateY(-7px) scale(.99);
  transform-origin: top center;
  transition: opacity 160ms var(--ease-standard), transform 160ms var(--ease-standard), visibility 160ms;
}
.global-search.is-open .global-search__filters {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.global-search__filters-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.global-search__filters-head > div { display: grid; gap: 2px; }
.global-search__filters-head strong { font-size: 13px; }
.global-search__filters-head span { color: var(--muted); font-size: 10px; }
.global-search__filters-head a { color: var(--purple); font-size: 10px; font-weight: 700; }
.global-search__date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.global-search__date-range label { display: grid; gap: 5px; }
.global-search__date-range span,
.global-search__types legend {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.global-search__date-range input {
  min-height: 40px !important;
  padding: 7px 9px !important;
  background: var(--surface-soft) !important;
  font-size: 11px !important;
}
.global-search__types {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  border: 0;
}
.global-search__types legend { width: 100%; margin-bottom: 1px; }
.global-search__types label { cursor: pointer; }
.global-search__types input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.global-search__types span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 650;
  transition: border-color var(--duration-ui) var(--ease-standard), color var(--duration-ui) var(--ease-standard), background-color var(--duration-ui) var(--ease-standard);
}
.global-search__types label:hover span,
.global-search__types input:focus-visible + span {
  border-color: color-mix(in srgb, var(--purple) 40%, var(--line));
  color: var(--purple);
}
.global-search__types input:checked + span {
  border-color: color-mix(in srgb, var(--purple) 50%, var(--line));
  color: var(--purple);
  background: var(--purple-soft);
}
.global-search .global-search__filter-submit {
  display: inline-flex;
  min-height: 40px;
  color: var(--purple);
  background: var(--surface);
  white-space: nowrap;
}
.global-search__error { grid-column: 1 / -1; color: var(--red); font-size: 10px; }
.page-home .home-task-focus { margin-top: 14px; }
.page-home .home-task-focus__head { padding: 11px 18px 9px; }
.page-home .home-task-focus__head h3 { font-size: 19px; }
.page-home .home-task-focus__table-wrap {
  max-height: 168px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: color-mix(in srgb, var(--purple) 45%, var(--line-strong)) transparent;
  scrollbar-width: thin;
}
@media (min-width: 769px) {
  .page-home .home-task-focus__table th {
    position: sticky;
    padding-block: 5px;
  }
  .page-home .home-task-focus__table td { padding-block: 4px; }
  .page-home .home-task-focus__table time { gap: 1px; }
  .page-home .home-task-focus__table time strong {
    font-size: 9px;
    line-height: 1.1;
  }
  .page-home .home-task-focus__table time span {
    font-size: 14px;
    line-height: 1.1;
  }
  .page-home .home-task-focus__task .task-type {
    min-height: 24px;
    padding: 3px 7px;
  }
  .page-home .home-task-focus__task-link strong { line-height: 1.2; }
  .page-home .home-task-focus__assignees span {
    width: 23px;
    height: 23px;
  }
}
.page-home .home-task-focus__table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.page-home .home-task-focus__table-wrap::-webkit-scrollbar-track { background: transparent; }
.page-home .home-task-focus__table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--purple) 42%, var(--line-strong));
  background-clip: padding-box;
}
.page-home .home-task-focus__table-wrap:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--purple) 52%, transparent);
  outline-offset: -2px;
}
.page-home .home-task-focus__foot { min-height: 36px; padding: 6px 18px; }
.page-home .home-sections { margin-top: 14px; }
.page-home .home-sections .section-head { margin-bottom: 9px; }
.page-home .home-sections h2 { font-size: 21px; }
.page-home .module-card { padding-block: 11px; }
.page-home .module-card__icon { width: 38px; height: 38px; }
.page-home .home-search-results { margin: 14px auto 0; padding: 17px; }

@media (min-width: 1024px) {
  .page-home .workspace__content {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .page-home .create-menu,
  .page-home .global-search,
  .page-home .home-task-focus,
  .page-home .home-sections {
    margin-top: 10px;
  }

  .page-home .home-sections .section-head { margin-bottom: 6px; }
  .page-home .module-card { padding-block: 9px; }
}

/* Task analytics collapse into the sticky page header */
.task-topbar-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 280ms;
}
html.task-summary-visible .task-topbar-summary {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.page-tasks .topbar {
  isolation: isolate;
}
.page-tasks .task-topbar-summary__metrics {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 9px)) scale(.96);
  transition: opacity 210ms var(--ease-standard), transform 280ms var(--ease-standard);
}
html.task-summary-visible .page-tasks .task-topbar-summary__metrics {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.task-topbar-summary__metrics { display: flex; align-items: center; gap: 6px; }
.task-topbar-metric {
  --task-color: #2e9460;
  display: flex;
  min-width: 96px;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.task-topbar-metric--burning { --task-color: #cf3f4b; }
.task-topbar-metric--current { --task-color: #d78a17; }
.task-topbar-metric i {
  position: relative;
  display: block;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 50%;
  background: conic-gradient(var(--task-color) var(--task-progress), var(--surface-soft) 0);
}
.task-topbar-metric i::after {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}
.task-topbar-metric > span { display: grid; min-width: 0; }
.task-topbar-metric strong { color: var(--task-color); font-size: 13px; line-height: 1; }
.task-topbar-metric small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-topbar-create {
  min-height: 42px;
  flex: 0 0 auto;
  padding-inline: 15px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 190ms var(--ease-standard), transform 260ms var(--ease-standard), background-color var(--duration-ui) var(--ease-standard), box-shadow var(--duration-ui) var(--ease-standard);
}
html.task-summary-visible .task-topbar-create {
  opacity: 1;
  transform: translateY(0);
}
.task-topbar-create svg { width: 16px; height: 16px; }

html[data-theme="dark"] .home-topbar-datetime,
html[data-theme="dark"] .global-search__bar,
html[data-theme="dark"] .global-search__filters,
html[data-theme="dark"] .task-topbar-metric {
  background: var(--surface);
}

@media (max-width: 1280px) {
  .home-topbar-datetime { width: min(360px, 36vw); }
  .home-topbar-datetime .home-hero__date time { font-size: 11px; }
  .task-topbar-metric { min-width: 62px; }
  .task-topbar-metric small { display: none; }
}

@media (max-width: 900px) {
  .home-topbar-datetime {
    width: auto;
    grid-template-columns: auto;
    padding: 7px 9px;
  }
  .home-topbar-datetime .home-hero__date { display: none; }
  .home-topbar-datetime .home-hero__clock {
    min-width: 86px;
    padding-left: 0;
    border-left: 0;
  }
  .home-topbar-datetime .home-hero__timezone { display: none; }
  .global-search__filters { grid-template-columns: 1fr auto; }
  .global-search__types { grid-column: 1 / -1; }
  .task-topbar-metric { min-width: 0; padding: 5px; }
  .task-topbar-metric > span { display: none; }
  .task-topbar-create span { display: none; }
  .task-topbar-create { width: 42px; padding: 0; }
}

@media (max-width: 620px) {
  .home-topbar-datetime .home-hero__seconds { display: none; }
  .home-topbar-datetime .home-hero__clock { min-width: auto; }
  .home-topbar-datetime .home-hero__clock > time { font-size: 18px; }
  .page-home .home-hero { padding-inline: 0; }
  .global-search .global-search__submit { display: none; }
  .global-search__filters {
    position: fixed;
    z-index: var(--z-dialog);
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-height: calc(100dvh - 20px);
    grid-template-columns: 1fr;
    overflow-y: auto;
    transform: translateY(12px) scale(.99);
  }
  .global-search.is-open .global-search__filters { transform: translateY(0) scale(1); }
  .global-search__types { grid-column: auto; }
  .global-search__filter-submit { width: 100%; }
  .page-home .home-task-focus__table-wrap {
    max-height: none;
    overflow: visible;
  }
  .task-topbar-summary { gap: 5px; }
  .task-topbar-summary__metrics { gap: 3px; }
  .task-topbar-metric i { width: 25px; height: 25px; flex-basis: 25px; }
  .task-topbar-metric i::after { inset: 4px; }
}

@media (max-width: 520px) {
  .create-menu.is-open .create-menu__panel {
    animation-name: menu-enter-fixed;
    transform-origin: bottom center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Task registry: keep five desktop rows visible and scroll additional tasks inside the card. */
.task-table-wrap--scrollable {
  max-height: 488px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--purple) 42%, var(--line)) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.task-table-wrap--scrollable .task-table thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  box-shadow: 0 1px 0 var(--line);
}

.task-table-wrap--scrollable::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.task-table-wrap--scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.task-table-wrap--scrollable::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--purple) 42%, var(--line));
  background-clip: padding-box;
}

.task-table-wrap--scrollable::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--purple) 62%, var(--line));
  background-clip: padding-box;
}

.task-table-wrap--scrollable:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--purple) 62%, transparent);
  outline-offset: -2px;
}

@media (max-width: 900px) {
  .task-table-wrap--scrollable {
    max-height: min(840px, 74dvh);
    overflow-x: hidden;
    overflow-y: auto;
  }
}
