.brand { display: block; width: fit-content; max-width: 100%; background: transparent; }
.brand img, .login .nok-logo { display: block; width: 200px; max-width: 100%; height: auto; background: transparent; }
.login .nok-logo { width: 240px; margin: 0 auto 16px; }
.login-forgot { margin: 14px 0 0; }
.sidebar .brand small { display: none; }

#case-live { display: grid; gap: 18px; }
.case-tablist { display: flex; flex-wrap: wrap; gap: 0; background: #fff; border: 1px solid var(--line); border-bottom: 0; }
.case-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 12px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink-2); font: 500 14px/1.2 var(--sans); text-decoration: none; }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--paper); color: var(--navy); font: 600 12px/1 var(--sans); }
html.js .case-tab[aria-selected="true"] .tab-count { background: var(--yellow); }
.table.parties-table, .table.arbiters-table, .table.money-table, .table.users-table { table-layout: fixed; min-width: 900px; }
.table.time-table, .table.expenses-table { table-layout: fixed; min-width: 720px; }
.parties-table td, .arbiters-table td, .money-table td, .users-table td, .time-table td, .expenses-table td { vertical-align: top; overflow-wrap: anywhere; }
.parties-table col.c-name { width: 24%; }
.parties-table col.c-ids { width: 18%; }
.parties-table col.c-address { width: 22%; }
.parties-table col.c-rep { width: 17%; }
.parties-table col.c-cases { width: 19%; }
.arbiters-table col.c-name { width: 26%; }
.arbiters-table col.c-office { width: 12%; }
.arbiters-table col.c-field { width: 24%; }
.arbiters-table col.c-load { width: 16%; }
.arbiters-table col.c-cases { width: 22%; }
.money-table col.c-case { width: 20%; }
.money-table col.c-kind { width: 18%; }
.money-table col.c-party { width: 20%; }
.money-table col.c-amount { width: 18%; }
.money-table col.c-order { width: 24%; }
.time-table col.c-case { width: 30%; }
.time-table col.c-date { width: 16%; }
.time-table col.c-who { width: 32%; }
.time-table col.c-spent { width: 22%; }
.expenses-table col.c-case { width: 26%; }
.expenses-table col.c-note { width: 34%; }
.expenses-table col.c-amount { width: 18%; }
.expenses-table col.c-who { width: 22%; }
.users-table col.c-name { width: 24%; }
.users-table col.c-role { width: 17%; }
.users-table col.c-email { width: 23%; }
.users-table col.c-login { width: 20%; }
.users-table col.c-access { width: 16%; }
.table tr.is-off td { color: var(--ink-3); }
.register-total { margin: 0; }
.money-status { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 10px; background: var(--paper); color: var(--navy); font: 600 12px/18px var(--sans); }
.money-requested { background: #fff1d6; color: #8a5a00; }
.money-paid { background: #e6eefb; color: #1f4ea3; }
.money-confirmed { background: #e3f1e6; color: #1d6b34; }
.user-access { display: inline-flex; align-items: center; gap: 10px; }
.user-access form { margin: 0; }
.table.cases-table { table-layout: fixed; min-width: 960px; }
.cases-table td { vertical-align: top; overflow-wrap: anywhere; }
.cases-table col.c-id { width: 15%; }
.cases-table col.c-stage { width: 14%; }
.cases-table col.c-subject { width: 17%; }
.cases-table col.c-sides { width: 17%; }
.cases-table col.c-judges { width: 19%; }
.cases-table col.c-docs { width: 18%; }
.case-id { font-weight: 600; }
.table.intakes-table { table-layout: fixed; min-width: 960px; }
.intakes-table td { vertical-align: top; overflow-wrap: anywhere; }
.intakes-table col.c-id { width: 15%; }
.intakes-table col.c-decision { width: 15%; }
.intakes-table col.c-summary { width: 22%; }
.intakes-table col.c-receipts { width: 13%; }
.intakes-table col.c-docs { width: 18%; }
.intakes-table col.c-case { width: 17%; }
.intake-classify { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.intake-classify .btn { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.intake-decision { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.intake-decision .intake-classify { margin-top: 0; }
.intakes-table td:last-child .doc-row::after, .intakes-table td:nth-last-child(2) .doc-row::after { left: auto; right: -6px; }
.journal-search { margin-bottom: 12px; }
.journal-date { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-3); font-weight: 400; }
.journal-search .journal-date input { width: auto; }
.journal-total { margin: 0 0 8px; }
.table.journal-table { table-layout: fixed; min-width: 860px; }
.journal-table td { vertical-align: top; overflow-wrap: anywhere; }
.journal-table col.j-at { width: 180px; }
.journal-table col.j-who { width: 19%; }
.journal-table col.j-kind { width: 120px; }
.journal-table col.j-where { width: 20%; }
.journal-at { white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal-kind { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--paper); color: var(--navy); font: 600 12px/18px var(--sans); white-space: nowrap; }
.journal-kind-create { background: #e3f1e6; color: #1d6b34; }
.journal-kind-update { background: #e6eefb; color: #1f4ea3; }
.journal-kind-delete { background: #fbe7e5; color: #a3281f; }
.journal-kind-refused { background: #fff1d6; color: #8a5a00; }
.journal-kind-login, .journal-kind-logout { background: #efeaf8; color: #4b3a86; }
.journal-pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.journal-history .table-wrap { margin-top: 4px; }
.journal-changes { display: grid; gap: 6px; margin-top: 6px; }
.jc-group { padding: 6px 8px; border-left: 3px solid var(--line); background: var(--paper); border-radius: 0 6px 6px 0; }
.jc-change { border-left-color: #7a9be0; }
.jc-add { border-left-color: #5fae76; }
.jc-remove { border-left-color: #d9786f; }
.jc-head { margin: 0; font-weight: 600; color: var(--ink); }
.jc-verb { color: var(--ink-3); font-weight: 400; }
.jc-group ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.jc-group li { line-height: 1.45; white-space: pre-line; }
.jc-field { color: var(--ink-3); }
.jc-field::after { content: ":"; }
.jc-group del { color: #a3281f; background: #fbe7e5; text-decoration: line-through; padding: 0 3px; border-radius: 3px; }
.jc-group ins { color: #1d6b34; background: #e3f1e6; text-decoration: none; padding: 0 3px; border-radius: 3px; }
.jc-add del, .jc-remove del { text-decoration: none; }
.jc-empty, .jc-secret { color: var(--ink-3); font-style: italic; }
.jc-arrow { color: var(--ink-3); }
.case-line { display: block; margin-top: 3px; }
.case-sub { color: var(--ink-3); font-size: 12px; line-height: 1.3; }
.case-sides { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; row-gap: 4px; }
.case-sides li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; margin: 0; }
.case-role { color: var(--ink-3); }
.case-persons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.case-persons li { display: grid; gap: 1px; margin: 0; }
.case-person-role { color: var(--ink-3); font-size: 12px; line-height: 1.25; }
.doc-list { display: grid; gap: 6px; min-width: 0; }
.doc-row { display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; color: inherit; text-decoration: none; font-weight: 500; }
.doc-row:hover { color: var(--blue); }
.doc-mark { width: 14px; height: 18px; display: block; color: var(--navy); }
.doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.doc-row { position: relative; }
.doc-row::after { content: attr(data-full); display: none; position: absolute; z-index: 5; top: -4px; left: 14px; width: max-content; min-width: calc(100% - 14px); max-width: 320px; padding: 3px 6px; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(15, 30, 60, .14); color: var(--blue); font-weight: 500; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; pointer-events: none; }
.doc-row:hover::after, .doc-row:focus-visible::after { display: block; }
.cases-table td:last-child .doc-row::after { left: auto; right: -6px; }.case-tab:hover { color: var(--navy); }
html.js .case-tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--yellow); }
html:not(.js) #case-root:not(:has(.case-panel:target)) .case-tab[data-tab="file"],
html:not(.js) #case-root:has(#case-panel-file:target) .case-tab[data-tab="file"],
html:not(.js) #case-root:has(#case-panel-panel:target) .case-tab[data-tab="panel"],
html:not(.js) #case-root:has(#case-panel-parties:target) .case-tab[data-tab="parties"],
html:not(.js) #case-root:has(#case-panel-documents:target) .case-tab[data-tab="documents"],
html:not(.js) #case-root:has(#case-panel-deadlines:target) .case-tab[data-tab="deadlines"],
html:not(.js) #case-root:has(#case-panel-money:target) .case-tab[data-tab="money"],
html:not(.js) #case-root:has(#case-panel-time:target) .case-tab[data-tab="time"],
html:not(.js) #case-root:has(#case-panel-expenses:target) .case-tab[data-tab="expenses"] { color: var(--navy); border-bottom-color: var(--yellow); }
.case-panel { display: none; }
html.js .case-panel.is-active { display: grid; gap: 18px; }
html:not(.js) #case-root:not(:has(.case-panel:target)) .case-panel[data-tab="file"],
html:not(.js) .case-panel:target { display: grid; gap: 18px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.table td form { display: inline; }
.table td .btn + form { margin-left: 8px; }
.card-head h2 { margin: 0; }

.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 18, 50, .45); }
.drawer-panel { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; width: min(440px, 100%); height: 100%; background: #fff; box-shadow: -16px 0 40px rgba(20, 18, 50, .18); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; }
.drawer-body { padding: 18px 20px 32px; overflow: auto; }
.drawer-body h2 { margin-top: 22px; }
.drawer-body label { margin-top: 14px; }
.drawer-body .check { display: flex; margin-top: 12px; }
html.drawer-open, html.drawer-open body { overflow: hidden; }

@media (max-width: 1100px) {
  .main { padding: 0 20px 48px; }
  .topbar { padding: 18px 0 14px; }
  .topbar h1 { font-size: 22px; }
  .card { padding: 18px 16px; }
}

.nav-toggle { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nav-toggle-btn { display: none; }
@media (min-width: 901px) { .nav-toggle { display: none; } }

@media (max-width: 900px) {
  .sidebar { position: sticky; top: 0; z-index: 40; overflow: visible; height: auto; flex-flow: row wrap; align-items: center; padding: 12px 12px 10px; }
  .sidebar .brand { flex: 1; padding: 0; }
  .sidebar .brand img { width: 160px; }
  .nav-toggle-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid rgba(255,255,255,.55); color: #fff; font: 500 14px/1 var(--sans); cursor: pointer; }
  .nav-toggle:checked + .nav-toggle-btn { border-color: var(--yellow); color: var(--yellow); }
  .nav-toggle:focus-visible + .nav-toggle-btn { outline: 3px solid var(--yellow); outline-offset: 2px; }
  .sidebar nav { display: none; }
  .nav-toggle:checked ~ nav { display: flex; flex-direction: column; position: absolute; z-index: 1; left: 0; right: 0; top: 100%; height: calc(100dvh - 100%); margin: 0; padding: 8px 8px 28px; overflow: auto; background: var(--navy); box-shadow: 0 24px 48px rgba(20, 18, 50, .35); }
  body:has(.nav-toggle:checked) { overflow: hidden; }
  .sidebar nav ul { display: block; width: auto; min-width: 0; }
  .nav-group { margin: 8px 10px 4px; }
  .sidebar nav a { min-height: 44px; padding: 8px 12px; }
  .sidebar-foot { flex: 1 0 100%; margin-top: 10px; padding: 10px 4px 0; }
  .search, .search input, .search select { width: 100%; max-width: none; }
  .case-tablist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .case-tab { justify-content: space-between; min-height: 44px; white-space: normal; }  .table { min-width: 720px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table td .btn { margin: 0 6px 6px 0; }
  .table td form { display: inline-block; margin: 0; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
}

@media (max-width: 700px) {
  .main { padding: 0 12px 40px; }
  .topbar h1 { font-size: 20px; }
  .card { padding: 16px 14px; }
  .empty-state { padding: 24px 12px; }
  .login .nok-logo { width: min(240px, 100%); }
  .drawer-panel { width: 100%; }
  .drawer-body { padding: 16px 16px 28px; }
}
.help { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-toc { position: sticky; top: 16px; background: #fff; border: 1px solid var(--line); padding: 14px 16px; }
.help-toc p { margin: 0 0 8px; }
.help-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-toc a { text-decoration: none; }
.help-toc a:hover { text-decoration: underline; }
.help-body { display: grid; gap: 18px; min-width: 0; }
.help-section { scroll-margin-top: 16px; }
.help-section p, .help-section li { line-height: 1.55; max-width: 78ch; }
.help-section ul, .help-section ol { padding-left: 22px; }
.help-section li + li { margin-top: 4px; }
.help-open { margin: 12px 0 0; }
.help-mine { border-left: 4px solid var(--yellow); }
.help-mine h2 { margin-top: 0; }
.help-steps { list-style: none; padding: 0 !important; margin: 0 0 12px; display: grid; gap: 10px; counter-reset: none; }
.help-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0 !important; padding: 10px 12px; background: var(--paper); border-radius: 6px; }
.help-steps p { margin: 4px 0 0; }
.help-step-num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font: 700 14px/1 var(--sans); }
.help-steps li:last-child .help-step-num { background: var(--yellow); color: var(--navy); }
.help-stages > li { margin-top: 8px; }
.help-sub { list-style: none; padding-left: 8px !important; margin: 4px 0 0; color: var(--ink-2); }
.help-table th[scope="row"] { white-space: nowrap; }
.help-link { align-self: center; margin-right: 12px; font-weight: 500; }
@media (max-width: 900px) {
  .help { grid-template-columns: 1fr; }
  .help-toc { position: static; }
}
