/* Shared workspace: navigation, account controls and reading hierarchy. */
:root {
  --ink: #202a36;
  --navy: #202a36;
  --muted: #546171;
  --line: #dce2e8;
  --bg: #f2f4f7;
  --blue: #b71234;
  --blue-2: #99102d;
}
:where(input, select, textarea, button, summary) { font-family: inherit; }
.app-shell { background: var(--bg); }
.sidebar { width: 204px; flex-basis: 204px; padding: 24px 14px 20px; }
.brand { padding: 0 0 24px; }
.brand strong { color: #9f1231; font-size: 19px; }
.brand small { color: var(--muted); font-size: 12px; }
.nav-list { gap: 5px; }
.nav-item { min-height: 46px; padding: 10px 14px; font-size: 16px; gap: 12px; border-radius: 7px; }
.nav-item.active { color: #a50e30; background: #fceaf0; box-shadow: inset 3px 0 #bc173c; }
.sidebar-footer { padding-inline: 4px; }
.topbar {
  height: auto; min-height: 64px; gap: 18px; padding: 9px clamp(16px,2.4vw,36px);
  display: flex; justify-content: space-between; align-items: center; background: #fff;
}
.global-search { width: min(100%,490px); min-width: 0; height: 42px; gap: 7px; padding: 0 4px 0 12px; background: #f8f9fb; }
.global-search .search-icon { flex: none; color: #536071; }
.global-search input { font-size: 15px; min-width: 0; flex: 1; padding: 4px 0; }
.global-search input::placeholder { color: #627083; }
.global-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px #b7123414; }
.global-search .btn { flex: none; min-height: 32px; padding: 4px 10px; }
.top-actions { display: flex; width: auto; gap: 12px; align-items: center; }
.top-actions .notification { display: grid; place-content: center; color: #536071; width: 40px; height: 40px; }
.account-tools { display: block; position: relative; flex: none; }
.account-tools summary { display: flex; align-items: center; gap: 9px; list-style: none; min-height: 42px; padding: 3px 7px; border-radius: 7px; cursor: pointer; }
.account-tools summary:hover,.account-tools[open] summary { background: #f4f5f7; }
.account-tools summary::-webkit-details-marker { display: none; }
.account-tools .avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; background: #f7e8ed; color: #9e1431; font-weight: 700; }
.account-tools .user-copy { display: block; }
.account-tools .user-copy strong { font-size: 14px; line-height: 1.4; }
.account-tools .user-copy small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.account-chevron { width: 7px; height: 7px; border: solid #5a6775; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin: 0 3px 4px 1px; }
.account-tools[open] .account-chevron { transform: rotate(225deg); margin-block: 4px 0; }
.account-panel { position: absolute; right: 0; top: calc(100% + 5px); z-index: 15; display: grid; min-width: 158px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 26px #1b283522; }
.account-tools:not([open]) .account-panel,.account-guide { display: none; }
.account-panel button,.account-panel a { display: block; padding: 9px 12px; border: 0; min-height: 40px; border-radius: 4px; background: none; text-align: left; font: inherit; font-size: 14px; line-height: 1.5; color: var(--ink); cursor: pointer; text-decoration: none; }
.account-panel .account-guide { display: none; }
.account-panel :is(button,a):hover,.account-panel :is(button,a):focus-visible { background: #f4f6f8; }
.account-panel #logoutBtn { border-top: 1px solid #e7eaf0; border-radius: 0; color: #941a35; }
.shared-status-row { min-height: 36px; padding: 4px clamp(16px,2.4vw,36px); align-items: center; background: white; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.45; }
.shared-status-copy { align-items: center; gap: 6px 14px; }
#sharedStatus::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #148462; margin: 0 7px 1px 0; }
#sharedStatus.sync-error::before { background: #c83b41; }
#phoneAccessStatus:not(:empty) { color: var(--muted); }
#phoneAccessStatus.phone-limit-warning:not(:empty) { color: #923c19; }
.shared-tools #syncBtn { min-height: 28px; color: #556174; padding: 2px 4px; }
.shared-status-row:has(.sync-error) #syncBtn { color: var(--blue); font-weight: 700; }
.content { max-width: 1530px; padding: 24px clamp(16px,2.4vw,36px) 40px; }
.heading-copy h1 { font-size: clamp(25px,2.3vw,32px); line-height: 1.25; letter-spacing: 0; }
.heading-copy p { color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.page-heading { margin-bottom: 17px; align-items: center; }
.heading-actions:empty,.heading-copy p:empty { display: none; }
.btn { font-size: 14px; font-weight: 560; min-height: 38px; }
.btn.small,.table-link { font-size: 13px; }
.btn.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.app-shell :is(button,a,summary):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.view-tabs { gap: 4px; scrollbar-width: thin; }
.view-tabs button { min-height: 42px; font-size: 15px; font-weight: 560; }
.view-tabs small { font-variant-numeric: tabular-nums; font-size: 13px; }
.section-card,.work-card { background: #fff; border-color: var(--line); border-radius: 11px; }
.section-card > h2,.section-card header h2 { font-size: 19px; line-height: 1.5; }
td { line-height: 1.55; }
th { color: #465466; }
.tag { font-weight: 560; }
dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size: 16px; }
dialog :is(.field,.brief-list,.form-grid p) { font-size: 14px; }
.cell-note,.protection-strip,.case-people,.page-footnote { line-height: 1.65; }
.archive-search .field,.archive-card-facts,.archive-registration,.archive-company-summary,.archive-detail-owner,.archive-count,.archive-history-row { font-size: 14px; }
.archive-history-row time,.archive-registration small,.archive-selected-label { font-size: 13px; }
.archive-fold > summary { padding-block: 10px; min-height: 42px; }
.archive-company-summary { background: #f2f5f8; color: #455164; border-left: 3px solid #bbc6d1; }
.auth-main { padding-top: clamp(40px,8vh,92px); }
.auth-logo-frame { width: 95px; height: 95px; margin-bottom: 12px; }
.auth-logo-frame .company-logo { width: 134px; height: 134px; left: -18px; top: -13px; }
.auth-identity { margin-bottom: 28px; }
.auth-device-note,.auth-card .auth-help { font-size: 13px; color: var(--muted); }
@media (min-width:781px) and (max-width:1100px) {
  .sidebar { width: 172px; flex-basis: 172px; padding-inline: 9px; }
  .top-actions { gap: 6px; }
}
@media (max-width:780px) {
  .topbar { flex-wrap: nowrap; min-height: 56px; padding: 6px 13px; gap: 8px; }
  .global-search { flex: 1; width: auto; height: 42px; padding-left: 9px; gap: 5px; }
  .global-search input { font-size: 16px; }
  .global-search .search-icon { width: 17px; height: 17px; }
  .global-search .btn.small { min-height: 34px; }
  .top-actions { display: flex; flex: none; width: auto; }
  .top-actions .notification,#guideBtn { display: none; }
  .account-panel .account-guide { display: block; }
  .account-tools summary { min-height: 44px; gap: 5px; padding: 2px; }
  .account-tools .avatar { display: none; }
  .account-tools .user-copy { max-width: 82px; }
  .account-tools .user-copy strong,.account-tools .user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .account-chevron { margin-left: 2px; }
  .account-panel button,.account-panel a { min-height: 44px; }
  .shared-status-row { min-height: 32px; padding: 1px 13px; gap: 6px; font-size: 12px; }
  .shared-status-copy { display: flex; gap: 2px 8px; }
  .shared-tools #syncBtn { font-size: 13px; min-height: 32px; }
  .content { padding: 16px 13px calc(84px + env(safe-area-inset-bottom)); }
  .page-heading { align-items: flex-start; gap: 8px; margin-bottom: 12px; }
  .heading-copy h1 { font-size: 25px; }
  .heading-copy p { font-size: 14px; }
  .heading-actions { flex-wrap: wrap; gap: 6px; }
  .heading-actions .btn { min-height: 42px; }
  .view-tabs { overflow-x: auto; flex-wrap: nowrap; overscroll-behavior-x: contain; }
  .view-tabs button { flex: 0 0 auto; padding: 9px 12px; }
  .view-tabs button.active { font-weight: 680; }
  .mobile-bottom { padding-inline: 5px; }
  .mobile-shortcuts { min-width: 0; }
  .mobile-shortcuts button { min-width: 0; min-height: 48px; padding: 4px 2px; gap: 3px; line-height: 1.35; font-size: 13px; }
  .mobile-shortcuts button.active { background: #fceaf0; }
  .mobile-shortcuts button>span svg { width: 20px; height: 20px; }
  .auth-main { padding: 28px 20px 16px; }
  .auth-card .auth-identity h1 { font-size: 28px; }
  .auth-footer { padding-top: 32px; }
}
