/* Deliberately small, shared visual system; existing feature layouts remain intact. */
:root {
  --bg: #f4f6f8; --surface: #fff; --surface-strong: #fff; --surface-muted: #eef2f5;
  --text: #182c37; --text-muted: #536672; --border: #dce3e7;
  --accent: #176b61; --accent-2: #257b71; --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --shadow-soft: 0 2px 5px #182c3705; --shadow: 0 16px 45px #182c3712;
}
[data-theme=dark] {
  --bg: #111b22; --surface: #18262f; --surface-strong: #1c2c36; --surface-muted: #243741;
  --text: #e9f1f4; --text-muted: #acbfc9; --border: #354750; --accent: #83d6c1; --accent-2: #71bfae;
}
body { background: var(--bg); font-size: 15px; }
.sync-bar { flex-wrap: wrap; }
.sync-choice { margin-block: 16px; border: 1px solid var(--border); border-radius: 8px; }
.sync-choice label { display: block; padding: 10px; overflow-wrap: anywhere; }
#uploadProgress { width: 100%; height: 22px; accent-color: var(--accent); }
#uploadModal, #syncConflictModal { color: var(--text); }
#recordConflictModal, #documentBatchModal { color: var(--text); }
.planner-panel { margin-bottom: 24px; }
.planner-row, .document-selection { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 12px; }
.planner-row small { display: block; color: var(--text-muted); margin-top: 4px; }
.document-select { display: flex; gap: 8px; padding-block: 8px; }
#sessionList small { overflow-wrap: anywhere; }
#recordConflictModal .modal-actions, #documentBatchModal .modal-actions { flex-wrap: wrap; }
#uploadModal .modal-actions, #syncConflictModal .modal-actions { flex-wrap: wrap; }
.ambient { display: none; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 1000; padding: 14px; background: var(--surface); border: 2px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.app-shell { grid-template-columns: 244px minmax(0,1fr); }
.sidebar { padding: 28px 18px; background: var(--surface); display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-head { padding: 0 10px; margin-bottom: 22px; }
.brand { font-size: 19px; letter-spacing: -.6px; }
.brand-mark { background: var(--accent); box-shadow: none; width: 34px; height: 34px; border-radius: 10px; color: var(--surface); }
.side-nav { gap: 4px; }
.side-nav .nav-label { margin: 20px 12px 6px; color: var(--text-muted); font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; font-weight: 750; }
.side-nav .nav-label:first-child { margin-top: 0; }
.side-nav a { font-weight: 550; font-size: 14px; min-height: 44px; padding: 7px 12px; gap: 11px; }
.side-nav a > span { width: 24px; height: 24px; background: none; box-shadow: none; color: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: 6px; }
.side-nav a:hover { transform: none; background: var(--surface-muted); }
.side-nav a.active, .side-nav a[aria-current=page] { color: var(--accent); background: color-mix(in srgb,var(--accent) 10%,var(--surface)); transform: none; font-weight: 750; }
.sidebar-footer { margin-top: auto; padding: 32px 12px 0; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.online-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.workspace { padding: 26px clamp(20px,3.2vw,54px) 48px; max-width: 1740px; width: 100%; margin: 0 auto; }
.workspace-top { position: relative; top: auto; margin: 0 0 10px; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; background: none; backdrop-filter: none; }
.workspace-top h1 { font-size: 27px; letter-spacing: -.8px; font-weight: 750; }
.workspace-title { min-width: 145px; }
.workspace-actions { grid-template-columns: minmax(160px,300px) auto auto; gap: 10px; align-items: center; }
.workspace-top .eyebrow { color: var(--text-muted); font-size: 10px; letter-spacing: 1px; margin-bottom: 5px; }
.global-search { width: 100%; }
.global-search span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.global-search input { min-height: 42px; font-size: 13px; padding: 0 14px; }
.icon-button { border-radius: 10px; width: 42px; height: 42px; box-shadow: none; }
.button { border-radius: 9px; font-size: 13px; min-height: 42px; padding: 0 16px; font-weight: 650; box-shadow: none; }
.button:hover { transform: none; }
.button-primary { background: var(--accent); color: var(--surface); }
.button-secondary { background: var(--surface); border: 1px solid var(--border); }
.sync-bar { min-height: 28px; margin-bottom: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
.sync-bar[data-state=error] { color: var(--danger); background: color-mix(in srgb,var(--danger) 7%,var(--surface)); border: 1px solid currentColor; padding: 10px 14px; border-radius: 8px; }
.sync-bar button { color: inherit; background: none; border: 1px solid currentColor; border-radius: 5px; padding: 6px 10px; cursor: pointer; }
.welcome-strip { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 28px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.welcome-strip h2 { margin: 0 0 8px; font-size: clamp(21px,2.1vw,30px); letter-spacing: -.7px; font-weight: 700; }
.welcome-strip p:last-child { color: var(--text-muted); margin: 0; line-height: 1.6; font-size: 13px; }
.welcome-strip .eyebrow { font-size: 10px; letter-spacing: 1.2px; margin-bottom: 12px; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: 320px; }
.stats-grid { gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px 22px; box-shadow: none; border-radius: 12px; }
.stat-card strong { font-size: 30px; letter-spacing: -1px; }
.stat-card > span { font-size: 12px; color: var(--text-muted); }
.stat-card small { font-size: 11px; }
.content-grid { gap: 20px; margin-bottom: 20px; }
.panel { padding: 24px; }
.panel-head { margin-bottom: 18px; align-items: center; gap: 12px; }
.panel-head h2 { font-size: 16px; letter-spacing: -.2px; }
.panel-head p { font-size: 12px; line-height: 1.5; }
.panel-head a { color: var(--accent); font-size: 12px; font-weight: 650; white-space: nowrap; }
.subject-row-list { gap: 4px; }
.subject-row { box-shadow: none; border-radius: 8px; }
.card-grid { gap: 18px; }
.document-card, .task-card, .subject-card { box-shadow: none; }
.document-card h2, .task-card h2 { font-size: 17px; overflow-wrap: anywhere; }
.toolbar { gap: 12px; flex-wrap: wrap; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.toolbar .search { flex: 1; min-width: 170px; }
.empty-state { padding: 32px 20px; color: var(--text-muted); background: var(--surface-muted); border: 1px dashed var(--border); border-radius: 10px; font-size: 13px; }
.modal { max-height: calc(100dvh - 32px); }
.modal-card { box-shadow: none; }
.modal::backdrop { background: #10252f66; backdrop-filter: blur(3px); }
.resource-actions { flex-wrap: wrap; }
.document-preview-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 24px; margin: 0; color: var(--text); font: 14px/1.7 ui-monospace,monospace; }
.auth-card { border-top: 4px solid var(--accent); box-shadow: var(--shadow); }
.auth-heading h1 { font-size: 30px; letter-spacing: -.6px; }
.auth-heading p:not(.eyebrow) { font-size: 14px; }
@media(min-width:861px) and (max-width:1150px) {
  .workspace { padding: 24px; }
  .workspace-actions { grid-template-columns: minmax(160px,1fr) auto; }
  .welcome-strip { align-items: flex-start; flex-direction: column; }
}
@media(max-width:860px) {
  .app-shell { display: block; }
  .sidebar { width: 272px; max-width: calc(100vw - 40px); z-index: 60; }
  .sidebar-footer { padding-top: 24px; }
  .workspace { padding: 18px 20px 40px; }
  .workspace-top { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; }
  .workspace-title { min-width: 0; }
  .workspace-top h1 { font-size: 24px; }
  .workspace-actions { grid-column: 1/-1; display: grid; grid-template-columns: minmax(0,1fr) auto auto; width: 100%; }
  .workspace-actions .global-search { grid-column: auto; grid-row: auto; margin-top: 0; }
  .workspace-actions .theme-toggle { grid-column: auto; grid-row: auto; }
  .workspace-actions #logoutButton { display: inline-flex; }
  .welcome-strip { flex-direction: column; align-items: flex-start; padding: 24px; }
  .welcome-actions { max-width: none; }
  .sync-bar { justify-content: flex-start; }
  .panel { padding: 20px; }
  .mobile-overlay.open { z-index: 50; }
}
@media(max-width:540px) {
  .workspace { padding: 14px 14px 32px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .stat-card { padding: 16px; }
  .welcome-strip { padding: 20px; }
  .welcome-actions { width: 100%; }
  .welcome-actions .button { flex: 1 1 auto; }
  .panel-head { flex-wrap: wrap; }
  .toolbar > select { width: 100%; }
  .button, .icon-button, .card-more-menu summary { min-height: 44px; }
  .workspace-actions #logoutButton { padding-inline: 10px; font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

