:root {
  color-scheme: light;
  --canvas: #ffffff;
  --rail: #f7f9fc;
  --rail-selected: #eaf2ff;
  --text: #141820;
  --muted: #667181;
  --subtle: #8a94a3;
  --border: #dce2ea;
  --border-strong: #c8d1dd;
  --primary: #0969e8;
  --primary-dark: #0758c7;
  --primary-soft: #eef5ff;
  --success: #0b7f4f;
  --success-soft: #e8f8f0;
  --warning: #bf6200;
  --danger: #c93434;
  --radius: 6px;
  --radius-region: 8px;
  --radius-modal: 10px;
  --topbar: 60px;
  --nav: 194px;
  --inspector: 484px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--canvas); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary-dark) 28%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: -80px; left: 12px; padding: 10px 14px; border-radius: var(--radius); color: #fff; background: var(--text); text-decoration: none; }
.skip-link:focus { top: 10px; }

.sign-in-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: linear-gradient(145deg, #f4f7fa 0%, #eaf0f5 100%); }
.sign-in-card { display: grid; width: min(100%, 420px); gap: 18px; padding: 32px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 18px 48px rgba(25, 45, 61, .12); }
.sign-in-card h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.sign-in-card > p:not(.sign-in-kicker):not(.sign-in-note) { margin: -7px 0 0; color: var(--muted); line-height: 1.7; }
.sign-in-kicker { margin: 0; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.sign-in-card form { display: grid; gap: 15px; }
.sign-in-card label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.sign-in-card input { min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); background: #fff; font: inherit; }
.sign-in-card .primary-button { width: 100%; }
.sign-in-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: var(--nav) minmax(560px, 1fr) var(--inspector); grid-template-rows: var(--topbar) minmax(calc(100vh - var(--topbar)), auto); grid-template-areas: "topbar topbar topbar" "nav main inspector"; }
.topbar { grid-area: topbar; z-index: 30; display: flex; align-items: center; gap: 28px; padding: 0 16px 0 22px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.98); }
.brand { min-width: 144px; color: var(--text); font-size: 18px; font-weight: 500; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.brand strong { font-weight: 760; }
.global-search { position: relative; display: flex; width: min(420px, 38vw); align-items: center; margin-left: 20px; }
.global-search svg { position: absolute; left: 12px; color: var(--muted); }
.global-search input { width: 100%; height: 38px; padding: 0 12px 0 40px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); background: #fff; }
.global-search input::placeholder { color: var(--subtle); }
.topbar-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.role-control { display: flex; align-items: center; gap: 8px; }
.role-control > span { color: var(--muted); font-size: 12px; }
.role-control select { min-width: 144px; height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); background: #fff; }

.primary-button, .quiet-button, .outline-button, .danger-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: var(--radius); font-weight: 700; line-height: 1.2; cursor: pointer; }
.primary-button { border: 1px solid var(--primary); color: #fff; background: var(--primary); }
.primary-button:hover:not(:disabled) { border-color: var(--primary-dark); background: var(--primary-dark); }
.primary-button.compact, .quiet-button, .outline-button, .danger-button { min-height: 38px; padding: 0 13px; font-size: 13px; }
.quiet-button { border: 1px solid var(--border-strong); color: var(--text); background: #fff; }
.quiet-button:hover:not(:disabled), .outline-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.outline-button { border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); color: var(--primary); background: #fff; }
.danger-button { border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); background: #fff; }
button:disabled { cursor: not-allowed; opacity: .48; }
.icon-button { display: inline-grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--muted); background: #fff; cursor: pointer; }
.icon-button:hover { border-color: var(--primary); color: var(--primary); }

.side-navigation { grid-area: nav; position: sticky; top: var(--topbar); display: flex; height: calc(100vh - var(--topbar)); flex-direction: column; gap: 6px; padding: 24px 6px 16px; border-right: 1px solid var(--border); background: var(--canvas); }
.nav-link { display: flex; min-height: 48px; align-items: center; gap: 12px; padding: 0 14px; border-left: 4px solid transparent; border-radius: 0 var(--radius) var(--radius) 0; color: var(--text); font-weight: 600; text-decoration: none; }
.nav-link:hover { color: var(--primary); background: var(--rail); }
.nav-link.is-current { border-left-color: var(--primary); color: var(--primary); background: var(--rail-selected); }
.environment-note { margin: auto 10px 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }

.main-content { grid-area: main; min-width: 0; padding: 26px 28px 56px; background: var(--canvas); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; margin: 0 0 20px; }
.page-heading h1 { margin: 0; font-size: clamp(24px, 2.1vw, 28px); font-weight: 760; line-height: 1.25; letter-spacing: -.035em; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.mobile-create { display: none; }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-region); background: #fff; }
.summary-strip article { display: grid; min-height: 84px; align-content: center; gap: 2px; padding: 12px 18px; border-right: 1px solid var(--border); }
.summary-strip article:last-child { border-right: 0; }
.summary-strip span { color: var(--muted); font-size: 12px; font-weight: 600; }
.summary-strip strong { color: var(--primary); font-size: 25px; line-height: 1.2; }
.summary-strip article:nth-child(2) strong { color: var(--warning); }
.summary-strip article:nth-child(3) strong { color: var(--success); }
.summary-strip article:nth-child(4) strong { color: var(--danger); }

.case-board { min-width: 0; }
.filters { display: grid; grid-template-columns: minmax(180px, 1.7fr) repeat(3, minmax(105px, .85fr)) auto auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius-region) var(--radius-region) 0 0; background: var(--rail); }
.filters label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 650; }
.filters input, .filters select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); background: #fff; }
.search-field { position: relative; align-self: end; }
.search-field svg { position: absolute; z-index: 1; bottom: 9px; left: 11px; width: 18px; color: var(--muted); }
.search-field input { padding-left: 38px; }

.table-frame { overflow: auto; border: 1px solid var(--border); border-radius: 0 0 var(--radius-region) var(--radius-region); background: #fff; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 12px; text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #fbfcfe; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
th:nth-child(1) { width: 22%; } th:nth-child(2) { width: 15%; } th:nth-child(3) { width: 11%; } th:nth-child(4) { width: 19%; } th:nth-child(5) { width: 12%; } th:nth-child(6) { width: 10%; } th:nth-child(7) { width: 11%; }
tbody tr { cursor: pointer; transition: background-color 150ms ease, box-shadow 150ms ease; }
tbody tr:hover { background: var(--rail); }
tbody tr.is-selected { background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }
tbody tr:last-child td { border-bottom: 0; }
.case-link { display: grid; width: 100%; gap: 1px; padding: 0; border: 0; color: var(--text); background: transparent; font-weight: 700; text-align: left; cursor: pointer; }
.case-link small { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.stage-chip, .status-chip { display: inline-flex; max-width: 100%; min-height: 26px; align-items: center; padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border)); border-radius: 4px; color: var(--primary); background: var(--primary-soft); font-weight: 700; line-height: 1.3; }
.status-chip.success { border-color: color-mix(in srgb, var(--success) 30%, var(--border)); color: var(--success); background: var(--success-soft); }
.status-chip.warning { border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); color: var(--warning); background: #fff7e8; }
.status-chip.danger { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); color: var(--danger); background: #fff1f1; }
.muted-value { color: var(--muted); }
.deadline { color: var(--warning); font-weight: 700; }
.empty-state { margin: 0; padding: 52px 20px; color: var(--muted); text-align: center; }
.result-count { margin: 8px 2px 0; color: var(--muted); font-size: 11px; }

.inspector { grid-area: inspector; position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow: auto; border-left: 1px solid var(--border); background: #fff; }
.inspector-empty { display: grid; min-height: 100%; place-content: center; justify-items: center; gap: 8px; padding: 32px; color: var(--muted); text-align: center; }
.inspector-empty svg { width: 32px; height: 32px; }
.inspector-header { display: flex; min-height: 72px; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px 12px; }
.inspector-header h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.inspector-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.inspector-close { display: none; }
.tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.tabs button { min-height: 42px; padding: 6px 4px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.tabs button:hover { color: var(--primary); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); }
.tab-panel { padding: 16px 18px 32px; }
.panel-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.panel-section:first-child { padding-top: 0; }
.panel-section:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-heading h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.section-heading .quiet-button, .section-heading .outline-button { min-height: 34px; padding: 0 9px; font-size: 11px; }
.definition-list { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px 12px; margin: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.stage-flow { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.stage-flow li { position: relative; display: grid; min-height: 34px; grid-template-columns: 22px 1fr; align-items: start; gap: 8px; color: var(--muted); font-size: 11px; }
.stage-flow li::before { z-index: 1; display: block; width: 13px; height: 13px; margin: 2px 0 0 3px; border: 1px solid var(--subtle); border-radius: 50%; background: #fff; content: ""; }
.stage-flow li:not(:last-child)::after { position: absolute; top: 16px; bottom: 0; left: 9px; width: 1px; background: var(--border-strong); content: ""; }
.stage-flow li.is-complete { color: var(--success); }
.stage-flow li.is-complete::before { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 3px #fff; }
.stage-flow li.is-current { color: var(--primary); font-weight: 750; }
.stage-flow li.is-current::before { width: 17px; height: 17px; margin: 0 0 0 1px; border: 3px solid #fff; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.record-list { display: grid; gap: 0; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); list-style: none; }
.record-list li { display: grid; gap: 3px; padding: 10px 11px; border-bottom: 1px solid var(--border); }
.record-list li:last-child { border-bottom: 0; }
.record-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.record-title { font-weight: 700; }
.record-meta { color: var(--muted); font-size: 11px; }
.document-create-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.document-create-actions button { justify-content: center; min-height: 38px; padding-inline: 9px; font-size: 11px; }
.document-draft-list li { padding: 0; }
.document-draft-row { display: grid; width: 100%; min-height: 50px; gap: 4px; padding: 10px 11px; border: 0; color: var(--text); background: #fff; text-align: left; cursor: pointer; }
.document-draft-row:hover { background: var(--rail); }
.document-draft-row.is-selected { background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }
.document-draft-row .record-line { width: 100%; }
.document-preview { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-region); background: #fff; }
.document-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.document-preview-kicker { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.document-preview h4 { margin: 0; font-size: 18px; line-height: 1.4; }
.document-preview-type { margin: -6px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.document-preview .definition-list { grid-template-columns: 116px minmax(0, 1fr); padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.document-preview-summary { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-preview-disclaimer { margin: 0; padding: 10px; border-left: 3px solid var(--primary); color: var(--muted); background: var(--rail); font-size: 11px; line-height: 1.6; }
.document-preview .button-row { margin-top: 0; }
.empty-inline { margin: 0; padding: 20px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-list li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 9px; padding-bottom: 15px; }
.activity-list li::before { z-index: 1; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--border-strong); content: ""; }
.activity-list li:not(:last-child)::after { position: absolute; top: 13px; bottom: 0; left: 4px; width: 1px; background: var(--border); content: ""; }
.activity-list p { margin: 0; }
.activity-list small { color: var(--muted); }
.permission-note { margin: 12px 0 0; padding: 9px 10px; border-left: 3px solid var(--border-strong); color: var(--muted); background: var(--rail); font-size: 11px; }

.bottom-navigation { display: none; }
.form-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); padding: 0; overflow: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-modal); color: var(--text); background: #fff; box-shadow: 0 18px 48px rgba(20,24,32,.16); }
.form-dialog::backdrop { background: rgba(20,24,32,.38); }
.form-dialog form > header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); background: #fff; }
.form-dialog h2 { margin: 0; font-size: 18px; }
.dialog-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.dialog-fields label { display: grid; align-content: start; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.dialog-fields label.full { grid-column: 1 / -1; }
.dialog-fields label.check-field { grid-template-columns: 20px minmax(0, 1fr); align-items: center; }
.dialog-fields label.check-field > span { grid-column: 2; }
.dialog-fields label.check-field > input[type="checkbox"] { grid-row: 1; grid-column: 1; width: 18px; min-height: 18px; margin: 0; padding: 0; }
.dialog-fields label.check-field > small { grid-column: 2; }
.dialog-fields input, .dialog-fields select, .dialog-fields textarea { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); background: #fff; }
.dialog-fields textarea { min-height: 96px; resize: vertical; }
.dialog-fields [aria-invalid="true"] { border-color: var(--danger); }
.form-error { min-height: 22px; margin: 0; padding: 0 18px; color: var(--danger); font-size: 12px; }
.form-dialog footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); background: #fff; }
.toast { position: fixed; z-index: 1001; right: 20px; bottom: 20px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border)); border-radius: var(--radius); color: var(--success); background: var(--success-soft); font-weight: 700; }
.toast.is-error { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); color: var(--danger); background: #fff1f1; }

@media (max-width: 1280px) {
  :root { --inspector: 420px; }
  .main-content { padding-inline: 18px; }
  .filters { grid-template-columns: minmax(160px, 1.5fr) repeat(3, minmax(92px, .8fr)); }
  .filters button { grid-row: 2; }
}

@media (max-width: 1100px) {
  :root { --topbar: 68px; }
  .app-shell { display: grid; padding-bottom: 76px; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--topbar) auto auto; grid-template-areas: "topbar" "main" "inspector"; }
  .topbar { position: sticky; top: 0; padding: 0 22px; }
  .brand { font-size: 20px; }
  .global-search { width: 44px; margin-left: auto; }
  .global-search input { width: 44px; padding: 0; color: transparent; cursor: pointer; }
  .global-search input::placeholder { color: transparent; }
  .global-search:focus-within { position: absolute; z-index: 5; right: 210px; width: min(420px, calc(100vw - 260px)); }
  .global-search:focus-within input { width: 100%; padding-left: 40px; color: var(--text); cursor: text; }
  .global-search:focus-within input::placeholder { color: var(--subtle); }
  .topbar-actions { margin-left: 0; }
  .role-control > span { display: none; }
  .role-control select { min-width: 150px; border-color: transparent; font-size: 15px; }
  .topbar .primary-button { display: none; }
  .side-navigation { display: none; }
  .main-content { padding: 30px 22px 20px; }
  .page-heading { align-items: center; }
  .page-heading h1 { font-size: 30px; }
  .mobile-create { display: inline-flex; }
  .summary-strip { display: none; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 0 20px; border: 0; background: #fff; }
  .filters .search-field { display: none; }
  .filters label { font-size: 0; }
  .filters select { height: 52px; padding: 0 40px 0 16px; font-size: 15px; font-weight: 650; }
  .filters label:nth-of-type(2)::before, .filters label:nth-of-type(3)::before, .filters label:nth-of-type(4)::before { position: absolute; pointer-events: none; }
  .filters button { display: none; }
  .table-frame { overflow: visible; border-radius: var(--radius-region); }
  table, tbody { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody tr { display: grid; min-height: 84px; grid-template-columns: minmax(170px, 1.45fr) minmax(110px, .9fr) minmax(70px, .55fr) minmax(130px, 1fr) minmax(98px, .75fr) minmax(78px, .55fr) minmax(88px, .65fr); align-items: center; }
  tbody td { display: block; min-width: 0; padding: 16px 10px; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  tbody td:first-child { padding-left: 70px; }
  tbody td:first-child::before { position: absolute; left: 29px; width: 9px; height: 9px; margin-top: 11px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); content: ""; transform: rotate(-45deg); }
  tbody tr.is-selected td:first-child::before { transform: rotate(45deg); }
  .case-link { font-size: 16px; }
  .case-link small { font-size: 13px; }
  .result-count { margin-bottom: 8px; }
  .inspector { position: static; min-width: 0; height: auto; margin: 8px 22px 20px; overflow: visible; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)); border-radius: var(--radius-region); }
  .inspector-empty { display: none; }
  .inspector-header { padding: 16px; }
  .inspector-close { display: inline-grid; }
  .tabs button { min-height: 50px; font-size: 13px; }
  .tab-panel { padding: 18px 22px 28px; }
  .bottom-navigation { position: fixed; z-index: 1000; right: 0; bottom: 0; left: 0; display: grid; height: 76px; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); background: rgba(255,255,255,.98); pointer-events: auto; transform: translateZ(0); }
  .bottom-navigation a { position: relative; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 3px; color: var(--text); font-size: 12px; text-decoration: none; pointer-events: auto; }
  .bottom-navigation a.is-current { color: var(--primary); background: linear-gradient(to bottom, var(--primary-soft), #fff); }
  .bottom-navigation svg { width: 24px; height: 24px; }
  .toast { bottom: 90px; }
}

@media (max-width: 760px) {
  .topbar { gap: 8px; padding-inline: 14px; }
  .brand { min-width: 0; font-size: 17px; }
  .global-search { display: none; }
  .role-control select { min-width: 124px; min-height: 44px; max-width: 136px; padding-left: 5px; font-size: 13px; }
  .main-content { padding: 24px 14px 16px; }
  .page-heading { gap: 12px; }
  .page-heading h1 { font-size: 25px; }
  .mobile-create { min-height: 48px; flex: 0 0 auto; padding-inline: 13px; }
  .filters { gap: 8px; }
  .filters select { height: 48px; padding-inline: 10px 28px; font-size: 13px; }
  tbody tr { position: relative; grid-template-columns: 1.4fr .9fr; padding: 10px 8px 10px 38px; }
  tbody td { padding: 5px 8px; border-bottom: 0; font-size: 12px; }
  tbody td:first-child { grid-column: 1 / -1; padding: 5px 8px; }
  tbody td:first-child::before { left: 14px; margin-top: 9px; }
  tbody td:nth-child(4) { grid-column: 1 / 2; }
  tbody td:nth-child(5) { grid-column: 2 / 3; }
  tbody td:nth-child(6), tbody td:nth-child(7) { display: none; }
  .inspector { margin: 8px 14px 20px; }
  .tabs { overflow-x: auto; grid-template-columns: repeat(6, minmax(82px, 1fr)); }
  .tab-panel { padding: 16px 14px 24px; }
  .section-heading .quiet-button, .section-heading .outline-button, .form-dialog footer .quiet-button, .form-dialog footer .outline-button { min-height: 44px; }
  .tab-panel select, .dialog-fields input, .dialog-fields select, .dialog-fields textarea { min-height: 44px; }
  .dialog-fields label.check-field { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .definition-list { grid-template-columns: 96px minmax(0, 1fr); }
  .document-create-actions button { min-height: 44px; }
  .document-preview-actions .outline-button, .document-preview-actions .primary-button { min-height: 44px; }
  .document-preview { padding: 14px; }
  .document-preview .definition-list { grid-template-columns: 96px minmax(0, 1fr); }
  .dialog-fields { grid-template-columns: 1fr; }
  .dialog-fields label.full { grid-column: auto; }
}

@media print {
  @page { margin: 12mm; }
  body > * { visibility: hidden !important; }
  .document-preview, .document-preview * { visibility: visible !important; }
  .document-preview { position: fixed; inset: 0; width: auto; padding: 0; border: 0; border-radius: 0; background: #fff; }
  .document-preview-actions { display: none !important; }
  .document-preview-disclaimer { display: block !important; border: 1px solid #111; color: #111; background: #fff; font-weight: 800; }
}

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