.avatar-image { object-fit: cover; padding: 0; overflow: hidden; }
.mobile-tabbar { display: none; }
:root { --tab-glass:rgba(255,255,255,.4); --tab-fallback:#f4f3f7; --tab-ink:#24242b; --tab-edge:rgba(255,255,255,.8); --tab-highlight:rgba(255,255,255,.66); --tab-selected:rgba(255,255,255,.52); --tab-shadow:rgba(38,32,54,.16); }
html[data-theme="dark"] { --tab-glass:rgba(29,30,34,.38); --tab-fallback:#27272c; --tab-ink:#f6f6f8; --tab-edge:rgba(255,255,255,.19); --tab-highlight:rgba(255,255,255,.17); --tab-selected:rgba(255,255,255,.16); --tab-shadow:rgba(0,0,0,.34); }
.profile-card { max-width: 850px; padding: clamp(18px, 4vw, 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.profile-photo-row { display: flex; align-items: center; gap: 24px; margin: 18px 0 26px; }
.profile-photo { width: 104px; height: 104px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: var(--primary-soft); border: 3px solid var(--line); }
.profile-photo-row .field-hint { margin: 9px 0; }
#profile-avatar-input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.profile-remove { display: flex; gap: 7px; align-items: center; font-size: 13px; color: var(--muted); }
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-fields label { display: grid; gap: 7px; font-size: 13px; font-weight: 650; }
.profile-wide { grid-column: 1 / -1; }
.profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.case-sheet-scroll { overflow: auto; max-height: 65vh; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sheet-grid { border-collapse: separate; border-spacing: 0; font-size: 14px; color: #251d30; background: white; width: max-content; min-width: 100%; }
.sheet-grid th, .sheet-grid td { padding: 10px 12px; border-right: 1px solid #ddd5e5; border-bottom: 1px solid #ddd5e5; min-width: 115px; max-width: 350px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; vertical-align: top; }
.sheet-grid th { position: sticky; top: 0; z-index: 2; color: #483259; background: #eee5f7; font-weight: 700; }
.sheet-grid .sheet-row-number { position: sticky; left: 0; min-width: 48px; background: #eee5f7; z-index: 1; }
.sheet-grid .is-changed { background: #fff1ca; }
.sheet-cell { display: block; width: 100%; min-height: 24px; padding: 0; border: 0; font: inherit; color: inherit; background: transparent; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.sheet-cell:focus-visible { outline: 3px solid #a974ea; outline-offset: 3px; }
.sheet-panel { width: 100%; height: 100%; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; gap: 10px; }
.sheet-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sheet-controls label { display: flex; align-items: center; gap: 8px; }
.sheet-controls select { min-height: 44px; max-width: 200px; border-radius: 8px; padding: 6px; font-size: 16px; }
.sheet-hint { margin: 0; color: #d4c9df; font-size: 13px; }
.sheet-scroll { overflow: auto; min-width: 0; min-height: 0; border-radius: 8px; touch-action: pan-x pan-y; }
.sheet-dialog { width: min(440px, calc(100% - 28px)); padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); }
.sheet-dialog::backdrop { background: #0009; }
.sheet-dialog h2 { margin: 0 0 16px; }
.sheet-dialog label { display: grid; gap: 7px; margin-bottom: 14px; }
.sheet-dialog textarea, .sheet-dialog select { width: 100%; min-height: 44px; padding: 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); }
.viewer-stage.can-swipe { touch-action: pan-y; }
.file-viewer.is-sheet { grid-template-rows: auto minmax(0,1fr) auto; }
.file-viewer.is-sheet .viewer-toolbar { display: none; }
.viewer-stage.is-table { overflow: hidden; }
.viewer-stage.is-table .viewer-surface { display: block; width: 100%; height: 100%; min-height: 0; }
.viewer-stage.is-text .viewer-surface { display: block; width: 100%; min-height: 100%; }
.pdf-text-editor { width: 100%; min-height: 100%; height: 55vh; resize: vertical; padding: 18px; font: 16px/1.65 sans-serif; color: #201c26; background: #fff; border: 2px solid transparent; border-radius: 8px; white-space: pre-wrap; }
.pdf-text-editor:not([readonly]) { border-color: #b48bef; }
.viewer-toolbar [hidden] { display: none !important; }
.viewer-document-note { flex-basis: 100%; margin: 0; text-align: center; font-size: 12px; color: #d4c9df; }
@media (max-width: 960px) {
  .mobile-tabbar { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; position:fixed; inset:auto max(10px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); margin-inline:auto; max-width:640px; z-index:60; padding:5px; border:1px solid var(--tab-edge); border-radius:44px; color:var(--tab-ink); background:var(--tab-glass); -webkit-backdrop-filter:blur(18px) saturate(175%); backdrop-filter:blur(18px) saturate(175%); box-shadow:0 8px 32px var(--tab-shadow),inset 0 1px 0 var(--tab-highlight),inset 0 -1px 0 rgba(255,255,255,.05); }
  .mobile-tabbar::before { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; background:linear-gradient(155deg,var(--tab-highlight),transparent 27%,transparent 76%,var(--tab-highlight)); opacity:.3; }
  .mobile-tabbar a, .mobile-tabbar button { position:relative; min-width:0; min-height:57px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:6px 1px; border:1px solid transparent; border-radius:34px; color:inherit; background:transparent; text-decoration:none; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:10.5px; line-height:1.15; font-weight:550; -webkit-tap-highlight-color:transparent; touch-action:manipulation; transition:background .16s ease,box-shadow .16s ease; }
  .mobile-tabbar [aria-current="page"], .mobile-tabbar [aria-expanded="true"] { background:var(--tab-selected); border-color:var(--tab-edge); box-shadow:inset 0 1px 0 var(--tab-highlight),0 2px 8px rgba(0,0,0,.04); font-weight:750; }
  .mobile-tabbar a:active, .mobile-tabbar button:active { background:var(--tab-selected); }
  .mobile-tabbar a:focus-visible, .mobile-tabbar button:focus-visible { outline:2px solid var(--primary); outline-offset:-3px; }
  .mobile-tabbar svg { width:26px; height:26px; flex-shrink:0; }
  .mobile-tabbar .mobile-tab-avatar { width:26px; height:26px; border-radius:50%; object-fit:cover; box-shadow:0 0 0 1.5px var(--tab-edge); }
  .mobile-tabbar .mobile-tab-new svg { width:27px; height:27px; padding:0; color:inherit; background:transparent; }
  .mobile-tabbar b { position:absolute; top:0; left:calc(50% + 6px); min-width:19px; height:19px; display:grid; place-items:center; padding:1px 5px; border-radius:12px; font-size:10px; font-weight:750; line-height:1; color:#052d19; background:#20d477; box-shadow:0 0 0 2px var(--tab-glass); }
  .mobile-tabbar b[hidden] { display:none; }
  .app-body .page-wrap { padding-bottom:calc(108px + env(safe-area-inset-bottom)); }
  .app-body .sticky-actions { bottom:calc(94px + env(safe-area-inset-bottom)); }
  .app-body.is-keyboard-open .sticky-actions { bottom:0; }
  .is-keyboard-open .mobile-tabbar, .mobile-menu-open .mobile-tabbar, .file-viewer-body .mobile-tabbar { display: none; }
  .profile-fields { grid-template-columns: 1fr; gap: 16px; }
  .profile-photo-row { gap: 16px; }
  .profile-photo { width: 88px; height: 88px; }
  .profile-card { padding: 18px; }
  .sheet-grid th, .sheet-grid td { padding: 8px; min-width: 96px; }
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) { .mobile-tabbar { background:var(--tab-fallback); } }
@media (prefers-reduced-transparency:reduce) { .mobile-tabbar { background:var(--tab-fallback); -webkit-backdrop-filter:none; backdrop-filter:none; } }
@media (prefers-reduced-motion:reduce) { .mobile-tabbar a,.mobile-tabbar button { transition:none; } }
