:root {
  --bg: #f4f8f9;
  --rail: #f7fafb;
  --surface: #ffffff;
  --text: #17202b;
  --muted: #65717f;
  --line: #dce3e7;
  --line-strong: #c7d0d6;
  --teal: #087789;
  --teal-strong: #055d6b;
  --turquoise: #19a8aa;
  --teal-soft: #e9f6f7;
  --green: #138a4b;
  --green-soft: #edf8f1;
  --amber: #b56608;
  --amber-soft: #fff7e8;
  --red: #c43737;
  --red-soft: #fff0f0;
  --violet: #6d52a3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(17, 30, 43, .04);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input, select { font: inherit; }
input, select, textarea { max-width: 100%; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(8,119,137,.28); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--line); }
.brand { min-height: 70px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); font-size: 19px; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--text); border-radius: 6px; font-size: 11px; letter-spacing: .03em; }
.nav { padding: 12px 10px 24px; display: grid; gap: 13px; overflow-y: auto; }
.nav-group { display: grid; gap: 3px; }
.nav-group-label { padding: 5px 12px; color: #8a97a3; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.nav-button { width: 100%; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; background: transparent; color: #2e3945; cursor: pointer; text-align: left; font-size: 14px; font-weight: 550; }
.nav-button:hover { background: #eef3f4; }
.nav-button.active { color: #075e6b; border-color: #90c9d1; background: #eaf6f7; }
.nav-icon { width: 19px; height: 19px; display: grid; place-items: center; color: currentColor; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.75; }
.sidebar-note { margin-top: auto; padding: 18px 20px 22px; color: var(--muted); font-size: 12px; line-height: 1.5; border-top: 1px solid var(--line); }
.sidebar-note span { color: #8a949e; }

.workspace { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.scheduler { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.page { flex: 1; padding: 24px 28px 32px; }
.statusbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.statusbar strong { color: var(--text); font-weight: 600; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.connection-list { margin-bottom: 18px; }
.connection-row { min-height: 72px; display: grid; grid-template-columns: minmax(250px,1.15fr) minmax(205px,.8fr) 135px minmax(190px,.75fr) 24px; align-items: center; gap: 18px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.connection-row:last-child { border-bottom: 0; }
.connection-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.connection-name strong { font-size: 16px; }
.status-dot { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--line-strong); position: relative; }
.status-dot.ok { background: var(--green); }
.status-dot.warn { background: var(--amber); }
.status-dot.error { background: var(--red); }
.status-dot.neutral { width: 9px; height: 9px; background: #86929d; }
.status-dot.ok::after { content: ""; position: absolute; width: 7px; height: 4px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg); left: 6px; top: 6px; }
.connection-copy { min-width: 0; }
.connection-copy .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.connection-copy .value { font-size: 14px; font-weight: 650; }
.connection-copy .value.teal { color: var(--teal); font-size: 18px; }
.status-label { display: inline-flex; margin-left: auto; max-width: 260px; padding: 6px 8px; border-radius: 6px; font-size: 12px; font-weight: 620; line-height: 1.25; }
.status-label.ok { color: #116d3e; background: var(--green-soft); border: 1px solid #cce8d6; }
.status-label.warn { color: var(--amber); background: var(--amber-soft); border: 1px solid #efd7ad; }
.status-label.error { color: var(--red); background: var(--red-soft); border: 1px solid #f2c9c9; }
.button { border: 1px solid var(--line-strong); background: white; color: #34414e; min-height: 36px; border-radius: 7px; padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.button:hover:not(:disabled) { border-color: #8ebcc2; background: #f6fbfb; }
.button:disabled { color: #a3adb5; background: #fafbfb; cursor: not-allowed; }
.button.primary { color: #075e6b; border-color: #8fbfc6; }
.button.primary:disabled { color: #a3adb5; border-color: var(--line-strong); background: #fafbfb; }
.button.danger { color: var(--red); border-color: #e5aaaa; background: var(--red-soft); }
.button.full { width:100%; }

.decision-band { display: grid; grid-template-columns: repeat(6,1fr); margin-bottom: 18px; }
.decision-item { min-height: 86px; padding: 15px 16px; display: flex; align-items: center; gap: 12px; border-right: 1px solid var(--line); }
.decision-item:last-child { border-right: 0; }
.decision-icon { width: 32px; height: 32px; color: #364451; display: grid; place-items: center; }
.decision-icon svg { width: 27px; height: 27px; stroke-width: 1.6; }
.decision-label { color: #3e4a56; font-size: 11px; font-weight: 700; letter-spacing: .015em; }
.decision-value { margin-top: 3px; color: var(--teal); font-size: 19px; font-weight: 740; }

.work-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; min-height: 375px; }
.table-panel { border-right: 1px solid var(--line); overflow: hidden; }
.panel-title { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 720; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: #3e4954; background: #fbfcfc; font-weight: 650; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid #e8edef; vertical-align: top; }
tr.operation-row { cursor: pointer; }
tr.operation-row:hover, tr.operation-row.selected { background: #f1fafb; }
.amount { text-align: right; white-space: nowrap; font-weight: 650; }
.empty-state { min-height: 300px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px; }
.error-state { gap: 12px; border: 1px solid #e4a3a3; background: #fff7f7; color: #7f1d1d; }
.empty-state svg { width: 44px; height: 44px; color: #9ca7b0; stroke-width: 1.4; margin-bottom: 12px; }
.empty-state strong { display: block; color: #46535f; font-size: 14px; margin-bottom: 6px; }
.audit-drawer { padding-bottom: 14px; }
.classify-button { width: 100%; margin-top: 14px; }
.audit-list { list-style: none; margin: 0; padding: 7px 18px 10px 30px; }
.audit-list li { position: relative; display: grid; grid-template-columns: 108px minmax(0,1fr); gap: 8px; min-height: 40px; align-items: center; font-size: 12px; }
.audit-list li::before { content: ""; position: absolute; left: -14px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.audit-list li:not(:last-child)::after { content: ""; position: absolute; left: -11px; top: 23px; bottom: -9px; border-left: 1px solid #9ecbd0; }
.audit-list .label { color: #34414d; }
.audit-list .value { color: var(--muted); overflow-wrap: anywhere; }
.tag { display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 5px; font-size: 10px; font-weight: 750; letter-spacing: .01em; }
.tag.auto { color: #157544; background: var(--green-soft); }
.tag.match { color: #17617c; background: #eaf5fb; }
.tag.ai { color: var(--violet); background: #f1edf8; }
.tag.owner { color: var(--amber); background: var(--amber-soft); }

.content-page { max-width: 1180px; }
.content-page.wide { max-width: 1500px; }
.content-page h2 { margin: 0 0 6px; font-size: 22px; }
.content-page > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.section-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.section-row { display: grid; grid-template-columns: 180px minmax(0,1fr) 150px; gap: 18px; align-items: center; min-height: 58px; padding: 10px 15px; border-bottom: 1px solid var(--line); font-size: 13px; }
.section-row:last-child { border-bottom: 0; }
.section-row .muted { color: var(--muted); }
.muted { color: var(--muted); }
.system-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; color: #475561; }

.policy-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid #9bcbd0; border-left: 4px solid var(--teal); border-radius: 8px; background: #f5fbfb; font-size: 13px; }
.policy-banner strong { color: #075e6b; }
.policy-banner span { color: var(--muted); }
.policy-banner.slim { margin-top: 18px; }
.cash-first { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border-color: #8fc4cb; }
.cash-first > div { min-height: 74px; padding: 14px 18px; display: grid; align-content: center; gap: 5px; border-right: 1px solid var(--line); }
.cash-first > div:last-child { border-right: 0; }
.cash-first span { color: var(--muted); font-size: 12px; }
.cash-first strong { font-size: 20px; }
.cash-first .amber { color: var(--amber); }
.cash-first .teal { color: var(--teal); }
.operation-row td small { display: block; max-width: 340px; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.cash-state { display: inline-flex; padding: 3px 6px; border-radius: 5px; color: #075e6b; background: var(--teal-soft); font-size: 10px; font-weight: 700; }
.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-intro h2 { margin: 0 0 6px; }
.page-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.prohibited { padding: 7px 10px; border-radius: 6px; color: var(--red); background: var(--red-soft); font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.calendar-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 16px; }
.calendar-accounts { align-self: start; }
.account-toggle { min-height: 62px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.account-toggle:last-child { border-bottom: 0; }
.account-toggle span { min-width: 0; }
.account-toggle small { display: block; margin-top: 3px; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.account-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.account-toggle i { width: 38px; height: 22px; flex: 0 0 auto; border-radius: 12px; background: #b7c1c7; position: relative; transition: .16s ease; }
.account-toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: .16s ease; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.account-toggle input:checked + i { background: var(--teal); }
.account-toggle input:checked + i::after { left: 19px; }
.calendar-empty { height: 210px; text-align: center; color: var(--muted); }
.rule-editor { margin-bottom: 16px; }
.hidden { display: none !important; }
.rule-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; padding: 16px; }
.rule-form label { display: grid; gap: 6px; color: #3d4955; font-size: 12px; font-weight: 650; }
.rule-form input, .rule-form select { width: 100%; min-height: 38px; padding: 8px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--text); }
.rule-form input:focus, .rule-form select:focus { outline: 3px solid rgba(8,119,137,.15); border-color: #78b6be; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.rule-state { display: inline-flex; padding: 3px 6px; border-radius: 5px; background: #f0f3f5; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.button.ghost { min-height: 30px; padding: 5px 8px; background: transparent; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.integration-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: white; }
.integration-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.integration-head strong { font-size: 17px; }
.integration-card dl { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 8px 12px; margin: 13px 0 0; font-size: 12px; }
.integration-card dt { color: var(--muted); }
.integration-card dd { margin: 0; overflow-wrap: anywhere; }
.pad { padding: 14px; }
.empty-state.compact { min-height: 140px; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 74px minmax(0,1fr); }
  .brand strong, .nav-button span:last-child, .sidebar-note { display: none; }
  .brand { justify-content: center; padding: 0; }
  .nav-button { justify-content: center; padding: 11px; }
  .connection-row { grid-template-columns: minmax(210px,1fr) 170px 95px; }
  .connection-copy.action, .connection-row > .chevron { display: none; }
  .decision-band { grid-template-columns: repeat(3,1fr); }
  .decision-item:nth-child(3) { border-right: 0; }
  .decision-item:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .work-grid { grid-template-columns: 1fr; }
  .table-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .calendar-layout { grid-template-columns: 1fr; }
  .rule-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { height: 58px; justify-content: flex-start; padding: 0 16px; }
  .brand strong { display: inline; }
  .nav { grid-template-columns: repeat(4,1fr); padding: 8px; gap: 4px; overflow-x: auto; }
  .nav-button { min-width: 56px; padding: 9px 6px; }
  .topbar { padding: 13px 16px; }
  .topbar h1 { font-size: 23px; }
  .topbar p, .scheduler { display: none; }
  .page { padding: 14px 12px 20px; }
  .connection-row { grid-template-columns: 1fr; gap: 8px; padding: 14px; }
  .status-label { margin-left: 0; }
  .connection-copy.action { display: block; }
  .decision-band { grid-template-columns: repeat(2,1fr); }
  .decision-item:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .decision-item:nth-child(2n) { border-right: 0; }
  .decision-item:nth-last-child(-n+2) { border-bottom: 0; }
  .statusbar { align-items: flex-start; flex-direction: column; padding: 12px; }
  .cash-first { grid-template-columns: repeat(2,1fr); }
  .cash-first > div:nth-child(2) { border-right: 0; }
  .cash-first > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .calendar-layout, .integration-grid, .rule-form { grid-template-columns: 1fr; }
  .page-intro { flex-direction: column; }
}

/* Direction A — owner-rejected V2 full production recovery */
:root {
  --rail-deep:#0c2428;
  --rail-line:#203b40;
  --rail-copy:#bfd0d2;
  --rail-muted:#819a9e;
  --focus:rgba(20,174,174,.28);
  --surface-raised:#ffffff;
  --page-max:1680px;
}

body { font-size:14px; line-height:1.45; }
.app-shell { grid-template-columns:272px minmax(0,1fr); }
.sidebar { background:var(--rail-deep); border-right-color:var(--rail-line); color:#fff; box-shadow:12px 0 40px rgba(9,31,35,.08); }
.brand { min-height:76px; border-bottom-color:var(--rail-line); padding:0 20px; }
.brand-mark { border:0; border-radius:10px; color:#062f34; background:#5fe0d4; box-shadow:inset 0 0 0 1px rgba(255,255,255,.45); font-weight:900; }
.brand-copy { display:grid; gap:1px; }
.brand-copy strong { color:#fff; font-size:18px; }
.brand-copy small { color:var(--rail-muted); font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.sidebar .icon-button { color:#8ba4a7; }
.nav { gap:7px; padding:14px 12px 26px; }
.nav-group { border-bottom:1px solid rgba(255,255,255,.045); padding-bottom:6px; }
.nav-group-label { min-height:38px; display:flex; align-items:center; justify-content:space-between; padding:8px 10px; color:var(--rail-copy); font-size:11px; letter-spacing:.04em; text-transform:none; border-radius:9px; }
.nav-group-label:hover { color:#fff; background:rgba(255,255,255,.04); }
.nav-group-name { display:flex; align-items:center; gap:9px; }
.nav-group-icon { width:20px; height:20px; display:grid; place-items:center; color:#58d3ca; }
.nav-group-icon svg { width:18px; height:18px; stroke-width:1.7; }
.nav-chevron { color:#6f8b8e; }
.nav-button { min-height:40px; gap:11px; padding:9px 11px 9px 38px; color:#aebfc2; border-radius:9px; font-size:13px; font-weight:560; }
.nav-button:hover { color:#fff; background:rgba(255,255,255,.055); }
.nav-button.active { color:#fff; border-color:rgba(95,224,212,.28); background:linear-gradient(90deg,rgba(25,168,170,.25),rgba(25,168,170,.08)); box-shadow:inset 3px 0 #5fe0d4; }
.nav-icon { color:#79a4a8; }
.nav-button.active .nav-icon { color:#5fe0d4; }
.sidebar-note { color:#d1dfe0; border-top-color:var(--rail-line); }
.sidebar-note span { color:var(--rail-muted); }
.workspace { background:linear-gradient(180deg,#f8fbfb,#f2f7f8 620px); }
.topbar { min-height:76px; padding:12px 30px; border-bottom-color:#dfe8ea; background:rgba(255,255,255,.95); }
.topbar h1 { font-size:24px; color:#122d32; }
.topbar p { max-width:720px; color:#687b80; }
.page { width:100%; max-width:var(--page-max); margin:0 auto; padding:26px 30px 38px; }
.statusbar { background:#fff; }
.button { min-height:40px; border-radius:9px; transition:transform .12s ease,border-color .12s ease,background .12s ease; }
.button:active:not(:disabled) { transform:translateY(1px); }
.button.primary { color:#fff; border-color:#087789; background:#087789; }
.button.primary:hover:not(:disabled) { color:#fff; background:#065f6d; }
.panel,.kpi-card,.connection-card,.account-registry-card,.settings-tile,.workspace-card { border-color:#dce7e9; border-radius:14px; box-shadow:0 8px 26px rgba(24,57,62,.045); }
.hero { min-height:208px; border:0; border-radius:20px; color:#fff; background:linear-gradient(118deg,#102f34 0%,#0a5963 58%,#0b7f88 100%); box-shadow:0 18px 54px rgba(11,72,78,.18); }
.hero::after { border-color:rgba(95,224,212,.12); }
.hero .eyebrow { color:#83ede3; }
.hero p { color:#cfe4e6; font-size:15px; line-height:1.6; }
.hero .button:not(.primary) { color:#0b4f58; border-color:#fff; background:#fff; }
.hero .button.primary { border-color:#5fe0d4; background:#5fe0d4; color:#07363b; }
.owner-action-strip button { min-height:98px; border-radius:13px; text-align:left; }
.kpi-card { min-height:132px; padding:20px; }
.kpi-card > span { font-size:13px; font-weight:650; }
.kpi-card strong { color:#17353a; }
.connection-card header { min-height:54px; }
.provider-identity { min-width:0; display:inline-flex; align-items:center; gap:10px; color:#20363a; font-weight:760; }
.provider-identity.compact { gap:7px; font-size:12px; }
.provider-mark { flex:0 0 auto; min-width:36px; height:32px; display:grid; place-items:center; padding:0 6px; border-radius:9px; color:#fff; background:#718087; font-size:12px; font-weight:900; letter-spacing:-.04em; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); }
.compact .provider-mark { min-width:30px; height:27px; border-radius:7px; font-size:10px; }
.provider-tbank .provider-mark { color:#111; background:#ffdd2d; font-size:18px; }
.provider-sber .provider-mark { color:#fff; background:linear-gradient(135deg,#22a257,#17a7a0); font-size:18px; }
.provider-wb .provider-mark { min-width:44px; background:linear-gradient(135deg,#cb11ab,#8d0bad); }
.provider-ozon .provider-mark { min-width:52px; background:#005bff; letter-spacing:-.08em; }
.provider-yandex .provider-mark { color:#111; background:linear-gradient(90deg,#ffcc00 0 68%,#f33 68%); font-size:18px; }
.provider-cash .provider-mark { color:#075e45; background:#d9f2e8; font-size:17px; }
.provider-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-identity-line,.account-card-identity { min-width:0; display:flex; align-items:center; gap:11px; }
.account-identity-line > span:last-child,.account-card-identity > div { min-width:0; display:grid; gap:3px; }
.account-registry-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.marketplace-identity-bar { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:18px; }
.marketplace-identity-choice { min-height:72px; display:flex; align-items:center; gap:10px; padding:12px 14px; border:1px solid #dce7e9; border-radius:13px; color:#334d51; background:#fff; cursor:pointer; text-align:left; box-shadow:0 7px 20px rgba(24,57,62,.035); }
.marketplace-identity-choice > svg { width:26px; height:26px; color:#087789; }
.marketplace-identity-choice small { margin-left:auto; color:#849397; }
.marketplace-identity-choice.active { border-color:#8ec9cd; background:#eefafa; box-shadow:inset 0 0 0 1px #bfe4e6; }
.marketplace-context-strip { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin-bottom:14px; padding:10px 12px; border:1px solid #d9e7e9; border-radius:12px; background:#fff; }
.marketplace-context-strip > span:first-child,.marketplace-context-strip small { color:#778a8e; }
.marketplace-context-strip small { margin-left:auto; }
.mobile-bottom-nav { display:none; }

@media (max-width:1180px) and (min-width:721px) {
  .app-shell { grid-template-columns:228px minmax(0,1fr); }
  .brand-copy,.nav-group-name { display:flex; }
  .brand-copy { flex-direction:column; }
  .nav-group-label { padding:8px 9px; }
  .nav-button { justify-content:flex-start; padding-left:36px; }
  .nav-button span:last-child,.sidebar-note { display:block; }
  .sidebar-note { padding:14px; }
}

@media (max-width:720px) {
  html,body { overflow-x:hidden; }
  body { padding-bottom:calc(70px + env(safe-area-inset-bottom)); font-size:15px; }
  .app-shell { display:block; }
  .workspace { min-height:calc(100vh - 70px); }
  .sidebar { position:fixed; inset:0; z-index:110; width:100%; height:100dvh; display:none; padding-bottom:env(safe-area-inset-bottom); background:var(--rail-deep); overflow:hidden; }
  .sidebar-open .sidebar { display:flex; inset:0; width:100%; height:100dvh; padding:0; }
  .sidebar-open { overflow:hidden; }
  .brand { display:flex; flex:0 0 70px; padding:0 18px; }
  .brand-copy { display:grid; }
  .sidebar .icon-button { width:44px; height:44px; display:grid; place-items:center; color:#fff; font-size:25px; }
  .nav { height:auto; flex:1 1 auto; display:block; padding:12px 12px 32px; overflow-y:auto; overscroll-behavior:contain; }
  .nav-group { display:block; margin-bottom:7px; padding-bottom:7px; }
  .nav-group-label { display:flex; min-height:48px; color:#d2e1e2; font-size:14px; }
  .nav-group-name { display:flex; }
  .nav-group-icon { width:24px; height:24px; }
  .nav-group-icon svg { width:21px; height:21px; }
  .nav-button,.sidebar-open .nav-button { width:100%; min-height:48px; display:flex; justify-content:flex-start; gap:12px; padding:11px 12px 11px 44px; color:#b7c9cb; font-size:15px; }
  .nav-button span:last-child { width:auto; display:block; text-align:left; line-height:1.35; }
  .sidebar-note { display:block; flex:0 0 auto; padding:14px 20px; }
  .topbar { min-height:68px; padding:8px 12px; }
  .top-title { min-width:0; width:auto; flex:1 1 auto; gap:9px; }
  .mobile-menu { display:inline-flex; flex:0 0 44px; width:44px; height:44px; padding:0; font-size:20px; }
  .top-title > div { min-width:0; }
  .topbar h1 { font-size:20px; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .topbar p { display:none; }
  .top-actions { display:none; }
  .page { padding:16px 12px 26px; }
  .statusbar { display:none; }
  .mobile-bottom-nav { position:fixed; left:0; right:0; bottom:0; z-index:90; height:calc(68px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(6,1fr); padding:5px 4px env(safe-area-inset-bottom); border-top:1px solid #d8e5e6; background:rgba(255,255,255,.98); box-shadow:0 -10px 30px rgba(21,55,60,.1); backdrop-filter:blur(16px); }
  .mobile-bottom-nav button { min-width:0; min-height:56px; display:grid; place-items:center; align-content:center; gap:3px; padding:3px 1px; border:0; border-radius:9px; color:#6f7f83; background:transparent; font-size:10px; line-height:1.05; cursor:pointer; }
  .mobile-bottom-nav button.active { color:#087789; background:#eaf7f7; }
  .mobile-bottom-nav svg { width:21px; height:21px; stroke-width:1.8; }
  .hero { min-height:0; align-items:flex-start; padding:22px 18px; border-radius:17px; }
  .hero h2 { font-size:28px; line-height:1.05; }
  .hero p { font-size:14px; }
  .hero-actions { display:grid; grid-template-columns:1fr; width:100%; }
  .hero-actions .button { width:100%; }
  .owner-action-strip { margin-inline:-12px; padding-inline:12px; }
  .owner-action-strip button { flex-basis:176px; min-height:92px; }
  .kpi-grid,.forecast-strip,.decision-strip { grid-template-columns:1fr; }
  .kpi-card { min-height:110px; padding:17px; }
  .kpi-card > span,.kpi-card small { font-size:13px; }
  .kpi-card strong { font-size:24px; }
  .connection-grid,.account-registry-grid,.settings-grid,.workspace-grid,.stage-grid,.agent-grid { grid-template-columns:1fr; }
  .connection-card,.account-registry-card,.settings-tile,.workspace-card { border-radius:14px; }
  .connection-card dl,.account-registry-card dl { grid-template-columns:1fr; }
  .connection-card dd,.account-registry-card dd { margin:0 0 6px; text-align:left; }
  .marketplace-identity-bar { display:flex; margin-inline:-12px; padding:0 12px 6px; overflow-x:auto; scroll-snap-type:x mandatory; }
  .marketplace-identity-choice { flex:0 0 190px; scroll-snap-align:start; }
  .marketplace-context-strip small { width:100%; margin-left:0; }
  .table-wrap.mobile-cards { overflow:visible; }
  .mobile-cards table thead { display:none; }
  .mobile-cards table,.mobile-cards tbody { display:block; width:100%; }
  .mobile-cards tr { display:block; margin:10px; padding:12px 14px; border:1px solid #dce7e9; border-radius:13px; background:#fff; box-shadow:0 5px 18px rgba(24,57,62,.04); }
  .mobile-cards td { display:grid; grid-template-columns:minmax(105px,36%) minmax(0,1fr); gap:10px; width:100%; padding:8px 0; border:0; text-align:left; white-space:normal; overflow-wrap:anywhere; }
  .mobile-cards td::before { content:attr(data-label); color:#73868a; font-size:12px; font-weight:700; text-align:left; }
  .mobile-cards .amount { text-align:left; }
  .provider-identity.compact { font-size:13px; }
  .provider-name { white-space:normal; }
  .calendar-layout { display:block; }
  .calendar-accounts { margin-bottom:14px; }
  .calendar-board,.calendar-board.long-view { display:flex; max-width:calc(100vw - 24px); gap:10px; overflow-x:auto; scroll-snap-type:x mandatory; }
  .calendar-day { flex:0 0 calc(100vw - 48px); min-width:0; min-height:260px; scroll-snap-align:center; }
  .calendar-toolbar { display:grid; grid-template-columns:44px 1fr 44px; gap:8px; overflow:visible; }
  .calendar-toolbar > .button:nth-child(2) { grid-column:2; grid-row:1; }
  .calendar-toolbar > .button:nth-child(4) { grid-column:3; grid-row:1; }
  .period-title { grid-column:1/-1; grid-row:2; width:100%; min-width:0; padding:4px 0; text-align:center; }
  .calendar-toolbar .segmented { min-width:0; width:100%; }
  .calendar-toolbar .segmented:nth-of-type(n+5) { grid-column:auto; }
  .calendar-toolbar .prohibited,.calendar-toolbar .range-form { grid-column:1/-1; }
  .filter-bar { padding:10px; }
  .filter-bar input { flex:0 0 auto; min-height:44px; }
  .filter-bar input { flex:0 0 auto; min-height:44px; }
  .filter-bar input,.filter-bar select,.form-grid input,.form-grid select,.form-grid textarea { min-height:44px; font-size:16px; }
  .filter-bar input,.filter-bar select { flex:0 0 auto; width:100%; }
  .button,.segmented,button,input,select,textarea { min-height:44px; }
  .help { width:44px; min-width:44px; height:44px; min-height:44px; margin:-10px 0 -10px 4px; }
  .modal-backdrop { align-items:end; padding:0; }
  .modal,.wide-modal { width:100%; max-height:calc(100dvh - 8px); padding:20px 16px max(30px,env(safe-area-inset-bottom)); border-radius:20px 20px 0 0; }
  .assistant-dock { right:12px; bottom:82px; }
  .assistant-panel { max-height:calc(100dvh - 150px); overflow:auto; }
}

/* Original Owner requirements recovery — Direction A is a working product, not a shell. */
.owner-dashboard{display:grid;gap:18px;max-width:1500px;margin:0 auto}.owner-command{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:28px 30px;border:1px solid #cfe1e3;border-radius:22px;background:linear-gradient(135deg,#fff 0%,#f3fbfb 68%,#dff5f3 100%);box-shadow:0 14px 40px rgba(22,59,64,.07)}.owner-command h2{margin:5px 0 8px;font-size:clamp(30px,3.1vw,46px);letter-spacing:-.04em;line-height:1}.owner-command p{max-width:760px;margin:0;color:#5f7478;font-size:15px}.owner-command-actions{display:flex;gap:10px;flex:0 0 auto}.owner-command-actions b{display:inline-grid;min-width:24px;height:24px;margin-left:8px;place-items:center;border-radius:999px;background:rgba(255,255,255,.25)}
.owner-metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.owner-metric{display:flex;position:relative;flex-direction:column;min-width:0;min-height:184px;padding:20px;border:1px solid #d9e6e8;border-radius:18px;background:#fff;box-shadow:0 7px 22px rgba(29,59,64,.045)}.owner-metric.warning{border-color:#efc57c;background:#fffaf1}.owner-metric.danger{border-color:#efaaaa;background:#fff6f6}.owner-metric.ok{border-color:#a9dccc;background:#f7fffb}.owner-metric-label{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#667b7f;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.035em}.owner-metric-label .help{width:28px;min-width:28px;height:28px;min-height:28px;margin:0}.owner-metric>strong{display:block;margin-top:18px;color:#102e33;font-size:clamp(24px,2.3vw,35px);line-height:1.04;letter-spacing:-.035em;overflow-wrap:anywhere}.owner-metric p{min-height:34px;margin:10px 0 0;color:#687d81;font-size:13px;line-height:1.35}.owner-metric-footer{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:auto;padding-top:14px}.owner-metric-footer small{min-width:0;color:#7b8e91;font-size:11px;line-height:1.35;overflow-wrap:anywhere}.metric-link,.text-button{margin-top:13px;padding:0;border:0;color:#087789;background:none;font:inherit;font-size:12px;font-weight:800;cursor:pointer}.metric-link{flex:0 0 auto;margin:0;white-space:nowrap}.text-button{margin:0}
.owner-work-grid{display:grid;grid-template-columns:minmax(360px,.86fr) minmax(520px,1.14fr);gap:14px}.owner-panel{min-width:0;padding:22px;border:1px solid #d8e5e7;border-radius:18px;background:#fff;box-shadow:0 8px 24px rgba(22,55,60,.045)}.owner-panel>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px}.owner-panel h3{margin:3px 0 0;color:#123238;font-size:20px}.section-kicker{color:#087789;font-size:10px;font-weight:900;letter-spacing:.09em}.owner-actions{display:grid;gap:9px}.owner-action-row{width:100%;display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:67px;padding:12px 13px;border:1px solid #dce7e8;border-radius:13px;background:#fff;color:#18373c;text-align:left;cursor:pointer}.owner-action-row:hover{border-color:#8bc9cc;background:#f5fbfb}.owner-action-row.warn{border-color:#f1d298;background:#fffbf3}.owner-action-row.danger{border-color:#efb3b3;background:#fff8f8}.owner-action-row .action-dot{width:8px;height:8px;border-radius:50%;background:#3ab8b6}.owner-action-row.warn .action-dot{background:#d88b16}.owner-action-row.danger .action-dot{background:#d45454}.owner-action-row span:nth-child(2){display:grid;gap:3px}.owner-action-row small{color:#6d8185;font-size:12px;line-height:1.35}.owner-action-row b{color:#087789;font-size:12px;white-space:nowrap}.all-clear{display:grid;gap:6px;padding:24px;border:1px dashed #b8d7d2;border-radius:13px;background:#f6fffb}.all-clear span{color:#667b7f;font-size:13px}
.cash-legend{display:flex;gap:16px;margin-bottom:12px;color:#728589;font-size:11px}.cash-legend i{display:inline-block;width:9px;height:9px;margin-right:5px;border-radius:50%}.cash-legend .in{background:#35b78a}.cash-legend .out{background:#de6f6f}.cash-timeline{display:grid;gap:10px}.cash-day{display:grid;grid-template-columns:48px minmax(120px,1fr) minmax(110px,auto);align-items:center;gap:12px}.cash-day>span{color:#718387;font-size:12px}.cash-day>strong{text-align:right;font-size:13px}.cash-bars{display:grid;gap:4px}.cash-bars progress{display:block;width:100%;height:5px;border:0;border-radius:999px;background:#edf2f3;appearance:none}.cash-bars progress::-webkit-progress-bar{border-radius:999px;background:#edf2f3}.cash-bars progress::-webkit-progress-value{border-radius:999px}.cash-bars progress.in::-webkit-progress-value{background:#35b78a}.cash-bars progress.out::-webkit-progress-value{background:#de6f6f}.cash-bars progress.in::-moz-progress-bar{background:#35b78a}.cash-bars progress.out::-moz-progress-bar{background:#de6f6f}.cash-trajectory footer{margin-top:16px;padding-top:14px;border-top:1px solid #e4ecee;color:#5e7377;font-size:12px;font-weight:700}
.marketplace-pulse-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.marketplace-pulse-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px;min-height:112px;padding:17px;border:1px solid #dce7e9;border-radius:15px;background:#fff;color:#16363b;text-align:left;cursor:pointer}.marketplace-pulse-card:hover{border-color:#86c9cc;transform:translateY(-1px)}.marketplace-pulse-card>div{display:grid;gap:4px}.marketplace-pulse-card>div>strong{font-size:18px}.marketplace-pulse-card>div>span{color:#6d8185;font-size:12px}.marketplace-pulse-card>.status-pill{grid-column:1/-1;justify-self:start}.recent-decisions>.split-panel{border:0;box-shadow:none}.recent-decisions .table-panel{border:0}.recent-decisions .audit-drawer{display:none}.recent-decisions .panel-title{display:none}.recent-decisions .operation-row{cursor:pointer}
.calendar-mobile-agenda{display:none}
.finance-health-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.module-map{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.module-card{display:grid;grid-template-columns:42px minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:center;gap:5px 13px;min-height:112px;padding:17px;border:1px solid #d9e6e8;border-radius:15px;background:#fff;color:#17373c;text-align:left;cursor:pointer}.module-card:hover{border-color:#82c6ca;background:#f8fdfd}.module-card-icon{grid-row:1/3;display:grid;width:42px;height:42px;place-items:center;border-radius:12px;color:#087789;background:#eaf7f7}.module-card-icon svg{width:23px;height:23px}.module-card>span:nth-child(2){display:grid;gap:4px;min-width:0}.module-card>span:nth-child(2)>strong{font-size:15px}.module-card>span:nth-child(2)>small{color:#6d8084;font-size:12px;line-height:1.35}.module-card>b{align-self:start;color:#24464b;font-size:12px;text-align:right}.module-card>.status-pill{grid-column:3;justify-self:end}

@media(max-width:1180px){.owner-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.owner-work-grid{grid-template-columns:1fr}.marketplace-pulse-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.module-map{grid-template-columns:1fr}}
@media(max-width:720px){.owner-dashboard{gap:12px}.owner-command{display:grid;gap:19px;padding:20px 18px;border-radius:17px}.owner-command h2{font-size:30px}.owner-command p{font-size:14px;line-height:1.5}.owner-command-actions{display:grid;grid-template-columns:1fr}.owner-command-actions .button{width:100%}.owner-metric-grid,.finance-health-strip{grid-template-columns:1fr}.owner-metric{min-height:154px;padding:18px}.owner-metric>strong{font-size:26px}.owner-metric p{min-height:0}.owner-metric-footer{align-items:flex-start;flex-direction:column;gap:10px}.owner-work-grid{display:grid;grid-template-columns:1fr}.owner-panel{padding:17px 14px;border-radius:15px}.owner-panel>header{align-items:center}.owner-panel h3{font-size:19px}.owner-action-row{grid-template-columns:9px minmax(0,1fr);min-height:76px;padding:12px}.owner-action-row b{grid-column:2;margin-top:2px}.cash-day{grid-template-columns:38px minmax(80px,1fr) minmax(96px,auto);gap:8px}.marketplace-pulse-grid{grid-template-columns:1fr}.marketplace-pulse-card{min-height:104px}.recent-decisions{padding-inline:8px}.recent-decisions>header{padding-inline:6px}.recent-decisions .split-panel .table-panel tr{margin:8px 0}.recent-decisions .table-wrap{overflow:visible}.owner-dashboard .help{width:32px;min-width:32px;height:32px;min-height:32px;margin:0}.owner-dashboard .provider-name{display:inline}.module-map{grid-template-columns:1fr}.module-card{grid-template-columns:40px minmax(0,1fr);min-height:118px}.module-card>b,.module-card>.status-pill{grid-column:2;justify-self:start;text-align:left}.calendar-mobile-agenda{display:grid;gap:10px}.calendar-mobile-agenda>.panel-title{padding:4px 2px}.agenda-day{overflow:hidden;border:1px solid #d9e6e8;border-radius:14px;background:#fff}.agenda-day.gap{border-color:#e7a8a8;background:#fff8f8}.agenda-day>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 13px;border-bottom:1px solid #e4ecee}.agenda-day>header div{display:grid;gap:2px}.agenda-day>header small{color:#728589;font-size:12px}.agenda-day>header span{color:#50666a;font-size:12px;font-weight:750;text-align:right}.agenda-day>div{display:grid}.agenda-event{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:62px;padding:11px 13px;border:0;border-bottom:1px solid #edf2f3;background:#fff;color:#17363b;text-align:left}.agenda-event:last-child{border-bottom:0}.agenda-event span{display:grid;gap:3px;min-width:0}.agenda-event span b{color:#73868a;font-size:10px;text-transform:uppercase}.agenda-event span{font-size:13px;overflow-wrap:anywhere}.agenda-event>strong{font-size:14px;white-space:nowrap}.agenda-event.income>strong{color:#168563}.agenda-event.expense>strong{color:#ba4b4b}.calendar-mobile-agenda+.calendar-layout .calendar-board{display:none}}

.nav-group > summary .nav-group-name,
.nav-group > summary .nav-group-icon { transform:none !important; }
.nav-group:not([open]) > summary .nav-chevron { transform:rotate(-90deg); }
.nav-group[open] > summary .nav-chevron { transform:rotate(0); }

.calendar-view-switch { display:flex; align-items:center; gap:0; }
.connection-card header .provider-identity { flex:1 1 auto; }
.connection-card header .provider-name { overflow:visible; text-overflow:clip; }
.connection-card header .status-pill { flex:0 1 auto; max-width:160px; white-space:normal; }

@media (max-width:720px) {
  .help { width:44px; min-width:44px; height:44px; min-height:44px; margin:-10px 0 -10px 4px; }
  .calendar-view-switch { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .calendar-view-switch [data-calendar-view="2years"] { grid-column:1 / -1; }
  .calendar-view-switch .segmented { width:100%; border-radius:9px; font-size:12px; padding:6px 5px; }
  .connection-card header { align-items:flex-start; flex-wrap:wrap; }
  .connection-card header .provider-identity { min-width:150px; }
  .connection-card header .status-pill { max-width:100%; margin-left:0; }
}

/* Owner Operating System V2 */
.nav-group { border: 0; }
.nav-group > summary { display:flex; align-items:center; justify-content:space-between; list-style:none; cursor:pointer; user-select:none; }
.nav-group > summary::-webkit-details-marker { display:none; }
.nav-group > summary span { transition:transform .16s ease; }
.nav-group:not([open]) > summary span { transform:rotate(-90deg); }
.operation-source-summary { display:grid; gap:5px; padding:16px 18px; border-bottom:1px solid var(--line); }
.operation-source-summary .amount { font-size:24px; letter-spacing:-.03em; }
.operation-source-summary span { font-weight:700; }.operation-source-summary small { color:var(--muted); line-height:1.45; }
.owner-workspace { margin:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fbfdfd; }
.owner-workspace > summary { display:grid; grid-template-columns:1fr auto; gap:8px; padding:12px; cursor:pointer; }
.owner-workspace > summary span { color:var(--muted); font-size:10px; text-align:right; }
.owner-workspace form { display:grid; gap:12px; padding:0 12px 14px; }
.owner-workspace label,.inline-form label,.mapping-form label { display:grid; gap:5px; color:#3d4955; font-size:11px; font-weight:700; }
.owner-workspace input,.owner-workspace select,.owner-workspace textarea,.inline-form input,.mapping-form input,.mapping-form select,.mapping-form textarea { min-width:0; width:100%; min-height:40px; padding:8px 9px; border:1px solid var(--line-strong); border-radius:8px; background:#fff; color:var(--text); }
.allocation-line { position:relative; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; padding:12px; margin:0 0 9px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.allocation-line legend { padding:0 5px; color:var(--teal); font-size:11px; font-weight:800; }.allocation-line > .icon-button { position:absolute; right:7px; top:-25px; }
.inline-actions { display:flex; gap:8px; flex-wrap:wrap; }.allocation-check { padding:9px 11px; border-radius:8px; color:var(--amber); background:var(--amber-soft); font-size:12px; font-weight:750; }.allocation-check.ok { color:#0b7340; background:var(--green-soft); }.allocation-check.error { color:var(--red); background:var(--red-soft); }
.source-fact-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }.source-fact-strip span { padding:8px; border-radius:7px; color:var(--muted); background:var(--teal-soft); font-size:10px; }.source-fact-strip strong { display:block; margin-top:3px; color:var(--text); }
.recognition-line { display:grid; grid-template-columns:1fr 1fr auto; gap:8px; align-items:end; margin-bottom:8px; }.inline-loader { padding:18px; color:var(--muted); font-size:11px; }
.account-registry-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }.account-registry-card { padding:16px; border:1px solid var(--line); border-radius:13px; background:#fff; box-shadow:var(--shadow); }.account-registry-card.needs-mapping { border-color:#e8c178; background:#fffdf8; }.account-registry-card header { display:flex; justify-content:space-between; gap:12px; padding-bottom:12px; border-bottom:1px solid var(--line); }.account-registry-card header strong,.account-registry-card header small { display:block; }.account-registry-card header small { margin-top:4px; color:var(--muted); }.account-registry-card dl { display:grid; grid-template-columns:1fr 1fr; gap:7px 10px; font-size:11px; }.account-registry-card dt { color:var(--muted); }.account-registry-card dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.account-registry-card > summary { list-style:none; cursor:pointer; }
.account-registry-card > summary::-webkit-details-marker { display:none; }
.account-card-summary-status { display:grid; justify-items:end; gap:5px; min-width:120px; }
.account-card-summary-status small { color:var(--muted); font-size:11px; text-align:right; }
.account-card-details { padding-top:12px; margin-top:12px; border-top:1px solid var(--line); }
.account-registry-card:not([open]) { align-self:start; }
.inline-form,.mapping-form { display:grid; gap:8px; padding-top:12px; margin-top:12px; border-top:1px solid var(--line); }.mapping-form textarea { min-height:70px; resize:vertical; }
.agent-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }.agent-card { display:grid; gap:10px; min-height:210px; padding:18px; border:1px solid var(--line); border-radius:14px; background:#fff; text-align:left; cursor:pointer; }.agent-card:hover { border-color:#8fc7cd; box-shadow:0 12px 26px rgba(8,119,137,.09); }.agent-card p { margin:0; color:var(--muted); line-height:1.5; }.agent-card > span:last-child { margin-top:auto; color:var(--teal); font-weight:750; }.agent-avatar { width:42px; height:42px; display:grid; place-items:center; border-radius:12px; color:#fff; background:linear-gradient(135deg,var(--teal),var(--turquoise)); font-weight:900; }.agent-hero { display:flex; align-items:center; gap:16px; padding:20px; margin-bottom:16px; border:1px solid #c8e1e3; border-radius:14px; background:linear-gradient(120deg,#fff,#eaf8f8); }.agent-hero h2,.agent-hero p { margin:0 0 5px; }
.garage-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:180px; padding:28px; margin-bottom:18px; border-radius:16px; color:#fff; background:linear-gradient(120deg,#102d31,#087789 70%,#19a8aa); }.garage-hero h2 { margin:4px 0 8px; font-size:36px; }.garage-hero p { margin:0; color:#d4edef; }.garage-hero .eyebrow { color:#7de5dc; }.stage-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-bottom:16px; }.stage-card { display:grid; gap:8px; min-height:130px; padding:15px; border:1px solid var(--line); border-radius:11px; background:#fff; text-align:left; }.stage-card span { color:var(--muted); }.stage-card small { margin-top:auto; color:var(--teal); }.capability-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; }.capability-grid > div { display:grid; gap:7px; padding:12px; border:1px solid var(--line); border-radius:9px; }.capability-grid small { color:var(--muted); }
.back-link { min-height:38px; margin-bottom:14px; border:0; color:var(--teal); background:transparent; cursor:pointer; font-weight:750; }
.workspace-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; margin:16px 0; }
.workspace-card { min-width:0; padding:16px; border:1px solid var(--line); border-radius:13px; background:#fff; box-shadow:var(--shadow); }
.workspace-card header { display:flex; justify-content:space-between; gap:12px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.workspace-card header strong,.workspace-card header small { display:block; }.workspace-card header small { margin-top:4px; color:var(--muted); }
.workspace-card dl { display:grid; grid-template-columns:minmax(100px,.8fr) minmax(0,1.2fr); gap:7px 10px; font-size:11px; }
.workspace-card dt { color:var(--muted); }.workspace-card dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.workspace-actions { display:flex; gap:8px; flex-wrap:wrap; padding-top:12px; margin-top:12px; border-top:1px solid var(--line); }
.workspace-actions select { flex:1 1 150px; min-width:0; padding:7px 9px; border:1px solid var(--line-strong); border-radius:8px; background:#fff; }
.workspace-form { margin-top:16px; }.workspace-form .span-2 { grid-column:1/-1; }.workspace-form .form-actions { display:flex; align-items:center; gap:10px; margin-top:13px; }
.workspace-editor { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
.workspace-editor>summary { cursor:pointer; color:var(--ink-soft); font-size:12px; font-weight:750; }
.workspace-editor form { margin-top:12px; }
.owner-action-strip { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; margin:-2px 0 18px; }
.owner-action-strip button { display:grid; gap:5px; min-height:86px; padding:13px 14px; border:1px solid var(--line); border-radius:11px; color:var(--text); background:#fff; text-align:left; cursor:pointer; }
.owner-action-strip button:hover { border-color:#8fc7cd; background:var(--teal-soft); }.owner-action-strip strong { color:var(--teal); font-size:20px; }.owner-action-strip span { color:var(--muted); font-size:11px; line-height:1.35; }

@media (max-width: 1180px) {
  .account-registry-grid,.agent-grid,.workspace-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stage-grid,.capability-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .owner-action-strip { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .account-registry-grid,.agent-grid,.stage-grid,.capability-grid,.workspace-grid { grid-template-columns:1fr; }
  .allocation-line,.source-fact-strip,.recognition-line { grid-template-columns:1fr; }
  .owner-workspace { margin:10px 0; }.owner-workspace > summary { grid-template-columns:1fr; }.owner-workspace > summary span { text-align:left; }
  .audit-drawer { padding:0 10px 14px; }.garage-hero { align-items:flex-start; flex-direction:column; padding:22px 18px; }.garage-hero h2 { font-size:30px; }
  .account-registry-card dl { grid-template-columns:1fr; }.account-registry-card dd { text-align:left; margin-bottom:5px; }
  .workspace-card dl { grid-template-columns:1fr; }.workspace-card dd { text-align:left; margin-bottom:5px; }.workspace-actions { align-items:stretch; flex-direction:column; }.workspace-form .span-2 { grid-column:auto; }
  .owner-action-strip { display:flex; overflow-x:auto; scroll-snap-type:x proximity; }.owner-action-strip button { flex:0 0 190px; scroll-snap-align:start; }
}

/* Operational workspace V1 */
.help { display:inline-grid; place-items:center; width:18px; height:18px; margin-left:5px; border:1px solid #a8c4c8; border-radius:50%; color:var(--teal); background:#fff; font-size:11px; font-weight:850; cursor:help; vertical-align:middle; }
.help:hover,.help:focus { border-color:var(--teal); background:var(--teal-soft); }
.button.income-button { color:#0a7040; border-color:#9bcbae; background:var(--green-soft); }
.range-form { display:flex; align-items:end; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:white; }
.range-form label { display:grid; gap:4px; color:var(--muted); font-size:10px; }
.range-form input { min-height:32px; padding:5px 7px; border:1px solid var(--line-strong); border-radius:6px; }
.account-card { border-bottom:1px solid var(--line); background:white; }
.account-card:last-child { border-bottom:0; }
.account-balance-fields { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding:0 12px 12px; }
.account-balance-fields label { display:grid; gap:4px; color:var(--muted); font-size:9px; }
.account-balance-fields input { min-width:0; width:100%; padding:6px 7px; border:1px solid var(--line); border-radius:6px; }
.forecast-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.forecast-strip > div { padding:11px 12px; border:1px solid var(--line); border-radius:9px; background:white; }
.forecast-strip span { display:block; margin-bottom:5px; color:var(--muted); font-size:10px; }
.forecast-strip strong { font-size:16px; }
.calendar-board.long-view { grid-template-columns:repeat(12,minmax(170px,1fr)); }
.calendar-day.gap { border-color:#e6a0a0; background:linear-gradient(#fff,#fff8f8); box-shadow:inset 0 3px 0 #d65858; }
.day-balance { display:grid; grid-template-columns:1fr auto; gap:3px 8px; padding:7px 0; margin-bottom:8px; border-bottom:1px dashed var(--line); color:var(--muted); font-size:9px; }
.day-balance strong { color:var(--text); font-size:10px; text-align:right; }
.day-balance .negative { color:var(--red); }
.calendar-event.matched { opacity:.72; border-color:var(--teal); background:#edf8f8; }
.calendar-event.transfer,.calendar-day-flow.transfer{border-color:#82989e;background:#f2f6f7;color:#52676d}
.calendar-event em { font-style:normal; font-weight:700; }
.modal-backdrop { position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:22px; background:rgba(10,27,31,.54); backdrop-filter:blur(3px); }
.modal { width:min(620px,100%); max-height:min(88vh,900px); overflow:auto; padding:22px; border:1px solid #bfd7d9; border-radius:15px; background:white; box-shadow:0 28px 80px rgba(12,38,43,.3); position:relative; }
.wide-modal { width:min(980px,100%); }
.modal h2 { margin:0 38px 6px 0; }
.modal > p { margin:0 0 18px; color:var(--muted); }
.modal-close { position:absolute; top:12px; right:12px; width:44px; height:44px; border:0; border-radius:50%; color:var(--muted); background:#eef3f4; cursor:pointer; font-size:20px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.form-grid label { display:grid; gap:6px; color:#384652; font-size:12px; font-weight:700; }
.form-grid input,.form-grid select,.form-grid textarea { width:100%; min-height:40px; padding:8px 10px; border:1px solid var(--line-strong); border-radius:8px; background:white; color:var(--text); }
.form-grid textarea { min-height:84px; resize:vertical; }
.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus { outline:3px solid rgba(8,119,137,.15); border-color:#78b6be; }
.wide-field { grid-column:1/-1; }
.check,.radio { display:flex !important; align-items:center; gap:8px; }
.check input,.radio input { width:auto; min-height:auto; }
.diagnostic { padding:12px 13px; margin-top:12px; border:1px solid #edd49e; border-radius:9px; color:#6f4d17; background:#fff9ed; font-size:12px; line-height:1.5; }
.diagnostic strong { display:block; margin-bottom:4px; }
.report-row { display:grid; grid-template-columns:minmax(190px,1.5fr) repeat(4,minmax(90px,.7fr)) auto; align-items:center; gap:10px; padding:13px 15px; border-bottom:1px solid var(--line); }
.report-row:last-child { border-bottom:0; }
.report-row small { display:block; margin-top:3px; color:var(--muted); }
.report-stats { display:contents; }
.run-cards { display:grid; gap:10px; }
.run-card { display:grid; grid-template-columns:minmax(180px,1.2fr) minmax(220px,1fr) auto; gap:14px; align-items:center; padding:14px 16px; border:1px solid var(--line); border-radius:10px; background:white; }
.run-card small { display:block; margin-top:4px; color:var(--muted); }
.settings-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.settings-tile { min-height:150px; display:grid; align-content:center; justify-items:start; gap:10px; padding:20px; border:1px solid var(--line); border-radius:12px; background:white; color:var(--ink); text-align:left; cursor:pointer; }
.settings-tile strong { font-size:16px; line-height:1.3; }
.settings-tile span { color:var(--brand-strong); font-size:12px; font-weight:750; }
.settings-tile h3 { margin:8px 0 5px; }
.settings-tile p { margin:0 0 13px; color:var(--muted); font-size:12px; line-height:1.5; }
.toast { position:fixed; right:22px; bottom:22px; z-index:150; width:min(390px,calc(100vw - 28px)); padding:13px 15px; border-radius:10px; color:#0c5a37; background:#e7f7ed; box-shadow:0 15px 38px rgba(20,45,49,.2); }
.toast.error { color:#812a2a; background:#fff0f0; }
.alert.info { color:#185f6c; background:#edf8f8; }
.safety-note { margin-top:14px; padding:12px 14px; border:1px solid #bad8dc; border-radius:9px; color:#315d64; background:#f5fbfb; font-size:12px; line-height:1.5; }
.audit-grid { display:grid; grid-template-columns:minmax(120px,.7fr) minmax(0,1.3fr); gap:8px 14px; padding:14px 18px; font-size:12px; }
.audit-grid dt { color:var(--muted); }.audit-grid dd { margin:0; overflow-wrap:anywhere; }
.destructive-actions { display:flex; align-items:center; gap:9px; padding:12px 0; margin:12px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }.destructive-actions span { color:var(--muted); font-size:11px; }
.filter-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 14px; padding:12px; border:1px solid var(--line); border-radius:10px; background:white; }
.filter-bar input,.filter-bar select,.page-intro select { min-height:40px; padding:8px 10px; border:1px solid var(--line-strong); border-radius:8px; background:white; }
.filter-bar input { flex:1 1 280px; }.filter-bar span { color:var(--muted); font-size:12px; }
.pagination { display:flex; justify-content:center; gap:10px; padding:14px; }
.component-chart { margin-bottom:16px; }.chart-row { width:100%; display:grid; grid-template-columns:minmax(150px,.55fr) minmax(160px,1fr) 130px; align-items:center; gap:12px; padding:10px 14px; border:0; border-bottom:1px solid var(--line); background:white; text-align:left; cursor:pointer; }.chart-row:last-child{border-bottom:0}.chart-row progress{width:100%;height:10px;border:0;border-radius:5px;overflow:hidden;background:#e8eff0;appearance:none}.chart-row progress::-webkit-progress-bar{background:#e8eff0}.chart-row progress::-webkit-progress-value{background:var(--teal)}.chart-row progress::-moz-progress-bar{background:var(--teal)}.chart-row strong{text-align:right;}
.period-title { min-width:180px; text-align:center; font-size:13px; }
.top-title { display:flex; align-items:center; gap:10px; }.mobile-menu { display:none; }
.mobile-assistant { display:none; }
.account-balance-fields select { min-width:0; width:100%; padding:6px 7px; border:1px solid var(--line); border-radius:6px; background:white; }
.calendar-account-card { padding:0; overflow:hidden; }
.account-card-summary { display:grid; gap:8px; padding:12px; cursor:pointer; list-style:none; }
.account-card-summary::-webkit-details-marker { display:none; }
.account-card-summary::after { content:'Настроить'; color:var(--teal); font-size:11px; font-weight:800; }
.calendar-account-card[open] .account-card-summary { border-bottom:1px solid var(--line); }
.calendar-account-card[open] .account-card-summary::after { content:'Свернуть'; }
.account-summary-state { color:var(--muted); font-size:11px; line-height:1.35; }
.calendar-account-card .account-balance-fields { padding:12px; }
.calendar-account-inclusion { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.calendar-account-inclusion input { width:22px; min-height:22px; }
.account-card-list-more { border-top:1px solid var(--line); background:#f8fbfb; }
.account-card-list-more > summary { min-height:44px; display:flex; align-items:center; padding:10px 12px; color:var(--teal); font-size:12px; font-weight:800; cursor:pointer; }
.account-card-list-more > div { border-top:1px solid var(--line); }
.cell-stack { min-width:0; display:grid; gap:4px; }
.source-status{white-space:normal;overflow-wrap:anywhere}.source-status .button{height:auto;min-height:40px;white-space:normal}.operation-statuses{display:grid;gap:8px;margin-bottom:16px}.erp-awaiting-data{color:#805b12;background:#fff7df}.cash-position{border:1px solid var(--line);border-radius:14px;padding:18px;margin:16px 0;background:#fff}.cash-position-accounts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:12px}.cash-position-accounts article{padding:14px;border:1px solid var(--line);border-radius:10px;min-width:0;overflow-wrap:anywhere}.cash-position-accounts h4{margin:0 0 8px}.cash-position-accounts small{line-height:1.6}.cash-position-accounts .button{margin-top:12px;white-space:normal}
.assistant-dock { position:fixed; right:22px; bottom:66px; z-index:80; display:grid; justify-items:end; gap:9px; }
.assistant-trigger { display:flex; align-items:center; gap:9px; min-height:46px; padding:7px 14px 7px 8px; border:1px solid #78b6be; border-radius:24px; color:#0c5964; background:white; box-shadow:0 12px 34px rgba(20,58,64,.2); cursor:pointer; }
.assistant-trigger span { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; color:white; background:var(--teal); font-size:11px; font-weight:850; }
.assistant-panel { width:min(390px,calc(100vw - 28px)); padding:18px; border:1px solid #b9d7da; border-radius:14px; background:white; box-shadow:0 24px 70px rgba(17,52,57,.25); }
.assistant-panel header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid var(--line); }
.assistant-panel header strong,.assistant-panel header small { display:block; }.assistant-panel header small { margin-top:3px; color:var(--muted); font-size:10px; }
.assistant-panel p { margin:9px 0; color:#44565c; font-size:12px; line-height:1.5; }.assistant-actions { display:flex; gap:8px; margin-top:14px; }
.operation-filter input { min-width:min(320px,100%); }

@media (max-width: 960px) {
  .forecast-strip { grid-template-columns:repeat(2,1fr); }
  .settings-grid { grid-template-columns:repeat(2,1fr); }
  .report-row { grid-template-columns:minmax(180px,1.5fr) repeat(2,minmax(90px,.7fr)) auto; }
  .report-stats span:nth-child(n+3) { display:none; }
}

@media (max-width: 720px) {
  .calendar-toolbar { align-items:stretch; overflow-x:auto; padding-bottom:4px; }
  .calendar-toolbar .segmented { flex:0 0 auto; border-radius:7px; }
  .calendar-toolbar .prohibited { flex:0 0 auto; margin-left:0; }
  .range-form { width:100%; align-items:stretch; flex-direction:column; }
  .forecast-strip { grid-template-columns:1fr 1fr; }
  .calendar-board,.calendar-board.long-view { grid-template-columns:repeat(31,minmax(150px,1fr)); scroll-snap-type:x proximity; }
  .calendar-day { min-height:230px; scroll-snap-align:start; }
  .modal-backdrop { align-items:end; padding:0; }
  .modal,.wide-modal { width:100%; max-height:92vh; padding:20px 16px 28px; border-radius:18px 18px 0 0; }
  .form-grid { grid-template-columns:1fr; }
  .wide-field { grid-column:auto; }
  .settings-grid { grid-template-columns:1fr; }
  .report-row { grid-template-columns:1fr auto; align-items:start; }
  .report-stats { display:grid; grid-column:1/-1; grid-template-columns:repeat(2,1fr); gap:8px; color:var(--muted); font-size:11px; }
  .report-stats span:nth-child(n) { display:block; }
  .run-card { grid-template-columns:1fr; gap:8px; }
  .account-balance-fields { grid-template-columns:1fr 1fr; }
  .toast { left:14px; right:14px; bottom:82px; width:auto; }
}

/* Standalone platform foundation */
.hidden { display: none !important; }
.icon-button { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.top-actions, .hero-actions, .card-actions, .calendar-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; color: white; background: var(--amber); font-size: 11px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 80% 0,#dff5f5 0,transparent 34%),linear-gradient(135deg,#f7fbfb,#eef5f6); }
.auth-card { width: min(440px,100%); padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 22px 60px rgba(30,63,69,.12); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand strong,.auth-brand small { display: block; }.auth-brand small { margin-top: 3px; color: var(--muted); }
.auth-card h1 { margin: 0 0 8px; font-size: 28px; }.auth-card > p { margin: 0 0 22px; color: var(--muted); }
.login-form { display: grid; gap: 15px; }.login-form label,.plan-form label { display: grid; gap: 6px; color: #384652; font-size: 12px; font-weight: 700; }
.login-form input,.plan-form input,.plan-form select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; }
.button.large { min-height: 46px; margin-top: 5px; }.auth-card footer { margin-top: 24px; color: #85919b; font-size: 11px; line-height: 1.5; }
.alert { padding: 11px 13px; margin-bottom: 15px; border-radius: 8px; font-size: 13px; }.alert strong,.alert span { display:block; }.alert span { margin-top:4px; }.alert.error { color: var(--red); background: var(--red-soft); }.alert.warn { color: var(--amber); background: var(--amber-soft); }
.hero { min-height: 180px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 34px; margin-bottom: 18px; border: 1px solid #c8e1e3; border-radius: 16px; color: #0c3940; background: linear-gradient(120deg,#fff 15%,#eaf8f8 75%,#d8f0f1); overflow: hidden; position: relative; }
.hero::after { content:''; position:absolute; width:260px; height:260px; right:-80px; top:-110px; border:38px solid rgba(8,119,137,.08); border-radius:50%; }.hero > * { position: relative; z-index: 1; }
.hero h2 { margin: 4px 0 8px; font-size: clamp(28px,4vw,43px); letter-spacing: -.045em; }.hero p { max-width: 650px; margin: 0; color: #526a70; }
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.kpi-card { min-width:0; min-height: 116px; display: grid; align-content: center; gap: 7px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); overflow:hidden; }.kpi-card.warning { border-color: #ebc98d; background: #fffaf1; }
.kpi-card span,.kpi-card small { color: var(--muted); font-size: 12px; }.kpi-card strong { font-size: 25px; letter-spacing: -.035em; }
.connection-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.connection-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }.connection-card header { display:flex; align-items:center; gap:9px; padding-bottom:12px; border-bottom:1px solid var(--line); }.connection-card header .status-pill { margin-left:auto; }
.connection-card dl { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:13px 0; font-size:12px; }.connection-card dt { color:var(--muted); }.connection-card dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.status-pill { display:inline-flex; align-items:center; max-width:100%; padding:4px 7px; border-radius:999px; font-size:9px; font-weight:800; line-height:1.2; letter-spacing:.02em; }.status-pill.ok { color:#0b7340; background:var(--green-soft); }.status-pill.warn { color:var(--amber); background:var(--amber-soft); }.status-pill.neutral { color:#596773; background:#eef2f4; }
.decision-strip { display:grid; grid-template-columns:repeat(4,1fr); margin-bottom:18px; border:1px solid var(--line); border-radius:12px; background:white; }.decision-strip div { padding:14px 18px; border-right:1px solid var(--line); }.decision-strip div:last-child { border:0; }.decision-strip span { color:var(--muted); font-size:10px; font-weight:800; }.decision-strip strong { display:block; margin-top:4px; color:var(--teal); font-size:20px; }
.split-panel { display:grid; grid-template-columns:minmax(0,1fr) 310px; }.split-panel .table-panel { border-right:1px solid var(--line); }.panel-title span { color:var(--muted); font-size:11px; font-weight:600; }.audit-list strong { font-weight:600; overflow-wrap:anywhere; }
.content-page { max-width:1240px; }.content-page.wide { max-width:1600px; }.content-page > h2 { margin:0 0 6px; }.content-page > p { margin:0 0 18px; color:var(--muted); }
.calendar-toolbar { margin-bottom:12px; }.segmented { min-height:34px; padding:6px 11px; border:1px solid var(--line); background:white; color:#4a5864; cursor:pointer; }.segmented:first-child { border-radius:8px 0 0 8px; }.segmented:last-of-type { border-radius:0 8px 8px 0; }.segmented.active { color:#075e6b; border-color:#7db9c1; background:var(--teal-soft); }
.calendar-toolbar .prohibited { margin-left:auto; }.plan-editor { margin-bottom:14px; }.plan-form { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; padding:16px; }.plan-form .wide-field { grid-column:span 2; }.plan-form .check { display:flex; align-items:center; gap:8px; }.plan-form .check input { width:auto; min-height:auto; }.plan-form .form-actions { grid-column:1/-1; }
.calendar-layout { grid-template-columns:250px minmax(0,1fr); align-items:start; }.calendar-board { min-width:0; display:grid; grid-template-columns:repeat(7,minmax(150px,1fr)); gap:8px; overflow-x:auto; padding-bottom:8px; }.calendar-day { min-height:260px; padding:10px; border:1px solid var(--line); border-radius:10px; background:white; }.calendar-day > header { display:flex; justify-content:space-between; padding-bottom:9px; margin-bottom:9px; border-bottom:1px solid var(--line); }.calendar-day > header span { color:var(--muted); }.day-empty { display:block; padding:20px 3px; color:#a0aab2; font-size:11px; text-align:center; }
.calendar-event { display:grid; gap:4px; padding:9px; margin-bottom:7px; border-left:3px solid var(--red); border-radius:6px; background:#fff5f5; cursor:default; }.calendar-event[draggable="true"] { cursor:grab; }.calendar-event.income { border-color:var(--green); background:var(--green-soft); }.calendar-event small,.calendar-event span,.calendar-event em { color:var(--muted); font-size:9px; }.calendar-event strong { font-size:13px; }.calendar-legend { display:grid; gap:8px; padding:14px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; }.calendar-legend span { display:flex; align-items:center; gap:7px; }.calendar-legend i { width:8px; height:8px; border-radius:50%; }.calendar-legend i.income { background:var(--green); }.calendar-legend i.expense { background:var(--red); }.calendar-legend i.fact { background:var(--teal); }
.integration-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.integration-card header { display:flex; justify-content:space-between; align-items:center; }.card-actions { margin-top:14px; }.foundation-state { min-height:440px; display:grid; place-items:center; align-content:center; gap:10px; padding:50px; border:1px dashed #b9ccd0; border-radius:14px; text-align:center; background:rgba(255,255,255,.7); }.foundation-state > span svg { width:48px; height:48px; color:#8aa5aa; }.foundation-state h2,.foundation-state p { margin:0; }.foundation-state p { max-width:620px; color:var(--muted); line-height:1.6; }
.domain-banner { padding:30px; margin-bottom:18px; border-radius:15px; background:linear-gradient(120deg,#102d31,#087789); color:white; }.domain-banner p { color:#cbe4e6; }.domain-banner .eyebrow { color:#6ce1d8; }
.sku-waterfall { display:grid; gap:7px; min-width:min(680px,76vw); padding:12px 0; }.sku-waterfall>span { display:flex; justify-content:space-between; gap:16px; padding:6px 0; border-bottom:1px dashed var(--line); }.inline-mapping { display:flex; gap:8px; align-items:center; margin-top:12px; }.inline-mapping select { min-width:320px; max-width:100%; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns:78px minmax(0,1fr); }.brand strong,.nav-group-label,.nav-button span:last-child,.sidebar-note { display:none; }.nav-button { justify-content:center; }.kpi-grid { grid-template-columns:repeat(2,1fr); }.connection-grid { grid-template-columns:1fr; }.plan-form { grid-template-columns:repeat(2,1fr); }.split-panel { grid-template-columns:1fr; }.split-panel .table-panel { border-right:0; border-bottom:1px solid var(--line); }
}
@media (max-width: 720px) {
  body { padding-bottom:70px; overflow-x:hidden; }.app-shell { display:block; }.sidebar { position:fixed; left:0; right:0; bottom:0; top:auto; height:68px; z-index:50; border:0; border-top:1px solid var(--line); background:var(--surface); }.brand,.sidebar-note,.nav-group-label { display:none; }.nav { height:68px; display:flex; padding:6px; gap:2px; overflow:hidden; }.nav-group { display:contents; }.nav-button { display:none; min-width:0; width:20%; flex:1 1 20%; max-width:none; min-height:56px; justify-items:center; gap:2px; padding:5px 2px; font-size:9px; }.nav-button[data-nav="overview"],.nav-button[data-nav="operations"],.nav-button[data-nav="calendar"],.nav-button[data-nav="review"],.nav-button[data-nav="settings"] { display:grid; }.nav-button span:last-child { display:block; width:100%; white-space:normal; line-height:1.1; text-align:center; }.sidebar-open .sidebar { top:0; height:100vh; padding:62px 0 12px; overflow:auto; }.sidebar-open .nav { height:auto; display:grid; grid-template-columns:repeat(3,1fr); overflow:visible; }.sidebar-open .nav-group { display:contents; }.sidebar-open .nav-button { display:grid; width:auto; min-height:66px; }.sidebar-open .nav-group-label { display:none; }.topbar { padding:9px 10px; }.top-title { min-width:0; }.mobile-menu { display:inline-flex; min-width:44px; min-height:44px; align-items:center; justify-content:center; }.top-actions .scheduler,.profile-button { display:none; }.topbar .top-actions>.button { min-height:44px; padding:6px 8px; font-size:11px; }.page { padding:14px 11px 24px; }.hero { align-items:flex-start; flex-direction:column; padding:22px 17px; }.hero-actions { width:100%; }.hero-actions .button { flex:1; }.kpi-grid,.decision-strip { grid-template-columns:1fr 1fr; }.integration-grid { grid-template-columns:1fr; }.decision-strip div:nth-child(2) { border-right:0; }.connection-card dl { grid-template-columns:1fr; }.connection-card dd { text-align:left; margin-bottom:6px; }.calendar-layout { grid-template-columns:1fr; }.calendar-board { max-width:100%; grid-template-columns:repeat(14,minmax(145px,1fr)); overscroll-behavior-x:contain; }.plan-form { grid-template-columns:1fr; }.plan-form .wide-field { grid-column:auto; }.auth-card { padding:24px 20px; }.statusbar { display:none; }.content-page { width:100%; }.section-row { grid-template-columns:1fr; gap:5px; }.table-wrap { max-width:100%; overflow:visible; }
  .button,.button.ghost,.segmented,button,input,select,textarea { min-height:44px; }.help { width:44px; min-width:44px; height:44px; min-height:44px; display:inline-grid; place-items:center; margin:-10px; }.calendar-toolbar>.button { min-width:44px; }.kpi-card strong { font-size:clamp(19px,6vw,25px); overflow-wrap:anywhere; }
  .forecast-strip { grid-template-columns:1fr; }.account-balance-fields { grid-template-columns:1fr; }.calendar-toolbar { overflow:visible; }.period-title { order:-1; width:100%; text-align:left; }.prohibited { white-space:normal; }
  .split-panel .table-panel table thead,.mobile-cards table thead { display:none; }.split-panel .table-panel table,.split-panel .table-panel tbody,.mobile-cards table,.mobile-cards tbody { display:block; width:100%; }.split-panel .table-panel tr,.mobile-cards tr { display:block; margin:10px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:white; }.split-panel .table-panel td,.mobile-cards td { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; width:100%; padding:7px 0; border:0; text-align:right; white-space:normal; overflow-wrap:anywhere; }.split-panel .table-panel td::before,.mobile-cards td::before { content:attr(data-label); flex:0 0 36%; color:var(--muted); font-size:10px; font-weight:700; text-align:left; }.split-panel .table-panel td>* ,.mobile-cards td>* { min-width:0; }.operation-row td small { max-width:190px; }.amount { white-space:normal; }
  .modal-backdrop { padding-bottom:env(safe-area-inset-bottom); }.modal,.wide-modal { max-height:calc(100dvh - 12px); padding-bottom:max(30px,env(safe-area-inset-bottom)); }.form-actions,.destructive-actions { align-items:stretch; flex-direction:column; }.form-actions .button,.destructive-actions .button { width:100%; }
  .filter-bar { align-items:stretch; flex-direction:column; }.filter-bar input,.filter-bar select { width:100%; }.chart-row { grid-template-columns:1fr auto; }.chart-row progress { grid-column:1/-1; grid-row:2; }.chart-row strong { text-align:right; }.report-row summary { display:grid; gap:6px; }.audit-grid { grid-template-columns:1fr; }.topbar h1 { font-size:20px; }
  .sku-waterfall { min-width:0; }.inline-mapping { align-items:stretch; flex-direction:column; }.inline-mapping select { min-width:0; width:100%; }
  .assistant-dock { right:12px; bottom:78px; }.assistant-trigger strong { display:none; }.assistant-trigger { padding:6px; border-radius:50%; }.assistant-panel { max-height:calc(100dvh - 160px); overflow:auto; }.assistant-actions { align-items:stretch; flex-direction:column; }.assistant-actions .button { width:100%; }
}

/* V2 FULLFIX final cascade: must remain the last responsive layer. */
@media (max-width:1180px) and (min-width:721px) {
  .app-shell { grid-template-columns:228px minmax(0,1fr); }
  .brand strong,.brand-copy,.brand-copy strong,.nav-group-label,.nav-button span:last-child,.sidebar-note { display:flex; }
  .brand-copy { flex-direction:column; }
  .brand-copy small { display:block; }
  .nav-group-label { padding:8px 9px; }
  .nav-button { justify-content:flex-start; padding-left:36px; }
}

@media (max-width:720px) {
  html,body { max-width:100%; overflow-x:hidden; }
  body { padding-bottom:calc(70px + env(safe-area-inset-bottom)); font-size:15px; }
  .app-shell { display:block; }
  .workspace { min-height:calc(100vh - 70px); }
  .sidebar { position:fixed; inset:0; z-index:110; width:100%; height:100dvh; display:none; padding:0 0 env(safe-area-inset-bottom); border:0; background:var(--rail-deep); overflow:hidden; }
  .sidebar-open .sidebar { display:flex; inset:0; width:100%; height:100dvh; padding:0; overflow:hidden; }
  .sidebar-open { overflow:hidden; }
  .brand { display:flex; flex:0 0 70px; padding:0 18px; border-bottom:1px solid var(--rail-line); }
  .brand-copy,.brand-copy strong { display:grid; }
  .brand-copy small { display:block; }
  .sidebar .icon-button { width:44px; height:44px; display:grid; place-items:center; color:#fff; font-size:25px; }
  .nav,.sidebar-open .nav { height:auto; flex:1 1 auto; display:block; padding:12px 12px 32px; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; }
  .nav-group,.sidebar-open .nav-group { display:block; margin-bottom:7px; padding-bottom:7px; }
  .nav-group-label,.sidebar-open .nav-group-label { display:flex; min-height:48px; color:#d2e1e2; font-size:14px; }
  .nav-group-name { display:flex; }
  .nav-group-icon { width:24px; height:24px; }
  .nav-group-icon svg { width:21px; height:21px; }
  .nav-button,.sidebar-open .nav-button { width:100%; min-width:0; min-height:48px; display:flex; justify-content:flex-start; gap:12px; padding:11px 12px 11px 44px; color:#b7c9cb; font-size:15px; }
  .nav-button span:last-child { width:auto; display:block; text-align:left; line-height:1.35; }
  .sidebar-note { display:block; flex:0 0 auto; padding:14px 20px; }
  .topbar { min-height:68px; padding:8px 12px; }
  .top-title { min-width:0; width:auto; flex:1 1 auto; gap:9px; }
  .mobile-menu { display:inline-flex; flex:0 0 44px; width:44px; height:44px; padding:0; font-size:20px; }
  .top-title > div { min-width:0; }
  .mobile-assistant { display:inline-grid; flex:0 0 44px; width:44px; height:44px; padding:0; place-items:center; border-radius:50%; color:#fff; background:var(--teal); font-weight:850; }
  .topbar h1 { font-size:20px; line-height:1.2; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .topbar p,.top-actions { display:none; }
  .page { padding:16px 12px 26px; }
  .statusbar { display:none; }
  .mobile-bottom-nav { position:fixed; left:0; right:0; bottom:0; z-index:90; height:calc(68px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(6,1fr); padding:5px 4px env(safe-area-inset-bottom); border-top:1px solid #d8e5e6; background:rgba(255,255,255,.98); box-shadow:0 -10px 30px rgba(21,55,60,.1); backdrop-filter:blur(16px); }
  .mobile-bottom-nav button { min-width:0; min-height:56px; display:grid; place-items:center; align-content:center; gap:3px; padding:3px 1px; border:0; border-radius:9px; color:#6f7f83; background:transparent; font-size:10px; line-height:1.05; cursor:pointer; }
  .mobile-bottom-nav button.active { color:#087789; background:#eaf7f7; }
  .mobile-bottom-nav svg { width:21px; height:21px; stroke-width:1.8; }
  .hero { min-height:0; align-items:flex-start; flex-direction:column; padding:22px 18px; border-radius:17px; }
  .hero h2 { font-size:28px; line-height:1.05; }
  .hero p { font-size:14px; }
  .hero-actions { display:grid; grid-template-columns:1fr; width:100%; }
  .hero-actions .button { width:100%; }
  .owner-action-strip { margin-inline:-12px; padding-inline:12px; scrollbar-width:none; }
  .owner-action-strip::-webkit-scrollbar,.marketplace-identity-bar::-webkit-scrollbar,.calendar-board::-webkit-scrollbar { display:none; }
  .owner-action-strip button { flex:0 0 176px; min-height:92px; }
  .kpi-grid,.forecast-strip,.decision-strip { grid-template-columns:1fr; }
  .kpi-card { min-height:110px; padding:17px; }
  .kpi-card > span,.kpi-card small { font-size:13px; }
  .kpi-card strong { font-size:24px; }
  .connection-grid,.account-registry-grid,.settings-grid,.workspace-grid,.stage-grid,.agent-grid { grid-template-columns:1fr; }
  .account-registry-card { padding:12px 13px; }
  .account-registry-header { display:grid; grid-template-columns:minmax(0,1fr) minmax(76px,96px); align-items:center; }
  .account-card-identity { min-width:0; }
  .account-card-identity > .provider-identity { flex:0 0 36px; min-width:36px; }
  .account-card-identity > .provider-identity .provider-name { display:none; }
  .account-card-identity > div { min-width:0; }
  .account-card-identity > div strong,.account-card-identity > div small { overflow-wrap:anywhere; }
  .account-card-summary-status { min-width:0; max-width:96px; }
  .account-card-summary-status small { max-width:96px; overflow-wrap:anywhere; }
  .account-card-details { padding-top:10px; margin-top:10px; }
  .connection-card dl,.account-registry-card dl { grid-template-columns:1fr; }
  .connection-card dd,.account-registry-card dd { margin:0 0 6px; text-align:left; }
  .marketplace-identity-bar { display:flex; margin-inline:-12px; padding:0 12px 6px; overflow-x:auto; scroll-snap-type:x mandatory; }
  .marketplace-identity-choice { flex:0 0 190px; scroll-snap-align:start; }
  .marketplace-context-strip small { width:100%; margin-left:0; }
  .table-wrap.mobile-cards { overflow:visible; }
  .mobile-cards table thead { display:none; }
  .mobile-cards table,.mobile-cards tbody { display:block; width:100%; }
  .mobile-cards tr { display:block; margin:10px; padding:12px 14px; border:1px solid #dce7e9; border-radius:13px; background:#fff; box-shadow:0 5px 18px rgba(24,57,62,.04); }
  .mobile-cards td { display:grid; grid-template-columns:minmax(105px,36%) minmax(0,1fr); gap:10px; width:100%; padding:8px 0; border:0; text-align:left; white-space:normal; overflow-wrap:anywhere; }
  .mobile-cards td::before { content:attr(data-label); grid-column:1; grid-row:auto; color:#73868a; font-size:12px; font-weight:700; text-align:left; }
  .mobile-cards td > * { grid-column:2; min-width:0; overflow-wrap:anywhere; }
  .mobile-cards .amount { text-align:left; }
  .provider-identity.compact { font-size:13px; }
  .provider-name { white-space:normal; }
  .calendar-account-card .provider-name { display:none; }
  .calendar-layout { display:block; }
  .calendar-accounts { margin-bottom:14px; }
  .calendar-board,.calendar-board.long-view { display:flex; max-width:calc(100vw - 24px); gap:10px; overflow-x:auto; scroll-snap-type:x mandatory; }
  .calendar-day { flex:0 0 calc(100vw - 48px); min-width:0; min-height:260px; scroll-snap-align:center; }
  .calendar-toolbar { display:grid; grid-template-columns:44px 1fr 44px; gap:8px; overflow:visible; }
  .calendar-toolbar > .button:nth-child(2) { grid-column:2; grid-row:1; }
  .calendar-toolbar > .button:nth-child(4) { grid-column:3; grid-row:1; }
  .period-title { grid-column:1/-1; grid-row:2; width:100%; min-width:0; padding:4px 0; text-align:center; }
  .calendar-toolbar .segmented { min-width:0; width:100%; }
  .calendar-toolbar .prohibited,.calendar-toolbar .range-form { grid-column:1/-1; }
  .filter-bar { padding:10px; }
  .filter-bar input,.filter-bar select,.form-grid input,.form-grid select,.form-grid textarea { min-height:44px; font-size:16px; }
  .filter-bar input,.filter-bar select { flex:0 0 auto; width:100%; }
  .button,.segmented,button,input,select,textarea { min-height:44px; }
  .help { width:44px; min-width:44px; height:44px; min-height:44px; margin:-10px 0 -10px 4px; }
  .modal-backdrop { align-items:end; padding:0; }
  .modal,.wide-modal { width:100%; max-height:calc(100dvh - 8px); padding:20px 16px max(30px,env(safe-area-inset-bottom)); border-radius:20px 20px 0 0; }
  .assistant-dock:not(.open) { display:none; }
  .assistant-dock.open { inset:76px 12px calc(76px + env(safe-area-inset-bottom)); z-index:120; display:block; }
  .assistant-dock.open .assistant-trigger { display:none; }
  .assistant-panel { width:100%; max-height:100%; overflow:auto; }
}

@media(max-width:720px){
  .marketplace-identity-bar { display:grid; grid-template-columns:1fr 1fr; margin-inline:0; padding:0; overflow:visible; scroll-snap-type:none; }
  .marketplace-identity-choice { min-width:0; min-height:82px; display:grid; grid-template-columns:auto minmax(0,1fr); align-content:center; flex:none; padding:12px; }
  .marketplace-identity-choice small { grid-column:1/-1; margin:2px 0 0; font-size:11px; }
  .marketplace-identity-choice > .provider-identity { min-width:0; }
  .settings-tile { min-height:112px; }
}

/* R16f Owner corrections: content-sized help, operational DDS, calendar parity and account table. */
.help-overlay{
  right:auto!important;bottom:auto!important;display:inline-block!important;width:fit-content!important;
  min-width:0!important;max-width:min(320px,calc(100vw - 24px))!important;max-height:min(240px,calc(100vh - 24px));
  white-space:normal;overflow-wrap:anywhere
}

/* Owner daily-finance correction: saved filters, selection math, attachments and ERP workspace. */
.operation-quick-filter-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff}
.quick-filter-pills{display:flex;flex-wrap:wrap;gap:7px;min-width:0}.quick-filter-pill{min-height:36px;padding:7px 12px;border:1px solid #cbdcdf;border-radius:999px;background:#f8fbfb;color:var(--ink);font:inherit;font-size:12px;font-weight:750;cursor:pointer}.quick-filter-pill:hover,.quick-filter-pill.active{border-color:var(--brand);background:#eaf7f8;color:#086f7b}.quick-filter-custom{display:inline-flex;align-items:center;padding-right:4px;border:1px solid #d8e5e7;border-radius:999px;background:#fff}.quick-filter-custom>.quick-filter-pill{border:0}.quick-filter-custom>button:not(.quick-filter-pill){display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}.quick-filter-custom>button:not(.quick-filter-pill):hover{background:#edf5f6;color:var(--ink)}
.operation-selection-summary{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:8px;margin-bottom:9px}.operation-selection-summary>span{display:grid;gap:3px;padding:10px 12px;border:1px solid #dce7e9;border-radius:10px;background:#f8fbfb}.operation-selection-summary small{color:var(--muted);font-size:10px;font-weight:750}.operation-selection-summary strong{font-size:14px}
.operation-attachments{display:grid;gap:10px;margin-top:14px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fbfdfd}.operation-attachments>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.operation-attachments>header>div{display:grid;gap:3px}.operation-attachments small{color:var(--muted);font-size:11px}.attachment-add{cursor:pointer}.attachment-list{display:grid;gap:7px}.attachment-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:9px 10px;border:1px solid #dfe9eb;border-radius:9px;background:#fff}.attachment-row>span{display:grid;min-width:0}.attachment-row strong{overflow-wrap:anywhere}.attachment-row>div{display:flex;flex-wrap:wrap;gap:8px}.danger-text{color:#a13e3e!important}.compact-empty{min-height:72px;padding:12px}
.workspace-tabs{display:flex;gap:7px;max-width:100%;padding:3px 0 10px;overflow-x:auto;scrollbar-width:thin}.workspace-tabs .segmented{flex:0 0 auto;white-space:nowrap}.moysklad-workspace .panel{min-width:0}.party-directory-page td small,.moysklad-workspace td small{display:block;margin-top:4px;color:var(--muted)}
.dds-collapse-button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:38px;padding:6px 8px;border:0;background:transparent;color:var(--ink);font:inherit;font-weight:800;text-align:left;cursor:pointer}.dds-collapse-button small{color:var(--muted);font-size:10px}.dds-group-row.collapsed{border-bottom:1px solid var(--line)}
.operation-editor-form>label,.operation-editor-form>fieldset{min-width:0}.operation-editor-form input,.operation-editor-form select,.operation-editor-form textarea{max-width:100%}
@media(min-width:721px){.calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:150px}.calendar-board.month-grid .calendar-day{padding:10px}.calendar-board.month-grid .day-closing-balance{margin-top:auto;padding-top:8px}.calendar-board.month-grid .calendar-event.compact{min-height:38px;padding:6px 8px}.calendar-board.month-grid .calendar-event.compact strong{font-size:11px}}
@media(max-width:900px){.operation-selection-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.operation-selection-summary>span:last-child{grid-column:1/-1}}
@media(max-width:720px){
  .operation-quick-filter-bar{display:grid;padding:9px}.quick-filter-pills{display:flex;flex-wrap:nowrap;padding-bottom:3px;overflow-x:auto;scroll-snap-type:x proximity}.quick-filter-pill,.quick-filter-custom{flex:0 0 auto;scroll-snap-align:start}.operation-quick-filter-bar>.button{width:100%;min-height:44px}
  .operation-selection-summary{grid-template-columns:1fr 1fr}.operation-selection-summary>span{min-height:58px}.operation-bulk-toolbar{top:0}
  .operation-attachments{padding:11px}.operation-attachments>header,.attachment-row{display:grid}.attachment-add{width:100%;min-height:44px}.attachment-row>div{display:grid;grid-template-columns:1fr 1fr}.attachment-row>div .text-button{min-height:40px}.attachment-row>div .danger-text{grid-column:1/-1}
  .operation-editor-form{grid-template-columns:1fr!important}.operation-editor-form .wide-field{grid-column:1!important}.operation-editor-form .form-actions{position:sticky;bottom:calc(-1 * max(28px,env(safe-area-inset-bottom)));z-index:4;margin:0 -16px;padding:12px 16px max(16px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line)}
  .workspace-tabs{margin-inline:-4px}.workspace-tabs .segmented{min-height:42px}.party-directory-page .filter-bar{grid-template-columns:1fr}.party-directory-page .filter-bar span{grid-column:1}
  .calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:68px!important}
}
.help-overlay[hidden]{display:none!important}
.modal-close,.compact-close{
  top:8px!important;right:8px!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;
  padding:0!important;border-radius:7px!important;font-size:18px!important;line-height:1!important
}
.modal>header{padding-right:34px}
.recognition-workspace>form{display:grid;gap:12px}
.recognition-workspace>summary{min-height:54px}
.dds-section-row.income th,.dds-section-row.expense th{background:#f5f9f9!important;color:var(--ink)!important}
.dds-section-row .positive,.dds-article-row .positive{color:#16835f!important}
.dds-section-row .negative,.dds-article-row .negative{color:#b94949!important}
.dds-colors-off .positive,.dds-colors-off .negative,.dds-colors-off .positive *,.dds-colors-off .negative *{color:inherit!important}
.dds-filter{display:grid;grid-template-columns:repeat(6,minmax(145px,1fr)) auto auto;gap:8px;align-items:end;margin-bottom:0}
.dds-filter>label{display:grid;gap:5px;min-width:0;color:var(--muted);font-size:11px;font-weight:750}
.dds-filter input:not([type="checkbox"]),.dds-filter select{width:100%;min-width:0;height:40px;min-height:40px;padding:7px 9px}
.dds-filter .check{height:40px;min-height:40px;white-space:nowrap}
.dds-filter>.button{height:40px;min-height:40px}
.dds-settings-dialog{width:min(620px,calc(100vw - 28px))}
.disabled-setting{opacity:.62}.disabled-setting input{cursor:not-allowed}
.day-closing-balance{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-top:auto;padding-top:5px;border-top:1px dashed #dce7e8;color:#74878b;font-size:9px}
.day-closing-balance small,.day-closing-balance span{font-size:9px;line-height:1.2}
.day-closing-balance.negative span{color:#b94949}
.calendar-board.month-grid .calendar-day{display:flex;flex-direction:column}
.calendar-account-filter-option{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start;min-width:0}
.calendar-account-option-copy{display:grid!important;grid-template-columns:30px minmax(0,1fr);align-items:center;min-width:0}
.calendar-account-option-copy>.provider-identity{min-width:0}
.calendar-account-option-copy>.provider-identity .provider-name{display:none}
.calendar-account-option-copy>span:last-child{display:grid;gap:3px;min-width:0}
.calendar-account-option-copy strong,.calendar-account-option-copy small{display:block;min-width:0;overflow-wrap:anywhere;line-height:1.3}
.calendar-account-picker>div{width:min(430px,calc(100vw - 32px))}
.account-directory-panel{padding:0;overflow:hidden}.account-directory-panel>.panel-title{padding:14px 16px;margin:0}
.account-directory-table{width:100%;min-width:780px;border-collapse:collapse}
.account-directory-table th{padding:10px 14px;background:#f5f9f9;color:var(--muted);font-size:11px;text-align:left;text-transform:uppercase}
.account-directory-table td{padding:13px 14px;border-top:1px solid var(--line);vertical-align:middle}
.account-directory-table td>strong,.account-directory-table td>small{display:block}.account-directory-table td>small{margin-top:4px;color:var(--muted);font-size:11px}
.account-directory-row{cursor:pointer}.account-directory-row:hover{background:#f7fbfb}.account-directory-row.needs-mapping{box-shadow:inset 3px 0 0 #d99732}
.account-bank-cell{display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 9px;align-items:center}.account-bank-cell>small{grid-column:1/-1;color:var(--muted);font-size:11px}
.account-directory-table .amount{text-align:right}
@media(max-width:1180px){.dds-filter{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){
  .help-overlay{max-width:calc(100vw - 20px)!important}
  .modal-close,.compact-close{top:7px!important;right:7px!important;width:27px!important;height:27px!important;min-width:27px!important;min-height:27px!important}
  .dds-filter{grid-template-columns:1fr 1fr;gap:8px}.dds-filter>label,.dds-filter>.button{width:100%;min-width:0}.dds-filter .check{grid-column:1/-1}.dds-filter>.button{grid-column:1/-1}
  .calendar-account-picker>div{left:10px;right:10px;bottom:calc(74px + env(safe-area-inset-bottom));width:auto!important;padding:8px}
  .calendar-account-filter-option{min-height:58px;padding:8px 5px}.calendar-account-option-copy{grid-template-columns:28px minmax(0,1fr)}
  .calendar-board.month-grid .calendar-day{min-height:82px}.calendar-board.month-grid .day-closing-balance{display:flex;padding-top:3px}.calendar-board.month-grid .day-closing-balance small{display:none}.calendar-board.month-grid .day-closing-balance span{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .account-directory-table{min-width:0}.account-directory-panel .table-wrap{overflow:visible}
  .account-directory-table thead{display:none}.account-directory-table,.account-directory-table tbody,.account-directory-table tr,.account-directory-table td{display:block;width:100%}
  .account-directory-table tr{position:relative;padding:13px 14px;border-top:1px solid var(--line)}.account-directory-table td{display:grid;grid-template-columns:92px minmax(0,1fr);gap:8px;padding:4px 0;border:0;text-align:left!important}.account-directory-table td::before{content:attr(data-label);color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}.account-directory-table td>small{grid-column:2}.account-bank-cell{grid-column:2}
}

/* Daily finance core: manual cash, DDS drill-down and MoySklad mapping workspace. */
.income-action{border-color:#9fd8c6;background:#edf9f4;color:#087153}.expense-action{border-color:#efc1c1;background:#fff5f5;color:#a63e3e}
[data-dds-drilldown]{cursor:pointer}[data-dds-drilldown]:hover,[data-dds-drilldown]:focus-visible{background:#edf9fa;outline:0;box-shadow:inset 3px 0 0 #078899}
.compact-form{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#f8fbfb}
[data-finance-article-map]{display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto;gap:7px;align-items:center}
[data-finance-article-map] input,[data-finance-article-map] select{min-width:0;width:100%}
.manual-operation-safety{color:var(--muted);font-size:12px}
@media(max-width:720px){
  [data-finance-article-map]{grid-template-columns:1fr}
  .content-page>.page-intro .hero-actions{grid-template-columns:1fr 1fr}
  .content-page>.page-intro .hero-actions .button{min-width:0;padding-inline:8px}
}

.owner-metric > strong { font-size:clamp(24px,2vw,30px); line-height:1.08; letter-spacing:-.025em; overflow-wrap:normal; word-break:normal; }
.mobile-drawer-close { display:none; }
.operation-filter-shell{margin-bottom:14px;border:1px solid var(--line);border-radius:14px;background:#fff}.operation-filter-shell>summary{display:flex;justify-content:space-between;gap:12px;padding:14px 16px;color:var(--ink);font-weight:750;cursor:pointer}.operation-filter-shell>summary span{color:var(--muted);font-size:12px;font-weight:600}.operation-filter{display:grid;grid-template-columns:minmax(240px,2fr) repeat(4,minmax(150px,1fr));gap:10px;padding:0 14px 14px}.operation-filter label{display:grid;gap:5px;color:var(--muted);font-size:11px;font-weight:700}.operation-filter input,.operation-filter select{width:100%}.operation-search-field{grid-column:span 2}
.owner-business-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.business-signal{display:grid;align-content:start;gap:8px;min-height:132px;padding:18px;border:1px solid var(--line);border-radius:15px;background:#fff;color:var(--ink);text-align:left;cursor:pointer}.business-signal:hover{border-color:#83c6ca;background:#f8fdfd}.business-signal>span{color:var(--muted);font-size:10px;font-weight:850;letter-spacing:.06em}.business-signal>strong{font-size:20px;line-height:1.15}.business-signal>small{color:var(--muted);font-size:12px;line-height:1.4}
@media(max-width:720px){.audit-drawer.open{position:fixed;left:0;right:0;bottom:0;z-index:130;max-height:88dvh;overflow:auto;padding:24px 18px calc(30px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0;background:#fff;box-shadow:0 -18px 50px rgba(8,37,42,.2)}.audit-drawer.open::before{content:"";display:block;width:42px;height:4px;margin:-10px auto 17px;border-radius:999px;background:#cad9dc}.mobile-drawer-close{position:absolute;top:14px;right:14px;display:grid;width:44px;height:44px;place-items:center;border:0;border-radius:50%;background:#eef3f4;color:var(--muted);font-size:20px;cursor:pointer}.audit-drawer.open .panel-title{padding-right:54px}}
@media(max-width:720px){.operation-filter-shell>summary{min-height:50px;align-items:center}.operation-filter{grid-template-columns:1fr;padding:0 10px 12px}.operation-search-field{grid-column:auto}}
@media(max-width:1180px){.owner-business-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.owner-business-grid{grid-template-columns:1fr}.business-signal{min-height:112px}}

/* Payment Calendar: Page 1 real calendar model */
.payment-calendar-page{display:grid;gap:16px}.owner-calendar-summary{grid-template-columns:repeat(5,minmax(0,1fr))}.calendar-workspace{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:16px;align-items:start}.calendar-primary{min-width:0;padding:14px;border:1px solid var(--line);border-radius:16px;background:#fff}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-bottom:6px;color:var(--muted);font-size:11px;font-weight:800;text-align:center;text-transform:uppercase}.calendar-board.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;max-width:none;overflow:visible}.calendar-board.month-grid .calendar-day,.calendar-month-empty{min-width:0;min-height:112px}.calendar-month-empty{border:1px dashed #edf2f3;border-radius:10px;background:#fafcfc}.calendar-board.month-grid .calendar-day{display:block;padding:8px;border-radius:10px}.calendar-board.month-grid .calendar-day.active{border-color:#078899;box-shadow:0 0 0 2px rgba(7,136,153,.15)}.calendar-board.month-grid .calendar-day>header{margin-bottom:6px;padding-bottom:5px}.calendar-board.month-grid .day-empty{padding:12px 0;font-size:10px}.calendar-event{width:100%;text-align:left;border-top:0;border-right:0;border-bottom:0}.calendar-event.compact{min-height:32px;margin-bottom:4px;padding:5px 6px;gap:1px}.calendar-event.compact small{font-size:8px}.calendar-event.compact strong{font-size:10px;white-space:nowrap}.calendar-more{display:block;color:var(--muted);font-size:9px}.calendar-attention{display:grid;gap:12px}.calendar-attention>.panel,.calendar-account-filter{padding:16px}.attention-warning,.attention-ok{display:grid;gap:6px;margin:12px 0 18px;padding:14px;border-radius:12px}.attention-warning{border:1px solid #efb6b6;background:#fff7f7}.attention-warning b{color:#b34141;font-size:12px}.attention-ok{border:1px solid #cfe3e3;background:#f6fbfb}.attention-warning span,.attention-ok span{color:var(--muted);font-size:12px}.attention-list{display:grid;gap:8px}.attention-list>strong{margin-bottom:4px}.attention-list button{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:7px;align-items:center;padding:9px 0;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);font-size:11px;text-align:left}.attention-list button span{color:var(--muted)}.calendar-account-filter>summary{min-height:44px;display:flex;align-items:center;font-weight:750;cursor:pointer}.calendar-account-filter-body{display:grid;gap:10px;margin-top:12px}.calendar-selected-day{display:grid;gap:13px;margin-top:14px;padding:16px;border:1px solid var(--line);border-radius:14px;background:#fbfdfd}.calendar-selected-day>header{display:flex;align-items:center;justify-content:space-between;gap:16px}.calendar-selected-day h3{margin:3px 0 0}.selected-day-formula{display:grid;grid-template-columns:repeat(4,minmax(0,1fr) auto) minmax(0,1fr);align-items:center;gap:8px;padding:12px;border-radius:10px;background:#f0f6f7}.selected-day-formula span{display:grid;gap:4px;color:var(--muted);font-size:11px}.selected-day-formula strong{color:var(--ink);font-size:13px}.selected-day-events{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.selected-day-events .calendar-event{margin:0;min-height:76px}.calendar-view-switch{display:flex;align-items:center}.period-title{text-transform:capitalize}
.calendar-account-filter:not([open]) .calendar-account-filter-body{display:none}
@media(max-width:1180px){.owner-calendar-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.calendar-workspace{grid-template-columns:1fr}.calendar-attention{grid-template-columns:1fr 1fr}.calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:100px}}
@media(max-width:720px){.payment-calendar-page{gap:12px}.owner-calendar-summary{grid-template-columns:1fr}.calendar-toolbar{grid-template-columns:44px minmax(0,1fr) 44px}.calendar-view-switch{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.calendar-view-switch .segmented{width:100%;min-height:44px;border-radius:9px}.calendar-view-switch [data-calendar-view="2years"],.calendar-view-switch [data-calendar-view="custom"]{grid-column:auto}.calendar-primary{padding:8px}.calendar-weekdays{gap:3px}.calendar-board.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;max-width:100%;overflow:visible;scroll-snap-type:none}.calendar-board.month-grid .calendar-day,.calendar-month-empty{flex:none;min-width:0;min-height:64px;border-radius:7px}.calendar-board.month-grid .calendar-day{padding:5px}.calendar-board.month-grid .calendar-day>header{min-height:18px;margin:0;padding:0;border:0}.calendar-board.month-grid .calendar-day>header strong{font-size:11px}.calendar-board.month-grid .calendar-day>header span{font-size:9px}.calendar-board.month-grid .calendar-event.compact{display:none}.calendar-board.month-grid .day-empty,.calendar-board.month-grid .calendar-more{display:none}.calendar-attention{grid-template-columns:1fr}.calendar-selected-day{padding:13px}.calendar-selected-day>header{display:grid}.calendar-selected-day>header .hero-actions{grid-template-columns:1fr 1fr}.selected-day-formula{grid-template-columns:1fr 1fr;gap:9px}.selected-day-formula>b{display:none}.selected-day-formula span{min-height:48px;padding:8px;border-radius:8px;background:#fff}.selected-day-formula span:last-child{grid-column:1/-1}.selected-day-events{grid-template-columns:1fr}.attention-list button{min-height:52px}.calendar-account-filter .provider-name{display:none}}

/* R14 ADesk behavioral parity: Operations, Calendar, DDS and article directory. */
.operation-select-cell{width:44px;text-align:center}.operation-select-cell input{width:18px;height:18px;accent-color:var(--brand)}.operation-row.bulk-selected{background:#f0fafb}.operation-bulk-toolbar{position:sticky;top:68px;z-index:4;display:flex;align-items:center;gap:8px;min-height:56px;padding:10px 14px;border-bottom:1px solid #b8dde1;background:#eaf8f9;box-shadow:0 6px 18px rgba(19,67,74,.08)}.operation-bulk-toolbar strong{margin-right:auto}.operation-date-with-plan{display:flex;align-items:center;gap:8px}.plan-confirm-control,.plan-match-ambiguous{display:inline-grid;place-items:center;width:24px;height:24px;border:1px solid #9fc9ce;border-radius:6px;background:#fff;color:#78969a;font-weight:900}.plan-confirm-control{cursor:pointer}.plan-confirm-control:hover{border-color:var(--brand);color:var(--brand)}.plan-confirm-control.matched{border-color:#8fd0b7;background:#e9f8f1;color:#14835e}.plan-match-ambiguous{border-color:#e0bb68;background:#fff8e7;color:#916514}.operation-filter-shell[open]>summary{border-bottom:1px solid var(--line)}
.calendar-workspace{grid-template-columns:minmax(0,1fr)}.calendar-account-picker{position:relative}.calendar-account-picker>summary{display:flex;align-items:center;min-height:42px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer;font-weight:700}.calendar-account-picker>div{position:absolute;right:0;z-index:12;display:grid;gap:5px;width:min(390px,calc(100vw - 32px));max-height:420px;margin-top:6px;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:var(--shadow);overflow:auto}.calendar-account-filter-option{display:flex;align-items:center;gap:10px;min-height:52px;padding:7px 8px;border-radius:9px}.calendar-account-filter-option:hover{background:#f3f8f8}.calendar-account-filter-option>input{width:18px;height:18px;accent-color:var(--brand)}.calendar-account-filter-option>span{display:flex;align-items:center;gap:9px}.calendar-account-filter-option>span>span{display:grid}.calendar-account-filter-option small{color:var(--muted)}.calendar-day-dialog{width:min(720px,calc(100vw - 28px));max-height:min(760px,calc(100vh - 36px));overflow:auto}.calendar-day-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:16px}.calendar-risk-strip{margin:0}.calendar-day-backdrop{z-index:120}.modal-backdrop:has([data-action="close-plan-details"]){z-index:180}
.adesk-dds{display:grid;gap:14px}.dds-view-tabs{display:flex;flex-wrap:wrap;gap:6px}.dds-report-wrap{border:1px solid var(--line);border-radius:14px;background:#fff;overflow:auto}.dds-report-table{min-width:920px;border-collapse:separate;border-spacing:0}.dds-report-table th,.dds-report-table td{padding:11px 12px;border-bottom:1px solid var(--line);border-right:1px solid #edf2f2;vertical-align:top}.dds-report-table thead th{position:sticky;top:0;z-index:2;background:#f5f9f9;color:#60777a;font-size:11px;text-transform:uppercase}.dds-report-table tr>th:first-child{position:sticky;left:0;z-index:1;min-width:250px;background:#fff;text-align:left}.dds-report-table thead tr>th:first-child{z-index:3;background:#f5f9f9}.dds-section-row th{font-size:14px}.dds-section-row.income th{background:#edf9f3!important;color:#157758}.dds-section-row.expense th{background:#fff2f2!important;color:#a54848}.dds-group-row th{padding-left:22px!important;background:#f7f9f9!important;color:#52696c;font-size:12px}.dds-article-row>th{padding-left:36px!important}.dds-article-row>th button,.dds-cell-button{border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}.dds-article-row>th button{display:block;font-weight:750}.dds-article-row>th small{display:block;margin-top:3px;color:var(--muted);font-weight:400}.dds-cell-button{display:grid;gap:2px;width:100%;text-align:right}.dds-cell-button:hover strong{text-decoration:underline;color:var(--brand)}.dds-cell-button small{color:var(--muted);font-size:10px}.dds-net-row th,.dds-net-row td{background:#edf7f8!important}.dds-transfer-row th,.dds-transfer-row td{background:#fafafa!important;color:#66787b}.dds-balance-row .muted{font-size:10px}.dds-drilldown-dialog{width:min(880px,calc(100vw - 28px));max-height:calc(100vh - 32px);overflow:auto}.dds-drilldown-list{display:grid;gap:6px}.dds-drilldown-row{display:grid;grid-template-columns:110px 130px minmax(0,1fr) auto;gap:12px;align-items:center;min-height:58px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);text-align:left;cursor:pointer}.dds-drilldown-row:hover{border-color:#91c7cd;background:#f7fbfb}.dds-drilldown-row small{color:var(--muted)}
.article-column-actions{display:flex;align-items:center;gap:7px}.article-group-block{display:grid;gap:8px}.article-group-block>header{display:flex;align-items:center;justify-content:space-between;padding:9px 10px;border-bottom:1px solid var(--line);background:#f6f9f9}.article-group-block>header span{color:var(--muted);font-size:12px}.article-create-dialog{width:min(920px,calc(100vw - 28px));max-height:calc(100vh - 32px);overflow:auto}.article-create-form{display:grid;gap:16px}.article-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding:12px;border:1px solid var(--line);border-radius:12px}.article-choice-grid legend{padding:0 6px;font-weight:800}.article-choice{display:flex;align-items:flex-start;gap:9px;min-height:72px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer}.article-choice:has(input:checked){border-color:#5eb6c0;background:#effafb}.article-choice input{margin-top:3px}.article-choice span{display:grid;gap:4px}.article-choice small{color:var(--muted);line-height:1.35}
@media(max-width:720px){.operation-bulk-toolbar{top:56px;display:grid;grid-template-columns:1fr 1fr}.operation-bulk-toolbar strong,.operation-bulk-toolbar .text-button{grid-column:1/-1}.operations-table-panel .mobile-cards .operation-select-cell{display:block;position:absolute;top:12px;right:12px;width:auto}.operation-row{position:relative}.operation-date-with-plan{padding-right:32px}.calendar-account-picker{grid-column:1/-1}.calendar-account-picker>summary{justify-content:center}.calendar-day-dialog>header{display:grid}.calendar-day-dialog>header .hero-actions{display:grid;grid-template-columns:1fr 1fr}.dds-view-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.dds-view-tabs .segmented{min-height:44px}.dds-drilldown-row{grid-template-columns:1fr auto}.dds-drilldown-row span:nth-of-type(2),.dds-drilldown-row small{grid-column:1/-1}.article-column-actions{display:grid;grid-template-columns:1fr}.article-choice-grid{grid-template-columns:1fr}.article-create-dialog{padding:18px}.article-create-dialog .form-actions{position:sticky;bottom:-18px;margin:0 -18px -18px;padding:12px 18px;background:#fff;border-top:1px solid var(--line)}}
@media(max-width:720px){.dds-filter .check{justify-content:flex-start;width:100%}.dds-filter .check input{flex:0 0 20px;width:20px;height:20px;min-height:20px;margin:0}}

/* R15b — Owner daily-finance interaction parity */
.page-intro-compact{padding-bottom:6px}.page-intro-compact h2{font-size:20px;margin-bottom:3px}
.compact-close{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;border-radius:8px!important;font-size:21px!important}
.transfer-amount-pair{display:grid;gap:2px;justify-items:end}.transfer-amount-pair .positive{color:#16835f}.transfer-amount-pair .negative{color:#b94949}
.transfer-route{display:grid;grid-template-columns:1fr auto 1fr;gap:14px;align-items:center;margin:18px 0}.transfer-route article{display:grid;gap:6px;padding:16px;border:1px solid var(--line);border-radius:12px;background:#f8fbfb}.transfer-route article small{color:var(--muted)}.transfer-route article span{font-size:18px;font-weight:800}.transfer-route>b{color:var(--brand);font-size:24px}
.owner-top-actions{position:relative;display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.header-balance-button{display:flex;align-items:center;gap:9px;min-height:42px;padding:7px 12px;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--ink);cursor:pointer}.header-balance-total{white-space:nowrap}.header-notification,.header-assistant{position:relative;display:grid!important;place-items:center;min-width:42px;min-height:42px}.header-notification>span:first-child{color:#d48a2c;font-size:15px}.header-notification .badge{position:absolute;right:-4px;top:-5px;min-width:20px;height:20px;padding:0 5px;font-size:10px}.header-assistant{color:#fff!important;background:linear-gradient(135deg,#087789,#14a3ad)!important;border:0!important;font-weight:800}.mobile-assistant{display:none!important}
#header-popovers{position:absolute;right:22px;top:66px;z-index:70}.header-popover{width:min(390px,calc(100vw - 28px));max-height:min(520px,calc(100vh - 90px));overflow:auto;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 18px 52px rgba(16,48,54,.2)}.header-popover>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.header-account-popover>button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 14px;width:100%;padding:11px;border:0;border-top:1px solid var(--line);background:#fff;color:var(--ink);text-align:left;cursor:pointer}.header-account-popover>button:hover{background:#f4f9fa}.header-account-popover>button small{grid-column:1/-1;color:var(--muted)}.header-notification-popover{display:grid;gap:12px}
.account-groups{display:grid;gap:16px}.account-group{border:1px solid var(--line);border-radius:15px;background:#fff;overflow:hidden}.account-group>header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;background:#f5f9f9}.account-group h3{margin:2px 0 0;font-size:17px}.account-group-list{display:grid}.account-list-row{display:grid;grid-template-columns:minmax(260px,1.4fr) minmax(180px,.8fr) auto;gap:16px;align-items:center;min-height:76px;padding:12px 16px;border:0;border-top:1px solid var(--line);background:#fff;color:var(--ink);text-align:left;cursor:pointer}.account-list-row:hover{background:#f7fbfb}.account-list-row.needs-mapping{box-shadow:inset 3px 0 0 #d99732}.account-list-identity{display:flex;align-items:center;gap:12px;min-width:0}.account-list-identity>span:last-child,.account-list-balance{display:grid;gap:4px;min-width:0}.account-list-identity strong,.account-list-identity small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-list-identity small,.account-list-balance small{color:var(--muted)}.account-list-balance{text-align:right}.account-detail-balance{display:grid;gap:5px;padding:18px;border-radius:13px;background:#eef8f9}.account-detail-balance>span,.account-detail-balance>small{color:var(--muted)}.account-detail-balance>strong{font-size:28px}.provider-choice-grid{display:grid;gap:10px;margin-top:16px}.provider-choice-grid>button{display:flex;align-items:center;gap:14px;min-height:66px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);text-align:left;cursor:pointer}.provider-choice-grid>button:hover{border-color:#75bfc8;background:#f5fbfb}.provider-choice-grid small{margin-left:auto;color:var(--muted)}
.calendar-settings-dialog{width:min(620px,calc(100vw - 28px))}.settings-toggle-list{display:grid;gap:8px}.settings-toggle-list>label{display:flex;align-items:flex-start;gap:12px;padding:13px;border:1px solid var(--line);border-radius:11px}.settings-toggle-list input{width:20px;height:20px;min-height:20px;margin-top:2px}.settings-toggle-list span{display:grid;gap:3px}.settings-toggle-list small{color:var(--muted);line-height:1.4}.calendar-settings-button{margin-left:auto}.calendar-account-filter-option>span>span{display:grid;gap:2px}.calendar-account-filter-option small{color:var(--muted)}
.dds-total-button{width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:800;text-align:inherit;cursor:pointer}.dds-total-button:hover{text-decoration:underline}.dds-transfer-row[role="button"]{cursor:pointer}.dds-transfer-row[role="button"]:hover td,.dds-transfer-row[role="button"]:hover th{background:#eef7f8!important}

/* Users/RBAC V1: follows the established product shell and collapses to cards. */
.users-page{--user-accent:#0f766e}.user-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}.user-summary-grid article{background:#fff;border:1px solid var(--line,#dfe7e6);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:5px;box-shadow:0 4px 18px rgba(19,45,48,.04)}.user-summary-grid strong{font-size:26px;color:#153c3d}.user-summary-grid span{font-size:12px;color:#647475}.user-list-panel{padding:0;overflow:hidden}.user-list-panel table{margin:0}.user-row td:first-child>span:last-child{display:inline-flex;flex-direction:column;gap:3px;vertical-align:middle}.user-avatar{display:inline-grid;place-items:center;width:34px;height:34px;margin-right:10px;border-radius:11px;background:#dff3ef;color:#0f766e;font-weight:800;vertical-align:middle}.role-badge,.user-status{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:800;letter-spacing:.02em}.role-owner{background:#dceeee;color:#0b5552}.role-admin{background:#e8e7ff;color:#4f46a5}.role-manager{background:#e7f0ff;color:#245a9b}.role-viewer{background:#f0f2f3;color:#58686a}.role-codex_qa{background:#fff2cc;color:#815d00}.user-status-active{background:#dcf5e8;color:#13734d}.user-status-invited{background:#fff1cf;color:#8b6400}.user-status-blocked{background:#fde3e1;color:#a33931}.user-drawer-backdrop{position:fixed;inset:0;z-index:90;background:rgba(9,30,32,.42);display:flex;justify-content:flex-end}.user-drawer{width:min(720px,100%);height:100%;overflow:auto;background:#f8fbfa;padding:28px;box-shadow:-16px 0 44px rgba(7,34,36,.18)}.user-drawer>header{padding-right:48px;margin-bottom:18px}.user-drawer>header h2{margin:5px 0}.user-edit-form>.form-grid{background:#fff;border:1px solid var(--line,#dfe7e6);border-radius:16px;padding:18px}.permission-matrix{margin:16px 0;background:#fff;border:1px solid var(--line,#dfe7e6);border-radius:16px;padding:15px}.permission-matrix>summary{cursor:pointer;font-weight:800}.permission-matrix>summary span{float:right}.permission-group{margin-top:18px}.permission-group h4{margin:0 0 8px;color:#506364}.permission-row{display:grid;grid-template-columns:minmax(160px,1fr) repeat(3,minmax(100px,130px));gap:8px;align-items:end;padding:10px 0;border-top:1px solid #edf1f0}.permission-row>span{display:flex;flex-direction:column}.permission-row label{font-size:10px;color:#677}.permission-row select{margin-top:3px}.user-audit{margin-top:24px}.user-audit article{display:grid;grid-template-columns:1fr auto;gap:3px 12px;padding:10px 0;border-bottom:1px solid #e6edeb}.user-audit small{grid-column:1/-1}.danger{color:#b23a32!important}
@media(max-width:900px){.user-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.user-drawer{padding:22px 16px}.permission-row{grid-template-columns:1fr}.permission-row label{display:grid;grid-template-columns:76px 1fr;align-items:center}.permission-row select{margin-top:0}}
@media(max-width:560px){.user-summary-grid{grid-template-columns:1fr 1fr;gap:8px}.user-summary-grid article{padding:13px}.user-summary-grid strong{font-size:21px}.user-drawer{width:100%;padding-top:max(20px,env(safe-area-inset-top))}.users-page .page-intro{align-items:flex-start}.users-page .page-intro .button{width:100%}.user-list-panel .user-row td:first-child{padding-top:16px}.user-list-panel .user-row td:last-child{padding-bottom:16px}}
.permission-row{grid-template-columns:minmax(160px,1fr);align-items:start}.permission-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.permission-actions label{min-width:0}.permission-actions select{width:100%}.permission-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.access-preview{display:flex;flex-direction:column;gap:4px;margin:12px 0;padding:12px;border-radius:12px;background:#eef8f5;color:#245253}.access-preview span{font-size:12px}.users-page .user-list-panel table{min-width:1080px}
@media(max-width:900px){.permission-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.users-page .user-list-panel table{min-width:0}}
@media(max-width:560px){.permission-actions{grid-template-columns:1fr}.permission-toolbar .button{width:100%}}
.import-template-note{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:10px 0;padding:11px 13px;border:1px solid var(--line);border-radius:10px;background:#f7fbfb;color:var(--muted);font-size:12px}
.operation-filter-shell>summary{cursor:pointer}.operations-page .operation-filter-shell:not([open]){margin-bottom:10px}

@media(max-width:720px){
  .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.owner-top-actions{gap:5px}.header-balance-button{min-width:42px;padding:6px 9px}.header-balance-total{display:none}.header-notification,.header-assistant{min-width:40px;min-height:40px}.top-title>div{min-width:0}
  #header-popovers{position:fixed;left:10px;right:10px;top:62px}.header-popover{width:100%;max-height:calc(100vh - 150px)}
  .transfer-route{grid-template-columns:1fr}.transfer-route>b{transform:rotate(90deg);justify-self:center}.transfer-route article{min-width:0}
  .account-list-row{grid-template-columns:1fr auto;gap:8px 10px;padding:13px}.account-list-balance{grid-column:1/-1;text-align:left}.account-list-row>.status-pill{position:absolute;right:12px;top:12px}.account-list-row{position:relative;padding-right:90px}.account-list-identity{align-items:flex-start}.account-group>header{padding:12px}
  .account-detail-balance>strong{font-size:23px}.provider-choice-grid>button{display:grid;grid-template-columns:1fr}.provider-choice-grid small{margin-left:0}
  .calendar-settings-button{margin-left:0}.settings-toggle-list>label{min-height:64px}.import-template-note{align-items:flex-start;flex-direction:column}
  .transfer-amount-pair{justify-items:start}.operations-table-panel .mobile-cards td[data-label="Сумма"]{align-items:flex-start}
  .dds-report-wrap{overflow-x:auto}.dds-report-table{min-width:760px}.dds-drilldown-dialog{width:calc(100vw - 16px);max-height:calc(100vh - 16px)}
}

/* Owner QA repair: truthful provider identity and touch-accessible help. */
.provider-text-fallback{display:inline-flex;align-items:center;min-height:32px;padding:5px 9px;border:1px solid #d9e5e7;border-radius:9px;background:#fff;color:#20363a;font-weight:780;box-shadow:none}
.provider-text-fallback:not(.provider-cash) .provider-mark{display:none}
.provider-text-fallback .provider-name{white-space:nowrap;overflow:visible;text-overflow:clip}
.provider-text-fallback.provider-tbank,.provider-text-fallback.provider-sber,.provider-text-fallback.provider-wb,.provider-text-fallback.provider-ozon,.provider-text-fallback.provider-yandex{background:#fff;color:#20363a}
.provider-mark-neutral{min-width:28px;height:26px;background:#e9f5f2!important;color:#075e45!important;font-size:14px!important}
.help{position:relative;z-index:2}
.help .help-popover{position:absolute;left:50%;top:calc(100% + 8px);z-index:220;width:min(270px,calc(100vw - 32px));display:none;padding:11px 12px;border:1px solid #b8d7da;border-radius:10px;background:#153b41;color:#fff;font-size:12px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;box-shadow:0 14px 34px rgba(8,37,42,.2);transform:translateX(-50%)}
.help-popover strong{display:block;margin-bottom:4px;font-size:12px}
.help[aria-expanded="true"] .help-popover{display:block}
.kpi-card{overflow:visible}.kpi-card:has(.help[aria-expanded="true"]){z-index:25}
.operations-completeness{margin-bottom:12px}
.operation-filter-reset{align-self:end;white-space:nowrap}
@media(max-width:720px){.help .help-popover{position:fixed;left:16px;right:16px;top:auto;bottom:calc(82px + env(safe-area-inset-bottom));width:auto;transform:none}.provider-text-fallback{max-width:100%}.provider-text-fallback .provider-name{white-space:normal}.account-card-identity>.provider-text-fallback{flex:0 1 auto;min-width:0}.account-card-identity>.provider-text-fallback .provider-name,.calendar-account-card .provider-text-fallback .provider-name{display:inline}}
.sku-filter-bar{display:grid;grid-template-columns:minmax(260px,2fr) repeat(2,minmax(180px,1fr));margin-bottom:14px}
.sku-filter-bar label{display:grid;gap:5px;color:var(--muted);font-size:11px;font-weight:700}
.sku-product-table{min-width:1450px}
.product-photo-placeholder{display:grid;width:54px;height:54px;place-items:center;border:1px dashed #c7d7da;border-radius:10px;background:#f7fafb;color:#718489;font-size:9px;line-height:1.2;text-align:center}
.sku-open-button{display:grid;gap:3px;min-width:180px;padding:0;border:0;background:transparent;color:var(--ink);text-align:left;cursor:pointer}
.sku-open-button strong{color:#087789;font-size:13px}.sku-open-button small{color:var(--muted);font-size:11px;white-space:normal}
.sku-detail{max-height:90dvh;overflow:auto}.sku-detail .kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.sku-detail .form-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:720px){.sku-filter-bar{grid-template-columns:1fr}.sku-product-table{min-width:0}.product-photo-placeholder{width:48px;height:48px}.sku-open-button{min-width:0}.sku-detail .kpi-grid{grid-template-columns:1fr}.sku-detail{width:calc(100vw - 18px);max-width:none;max-height:94dvh;padding:18px 14px}.sku-detail .form-actions{display:grid}.sku-detail .form-actions .button{width:100%}}

/* Step 1 Operations: direct editor, balanced geometry, viewport-safe help. */
.operations-table-panel.split-panel{display:block;grid-template-columns:none}
.operations-table-panel .table-panel{border-right:0}
.operation-row{outline:0}
.operation-row:focus-visible{position:relative;z-index:1;box-shadow:inset 0 0 0 3px rgba(8,119,137,.42)}
.operation-row[aria-selected="true"]{background:#eefafb}
.operation-editor-backdrop{z-index:180}
.operation-editor-modal{width:min(960px,100%);max-height:min(92dvh,940px);overflow-x:hidden;padding:26px}
.operation-editor-header{display:grid;gap:5px;padding-right:52px}
.operation-editor-header h2{margin:0;font-size:24px;letter-spacing:-.02em}
.operation-editor-header p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}
.operation-editor-summary{display:grid;grid-template-columns:190px minmax(0,1fr);gap:16px;margin:18px 0 14px;padding:16px;border:1px solid #d9e6e8;border-radius:14px;background:#f7fbfb}
.operation-editor-amount{display:grid;align-content:center;gap:7px;padding:4px 14px 4px 0;border-right:1px solid #d8e6e8}
.operation-editor-amount span,.operation-context-grid dt{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.045em;text-transform:uppercase}
.operation-editor-amount strong{font-size:25px;line-height:1.1;overflow-wrap:anywhere}
.operation-context-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;margin:0;min-width:0}
.operation-context-grid>div{display:grid;align-content:start;gap:4px;min-width:0}
.operation-context-grid .wide-context{grid-column:1/-1}
.operation-context-grid dd{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--ink);font-size:13px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;word-break:break-word}
.operation-context-grid .wide-context dd{display:block;max-height:76px;overflow:auto;font-weight:600}
.operation-context-grid .provider-identity{flex:0 0 auto}
.operation-editor-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;margin-top:14px}
.operation-editor-form>label{min-width:0}
.operation-editor-form .field-label{display:flex;align-items:center;min-height:24px;gap:5px}
.operation-editor-form .field-label .help{position:relative;width:26px;min-width:26px;height:26px;min-height:26px;margin:0}
.operation-editor-form .field-label .help::after{content:"";position:absolute;inset:-9px;border-radius:50%}
.operation-editor-form input:not([type="checkbox"]):not([type="radio"]),.operation-editor-form select{height:44px;min-height:44px;min-width:0;overflow:hidden;text-overflow:ellipsis}
.operation-editor-form .check{display:flex;align-items:center;min-height:44px;gap:10px;padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:#fbfdfd;font-size:13px}
.operation-editor-form .check input{flex:0 0 auto;width:20px;height:20px;min-height:20px}
.operation-save-mode{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding:12px;border:1px solid var(--line);border-radius:10px}
.operation-save-mode legend{padding:0 6px;color:#384652;font-size:12px;font-weight:800}
.operation-save-mode .radio{display:flex;align-items:center;min-height:44px;gap:9px;padding:8px 10px;border:1px solid #e0eaec;border-radius:8px;background:#fff;font-size:13px}
.operation-save-mode input{flex:0 0 auto;width:18px;height:18px;min-height:18px}
.operation-extended-workspace{display:grid;gap:10px;margin-top:16px}
.operation-extended-workspace .owner-workspace{margin:0}
.operation-technical-details{margin-top:14px}
.operation-technical-details .audit-grid dd{overflow-wrap:anywhere;word-break:break-all}
.help-overlay{position:fixed;right:20px;bottom:20px;z-index:1000;display:block;width:max-content;max-width:min(320px,calc(100vw - 24px));height:auto!important;min-height:0!important;max-height:min(240px,calc(100vh - 24px));overflow:auto;padding:11px 13px;border:1px solid #9ac4c9;border-radius:10px;background:#153b41;color:#fff;font-size:13px;font-weight:550;line-height:1.45;text-align:left;white-space:normal;box-shadow:0 16px 40px rgba(8,37,42,.28);pointer-events:none}
.help-overlay[hidden]{display:none}
.help[aria-expanded="true"]{border-color:#087789;background:#eaf7f8}
.help .help-popover{display:none!important}

@media(max-width:720px){
  .operation-editor-backdrop{align-items:end;padding:0}
  .operation-editor-modal{width:100%;max-width:none;max-height:calc(100dvh - 4px);padding:20px 16px max(26px,env(safe-area-inset-bottom));border-radius:20px 20px 0 0}
  .operation-editor-header{padding-right:48px}
  .operation-editor-header h2{font-size:21px;line-height:1.2}
  .operation-editor-summary{grid-template-columns:1fr;gap:12px;margin-top:16px;padding:13px}
  .operation-editor-amount{padding:0 0 12px;border-right:0;border-bottom:1px solid #d8e6e8}
  .operation-editor-amount strong{font-size:23px}
  .operation-context-grid{grid-template-columns:1fr;gap:10px}
  .operation-context-grid .wide-context{grid-column:auto}
  .operation-context-grid dd{font-size:14px}
  .operation-context-grid .wide-context dd{max-height:92px}
  .operation-editor-form{grid-template-columns:1fr;gap:12px}
  .operation-editor-form .field-label{min-height:34px;font-size:13px}
  .operation-save-mode{grid-template-columns:1fr}
  .operation-editor-form .form-actions{display:grid;grid-template-columns:1fr}
  .operation-editor-form .form-actions .button{width:100%}
  .operation-extended-workspace{margin-top:12px}
  .help-overlay{font-size:13px}
}

/* ADesk-inspired interaction mechanics, implemented independently in Direction A. */
.operation-drawer{position:absolute;inset:0 0 0 auto;width:min(720px,94vw);height:100%;max-height:none;overflow:auto;border-radius:20px 0 0 20px;padding:28px 28px 42px;box-shadow:-24px 0 70px rgba(8,37,42,.24)}
.operation-editor-modal.operation-drawer{width:min(820px,96vw);max-height:none}
.article-directory-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.article-mobile-switch{display:none}.moysklad-finance-articles .article-mobile-switch,.article-mapping-workspace .article-mobile-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:520px}
.article-directory-columns>div{display:grid;gap:12px;min-width:0}
.article-column-header{display:grid;gap:6px;padding:17px 18px;border:1px solid var(--line);border-radius:14px;background:#fff}
.article-column-header>div{display:flex;align-items:center;justify-content:space-between;gap:12px}
.article-column-header strong{font-size:20px}.article-column-header span{font-size:12px;font-weight:800;color:var(--muted)}
.article-column-header p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}
.article-column-header.income{border-top:4px solid #21a875}.article-column-header.expense{border-top:4px solid #d76464}
.article-guide{padding:15px 17px;border:1px solid #cfe0e2;border-radius:12px;background:#f7fbfb;color:#29474c}
.article-guide>strong{font-size:14px}.article-guide ul{display:grid;gap:6px;margin:10px 0;padding-left:19px}.article-guide li,.article-guide p{font-size:12px;line-height:1.45}.article-guide p{margin:8px 0 0;color:var(--muted)}
.article-card-list{display:grid;gap:10px}.article-card{border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}.article-card.archived{opacity:.72}
.article-card>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:62px;padding:12px 14px;cursor:pointer;list-style:none}.article-card>summary::-webkit-details-marker{display:none}.article-card>summary>span{display:grid;gap:4px;min-width:0}.article-card>summary strong{font-size:14px;overflow-wrap:anywhere}.article-card>summary small{color:var(--muted);font-size:11px}
.article-card[open]>summary{border-bottom:1px solid var(--line);background:#f8fbfb}.article-description{margin:14px;color:#435b60;font-size:13px;line-height:1.5}
.article-semantics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:14px}.article-semantics>div{min-width:0;padding:10px;border:1px solid #e4edef;border-radius:8px;background:#fbfdfd}.article-semantics dt{color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}.article-semantics dd{margin:4px 0 0;font-size:12px;font-weight:700;overflow-wrap:anywhere}
.article-card .compact-form,.article-mapping{margin:14px;padding:14px;border:1px solid #e0eaec;border-radius:10px;background:#fbfdfd}.article-mapping{display:grid;gap:9px}.article-mapping p{margin:0;font-size:12px;overflow-wrap:anywhere}
.article-mapping-workspace{display:grid;gap:16px;margin-top:16px}.mapping-card-list{display:grid;gap:10px}.mapping-card{display:grid;gap:11px;padding:15px;border:1px solid var(--line);border-radius:13px;background:#fff}.mapping-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.mapping-card>header>div{display:grid;gap:4px;min-width:0}.mapping-card>header strong{overflow-wrap:anywhere}.mapping-card>header small{color:var(--muted);font-size:11px}.mapping-card>p{margin:0;color:var(--muted);font-size:12px}.mapping-link{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:center;padding:11px;border:1px solid #cfe0e2;border-radius:10px;background:#f7fbfb}.mapping-link span{min-width:0;overflow-wrap:anywhere}.mapping-link b{color:var(--brand)}
.article-create-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.8fr);gap:18px}.article-create-panel textarea,.article-card textarea{width:100%;resize:vertical}
.dds-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.dds-column.income{border-top:4px solid #21a875}.dds-column.expense{border-top:4px solid #d76464}.dds-column td small{display:block;margin-top:4px;color:var(--muted);font-size:11px}.dds-filter .check{align-self:end;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:#fff}

@media(max-width:960px){.article-directory-columns,.dds-columns,.article-create-layout{grid-template-columns:1fr}}
@media(max-width:720px){
  .operation-drawer,.operation-editor-modal.operation-drawer{position:absolute;inset:auto 0 0;width:100%;height:auto;max-height:calc(100dvh - 4px);padding:20px 16px max(28px,env(safe-area-inset-bottom));border-radius:20px 20px 0 0}
  .article-mobile-switch{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:sticky;top:58px;z-index:12;padding:8px;background:rgba(245,249,250,.96);backdrop-filter:blur(10px)}
  .article-directory-columns{gap:14px}.article-directory-column:not(.mobile-selected){display:none}.article-guide{padding:13px}.article-semantics{grid-template-columns:1fr}.article-card .compact-form,.article-mapping{margin:10px;padding:11px}
  .mapping-card{padding:12px}.mapping-card>header{display:grid}.mapping-link{grid-template-columns:1fr;text-align:left}.mapping-link b{transform:rotate(90deg);justify-self:start}.article-mapping-workspace .form-actions{display:grid}.article-mapping-workspace .form-actions .button{width:100%}
  .dds-columns{gap:12px}.dds-filter{grid-template-columns:1fr}.operations-page .hero-actions{display:grid;grid-template-columns:1fr 1fr}.operations-page .hero-actions .button:last-child{grid-column:1/-1}
}

/* R14 Owner repair: searchable masters, unified operations and source-backed charts. */
.searchable-select-field{display:grid;align-content:start;gap:6px;min-width:0}.searchable-select-field>[type="search"]{height:38px;min-height:38px;border-style:dashed;background:#fbfdfd}.searchable-select-field select{min-width:0}.searchable-select-field>[data-searchable-select-count]{min-height:14px;color:var(--muted);font-size:10px}.operation-kind{display:inline-flex;align-items:center;min-height:27px;padding:4px 8px;border:1px solid var(--line);border-radius:999px;font-size:10px;font-weight:850;white-space:nowrap}.operation-kind.fact{border-color:#abd5da;background:#edf8f9;color:#087789}.operation-kind.plan{border-color:#dbc78b;background:#fff9e9;color:#8b6917}.operation-kind.transfer{border-color:#c8bfdc;background:#f7f3fc;color:#665182}.planned-row{background:#fffdf7}.plan-confirm-control.planned{border-color:#dbc78b;background:#fff9e9;color:#8b6917;cursor:default}.transfer-action{border-color:#c8bfdc;background:#f7f3fc;color:#665182}.operation-bulk-toolbar{position:static;flex-wrap:wrap}.operation-import-dialog{max-height:calc(100dvh - 32px);overflow:auto}.file-drop{display:grid;gap:8px;margin:14px 0;padding:18px;border:1px dashed #9fc6cb;border-radius:12px;background:#f8fbfb}.file-drop input{min-height:44px}.import-mapping{grid-template-columns:repeat(3,minmax(0,1fr))}.operation-import-dialog .table-wrap{max-height:260px;margin:14px 0;border:1px solid var(--line);border-radius:10px}.operation-import-dialog table{min-width:700px}
.chart-card{display:grid;gap:14px;padding:18px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 5px 18px rgba(24,57,62,.035)}.chart-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.chart-card h3{margin:3px 0 4px;font-size:17px}.chart-card p{margin:0;color:var(--muted);font-size:12px}.chart-legend{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px 14px;color:var(--muted);font-size:11px}.chart-legend span{display:flex;align-items:center;gap:6px}.legend-line{display:inline-block;width:22px;height:3px;border-radius:999px}.legend-line.balance{background:#087789}.legend-line.minimum{height:0;border-top:2px dashed #d58627}.legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%}.legend-dot.gap{background:#c84848}.legend-bar{display:inline-block;width:9px;height:14px;border-radius:3px}.legend-bar.in{background:#21a875}.legend-bar.out{background:#d76464}.legend-bar.plan{opacity:.45}.chart-scroll{width:100%;overflow-x:auto}.finance-chart{display:block;width:100%;min-width:560px;height:auto;overflow:visible}.chart-axis,.chart-grid{stroke:#dbe6e8;stroke-width:1}.chart-threshold{stroke:#d58627;stroke-width:1.5;stroke-dasharray:7 6}.balance-line{stroke:#087789;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.balance-point{fill:#fff;stroke:#087789;stroke-width:2}.gap-point{fill:#c84848;stroke:#fff;stroke-width:2}.chart-x-label,.chart-y-label{fill:#718489;font-size:10px}.chart-empty{display:grid;place-items:center;gap:5px;min-height:144px;padding:24px;border:1px dashed #cbdadc;border-radius:12px;background:#fafcfc;color:var(--muted);text-align:center}.chart-empty strong{color:var(--ink)}.dds-flow-switch{display:flex;flex-wrap:wrap;gap:6px}.flow-chart{min-height:226px}.flow-chart-svg{min-width:720px}.flow-bar-rect.in{fill:#21a875}.flow-bar-rect.out{fill:#d76464}.flow-bar-rect.plan{opacity:.45}.flow-bar-rect:hover{filter:brightness(.9)}
@media(max-width:900px){.import-mapping{grid-template-columns:1fr 1fr}.chart-card>header{display:grid}.chart-legend{justify-content:flex-start}}
@media(max-width:720px){
  .operations-page .hero-actions{grid-template-columns:1fr 1fr}.operations-page .hero-actions .button:nth-child(3){grid-column:1/-1}.operations-page .hero-actions .button:nth-child(4),.operations-page .hero-actions .button:nth-child(5){grid-column:auto}
  .operation-bulk-toolbar{display:grid;grid-template-columns:1fr 1fr}.operation-bulk-toolbar strong,.operation-bulk-toolbar .text-button{grid-column:1/-1}.import-mapping{grid-template-columns:1fr}.operation-import-dialog .form-actions{display:grid}.operation-import-dialog .form-actions .button{width:100%}
  .help-overlay{right:12px;bottom:84px}.chart-card{padding:14px}.chart-card>header{gap:10px}.chart-legend{display:grid;grid-template-columns:1fr 1fr}.finance-chart{min-width:620px}.dds-flow-switch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.dds-flow-switch .segmented{min-width:0;padding-inline:6px}.flow-chart{margin-inline:-4px}
  .calendar-primary{overflow-x:auto}.calendar-board.month-grid{grid-template-columns:repeat(7,118px);min-width:850px}.calendar-weekdays{grid-template-columns:repeat(7,118px);min-width:850px}.calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:126px}.calendar-account-picker>div{position:fixed;left:12px;right:12px;bottom:calc(78px + env(safe-area-inset-bottom));width:auto;max-height:55dvh;margin:0}
}
.chart-toggle-shell { display:grid; gap:8px; }
.chart-visibility-control { display:flex; justify-content:flex-end; }
.button.compact { min-height:34px; padding:6px 10px; font-size:12px; }
@media (max-width:720px) { .chart-visibility-control .button { width:100%; min-height:44px; } }

/* R15b4: important Russian page titles wrap on mobile instead of ellipsis clipping. */
@media(max-width:720px){
  .top-title h1{max-width:150px;overflow:visible;text-overflow:clip;white-space:normal;font-size:16px;line-height:1.08}
}

/* Owner corrections: daily cash presentation, ADesk-style editors and compact mobile. */
.header-notification #notification-icon,.header-notification #notification-icon svg{display:block;width:20px;height:20px}.header-notification .badge[hidden]{display:none}
.header-account-hint{margin:0 0 8px;color:var(--muted);font-size:12px}.header-account-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 4px;border-top:1px solid var(--line)}.header-account-row>label{display:flex;align-items:center;gap:10px;min-width:0}.header-account-row input{width:19px;height:19px;accent-color:var(--brand)}.header-account-row label span{display:grid;min-width:0}.header-account-row small{color:var(--muted)}
.searchable-select-field{position:relative}.searchable-select-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:42px;padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.searchable-select-trigger::after{content:'⌄';color:var(--muted)}.searchable-select-menu{position:absolute;left:0;right:0;top:100%;z-index:220;margin-top:5px;padding:8px;border:1px solid var(--line);border-radius:11px;background:#fff;box-shadow:var(--shadow)}.searchable-select-menu[hidden]{display:none}.searchable-select-menu>[type="search"]{display:block!important;width:100%;min-height:40px;margin-bottom:7px}.searchable-select-menu>select{display:none!important}.searchable-select-options{display:grid;gap:2px;max-height:260px;overflow:auto}.searchable-select-option-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}.searchable-select-option{min-height:40px;padding:8px;border:0;border-radius:8px;background:transparent;color:var(--ink);text-align:left;cursor:pointer}.searchable-select-option:hover,.searchable-select-option.selected{background:#eef7f8}.searchable-option-help{width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important}
.bank-import-warning{margin-top:12px}.scissors-button{display:inline-flex!important;align-items:center;gap:7px}.scissors-button svg{width:17px;height:17px}.recognition-workspace{display:grid;gap:12px}.recognition-toggle{display:flex!important;align-items:flex-start;gap:10px}.recognition-toggle span{display:grid;gap:3px}.recognition-toggle small{color:var(--muted)}
.page-intro-compact{margin-top:0;padding-top:0}.page-intro-compact>div>p{margin-top:0}.positive{color:#16835f!important}.negative{color:#b94949!important}.dds-section-row.income .amount,.dds-section-row.income .amount *{color:#16835f}.dds-section-row.expense .amount,.dds-section-row.expense .amount *{color:#b94949}.dds-filter .check{min-height:40px;padding:8px 10px;font-size:12px}.dds-filter .check input{flex:0 0 17px;width:17px;height:17px;min-height:17px}
.calendar-period-picker{position:relative;display:inline-grid}.calendar-period-picker>.button{text-transform:capitalize}.calendar-period-picker>input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.calendar-account-quick{display:flex;justify-content:space-between;gap:8px;padding:4px 5px 8px;border-bottom:1px solid var(--line)}.calendar-day.current-date{border:2px solid #087789!important;background:#eff9fa}.calendar-day.current-date>header>strong{display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:#087789;color:#fff}.calendar-toolbar{align-items:center}.calendar-toolbar>.calendar-period-picker{min-width:170px}
.account-profile-list{display:grid;gap:8px}.account-profile-card{border:1px solid var(--line);border-radius:11px;background:#fff}.account-profile-card>summary{display:flex;justify-content:space-between;gap:12px;align-items:center;min-height:56px;padding:10px 13px;cursor:pointer}.account-profile-card>summary>span{display:grid}.account-profile-card>summary small{color:var(--muted)}.account-profile-card form{margin:0 12px 12px;padding:12px;border-radius:10px;background:#f8fbfb}.account-groups-admin,.account-mapping-merged{display:grid;gap:10px}.account-mapping-merged .workspace-card{box-shadow:none}.audit-page .text-button{padding:0}.audit-page table td{vertical-align:middle}
.account-detail-editor{display:grid;gap:12px;padding:14px;border:1px solid var(--line);border-radius:13px;background:#f8fbfb}.account-detail-editor h3{margin:0;font-size:16px}.account-detail-requisites{grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:0;background:transparent}.account-group-admin-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end;padding:10px 0;border-top:1px solid var(--line)}.account-group-edit-form{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(240px,1.2fr) auto auto;gap:10px;align-items:end}.account-group-edit-form label{min-width:0}.account-group-edit-form input{width:100%}
@media(max-width:720px){
  .operation-editor-form .form-actions{grid-template-columns:1fr 1fr}.operation-editor-form .form-actions [data-form-result]{grid-column:1/-1}.searchable-select-menu{position:fixed;left:12px;right:12px;top:auto;bottom:calc(76px + env(safe-area-inset-bottom));max-height:60dvh}.searchable-select-options{max-height:45dvh}.searchable-select-option{min-height:46px}
  .calendar-primary{overflow:visible}.calendar-board.month-grid,.calendar-weekdays{grid-template-columns:repeat(7,minmax(0,1fr));min-width:0}.calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:64px}.calendar-toolbar{grid-template-columns:44px minmax(0,1fr) 44px}.calendar-toolbar>.calendar-period-picker{min-width:0}.calendar-toolbar>.calendar-period-picker .button{width:100%;min-width:0}.calendar-account-picker,.calendar-settings-button{grid-column:1/-1}.calendar-account-picker>div{position:fixed}.calendar-day.current-date>header>strong{width:23px;height:23px}.account-profile-card form,.account-detail-requisites{grid-template-columns:1fr}.account-admin-panel,.account-groups-admin,.account-mapping-merged{padding:13px}.account-group-admin-row{grid-template-columns:1fr}.account-group-edit-form{grid-template-columns:1fr}.header-account-row{grid-template-columns:1fr}.header-account-row>.text-button{justify-self:start;margin-left:29px}
  .dds-report-wrap{overflow-x:auto}.dds-report-table{min-width:720px}
}

/* R16f final cascade: amount-only DDS semantics and text-sized help. */
.dds-section-row.income th,.dds-section-row.expense th{
  background:#f5f9f9!important;
  color:var(--ink)!important;
}
.help-overlay{
  right:auto!important;
  bottom:auto!important;
  width:fit-content!important;
  min-width:0!important;
  max-width:min(320px,calc(100vw - 20px))!important;
}

/* Final daily-finance cascade. */
@media(min-width:721px){
  .calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:150px!important}
}
@media(max-width:720px){
  .calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:68px!important}
  .operation-editor-form{grid-template-columns:1fr!important}
}

/* R17b corrections: typed parties, source detail cards, DDS sections and denser calendar cells. */
.operation-entry-form{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.operation-entry-form>label,.operation-entry-form>.party-picker-field,.operation-entry-form>.searchable-select-field{min-width:0}
.party-picker-field{display:grid;gap:5px;min-width:0}.party-inline-create{justify-self:start;padding:0;font-size:11px}
.party-editor-dialog,.party-detail-dialog,.entity-detail-dialog{width:min(760px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.entity-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:16px 0}.entity-detail-grid>div{min-width:0;padding:11px;border:1px solid var(--line);border-radius:10px;background:#f8fbfb}.entity-detail-grid dt{color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}.entity-detail-grid dd{margin:5px 0 0;font-size:13px;font-weight:700;line-height:1.4;overflow-wrap:anywhere}.entity-detail-grid .wide-field{grid-column:1/-1}
.clickable-row{cursor:pointer}.clickable-row:hover{background:#f4f9f9}.clickable-row:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
.party-operation-list{display:grid;gap:8px;margin:16px 0}.party-operation-row{display:grid;grid-template-columns:110px 140px minmax(0,1fr);gap:12px;align-items:center;width:100%;min-height:44px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);text-align:left;cursor:pointer}.party-operation-row:hover,.party-operation-row:focus-visible{border-color:#74c8cd;background:#f1f9f9;outline:0}.party-operation-row strong{font-variant-numeric:tabular-nums}.party-operation-row span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dds-section-collapse{display:flex;align-items:center;gap:7px;width:100%;min-height:38px;padding:0;border:0;background:transparent;color:var(--ink);font:inherit;font-weight:850;text-align:left;cursor:pointer}.dds-section-row.collapsed .dds-section-collapse{color:var(--muted)}
.calendar-day-flows{display:grid;gap:4px}.calendar-day-flow{display:grid;gap:1px;width:100%;min-width:0;padding:5px 6px;border:0;border-left:3px solid;border-radius:6px;text-align:left;cursor:pointer}.calendar-day-flow span{color:var(--muted);font-size:8px;font-weight:700}.calendar-day-flow strong{min-width:0;font-size:10px}.calendar-day-flow strong b{font:inherit}.calendar-day-flow.income{border-color:#21a875;background:#eff9f4;color:#16835f}.calendar-day-flow.expense{border-color:#d76464;background:#fff4f4;color:#b94949}.calendar-money-compact{display:none}.day-closing-balance{display:flex;align-items:flex-end;justify-content:space-between;gap:4px;margin-top:auto;padding-top:7px;border-top:1px dashed #dbe5e7;color:var(--muted)}.day-closing-balance small{font-size:8px}.day-closing-balance span{font-size:9px;font-weight:750}.day-closing-balance span b{font:inherit}
@media(max-width:720px){
  .operation-entry-form{grid-template-columns:1fr!important}.party-editor-dialog,.party-detail-dialog,.entity-detail-dialog{position:absolute;inset:auto 0 0;width:100%;max-height:calc(100dvh - 4px);padding:20px 16px max(28px,env(safe-area-inset-bottom));border-radius:20px 20px 0 0}.entity-detail-grid{grid-template-columns:1fr}.party-operation-row{grid-template-columns:88px minmax(0,1fr);gap:5px 8px}.party-operation-row span:last-child{grid-column:1/-1;white-space:normal}
  .calendar-board.month-grid .calendar-day,.calendar-month-empty{min-height:92px!important}.calendar-board.month-grid .calendar-day{padding:4px}.calendar-day-flows{gap:2px}.calendar-day-flow{padding:2px 3px;border-left-width:2px;border-radius:4px}.calendar-day-flow span{font-size:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar-day-flow strong{font-size:7px;white-space:nowrap}.calendar-money-full{display:none}.calendar-money-compact{display:inline}.day-closing-balance{padding-top:2px}.day-closing-balance small{display:none}.day-closing-balance span{max-width:100%;font-size:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
.finance-article-picker{display:grid;gap:6px;min-width:0}.finance-article-picker .text-button{justify-self:start}.flat-provider-directory{display:grid;gap:10px}.moysklad-finance-articles .article-card summary small{display:block;color:var(--muted);font-weight:500;margin-top:3px}.moysklad-finance-articles .diagnostic{margin-top:10px}
@media(max-width:640px){.finance-article-picker{grid-column:1/-1}.moysklad-finance-articles .article-card summary{align-items:flex-start}.moysklad-finance-articles .article-card .form-actions{display:grid;grid-template-columns:1fr}.moysklad-finance-articles .article-card .button{width:100%}}

/* Autoscenarios correction: human IF -> THEN cards, guided editor and dry-run. */
.rules-page{display:grid;gap:16px}.rule-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.rule-summary>div{display:grid;gap:3px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff}.rule-summary strong{font-size:24px}.rule-summary span{color:var(--muted);font-size:12px}.rule-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.rule-card{display:grid;gap:14px;min-width:0;padding:16px;border:1px solid var(--line);border-radius:15px;background:#fff;box-shadow:0 7px 22px rgba(28,72,79,.05);cursor:pointer}.rule-card:hover,.rule-card:focus-visible{border-color:#65bec5;box-shadow:0 9px 28px rgba(16,111,122,.12);outline:0}.rule-card>header{display:flex;gap:10px;align-items:center}.rule-card>header>div{display:grid;gap:2px;min-width:0}.rule-card>header strong{font-size:16px}.rule-card>header small,.rule-card>footer>span{color:var(--muted);font-size:11px}.rule-status-dot{width:10px;height:10px;border-radius:50%;background:#aab8bb}.rule-card.active .rule-status-dot{background:#1fa173;box-shadow:0 0 0 4px #e7f7f0}.rule-flow{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:center}.rule-flow>div{align-self:stretch;padding:11px;border-radius:11px;background:#f5f9f9}.rule-flow>div>span{color:#087789;font-size:10px;font-weight:850;letter-spacing:.08em}.rule-flow p{display:grid;gap:4px;margin:7px 0 0}.rule-flow b{font-size:12px;line-height:1.35}.rule-flow small{color:var(--muted)}.rule-flow>i{color:#087789;font-size:20px;font-style:normal}.rule-card>footer{display:flex;justify-content:space-between;gap:10px;align-items:center;border-top:1px solid var(--line);padding-top:12px}.rule-card>footer>div{display:flex;flex-wrap:wrap;gap:6px}.rule-editor-dialog{width:min(980px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}.rule-guided-form{display:grid;gap:14px}.rule-step{display:grid;grid-template-columns:34px minmax(0,1fr);gap:12px;padding:14px;border:1px solid var(--line);border-radius:13px;background:#fbfdfd}.rule-step-no{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#087789;color:#fff;font-weight:850}.rule-step h3{margin:4px 0 10px;font-size:16px}.field-note{margin:0 0 10px;color:var(--muted);font-size:12px}.rule-form-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.rule-dry-run{display:grid;gap:10px;padding:14px;border:1px solid #9fd6da;border-radius:13px;background:#f2fbfb}.rule-dry-run>header{display:flex;justify-content:space-between;gap:10px;align-items:center}.rule-dry-run h3{margin:3px 0}.rule-dry-run p{margin:0;line-height:1.5}.rule-example-list{display:grid;gap:7px}.rule-example-list article{display:grid;grid-template-columns:90px 115px minmax(0,1fr);gap:5px 10px;padding:9px;border-radius:9px;background:#fff}.rule-example-list article small,.rule-example-list article em{grid-column:3}.rule-example-list article em{color:#a24646;font-size:11px}.rule-history{margin-top:16px}.rule-history>summary{font-weight:800;cursor:pointer}.rule-history>button{display:grid;grid-template-columns:150px minmax(0,1fr);gap:3px 12px;width:100%;padding:10px 0;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left;cursor:pointer}.rule-history>button small{grid-column:1/-1;color:var(--muted)}.operation-filter-notice{align-items:center}.operation-filter-notice .button{margin-left:auto}.calendar-coverage-alert{margin-bottom:12px}.moysklad-directory-section>.panel{border:0;box-shadow:none;padding:0}.moysklad-directory-section>.panel>.panel-title{display:none}
@media(max-width:720px){.rule-summary{grid-template-columns:repeat(3,1fr)}.rule-summary>div{padding:10px}.rule-summary strong{font-size:19px}.rule-card-grid{grid-template-columns:1fr}.rule-card{padding:13px}.rule-flow{grid-template-columns:1fr}.rule-flow>i{transform:rotate(90deg);justify-self:center}.rule-card>footer{align-items:flex-start;flex-direction:column}.rule-card>footer>div,.rule-card>footer .button{width:100%}.rule-editor-dialog{position:absolute;inset:auto 0 0;width:100%;max-height:calc(100dvh - 4px);padding:18px 14px max(28px,env(safe-area-inset-bottom));border-radius:20px 20px 0 0}.rule-step{grid-template-columns:28px minmax(0,1fr);padding:11px}.rule-step-no{width:27px;height:27px}.rule-step .form-grid{grid-template-columns:1fr}.rule-form-actions{display:grid;grid-template-columns:1fr}.rule-example-list article{grid-template-columns:80px minmax(0,1fr)}.rule-example-list article b,.rule-example-list article small,.rule-example-list article em{grid-column:1/-1}.operation-filter-notice .button{width:100%;margin-left:0}}

/* User/RBAC production QA: contain Calendar and Autoscenario mobile content. */
@media(max-width:720px){
  .calendar-toolbar{display:grid;width:100%;min-width:0;overflow:hidden}
  .calendar-toolbar>*,.rule-card,.rule-card>header,.rule-card>header>div,.rule-flow,.rule-flow>div,.rule-card>footer,.rule-card>footer>div{min-width:0;max-width:100%}
  .calendar-toolbar>.button:nth-child(1){grid-column:1;grid-row:1}.calendar-toolbar>.calendar-period-picker{grid-column:2;grid-row:1}.calendar-toolbar>.button:nth-child(3){grid-column:3;grid-row:1}
  .calendar-toolbar>.button.calendar-settings-button{grid-column:1/-1;grid-row:2;width:100%;white-space:normal}
  .rule-card strong,.rule-card small,.rule-flow b,.rule-flow small{overflow-wrap:anywhere;word-break:break-word}
}

/* Owner selected frame 300:61 only. No historical 117:* styling imported. */
.selected-300-preview{--ref-canvas:#f1f5f9;--ref-surface:#fbfcfe;--ref-ink:#090f18;--ref-muted:#77859a;--ref-border:#e1e8ee;background:var(--ref-canvas);color:var(--ref-ink);font-family:Inter,"Segoe UI",Arial,sans-serif}
.selected-300-preview h1,.selected-reference-main h2,.selected-reference-main h3{font-family:inherit}
.selected-300-preview .app-shell{grid-template-columns:262px minmax(0,1fr)}
.selected-300-preview .sidebar{width:262px;background:linear-gradient(#142027,#0d171c);color:#e6edf2;border-right:1px solid #23323c}
.selected-300-preview .brand{height:100px;padding:20px 18px;gap:13px;border-bottom:0}
.selected-300-preview .ref-brand-mark{width:40px;height:42px;flex:none}
.selected-300-preview .brand-copy strong{font-size:22px;letter-spacing:0;font-weight:600;color:#fbfcfe}
.selected-300-preview .brand-copy small{font-size:11px;letter-spacing:0;text-transform:none;color:#b2c2ce;font-weight:400}
.selected-300-preview .sidebar-toggle{color:#b2c2ce;font-size:15px;margin-left:auto;padding:2px;min-width:18px}
.selected-300-preview .nav{padding:4px 15px}
.selected-300-preview .nav button{color:#e6edf2;font-size:13px;font-weight:400;border-radius:8px;min-height:42px}
.selected-300-preview .nav button.active{background:#293b41;color:#e6edf2;border-color:transparent;box-shadow:inset 2px 0 #4dceb8}
.selected-300-preview .nav svg{width:18px;height:18px;color:#b2c2ce}
.selected-300-preview .sidebar-note{font-size:11px;color:#b2c2ce;background:transparent;border-top:1px solid #24333b;padding:18px}
.selected-300-preview .workspace{min-width:0;background:var(--ref-canvas)}
.selected-300-preview .topbar{min-height:76px;padding:14px 24px;background:#f7f9fc;border-bottom:1px solid var(--ref-border);box-shadow:none;gap:16px}
.selected-300-preview .topbar h1{font-size:17px;color:#102034;line-height:1.3}
.selected-300-preview .topbar p{font-size:11px;color:var(--ref-muted);margin-top:3px}
.selected-300-preview .header-balance-button{background:#fbfcfe;border:1px solid var(--ref-border);font-size:12px;border-radius:8px;min-height:36px}
.selected-300-preview .header-assistant{background:#20313a;border-radius:8px;color:#fbfcfe}
.selected-300-preview .page{max-width:none;padding:18px 22px 24px}
.selected-reference-main{display:grid;gap:16px;min-width:0}
.selected-reference-main button,.selected-reference-main a{font:inherit;cursor:pointer}
.selected-reference-main button:focus-visible,.selected-reference-main summary:focus-visible{outline:3px solid #2a9d8f;outline-offset:3px}
.selected-reference-main button:hover{filter:brightness(.97)}
.ref-greeting{display:flex;justify-content:space-between;align-items:center;gap:20px;min-width:0;min-height:90px}
.ref-greeting>div{min-width:0}
.ref-greeting h2{margin:0 0 6px;font-size:30px;line-height:1.2;font-weight:700;letter-spacing:-.8px;overflow-wrap:anywhere;color:var(--ref-ink)}
.ref-greeting p{margin:0;font-size:14px;line-height:1.5;color:#49566b}
.ref-greeting blockquote{margin:0;flex:0 0 340px;display:flex;gap:20px;padding:16px 19px;border:1px solid var(--ref-border);background:#f8fafc;border-radius:14px;font-size:12px;line-height:1.5;color:#243142}
.ref-greeting blockquote>span{font-size:37px;line-height:1;color:#ccd8e7;font-weight:700}
.ref-greeting cite{display:block;text-align:right;font-size:10px;margin-top:10px;color:#718197;font-style:normal}
.ref-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.ref-kpi{position:relative;display:flex;gap:14px;padding:18px 18px 25px;min-height:123px;border:1px solid var(--ref-border);border-radius:14px;background:var(--ref-surface);box-shadow:0 4px 12px #21334d06;min-width:0}
.ref-kpi>img{width:44px;height:44px;flex:none;border-radius:12px}
.ref-kpi>div{min-width:0}
.ref-kpi h3{font-size:12px;margin:2px 0 12px;font-weight:600;color:var(--ref-ink)}
.ref-kpi strong{display:block;font-size:23px;line-height:1.2;letter-spacing:-.5px;font-weight:700;overflow-wrap:anywhere}
.ref-kpi small{display:block;font-size:10px;line-height:1.35;color:var(--ref-muted);margin-top:10px}
.ref-kpi-link{position:absolute;bottom:6px;right:12px;background:none;border:0;color:#64758a;font-size:10px!important;padding:2px}
.ref-analytics{display:grid;grid-template-columns:minmax(0,1.36fr) minmax(0,1fr);gap:16px}
.ref-card{min-width:0;border:1px solid var(--ref-border);border-radius:14px;background:var(--ref-surface);box-shadow:0 4px 16px #1a2e470a;padding:17px}
.ref-card>header{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;margin-bottom:16px}
.ref-card h3{font-size:17px;line-height:1.3;margin:0;font-weight:700;color:#12243d;overflow-wrap:anywhere}
.ref-period{font-size:10px;color:#49566b;background:#f1f5f9;border-radius:6px;padding:7px 10px;white-space:nowrap}
.ref-chart{height:180px;position:relative;background:repeating-linear-gradient(to top,transparent 0,transparent 39px,#edf1f5 40px,transparent 41px)}
.ref-chart canvas{display:block;width:100%;height:168px}
.ref-chart-values{position:absolute;right:0;bottom:0;z-index:1;background:#fbfcfe;font-size:10px;max-height:180px;overflow:auto;padding:4px}
.ref-chart-values summary{cursor:pointer}
.ref-legend{display:flex;justify-content:center;gap:16px;font-size:10px;color:#56667a;flex-wrap:wrap;margin-top:9px}
.ref-legend span{display:flex;align-items:center;gap:7px}
.ref-legend i,.ref-market-legend i{display:inline-block;width:9px;height:9px;border-radius:3px;flex:none}
.ref-legend .revenue,.segment-0{background:#259f76}.ref-legend .profit{background:#b9e9ef}.segment-1{background:#6250dc}.segment-2{background:#e3a344}.segment-3{background:#8997a9}
.ref-donut-layout{display:grid;grid-template-columns:minmax(150px,1fr) minmax(130px,1fr);align-items:center;gap:15px;min-height:180px}
.ref-donut{position:relative;max-width:180px;width:100%;aspect-ratio:1;justify-self:center}
.ref-donut canvas{width:100%;height:100%;display:block}
.ref-donut>div{position:absolute;inset:34% 20%;text-align:center;display:flex;flex-direction:column;justify-content:center}
.ref-donut strong{font-size:24px;color:#12243d}.ref-donut small{font-size:10px;line-height:1.4;color:#49566b;margin-top:5px}
.ref-market-legend{font-size:11px;color:#26364a;min-width:0}
.ref-market-legend>div{display:flex;align-items:center;gap:9px;margin-bottom:17px}
.ref-market-legend span{flex:1;overflow-wrap:anywhere}.ref-market-legend b{font-weight:500}
.ref-market-legend p{line-height:1.6;color:var(--ref-muted)}
.ref-source-note{display:block;color:var(--ref-muted);font-size:10px;margin-top:5px}
.ref-work{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,.85fr);gap:15px}
.ref-work>.ref-card{min-height:276px;padding:15px}
.ref-work .ref-card h3{font-size:16px}
.ref-link{border:0;padding:0;background:none;color:#49566b;font-size:10px!important;text-decoration:underline;white-space:nowrap}
.ref-link span{margin-left:5px;text-decoration:none}
.ref-operation{display:flex;align-items:center;gap:10px;width:100%;background:none;border:0;border-bottom:1px solid #edf1f5;padding:5px 0;text-align:left;min-width:0}
.ref-op-icon{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;font-size:19px;flex:none}
.ref-op-icon.income{background:#def5e9;color:#159c70}.ref-op-icon.expense{background:#ffebe9;color:#c96060}.ref-op-icon.transfer{background:#ecdefc;color:#8255c6}
.ref-op-copy{flex:1;min-width:0}.ref-op-copy strong{display:block;font-size:11px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ref-op-copy small{display:block;color:#77859a;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:5px}
.ref-operation>b{font-size:11px;white-space:nowrap;max-width:40%;overflow-wrap:anywhere}
.ref-task{display:flex;align-items:center;gap:10px;width:100%;padding:12px 0;background:none;border:0;border-bottom:1px solid #edf1f5;text-align:left;font-size:11px!important;line-height:1.4;min-width:0}
.ref-task>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere}
.ref-task-state{width:15px;height:15px;border:1px solid #a8b6c2;border-radius:3px;background:linear-gradient(white,#f1f5f8);flex:none}
.ref-task small{font-size:9px;border-radius:8px;background:#fff0e0;color:#a6601c;padding:4px 6px;max-width:90px;overflow-wrap:anywhere}
.ref-spark{background:#ecdefc;border-radius:7px;padding:5px;color:#8855ca;margin-right:7px}
.ref-dark{background:linear-gradient(#23343d,#0f1b23);border:0;border-radius:8px;color:#fbfcfe;padding:8px 12px;font-size:11px!important;white-space:nowrap}
.ref-assistant>header{gap:5px}.ref-assistant h3{font-size:13px!important;white-space:nowrap}
.ref-assistant>p{font-size:11px;line-height:1.6;color:#49566b;margin:0 0 15px}
.ref-suggestions{display:grid;gap:8px}.ref-suggestions button{background:#f6f8fc;border:1px solid var(--ref-border);border-radius:8px;padding:10px;text-decoration:none;text-align:left;white-space:normal;font-size:10px!important;line-height:1.35}
.ref-suggestions button span{float:right}
.ref-empty{min-height:170px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:10px;padding:20px;line-height:1.5;color:var(--ref-muted)}
.ref-empty strong{font-size:13px;font-weight:500}.ref-empty span{font-size:10px}
.ref-garage{position:relative;min-height:87px;display:flex;align-items:center;gap:17px;padding:14px 20px;background:var(--ref-surface);border:1px solid var(--ref-border);border-radius:14px;overflow:hidden;isolation:isolate}
.ref-garage>div{min-width:0;z-index:1}.ref-garage h3{margin:0 0 8px;font-size:18px}.ref-garage p{margin:0;font-size:11px;max-width:440px;line-height:1.4}
.ref-garage-mark{flex:none;z-index:1}.ref-garage .ref-dark{z-index:1}
.ref-garage-art{position:absolute;right:0;bottom:0;width:54%;height:100%;object-fit:cover;z-index:-1;opacity:.9}
.ref-preserved{font-size:12px;color:#607086}.ref-preserved>summary{cursor:pointer;padding:12px 0}.ref-preserved[open]>.owner-dashboard{padding-top:18px}
.selected-300-preview .statusbar{font-size:9px;background:transparent;border:0;color:#77859a;flex-wrap:wrap;gap:9px;padding:12px 22px}
.selected-300-preview .auditor-banner{font-size:12px;margin-bottom:14px;background:#e8f2f4}
@media(min-width:1200px){.ref-greeting h2{font-size:29px}.ref-kpi{gap:12px}.ref-kpi strong{font-size:23px}}
@media(max-width:1200px){.ref-greeting blockquote{flex-basis:260px}.ref-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.ref-work{grid-template-columns:repeat(2,minmax(0,1fr))}.ref-assistant{grid-column:1/-1}.ref-suggestions{grid-template-columns:repeat(2,minmax(0,1fr))}.ref-analytics{grid-template-columns:minmax(0,1fr)}.ref-chart{height:230px}.ref-donut-layout{min-height:210px}.ref-garage-art{opacity:.35}}
@media(max-width:760px){.selected-300-preview .app-shell{display:block}.selected-300-preview .sidebar{position:fixed;width:262px;z-index:90}.selected-300-preview .page{padding:17px 14px 80px}.selected-300-preview .topbar{padding:10px 14px;min-height:64px;gap:8px}.selected-300-preview .topbar h1{font-size:17px}.selected-300-preview .topbar p{display:none}.ref-greeting{display:block}.ref-greeting h2{font-size:25px;letter-spacing:-.6px}.ref-greeting p{font-size:12px}.ref-greeting blockquote{margin-top:15px;padding:12px 15px;font-size:11px}.ref-greeting cite{margin-top:5px}.ref-kpis{gap:11px}.ref-kpi{padding:13px 12px 25px;gap:9px;min-height:146px;display:block}.ref-kpi>img{width:32px;height:32px;float:left;margin-right:10px}.ref-kpi h3{font-size:11px;min-height:32px;margin:0 0 10px}.ref-kpi strong{clear:both;font-size:19px;letter-spacing:-.4px}.ref-kpi small{font-size:9px}.ref-card{padding:14px}.ref-card h3{font-size:15px}.ref-work{grid-template-columns:minmax(0,1fr)}.ref-work>.ref-card{min-height:240px}.ref-assistant{grid-column:auto}.ref-garage{align-items:flex-start;flex-wrap:wrap;padding:16px;gap:12px;min-height:140px}.ref-garage>div{flex:1}.ref-garage h3{font-size:17px}.ref-garage p{font-size:11px;max-width:230px}.ref-garage-mark{width:36px;height:36px}.ref-garage-art{width:100%;height:57px;opacity:.45}.ref-garage .ref-dark{margin-left:48px}.ref-market-legend{font-size:10px}.ref-chart canvas{height:200px}.ref-donut-layout{gap:10px;grid-template-columns:minmax(125px,1fr) minmax(100px,1fr)}.ref-source-note{font-size:9px}.ref-preserved{font-size:11px}.selected-reference-main{gap:13px}.selected-300-preview .statusbar{padding-bottom:75px}}

/* Review-only compositions: existing UI neutrals + approved orange/cream.
   Original logo bytes; authorized derivative character on white, CSS multiply compositing.
   These selectors cannot affect other Main cards or the existing garage route. */
.ref-garage.gk-module{display:block;position:relative;isolation:isolate;padding:0;border-radius:14px;overflow:hidden;color:var(--ref-text,#0d1520);min-height:172px}
.gk-module .gk-logo{display:block;width:112px;height:auto;object-fit:contain;mix-blend-mode:multiply;flex:none}
.gk-module .gk-art{position:absolute;z-index:0;overflow:hidden;pointer-events:none;mix-blend-mode:multiply}
.gk-module .gk-portrait{position:static;display:block;width:100%;height:auto;max-width:none;object-fit:contain;opacity:1;mix-blend-mode:multiply}
.gk-module h3{font-family:inherit;font-size:26px;line-height:1.13;letter-spacing:-.7px;margin:0 0 8px;font-weight:650;overflow-wrap:anywhere}
.gk-module p{font-size:12px;line-height:1.55;color:var(--ref-muted,#536179);overflow-wrap:anywhere}
.gk-module .gk-link{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:10px 17px;margin:0;font-size:12px!important;border-radius:8px;white-space:normal;line-height:1.3}
.gk-module .gk-link:hover{box-shadow:0 3px 9px #14232c20;filter:brightness(1.12)}
.gk-module .gk-link:focus-visible{outline:3px solid #F2A000;outline-offset:3px}
/* A: quiet white UI module. Small signature, compact headline, an inset portrait vignette. */
.ref-garage.gk-a{background:var(--ref-surface,#fbfcfe);min-height:168px;border-color:var(--ref-border,#e1e8ee)}
.gk-a::before{content:"";position:absolute;left:0;top:24px;bottom:24px;width:3px;background:#F2A000}
.gk-a .gk-a-content{position:relative;padding:22px 30px 23px;max-width:55%}
.gk-a .gk-signature{display:flex;align-items:center;gap:16px;margin-bottom:13px}
.gk-a .gk-signature .gk-logo{width:86px}
.gk-a .gk-signature span{font-size:10px;color:var(--ref-muted,#536179);padding-left:16px;border-left:1px solid var(--ref-border,#e1e8ee);line-height:1.4}
.gk-a .gk-a-action{position:absolute;right:218px;bottom:30px;z-index:2}
.gk-a .gk-art{right:24px;bottom:0;width:164px;height:153px;background:#F3E6D2;border-radius:90px 90px 0 0}
.gk-a .gk-portrait{width:145px;margin:0 auto}
/* B: character-led warm, open composition. Face/gesture anchored to the card edge. */
.ref-garage.gk-b{background:#F3E6D2;border-color:#F3E6D2;min-height:216px}
.gk-b .gk-art{width:258px;height:213px;left:6%;bottom:0}
.gk-b .gk-b-content{position:relative;padding:22px 36px 23px;margin-left:35%;max-width:520px}
.gk-b .gk-logo{width:96px;margin-bottom:14px}
.gk-b h3{font-size:30px;max-width:340px}
.gk-b p{font-size:12px;max-width:330px;margin-bottom:16px}
.gk-b .gk-link{background:#F2A000;color:var(--ref-text,#0d1520);font-weight:600}
.gk-b .gk-b-index{position:absolute;right:24px;top:28px;writing-mode:vertical-rl;font-size:9px;letter-spacing:2px;color:var(--ref-muted,#536179)}
.gk-b .gk-link:focus-visible{outline-color:var(--ref-text,#0d1520)}
/* C: editorial hierarchy. Quiet signature rail + oversized line break + warm portrait page. */
.ref-garage.gk-c{display:grid;grid-template-columns:23% minmax(0,1fr) 25%;background:var(--ref-surface,#fbfcfe);min-height:192px}
.gk-c .gk-c-brand{padding:26px 28px;display:flex;flex-direction:column;justify-content:space-between;border-right:1px solid var(--ref-border,#e1e8ee);margin:20px 0}
.gk-c .gk-logo{width:128px;max-width:100%}
.gk-c .gk-c-brand>span{font-size:9px;color:var(--ref-muted,#536179);line-height:1.5;letter-spacing:.2px;margin-top:15px}
.gk-c .gk-c-content{position:relative;z-index:2;padding:24px 30px}
.gk-c .gk-eyebrow{display:block;font-size:9px;letter-spacing:1.4px;text-transform:uppercase;color:var(--ref-muted,#536179);margin-bottom:10px}
.gk-c h3{font-size:29px;font-weight:600;line-height:1.05;letter-spacing:-.9px;margin-bottom:16px}
.gk-c .gk-link{background:none;color:var(--ref-text,#0d1520);padding:0;min-height:24px;border-radius:0;justify-content:flex-start;border-bottom:2px solid #F2A000}
.gk-c .gk-link:hover{box-shadow:none;text-decoration:underline}
.gk-c .gk-art{right:0;bottom:0;width:25%;height:100%;background:#F3E6D2}
.gk-c .gk-portrait{position:absolute;width:205px;max-width:95%;left:50%;transform:translateX(-50%);top:8px}
@media(max-width:1200px) and (min-width:761px){
 .gk-a .gk-a-content{max-width:52%;padding-left:24px}.gk-a .gk-a-action{right:192px}.gk-a .gk-signature{gap:10px}.gk-a .gk-signature span{padding-left:10px}
 .gk-a .gk-art{right:12px;width:158px}.gk-a h3{font-size:24px}
 .gk-b .gk-art{left:3%;width:250px}.gk-b .gk-b-content{margin-left:37%;padding-left:20px}.gk-b h3{font-size:28px}
 .gk-c .gk-c-brand{padding:20px}.gk-c .gk-c-content{padding:24px}.gk-c h3{font-size:26px}
}
@media(max-width:760px){
 .gk-module .gk-link{min-height:44px}.gk-module h3{font-size:25px}.gk-module p{font-size:11px}
 .ref-garage.gk-a{min-height:255px}
 .gk-a .gk-a-content{padding:20px;max-width:100%}.gk-a .gk-signature{margin-bottom:20px;gap:12px}.gk-a .gk-signature span{font-size:9px;padding-left:12px}.gk-a .gk-signature .gk-logo{width:88px}
 .gk-a h3{max-width:205px;font-size:25px}.gk-a p{max-width:180px}
 .gk-a .gk-a-action{left:20px;right:auto;bottom:20px}
 .gk-a .gk-art{width:110px;height:137px;right:12px}.gk-a .gk-portrait{width:110px}
 .ref-garage.gk-b{min-height:314px}
 .gk-b .gk-b-content{margin:0;padding:20px;max-width:100%}
 .gk-b .gk-logo{width:102px;margin-bottom:20px}
 .gk-b h3{font-size:28px;max-width:180px;line-height:1.06;margin-bottom:11px}
 .gk-b p{max-width:155px;font-size:11px;margin-bottom:19px}.gk-b .gk-desktop-break{display:none}
 .gk-b .gk-art{left:auto;right:0;width:162px;height:220px}.gk-b .gk-portrait{width:176px;max-width:none}
 .gk-b .gk-b-index{font-size:8px;top:24px;right:18px;writing-mode:horizontal-tb;letter-spacing:1px}
 .gk-b .gk-link{max-width:153px}
 .ref-garage.gk-c{display:block;min-height:325px}
 .gk-c .gk-c-brand{margin:0 20px;padding:16px 0 14px;min-height:64px;flex-direction:row;align-items:center;border-right:0;border-bottom:1px solid var(--ref-border,#e1e8ee)}
 .gk-c .gk-logo{width:104px}.gk-c .gk-c-brand>span{margin:0;max-width:114px;text-align:right;font-size:9px}
 .gk-c .gk-c-content{padding:21px 20px;max-width:74%}.gk-c .gk-eyebrow{font-size:8px;margin-bottom:12px;letter-spacing:1px}
 .gk-c h3{font-size:28px;line-height:1.07;margin-bottom:15px;max-width:180px}
 .gk-c .gk-art{width:112px;height:200px;right:0;bottom:0;border-radius:58px 0 0 0}.gk-c .gk-portrait{max-width:none;width:149px;top:20px;left:57%}
 .gk-c .gk-link{min-height:36px;font-size:11px!important}
}
@media(max-width:360px){
 .gk-a .gk-art{right:0;width:87px}.gk-a h3{font-size:23px;max-width:180px}.gk-a p{max-width:158px}.gk-a .gk-signature span{max-width:90px}
 .gk-b .gk-art{right:0;width:120px;height:200px}.gk-b .gk-portrait{width:154px}.gk-b h3{max-width:160px;font-size:25px}.gk-b p{max-width:136px}.gk-b .gk-b-index{display:none}
 .gk-c .gk-c-content{max-width:80%}.gk-c h3{font-size:26px;max-width:160px}.gk-c .gk-art{width:88px}.gk-c .gk-c-brand>span{max-width:100px}
}

/* Final local polish of Owner-selected C only. Baseline C remains untouched.
   Same neutral surfaces + approved #F3E6D2/#F2A000; no new imagery or global tokens. */
.ref-garage.gk-c.gk-c-polished{min-height:204px}
.gk-c-polished::after{content:"";position:absolute;z-index:-1;inset:0 0 0 auto;width:43%;pointer-events:none;background:linear-gradient(90deg,transparent 0%,#F3E6D2 72%)}
.gk-c-polished .gk-c-brand{padding-top:20px;padding-bottom:20px}
.gk-c-polished .gk-c-brand>span{font-size:10px;line-height:1.5;color:var(--ref-muted,#536179);letter-spacing:0}
.gk-c-polished .gk-c-content{padding-top:24px;padding-bottom:24px}
.gk-c-polished h3{margin-bottom:10px}
.gk-c-polished .gk-support{font-size:11px;line-height:1.5;margin:0 0 15px;max-width:340px;color:var(--ref-muted,#536179)}
.gk-c-polished .gk-link{background:linear-gradient(#23343d,#0f1b23);color:#fbfcfe;border:1px solid transparent;border-radius:8px;min-height:40px;padding:9px 14px;font-size:12px!important;font-weight:600;justify-content:center;text-decoration:none;gap:8px}
.gk-c-polished .gk-link:hover{text-decoration:none;box-shadow:0 3px 9px #14232c20;filter:brightness(1.1)}
.gk-c-polished .gk-link:focus-visible{outline:3px solid #F2A000;outline-offset:3px}
.gk-c-polished .gk-art{width:31%;background:transparent;border-radius:0;overflow:hidden}
.gk-c-polished .gk-portrait{left:55%;top:12px;width:205px;max-width:95%}
@media(max-width:1200px) and (min-width:761px){
 .gk-c-polished .gk-c-content{padding-right:12px}.gk-c-polished .gk-support{max-width:280px}
 .gk-c-polished .gk-portrait{width:186px;left:60%;top:18px}
}
@media(max-width:760px){
 .ref-garage.gk-c.gk-c-polished{min-height:340px}
 .gk-c-polished::after{top:auto;height:240px;width:43%;background:linear-gradient(90deg,transparent 0%,#F3E6D2 80%);-webkit-mask-image:linear-gradient(180deg,transparent,#000 54px);mask-image:linear-gradient(180deg,transparent,#000 54px)}
 .gk-c-polished .gk-c-brand{padding:16px 0 14px}
 .gk-c-polished .gk-c-brand>span{font-size:10px;max-width:124px}
 .gk-c-polished .gk-c-content{padding:22px 20px;max-width:74%}
 .gk-c-polished h3{margin-bottom:11px}
 .gk-c-polished .gk-support{font-size:11px;max-width:178px;margin-bottom:16px}
 .gk-c-polished .gk-link{min-height:44px;padding:10px 12px;font-size:11px!important}
 .gk-c-polished .gk-art{width:112px;height:211px}
 .gk-c-polished .gk-portrait{width:149px;max-width:none;left:57%;top:20px}
}
@media(max-width:360px){
 .gk-c-polished .gk-c-content{max-width:80%}
 .gk-c-polished .gk-c-brand>span{max-width:112px}
 .gk-c-polished .gk-support{max-width:166px}
 .gk-c-polished .gk-art{width:86px}
}

/* Selected Main 300:61 shell refinement. No banner selectors or shared brand tokens.
   Approved C markup, assets and inherited typography must remain unchanged. */
.selected-300-preview:has(.selected-reference-main) .assistant-dock:not(.open){display:none}
.selected-300-preview:has(.selected-reference-main) .header-assistant{background:#e9eff3!important;color:#23343d!important;border:1px solid #dce5eb!important;font-weight:600}
.selected-300-preview .topbar button:focus-visible,
.selected-300-preview .mobile-bottom-nav button:focus-visible,
.selected-300-preview .sidebar button:focus-visible{outline:3px solid #2a9d8f;outline-offset:2px}
.selected-300-preview .sidebar{font-family:Inter,"Segoe UI",Arial,sans-serif}
.selected-300-preview .nav-group-label{font-size:14px;font-weight:500;letter-spacing:0;text-transform:none;min-height:44px;padding:10px 14px}
.selected-300-preview .nav-group-label svg{width:18px;height:18px;flex:none;stroke-width:1.6}
.selected-300-preview .nav-group{margin-bottom:4px;padding-bottom:4px}
.selected-300-preview .nav button{font-family:inherit;font-size:14px;line-height:1.35;font-weight:400}
.selected-300-preview .nav button.active{font-weight:600}
.selected-300-preview .topbar{font-family:Inter,"Segoe UI",Arial,sans-serif}
.selected-300-preview .topbar h1{font-weight:600;letter-spacing:-.2px}
.selected-300-preview .selected-reference-main> :not(.ref-garage){font-family:Inter,"Segoe UI",Arial,sans-serif}
.selected-300-preview .ref-greeting h2{font-weight:650;line-height:1.15;letter-spacing:-.6px}
.selected-300-preview .ref-card h3{font-weight:600;letter-spacing:-.2px}
.selected-300-preview .ref-kpi h3{font-weight:600}
.selected-300-preview .ref-kpi strong{font-weight:650}
@media(min-width:761px){
 .selected-300-preview .sidebar-toggle{display:none}
 .selected-300-preview .topbar{padding-left:24px;padding-right:24px}
 .selected-300-preview .nav-group-label{gap:12px}
 .selected-300-preview .nav-button{gap:12px}
}
@media(max-width:760px){
 .selected-300-preview{padding-bottom:0}
 .selected-300-preview .workspace{padding-bottom:calc(68px + env(safe-area-inset-bottom,0px));min-height:100dvh}
 .selected-300-preview .page{padding-bottom:20px}
 .selected-300-preview .statusbar{padding-bottom:0}
 .selected-300-preview .mobile-bottom-nav{height:calc(64px + env(safe-area-inset-bottom,0px));padding:4px 4px env(safe-area-inset-bottom,0px);box-shadow:0 -2px 12px #14232c0a;background:#fbfcfe;backdrop-filter:none}
 .selected-300-preview .mobile-bottom-nav button{min-height:55px;font-size:10px;line-height:1.15;gap:4px;border-radius:8px}
 .selected-300-preview .mobile-bottom-nav svg{width:20px;height:20px}
 .selected-300-preview .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;position:relative;min-height:68px;padding:10px 14px;gap:8px;align-items:center}
 .selected-300-preview .top-title{display:flex;align-items:center;gap:8px;min-width:0}
 .selected-300-preview .topbar h1{font-size:17px;margin:0;line-height:1.3;max-width:100%}
 .selected-300-preview .mobile-menu{width:40px;min-width:40px;height:44px;padding:0;border:1px solid #e1e8ee;background:#fbfcfe;border-radius:8px;font-size:19px;color:#23343d}
 .selected-300-preview .owner-top-actions{display:flex;gap:4px;flex-wrap:nowrap;align-items:center;min-width:0}
 .selected-300-preview .owner-top-actions>button{min-width:40px;min-height:44px;width:40px;height:44px;padding:6px;border-radius:8px}
 .selected-300-preview .header-balance-total{display:none}
 .selected-300-preview #header-balance-eye{font-size:18px;line-height:1}
 .selected-300-preview #header-popovers{top:68px;left:14px;right:14px}
 .selected-300-preview .sidebar-open .sidebar{width:262px}
 .selected-300-preview .ref-greeting h2{font-size:25px;line-height:1.18}
 .selected-300-preview .ref-greeting p{line-height:1.5}
 .selected-300-preview .assistant-dock.open{inset:80px 12px calc(76px + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 24px)}
}
@media(max-width:360px){
 .selected-300-preview .topbar{padding-left:10px;padding-right:10px;gap:4px}
 .selected-300-preview .top-title{gap:4px}
 .selected-300-preview .topbar h1{font-size:16px}
 .selected-300-preview .owner-top-actions{gap:2px}
 .selected-300-preview .owner-top-actions>button{width:36px;min-width:36px}
 .selected-300-preview .mobile-bottom-nav button{font-size:9px}
}

/* Keep the pinned label narrower than a phone so cash columns stay reachable. */
@media(max-width:720px){
  .dds-report-table{min-width:100%;width:max-content}
  .dds-report-table tr>th:first-child{min-width:140px;width:140px;max-width:140px;white-space:normal;overflow-wrap:anywhere}
  .dds-report-table tr>th:first-child button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
}

.erp-sync{font-size:11px;line-height:1.4}.erp-synced{color:#1c7756}.erp-error{color:#ad3434}.erp-pending,.erp-retry{color:#8d6200}.erp-unlinked{color:#6b7280}

.dds-plan-amount{display:block;font-size:11px;font-weight:400;color:#7b61a8;white-space:nowrap}.dds-plan-legend{font-size:12px;color:#626c75;margin:8px 0}

/* Same-scope fact / unpaid plan / forecast, without changing DDS column geometry. */
.cash-scenario{display:grid;gap:3px;font-variant-numeric:tabular-nums}
.cash-scenario>span,.cash-scenario>strong{display:block;white-space:nowrap}
.cash-scenario small{display:inline!important;font-size:10px!important;font-weight:400;margin-right:5px;color:var(--muted)}
.cash-scenario-fact{font-weight:500}.cash-scenario-plan{color:#735591;font-weight:400}
.cash-scenario-forecast{padding-top:3px;border-top:1px solid #dce6e8;font-weight:750}
.cash-scenario-forecast small{display:block!important;margin:0 0 2px}
.calendar-scenario-card .cash-scenario{margin:8px 0;font-size:14px}
.calendar-scenario-card>small{white-space:normal}

.bank-tools,.bank-account-selection{min-width:0;max-width:100%;margin:12px 0}.bank-tools [data-bank-result]{overflow:auto;max-height:420px;overflow-wrap:anywhere}.bank-tools form,.bank-account-selection form{min-width:0;margin-top:12px}.bank-tools input,.bank-account-selection input{max-width:100%;min-width:0}.bank-tools p,.bank-account-selection p{grid-column:1/-1}.bank-tools table{width:100%}.bank-reliability-card dl{overflow-wrap:anywhere}

/* Owner UUID confirmation stays above the operation drawer. */
.erp-owner-backdrop{z-index:200}
.erp-owner-backdrop .form-actions{flex-wrap:wrap}

/* Exact legacy review is informational, never full provider parity. */
.erp-legacy-review{color:#795419;background:#fff4d8;white-space:normal;overflow-wrap:anywhere;}
.legacy-provider-review{border-left:3px solid #bb8a35;padding:8px 12px;overflow-wrap:anywhere;max-width:100%;}
.diagnostic dd{overflow-wrap:anywhere;min-width:0;}
