/* The editing surface is independent from the existing A4 print stylesheet. */
@media screen {
  :root {
    --muted:#4b616c; --line:#b8c6ce; --bg:#eef2f4; --teal:#08746f;
    --control-line:#7b8f99; --control-hover:#536f7d; --label-ink:#29424f;
    /* Dense working rhythm: labels 4, rows 8, columns 12, sections 12. */
    --space-label:4px; --space-field:8px; --space-column:12px;
    --space-section:12px; --space-panel:14px; --space-heading:8px;
  }
  body { font-size:14px; line-height:1.45; }
  ::selection { background:#cee9e5; color:#172c38; }
  input,textarea { caret-color:var(--teal); }
  button,input,select,textarea { border-radius:4px; }
  input,select,textarea { border-color:var(--control-line); padding:6px 9px; line-height:1.45; }
  input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
  input:not(:disabled):not([readonly]):hover,select:not(:disabled):hover,textarea:not(:disabled):not([readonly]):hover { border-color:var(--control-hover); }
  input:focus-visible,select:focus-visible,textarea:focus-visible { border-color:var(--teal); }
  textarea { min-height:88px; }
  button:not(.primary):not(.tab):not(.journey-step):not(.text-button):not(:disabled) { border-color:var(--control-line); }
  a { text-underline-offset:3px; }
  .case-list,.table-wrap,.stage-tabs { scrollbar-color:#8a9da7 #e7edf0; scrollbar-width:thin; }
  button { transition:background-color 160ms ease-out,border-color 160ms ease-out; }
  button:disabled { opacity:.6; }
  button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:2px solid #08746f; outline-offset:3px; }
  h1 { font-size:22px; letter-spacing:-.02em; }
  h2 { font-size:17px; letter-spacing:-.02em; }
  h3 { font-size:15px; }
  .sidebar { width:216px; padding:16px 12px 10px; }
  .brand { font-size:15px; gap:8px; white-space:nowrap; }
  .brand-icon { flex-shrink:0; }
  .sidebar-brand { display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .side-navigation { display:flex; flex-direction:column; flex:1; min-height:0; }
  .mobile-menu,.mobile-browse { display:none; }
  .permission-hidden { display:none!important; }
  .case-permission { color:#395763; background:#eaf0f2; border-radius:6px; padding:12px 14px; margin:4px 0 16px; font-size:13px; }
  .staff-role { flex:0!important; white-space:nowrap; font-weight:600; }
  .staff-scope { flex:1; }
  input[readonly],textarea[readonly] { background:#f3f6f7; color:#344e5a; cursor:text; }
  .field select:disabled,.field input:disabled,.field textarea:disabled { color:#344e5a; opacity:1; background:#f3f6f7; }
  .workspace,#content,#editor,.panel,.panel-heading>div { min-width:0; }
  .panel p,.case-permission,.evidence-item { overflow-wrap:anywhere; }
  .form-grid input,.form-grid select,.form-grid textarea { max-width:100%; min-width:0; }
  .address-entry { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:var(--space-label) 8px; min-width:0; }
  .address-entry>.field { display:contents; }
  .address-entry>.field>span { grid-column:1; grid-row:1; }
  .address-entry>.field>input { grid-column:1; grid-row:2; }
  .field>.address-text { width:100%; min-height:36px; height:36px; box-sizing:border-box; resize:none; overflow:hidden; overflow-wrap:anywhere; white-space:pre-wrap; }
  .address-entry>.field>.address-text { grid-column:1; grid-row:2; }
  .address-entry>.field>small { grid-column:1/-1; grid-row:3; }
  .address-entry>.address-search-button { display:inline-flex; align-items:center; align-self:start; grid-column:2; grid-row:2; min-height:36px; padding:6px 10px; border:1px solid var(--control-line); border-radius:4px; background:white; color:var(--ink); line-height:1.4; text-decoration:none; white-space:nowrap; }
  .address-search-button:hover { background:#eff5f5; border-color:var(--control-hover); }
  .address-search-button:disabled { cursor:default; color:var(--muted); background:#f3f6f7; }
  .application-address-choice { margin:20px 0 12px; padding:0; border:0; min-width:0; }
  .application-address-choice legend { margin-bottom:8px; font-weight:600; }
  .application-address-choice .flags { margin:0; }
  .address-search-panel { margin-top:8px; padding:12px; border:1px solid var(--line); border-radius:6px; background:var(--paper); }
  .address-search-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
  .address-search-heading>span { font-weight:600; }
  #addressSearchRetry { display:inline-block; margin-top:8px; }
  .brand-icon { width:30px; height:34px; border-radius:6px; }
  .brand small { letter-spacing:0; font-size:12px; }
  .local-label { margin:12px 0; font-size:12px; }
  .side-heading { margin-top:16px; font-size:13px; }
  .side-actions button,.search { font-size:13px; }
  .side-actions { gap:6px; }
  .side-actions button { padding:8px 10px; }
  .case-item { padding:8px; }
  .case-item strong { white-space:normal; line-height:1.5; overflow-wrap:anywhere; }
  .case-item small { font-size:11px; }
  .side-bottom { gap:4px; padding-top:12px; }
  .side-bottom>button { border:0; background:transparent; padding:10px 8px; }
  .side-tools { border-top:1px solid var(--line); padding:10px 8px 0; margin-top:6px; }
  .side-tools summary { color:var(--muted); cursor:pointer; font-size:12px; padding:4px 0; }
  .side-tools button { width:100%; margin-top:6px; }
  .sidebar-account { display:grid; gap:4px; flex-shrink:0; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
  .sidebar-account button { width:100%; text-align:left; font-size:13px; }
  .runtime-details { max-width:100%; }
  .runtime-details>div { display:grid; gap:12px; max-width:70ch; margin-top:12px; overflow-wrap:anywhere; }
  .runtime-details .notice { margin:0; }
  .runtime-details .workspace-identity { padding:0; border:0; }
  .workspace { padding:0 20px; max-width:1440px; }
  .topbar { height:52px; gap:16px; }
  .breadcrumb { letter-spacing:0; font-size:13px; color:var(--ink); }
  .version { font-size:11px; }
  .staff-identity { padding:10px 0; gap:10px; font-size:12px; border:0; }
  .staff-identity button { padding:5px 9px; font-size:12px; }
  .workspace-identity { padding:8px 0 12px; border-bottom:1px solid var(--line); font-size:12px; }
  .workspace-identity>div { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
  .workspace-identity details { font-size:11px; }
  .workspace-identity summary { cursor:pointer; color:var(--muted); }
  .workspace-identity button { padding:5px 9px; font-size:12px; }
  .case-heading { align-items:flex-start; gap:12px; padding:12px 0 6px; }
  .case-heading>div:first-child { min-width:0; }
  .case-heading h1 { overflow-wrap:anywhere; }
  .case-kind { font-size:12px; color:var(--muted); margin-top:2px; }
  .save-state { display:inline-flex; align-items:baseline; gap:6px; font-size:13px; margin:0; color:var(--ink); }
  .save-state strong,.workflow-state strong { font-weight:700; }
  .save-state.is-dirty { color:#795719; }
  .header-actions { flex-shrink:0; gap:6px; }
  .header-actions button { font-size:13px; min-height:36px; padding:7px 11px; }
  .case-tools { position:relative; }
  .case-tools summary { cursor:pointer; padding:7px 10px; border:1px solid var(--control-line); border-radius:4px; background:white; }
  .case-tools>div { position:absolute; right:0; top:44px; width:190px; padding:8px; background:white; box-shadow:0 8px 28px #00000026; z-index:20; border-radius:8px; }
  .case-tools button { display:block; width:100%; margin:3px 0; text-align:left; }
  .workflow-status { display:flex; gap:6px 16px; align-items:center; flex-wrap:wrap; color:var(--muted); font-size:13px; padding:4px 0 10px; }
  .workflow-next { font-size:12px; }
  .workflow-state { padding:3px 8px; background:#e6efee; color:#235b54; border-radius:4px; font-weight:600; }
  .workflow-state.needs-work { color:#9a3934; background:#fff0ee; }
  #tabs { display:block; overflow:visible; border:0; margin-bottom:var(--space-section); }
  .journey { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); background:#e2e9ed; border:1px solid var(--line); padding:3px; border-radius:6px; gap:3px; }
  .journey-step { display:flex; align-items:center; justify-content:center; gap:6px; border:0; min-height:34px; padding:6px; background:transparent; color:var(--muted); font-weight:600; }
  .journey-step span { font-size:12px; }
  .journey-step.active { background:#fff; color:var(--teal); }
  .stage-tabs { display:flex; flex-wrap:wrap; gap:0 8px; border-bottom:1px solid var(--line); margin-top:4px; }
  .tab { min-height:36px; padding:6px 8px; font-size:13px; border-bottom-width:2px; }
  .tab.active { border-bottom-color:var(--teal); }
  .panel { padding:var(--space-panel); margin-bottom:var(--space-section); border:1px solid var(--line); border-radius:6px; }
  .panel-heading { margin-bottom:var(--space-heading); gap:12px; padding-bottom:8px; border-bottom:1px solid var(--line); }
  .panel-heading h2 { margin-bottom:3px; }
  .panel-heading p,.helper { font-size:12px; line-height:1.5; }
  .panel-heading p:empty { display:none; }
  .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-field) var(--space-column); }
  .field { gap:var(--space-label); }
  .field.check { gap:8px; }
  .field>span { font-size:14px; color:var(--label-ink); line-height:1.4; }
  .field small { font-size:12px; line-height:1.45; }
  .field small.input-rule,.panel-heading p.input-rule { font-size:13px; line-height:1.5; color:var(--label-ink); }
  .field-unit { font-size:12px; font-weight:400; white-space:nowrap; }
  .money-field input { text-align:right; font-variant-numeric:tabular-nums; }
  .field .money-error { color:#9a3934; font-size:13px; }
  .field input[data-money][aria-invalid="true"] { border-color:#b63c40; }
  .case-title-full { display:none; }
  .row-heading>[data-creditor-heading] { min-width:0; overflow-wrap:anywhere; }
  .details-label { font-weight:600; }
  .details-state { display:inline-block; margin-inline-start:10px; color:#395763; font-size:12px; font-weight:400; vertical-align:baseline; }
  .details-state.needs-work { color:#9a3934; font-weight:600; }
  .field textarea { line-height:1.6; }
  .field .contact-missing { color:#9a3934; }
  .field input[aria-invalid="true"] { border-color:#b63c40; }
  input,select { min-height:36px; }
  input[type=checkbox] { min-height:16px; }
  .row-card { border:0; border-top:1px solid var(--line); border-radius:0; background:transparent; padding:var(--space-section) 0; margin:0; }
  .row-card:first-child { border-top:0; padding-top:0; }
  .panel-heading+.row-card { border-top:0; padding-top:0; }
  .row-heading { margin-bottom:var(--space-heading); }
  .row-heading strong { font-size:14px; }
  .row-heading button { font-size:12px; }
  .optional-section { border-top:1px solid var(--line); margin:0 0 12px; padding:0; }
  .optional-section>summary { cursor:pointer; padding:8px 4px; font-size:14px; font-weight:600; color:var(--ink); }
  .optional-section>section.panel { border:0; background:transparent; padding:8px 4px 16px; margin:0; }
  .optional-body { padding:8px 0 16px; }
  .optional-body>.panel { margin:0; }
  .panel>.optional-section:last-child { margin-bottom:0; }
  .context-action,.delivery-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:var(--space-section); }
  .context-action p { margin:0; font-size:13px; color:var(--muted); }
  .context-action button { flex-shrink:0; }
  .delivery-toolbar+.panel-bottom { margin-top:0; margin-bottom:var(--space-section); }
  .step-footer { display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-top:1px solid var(--line); gap:12px; }
  .step-footer>span { color:var(--muted); font-size:12px; }
  .step-footer>div { display:flex; gap:8px; }
  .delivery-toolbar>label { max-width:350px; font-size:12px; display:grid; gap:6px; }
  .delivery-switch { display:flex; gap:6px; }
  .delivery-switch [aria-current] { background:var(--teal); color:white; border-color:var(--teal); }
  .metrics { gap:0; background:white; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
  .metric,.metric.accent { border:0; border-radius:0; background:transparent; color:var(--ink); padding:12px; }
  .metric+.metric { border-left:1px solid var(--line); }
  .metric strong { font-size:21px; letter-spacing:-.02em; }
  .metric>span,.metric.accent span,.metric small,.metric.accent small { color:var(--muted); font-size:12px; }
  .result-grid { display:block; }
  .panel-bottom { margin-top:var(--space-section); }
  .metrics { margin-bottom:var(--space-section); }
  .metric strong { margin-top:8px; margin-bottom:4px; }
  .kv { font-size:13px; padding:8px 0; border-bottom-color:var(--line); }
  .panel>.table-wrap th { font-size:12px; background:#e9eff2; color:var(--label-ink); }
  .panel>.table-wrap th,.panel>.table-wrap td { padding:8px; }
  .notice { font-size:13px; padding:10px 12px; margin-bottom:var(--space-section); }
  .notice.slim { background:#f0f5f6; color:#395763; }
  .welcome { padding:36px 0; max-width:900px; }
  .welcome h1 { font-size:28px; letter-spacing:-.02em; margin-bottom:12px; }
  .welcome>p { font-size:14px; line-height:1.7; margin-bottom:20px; }
  .welcome-actions { margin-bottom:24px; }
  .demo-card { padding:16px 0; border:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); border-radius:0; background:transparent; }
  .demo-card select { width:260px; }
  .workspace-footer { font-size:11px; color:var(--muted); }
  .workspace-footer details { max-width:75%; overflow-wrap:anywhere; }
  .workspace-footer summary { cursor:pointer; }
  .panel-description-details { font-size:12px; color:var(--muted); margin:6px 0; max-width:75ch; }
  .panel-description-details summary { cursor:pointer; }
  .panel-description-details p { margin:8px 0 0; }
  .table-wrap table { font-variant-numeric:tabular-nums; }
  .table-wrap { overscroll-behavior-inline:contain; }
  .section-actions { gap:12px; margin-bottom:var(--space-section); }
  .preprint-panel { padding:12px 14px; margin-bottom:var(--space-section); }
  .attachment-row,.deduction-row { padding:12px 0; }
  .link-record { padding:12px 0; }
  .link-record>.form-grid { margin-bottom:12px; }
  .application-row { padding:12px 0; margin-top:8px; }
  .application-reference { padding:12px 0; margin:8px 0; }
  .collateral-correction { margin-top:16px; padding-top:12px; }
  .evidence-item { padding:12px 0; }
  .evidence-details { margin:12px 0; }
  .evidence-details[open]>summary { margin-bottom:12px; }
  .submission-options { gap:8px 12px; }
  .submission-details[open]>summary { margin-bottom:12px; }
  .plan10-section>h4,.plan10-comparison>h4 { margin:20px 0 12px; }
  .plan10-columns { gap:12px; }
  #content>.panel-bottom:has(>[data-tab="income"]) { display:none; }
  @media(min-width:1180px) { .form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
  @media(max-width:1100px) { .sidebar { width:200px; padding:20px 12px; } .workspace { padding:0 20px; } .case-heading { flex-direction:column; } .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .metric:nth-child(3) { border-left:0; } }
  @media(max-width:760px) { .app-shell { display:block; } .sidebar { position:static; width:100%; height:auto; padding:16px; border-right:0; border-bottom:1px solid var(--line); } .brand { display:inline-flex; } .local-label { display:inline-flex; margin:0 0 0 16px; } .side-actions { grid-template-columns:1fr 1fr; margin-top:16px; } .side-heading { margin-top:16px; } .case-list { max-height:170px; } .side-bottom { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; } .side-tools { width:100%; } .side-tools button { width:auto; margin-right:6px; } .workspace { padding:0 16px; } .staff-identity,.workspace-identity { flex-wrap:wrap; } .case-heading { padding-top:20px; } .header-actions { justify-content:flex-start; width:100%; } .journey-step { gap:5px; font-size:12px; } .stage-tabs { gap:0 8px; } .tab { font-size:13px; } .panel { padding:20px 16px; } .form-grid { grid-template-columns:1fr; } .field.wide { grid-column:auto; } .metrics { grid-template-columns:1fr 1fr; } .metric { padding:14px 10px; } .metric strong { font-size:18px; } .delivery-toolbar,.context-action { align-items:flex-start; flex-direction:column; } .delivery-toolbar>label { width:100%; max-width:none; } .welcome { padding:30px 0; } .welcome-actions,.demo-card { flex-wrap:wrap; } .demo-card>div { flex-basis:100%; } .demo-card select { width:100%; } .step-footer { align-items:flex-start; } .step-footer>div { flex-wrap:wrap; justify-content:flex-end; } .workspace-footer details { max-width:100%; } }
  @media(prefers-reduced-motion:reduce) { button { transition:none; } }
  @media(min-width:761px) and (max-width:1100px) { .brand { white-space:normal; font-size:14px; } }
  @media(max-width:760px) {
    body { font-size:16px; }
    .sidebar { padding:12px 16px; }
    .brand { font-size:16px; }
    .brand small { font-size:11px; }
    .mobile-menu,.mobile-browse { display:block; min-height:44px; flex-shrink:0; }
    .mobile-menu { font-size:13px; padding:8px 10px; }
    .mobile-browse { margin:0 0 16px; }
    .side-navigation { display:none; }
    .side-navigation.is-open { display:flex; max-height:72dvh; overflow:auto; padding:12px 0 4px; }
    .side-navigation .local-label { display:flex; margin:0 0 12px; }
    .side-navigation .side-actions { display:grid; margin-top:0; }
    .side-navigation .side-heading { display:flex; }
    .side-navigation .search { display:block; }
    .side-navigation .case-list { display:block; min-height:70px; max-height:260px; flex:none; }
    .side-navigation .side-bottom { display:flex; }
    .topbar { display:none; }
    .staff-identity { padding:12px 0; gap:6px 10px; }
    .staff-identity .staff-role { flex-basis:auto; }
    .staff-scope { flex-basis:100%; order:2; }
    .staff-identity button { min-height:44px; font-size:13px; }
    .workspace { padding:0 12px; }
    .workspace-identity { padding-top:12px; }
    .workspace-identity details { max-width:100%; overflow-wrap:anywhere; }
    .workspace-identity button { min-height:44px; }
    button,summary { touch-action:manipulation; }
    summary { min-height:44px; align-content:center; }
    button,.row-heading button,.application-row-actions button { min-height:44px; }
    .journey-step { min-height:44px; }
    .address-entry>.address-search-button { min-height:44px; }
    .field>.address-text { min-height:44px; }
    #addressSearchRetry { padding:8px 0; min-height:44px; }
    input,select,textarea { font-size:16px; min-height:44px; }
    input[type=checkbox] { min-height:20px; width:20px; height:20px; }
    .field.check { min-height:44px; }
    .field>span { font-size:14px; }
    .panel { padding:12px; }
    .case-heading { padding-top:12px; }
    .welcome { padding:24px 0; }
    .preprint-panel { padding:12px; }
    .stage-tabs { flex-wrap:nowrap; overflow-x:auto; max-width:100%; gap:0; scrollbar-width:thin; }
    .tab { flex-shrink:0; }
    .header-actions { flex-wrap:wrap; }
    .header-actions button { min-height:44px; }
    .header-actions>button { flex:1; }
    .case-heading h1 { font-size:22px; line-height:1.45; }
    .case-title-full { display:block; font-size:13px!important; line-height:1.5!important; font-weight:400!important; overflow-wrap:anywhere; }
    .details-state { margin-inline-start:6px; white-space:normal; }
    .case-tools summary { min-height:44px; }
    .table-wrap { max-width:100%; }
    .evidence-actions,.comparison-actions { flex-wrap:wrap; }
    .evidence-actions>label,.comparison-actions>label { min-width:0; max-width:100%; }
    .evidence-actions input[type=file] { width:100%; min-width:0; font-size:14px; }
    .row-heading { gap:12px; flex-wrap:wrap; }
    .print-pages { max-width:100%; }
    .preview-controls,.preview-controls select { max-width:100%; }
    .toast { max-width:calc(100% - 32px); width:max-content; }
    .workspace-footer { padding-bottom:max(20px,env(safe-area-inset-bottom)); }
  }
  .app-shell:has(#staffView:not([hidden]) .staff-login) .workspace-footer,.app-shell:has(#staffView:not([hidden]) .staff-login) .workspace-identity { display:none; }
}
@media screen {
  .creditor-count-toolbar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px 12px; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid var(--line); }
  .creditor-count-toolbar>label { display:grid; gap:4px; font-size:14px; font-weight:600; }
  #creditorCount { width:110px; min-height:36px; font-variant-numeric:tabular-nums; }
  .creditor-count-toolbar>span { align-self:center; padding-top:20px; font-size:13px; color:var(--muted); }
  @media(max-width:760px) {
    #creditorCount { min-height:44px; font-size:16px; }
    .creditor-count-toolbar>span { flex-basis:100%; padding-top:0; }
  }
}
@media print { .workflow-status,.journey,.stage-tabs,.step-footer,.context-action,.delivery-toolbar,.case-tools,.case-permission,.mobile-browse,.creditor-count-toolbar { display:none!important; } }

@media screen {
  .creditor-order-help { flex-basis:100%; }
  .row-heading:has(.creditor-row-actions) { flex-wrap:wrap; gap:8px 16px; }
  .creditor-row-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  .creditor-move-control { display:flex; align-items:center; gap:6px; }
  .creditor-move-control label { font-size:12px; color:var(--label-ink); }
  .creditor-move-control input { width:64px; min-height:36px; font-variant-numeric:tabular-nums; }
  .creditor-row-actions button { min-height:36px; }
  @media(max-width:760px) {
    .creditor-row-actions { width:100%; }
    .creditor-move-control { flex-basis:100%; }
    .creditor-move-control input,.creditor-row-actions button { min-height:44px; }
    .creditor-move-control input { font-size:16px; }
  }
}

/* workstation-design-75: screen-only theme; A4 output rules are unchanged. */
@media screen {
  :root {
    --ink:#203542; --muted:#526572; --label-ink:#203542;
    --teal:#087772; --teal-dark:#06645f; --bg:#f3f5f7; --paper:#fff;
    --line:#c4d0d8; --control-line:#81939f; --control-hover:#526c7c;
    --space-label:6px; --space-field:12px; --space-column:16px;
    --space-section:16px; --space-panel:18px; --space-heading:12px;
  }
  body { font-size:15px; line-height:1.5; }
  button,input,select,textarea { border-radius:4px; }
  button { min-height:40px; }
  input:not([type=checkbox]),select { min-height:40px; padding:8px 10px; }
  textarea { padding:9px 10px; }
  input,select,textarea { font-size:15px; }
  h1 { font-size:26px; line-height:1.35; }
  h2 { font-size:18px; }
  h3 { font-size:16px; }
  .workspace { padding:0 28px; max-width:none; }
  .sidebar { width:272px; padding:22px 18px 14px; background:#173247; border-right:1px solid #29475b; color:#fff; }
  .sidebar .brand { color:#fff; font-size:18px; gap:10px; white-space:normal; line-height:1.4; }
  .sidebar .brand small { color:#c5d3dc; font-size:13px; margin-top:3px; }
  .sidebar .brand-icon { background:#fff; color:#173247; width:36px; height:40px; border-radius:6px; }
  .sidebar .local-label { color:#c5d3dc; font-size:13px; margin:16px 0 18px; }
  .sidebar .dot { background:#55d5ca; }
  .sidebar .side-actions { gap:8px; }
  .sidebar .side-actions button { min-height:44px; font-size:14px; padding:10px 12px; }
  .sidebar button:not(.primary):not(.case-item):not(.text-button) { background:transparent; color:#fff; border-color:#8da6b5; }
  .sidebar button:not(.primary):not(.case-item):not(.text-button):hover { background:#28485e; }
  .sidebar .side-heading { color:#fff; margin:22px 0 12px; font-size:14px; }
  .sidebar .text-button { color:#c5d3dc; min-height:32px; }
  .sidebar .search { background:#fff; color:#203542; border-color:#9fb3bf; min-height:42px; font-size:14px; }
  .sidebar .search::placeholder { color:#526572; }
  .sidebar .case-item { color:#fff; padding:11px 10px; border-left:3px solid transparent; border-radius:4px; margin:4px 0; }
  .sidebar .case-item:hover { background:#28485e; }
  .sidebar .case-item.active { background:#e3f1f0; color:#075f5c; border-left-color:#1caaa0; }
  .sidebar .case-item strong { font-size:14px; font-weight:600; line-height:1.5; white-space:normal; overflow-wrap:anywhere; }
  .sidebar .case-item small { color:#c5d3dc; font-size:12px; line-height:1.5; display:block; margin-top:4px; }
  .sidebar .case-item.active small { color:#47616c; }
  .sidebar .empty-list { color:#c5d3dc; font-size:13px; }
  .sidebar .side-bottom,.sidebar .side-tools,.sidebar .sidebar-account { border-color:#577386; }
  .sidebar .side-bottom { padding-top:14px; }
  .sidebar .side-bottom button,.sidebar .side-tools summary,.sidebar .sidebar-account button { color:#e5edf2; font-size:13px; }
  .sidebar .side-tools { padding:12px 4px 0; }
  .sidebar .sidebar-account { margin-top:14px; padding-top:14px; }
  .sidebar .sidebar-account button { min-height:42px; text-align:left; }
  .case-heading { padding:18px 0 8px; gap:16px; }
  .case-heading h1 { margin-bottom:5px; }
  .case-kind { font-size:14px; }
  .header-actions { gap:8px; }
  .header-actions button,.case-tools summary { font-size:14px; padding:9px 13px; min-height:40px; }
  .workflow-status { font-size:14px; padding:6px 0 16px; gap:8px 18px; }
  .save-state,.workflow-next { font-size:14px; }
  .workflow-state { font-size:14px; }
  .workflow-state.is-stale { color:#8a5700; background:#fff2d9; }
  .journey { gap:0; border-radius:4px; padding:0; min-height:52px; background:#eaf0f3; }
  .journey-step { position:relative; min-height:52px; gap:10px; padding:8px 18px; border-radius:3px; font-size:15px; overflow:hidden; }
  .journey-step.active { background:#fff; color:#087772; }
  .journey-step .journey-number { display:inline-flex; flex:0 0 30px; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; background:#8496a2; color:#fff; font-size:16px; font-weight:700; }
  .journey-step.active .journey-number { background:#087772; }
  .journey-step .journey-label { font-size:15px; font-weight:600; white-space:nowrap; }
  .journey-step:not(:last-child)::after { content:""; position:absolute; right:0; top:50%; width:12%; border-top:1px solid #97acb8; }
  .stage-tabs { flex-wrap:nowrap; overflow-x:auto; gap:0 8px; margin-top:5px; }
  .stage-tabs .tab { min-height:44px; font-size:14px; padding:10px 12px; }
  #tabs { margin-bottom:16px; }
  .panel { border:0; border-top:2px solid #314d60; border-radius:0; box-shadow:none; }
  .panel-heading { margin-bottom:14px; padding-bottom:10px; border-color:#c4d0d8; }
  .panel-heading p,.helper,.field small { font-size:13px; line-height:1.5; }
  .field>span { font-size:14px; line-height:1.5; }
  .form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .input-category { display:grid; grid-template-columns:88px minmax(0,1fr); margin:0; min-width:0; border-bottom:1px solid #d4dfe5; }
  .input-category>h3 { margin:0; padding:21px 10px; background:#edf2f4; color:#20384c; font-size:14px; line-height:1.5; font-weight:600; overflow-wrap:anywhere; }
  .category-fields { min-width:0; padding:12px 16px; }
  .category-fields .form-grid { margin:0; }
  .panel:has(>.input-category) { padding:0; }
  .panel:has(>.input-category)>.panel-heading { padding:14px 18px 10px; margin:0; }
  .input-category .field.wide,.input-category .address-entry { grid-column:1/-1; }
  .input-category .address-entry>.field>.address-text { min-height:40px; height:40px; }
  .input-category .address-search-button { min-height:40px; font-size:14px; padding:8px 11px; }
  .input-category textarea:not(.address-text) { min-height:88px; }
  .input-category .address-entry { margin-bottom:0; }
  .input-category .address-entry>.field>small { grid-row:auto; }
  .row-card { padding:16px 0; }
  .row-heading strong { font-size:15px; }
  .table-wrap { font-size:14px; }
  .panel>.table-wrap th { font-size:13px; }
  .panel>.table-wrap td,.panel>.table-wrap th { padding:10px 9px; }
  .step-footer { padding:14px 0; }
  .step-footer>span { font-size:13px; }
  .side-tools summary:focus-visible,.sidebar a:focus-visible,.sidebar button:focus-visible { outline-color:#70e0d5; }
  .workspace-footer { font-size:12px; }
  @media(max-width:1280px) and (min-width:761px) {
    .sidebar { width:232px; padding:18px 12px 12px; }
    .sidebar .brand { font-size:16px; }
    .workspace { padding:0 20px; }
    .input-category { grid-template-columns:88px minmax(0,1fr); }
    .category-fields { padding:12px; }
  }
  @media(max-width:1080px) and (min-width:761px) {
    .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .header-actions { flex-wrap:wrap; }
    .case-heading { flex-wrap:wrap; }
    .journey-step { padding:8px; gap:6px; }
    .journey-step .journey-label { font-size:14px; }
  }
  @media(max-width:760px) {
    .sidebar { width:100%; height:auto; padding:14px 16px; }
    .sidebar .brand { font-size:16px; }
    .sidebar .brand-icon { width:30px; height:34px; }
    .sidebar .mobile-menu { color:#fff; background:transparent; border-color:#8da6b5; min-height:44px; }
    .sidebar .local-label { margin:14px 0; }
    .sidebar .case-list { max-height:230px; }
    .workspace { padding:0 16px; }
    .case-heading { padding:18px 0 8px; flex-wrap:wrap; }
    .case-heading h1 { font-size:22px; }
    .header-actions { width:100%; justify-content:flex-start; }
    .header-actions button,.case-tools summary { min-height:44px; }
    .workflow-status { gap:8px; padding-bottom:12px; }
    .workflow-next { flex-basis:100%; }
    .journey-step { gap:5px; padding:8px 3px; min-height:52px; }
    .journey-step .journey-number { flex-basis:24px; width:24px; height:24px; font-size:14px; }
    .journey-step .journey-label { font-size:13px; white-space:normal; }
    .journey-step::after { display:none; }
    .stage-tabs { gap:0; }
    .stage-tabs .tab { padding:10px; font-size:14px; }
    .panel { padding:14px 12px; }
    .input-category { display:block; }
    .input-category>h3 { padding:9px 12px; }
    .category-fields { padding:12px; }
    .form-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
    input:not([type=checkbox]),select,textarea { font-size:16px; min-height:44px; }
    .input-category .address-entry { display:grid; grid-template-columns:minmax(0,1fr); }
    .input-category .address-entry>.field>span { grid-column:1; grid-row:1; }
    .input-category .address-entry>.field>.address-text { grid-column:1; grid-row:2; min-height:44px; }
    .input-category .address-entry>.address-search-button { grid-column:1; grid-row:3; justify-self:start; min-height:44px; }
    .input-category .address-entry>.field>small { grid-column:1; grid-row:auto; }
    .input-category .field.wide { grid-column:auto; }
    .step-footer>div { flex-wrap:wrap; }
    .step-footer button { min-height:44px; }
    .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  }
}

/* workstation-step-nav-77: one surface; current number and label carry the accent. */
@media screen {
  .journey { background:#eaf0f3; }
  .journey-step,
  .journey-step.active,
  .journey-step:hover,
  .journey-step.active:hover { background:transparent; }
  .journey-step { color:#526572; }
  .journey-step.active { color:#087772; }
  .journey-step .journey-number {
    background:transparent;
    color:#526572;
    border:1px solid #91a3af;
  }
  .journey-step.active .journey-number {
    background:transparent;
    color:#087772;
    border-color:#087772;
  }
  .journey-step .journey-label { color:inherit; }
  .journey-step::after,
  .journey-step:not(:last-child)::after { content:none; display:none; }
}

/* creditor-directory-v1 */
@media screen {
 .institution-panel { padding:12px 14px; }
 .institution-panel summary { cursor:pointer; font-size:15px; font-weight:650; color:var(--ink,#203542); }
 .institution-panel summary>span { margin-left:8px; font-size:12px; font-weight:400; color:var(--muted,#4b616c); }
 .institution-toolbar { display:flex; align-items:end; gap:8px; margin-top:12px; }
 .institution-toolbar .field { flex:1; margin:0; }
 .institution-toolbar button { flex-shrink:0; min-height:36px; }
 .institution-note { display:block; font-size:12px; line-height:1.5; color:var(--muted,#4b616c); margin:8px 0; }
 .institution-results { padding:0; margin:8px 0; list-style:none; max-height:310px; overflow-y:auto; overscroll-behavior:contain; border-block:1px solid var(--line,#b8c6ce); scrollbar-width:thin; scrollbar-color:#8a9da7 #e7edf0; }
 .institution-result { display:grid; grid-template-columns:minmax(0,1fr) 36px 36px; align-items:center; gap:6px; padding:8px 0; border-bottom:1px solid #d6dfe4; }
 .institution-result:last-child { border-bottom:0; }
 .institution-choice { display:flex; align-items:start; gap:9px; cursor:pointer; min-width:0; }
 .institution-choice>input { width:18px; height:18px; flex-shrink:0; margin:2px 0 0; accent-color:var(--teal,#08746f); }
 .institution-choice>span { min-width:0; }
 .institution-choice strong,.institution-choice small { display:block; overflow-wrap:anywhere; }
 .institution-choice small { font-size:12px; color:var(--muted,#4b616c); line-height:1.5; }
 .institution-favorite { display:grid; place-items:center; width:36px; height:36px; padding:0; color:#4b616c; background:transparent; }
 .institution-favorite[aria-pressed="true"] { color:#08746f; background:#e5f2ef; }
 .institution-source { font-size:12px; color:#086e69; text-align:center; }
 .institution-empty { padding:14px 6px; font-size:13px; color:var(--muted,#4b616c); }
 .institution-bottom { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-top:8px; }
 .institution-bottom>span { margin-right:auto; font-size:13px; font-weight:600; }
 .institution-name-field { min-width:0; position:relative; }
 .institution-name-field>.field { margin:0; }
 .institution-lookup-button { margin-top:6px; min-height:32px; padding:4px 8px; font-size:12px; }
 .institution-lookup { margin-top:8px; padding:10px; border:1px solid var(--control-line,#7b8f99); background:#f3f7f8; border-radius:4px; }
 .institution-lookup[hidden] { display:none; }
 .institution-lookup [role="option"] { display:block; width:100%; margin:5px 0; padding:8px; text-align:left; white-space:normal; background:white; color:var(--ink,#203542); }
 .institution-lookup [role="option"] strong,.institution-lookup [role="option"] small { display:block; overflow-wrap:anywhere; }
 .institution-lookup [role="option"] small { font-size:12px; color:var(--muted,#4b616c); line-height:1.5; margin-top:3px; }
 .institution-lookup [role="option"][aria-selected="true"],.institution-lookup [role="option"]:hover { background:#e5f2ef; border-color:#08746f; }
 .institution-panel [aria-pressed="true"] { border-color:#08746f; }
 @media(max-width:640px) {
  .institution-toolbar { flex-wrap:wrap; align-items:stretch; }
  .institution-toolbar .field { flex-basis:100%; }
  .institution-lookup-button,.institution-favorite { min-height:40px; }
  .institution-name-field { grid-column:1/-1; }
  .institution-bottom .primary { flex-grow:1; }
  .institution-panel { padding:12px; }
 }
}
@media print { .institution-panel,.institution-lookup,.institution-lookup-button { display:none!important; } }

/* Shared calendar parts: four-digit year and separate keyboard Tab stops. */
.date-field { min-width:0; }
.date-parts { display:grid; grid-template-columns:minmax(0,1.4fr) auto minmax(0,1fr) auto minmax(0,1fr) auto; align-items:center; gap:6px; }
.date-parts>input { min-width:0; width:100%; padding-inline:5px; text-align:center; font-variant-numeric:tabular-nums; }
.date-parts>span { color:var(--muted,#4b616c); }
.date-parts>button { padding-inline:8px; white-space:nowrap; }
.date-error { color:#a52b24; }
.date-parts>input[aria-invalid="true"] { border-color:#a52b24; }

/* creditor-bulk-date-v1: begin */
.creditor-bulk-date-toolbar { display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px 12px; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid var(--line); }
.creditor-bulk-date-toolbar>.date-field { flex:0 1 300px; min-width:0; }
.creditor-bulk-date-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding-top:24px; }
.creditor-bulk-date-actions>span { font-size:13px; color:var(--muted); }
.creditor-bulk-date-toolbar>#creditorBulkDateStatus { flex-basis:100%; margin:0; }
@media(max-width:640px) {
  .creditor-bulk-date-toolbar>.date-field { flex-basis:100%; width:100%; }
  .creditor-bulk-date-actions { width:100%; padding-top:0; }
}
@media print { .creditor-bulk-date-toolbar { display:none!important; } }


/* korean-name-input-v1: begin */
.korean-name-field { position:relative; min-width:0; }
.korean-name-field > .field > span:first-child { padding-inline-end:80px; }
.korean-name-mode { position:absolute; inset-inline-end:0; top:-3px; min-height:26px; padding:2px 7px; border:1px solid #9db5ba; border-radius:4px; background:#f3f8f8; color:#205858; font-size:12px; line-height:20px; white-space:nowrap; }
.korean-name-mode[aria-pressed="false"] { background:#f5f6f8; color:#344854; border-color:#a4b3bd; }
.korean-name-mode:hover:not(:disabled) { background:#e2eeee; border-color:#397c7b; }
.korean-name-mode:focus-visible { outline:2px solid #087e7b; outline-offset:2px; }
.korean-name-mode:disabled { opacity:.65; cursor:default; }
@media (pointer:coarse) { .korean-name-mode { min-height:32px; top:-6px; } }


/* korean-fields-v2: begin */
/* Keep the existing address grid, search panel, wrapping and textarea resizing. */
.korean-address-field .address-entry > .field > span:first-child { padding-inline-end:80px; }
.korean-address-field .address-entry > .korean-name-mode { position:static; grid-column:1; grid-row:1; justify-self:end; align-self:center; margin-block:-3px; }
@media (pointer:coarse) { .korean-address-field .address-entry > .korean-name-mode { margin-block:-6px; } }


/* Shared interaction vocabulary for the editing surface; never applied to paper output. */
@media screen {
 :root { --ui-surface:#fff; --ui-surface-soft:#f3f6f8; --ui-border:#b8c7cf; --ui-ink:#263e4b; --ui-muted:#506571; --ui-active:#076d67; --ui-active-soft:#e6f3f0; --ui-radius:6px; --ui-gap:8px; }
 .workspace .asset-kind-nav { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 16px; padding:0; border:0; }
 .workspace .asset-kind-nav a { display:inline-flex; align-items:center; justify-content:space-between; gap:10px; min-height:40px; padding:8px 12px; border:1px solid var(--ui-border); border-radius:var(--ui-radius); background:var(--ui-surface); color:var(--ui-ink); text-decoration:none; font-size:14px; line-height:1.4; font-weight:500; }
 .workspace .asset-kind-nav .asset-kind-label { color:inherit; font-size:inherit; font-weight:inherit; }
 .workspace .asset-kind-nav .asset-kind-count { display:inline-flex; align-items:center; justify-content:center; min-width:22px; min-height:22px; padding:1px 5px; border-radius:4px; background:#edf1f3; color:var(--ui-muted); font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
 .workspace .asset-kind-nav a.has-entries .asset-kind-count { color:var(--ui-active); background:var(--ui-active-soft); }
 .workspace .asset-kind-nav a:hover { border-color:var(--ui-active); background:#f5faf9; }
 .workspace .asset-kind-nav a[aria-current="location"] { border-color:var(--ui-active); background:var(--ui-active-soft); color:var(--ui-active); font-weight:650; box-shadow:inset 0 0 0 1px var(--ui-active); }
 .workspace .asset-kind-nav a[aria-current="location"] .asset-kind-count { background:var(--ui-active); color:#fff; }
 .asset-group-heading h2 { scroll-margin-top:20px; }
 .asset-group-heading h2:focus-visible { outline:2px solid var(--ui-active); outline-offset:4px; }
 .workspace .ui-disclosure { border:1px solid var(--ui-border); border-radius:var(--ui-radius); background:var(--ui-surface); padding:0; margin:0 0 8px; min-width:0; }
 .workspace .ui-disclosure>summary { display:list-item; list-style-position:inside; cursor:pointer; min-height:44px; padding:11px 12px; margin:0; color:var(--ui-ink); font-size:14px; line-height:1.5; font-weight:600; border-radius:var(--ui-radius); }
 .workspace .ui-disclosure>summary::marker { color:var(--ui-muted); font-size:.85em; }
 .workspace .ui-disclosure>summary:hover { background:var(--ui-surface-soft); }
 .workspace .ui-disclosure[open]>summary { background:var(--ui-surface-soft); border-bottom:1px solid var(--ui-border); border-radius:var(--ui-radius) var(--ui-radius) 0 0; }
 .ui-summary-content { display:inline-flex; width:calc(100% - 20px); align-items:center; justify-content:space-between; gap:8px 12px; vertical-align:middle; min-width:0; }
 .ui-summary-content>.details-label { min-width:0; overflow-wrap:anywhere; font-size:14px; font-weight:600; color:var(--ui-ink); }
 .ui-summary-content>.details-state { flex:0 0 auto; max-width:55%; margin:0; padding:3px 8px; border-radius:4px; background:#edf1f3; color:var(--ui-muted); font-size:12px; line-height:1.5; font-weight:500; overflow-wrap:anywhere; text-align:right; }
 .ui-summary-content>.details-state.is-active { background:var(--ui-active-soft); color:#075c54; }
 .ui-summary-content>.details-state.is-empty { background:#f1f3f5; color:#536672; }
 .ui-summary-content>.details-state.needs-work { background:#fff0ee; color:#923c35; }
 .ui-disclosure.has-input-error { border-color:#b25248; }
 .optional-section.ui-disclosure>.panel,.optional-section.ui-disclosure>.optional-body,.optional-section.ui-disclosure>.form-grid { padding:12px; margin:0; }
 .optional-section.ui-disclosure>.panel { border:0; background:transparent; }
 .ui-disclosure:not(.optional-section)>:not(summary) { margin-left:12px; margin-right:12px; }
 .ui-disclosure:not(.optional-section)>:last-child:not(summary) { margin-bottom:12px; }
 .panel-description-details.workspace .ui-disclosure { max-width:none; }
 .ui-disclosure .workspace .ui-disclosure { margin-top:8px; }
 .workspace .ui-action-link { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; padding:8px 12px; border:1px solid var(--control-line); border-radius:4px; background:#fff; color:var(--ui-active); text-decoration:none; font-size:14px; font-weight:600; line-height:1.4; text-align:center; overflow-wrap:anywhere; }
 .workspace .ui-action-link:hover { background:var(--ui-active-soft); border-color:var(--ui-active); }
 .workspace :where(.panel-bottom,.preview-controls,.section-actions,.row-heading):not(.print-pages *) { flex-wrap:wrap; gap:8px 12px; }
 .workspace .ui-structured-list { list-style:none; padding:0; margin:0; }
 .workspace .ui-structured-list>li { margin:0; padding:10px 0; border-bottom:1px solid #d6e0e5; line-height:1.6; overflow-wrap:anywhere; }
 .workspace .ui-structured-list>li:last-child { border-bottom:0; }
 .workspace .ui-structured-list .chip { margin-right:6px; }
 .workspace .stage-tabs .tab { border-radius:4px 4px 0 0; }
 .workspace .stage-tabs .tab:hover { background:#e7eef1; }
 .workspace .stage-tabs .tab.active { background:#e6f3f0; color:var(--ui-active); }
 .workspace .table-wrap a.ui-action-link { min-height:36px; padding:6px 9px; font-size:13px; }
 @media(max-width:760px) {
  .workspace .asset-kind-nav { gap:8px; }
  .workspace .asset-kind-nav a { min-height:44px; padding:9px 11px; }
  .workspace .ui-disclosure>summary { min-height:48px; padding:11px 10px; }
  .ui-summary-content { gap:5px 8px; flex-wrap:wrap; }
  .ui-summary-content>.details-label { flex:1 1 160px; }
  .ui-summary-content>.details-state { flex:0 1 auto; max-width:100%; text-align:left; }
  .workspace .ui-action-link { min-height:44px; }
  .workspace .table-wrap a.ui-action-link { min-height:44px; }
 }
}

/* Shared Korean input controls: keep labels and long text full width. */
.korean-input-wrapper { min-width:0; width:100%; padding-top:26px; }
.korean-input-wrapper.wide { grid-column:1/-1; }
.korean-input-wrapper > label { display:flex; flex-direction:column; min-width:0; width:100%; }
.korean-input-wrapper > label > input, .korean-input-wrapper > label > textarea { width:100%; min-width:0; box-sizing:border-box; }
.korean-input-wrapper > .korean-input-mode { top:0; }
.address-entry > .korean-input-mode { position:static; grid-column:1; grid-row:1; justify-self:end; align-self:center; }
