/* Shared Base / Checklist / Documents design system. */
:root {
  --ui-canvas: #f5f7fa;
  --ui-panel: #ffffff;
  --ui-sidebar: #f4f7fb;
  --ui-header: #f8fafc;
  --ui-subtle: #fafbfc;
  --ui-line: #dfe5ec;
  --ui-ink: #25303b;
  --ui-muted: #6f7d89;
  --ui-accent: #39768a;
  --ui-accent-strong: #1d5264;
  --ui-accent-soft: #e9f1f4;
  --ui-row-hover: #e8edf2;
  --ui-row-active: #dfe9f0;
  --ui-sidebar-width: 210px;
  --ui-rail-width: 20px;
  --ui-header-height: 44px;
  --ui-control-height: 28px;
  --ui-radius: 5px;
  --ui-shadow-menu: 0 12px 32px rgba(39, 51, 61, 0.14);
}

html, body { min-height:100%; background:var(--ui-canvas); }
body:not(.auth-visible) { overflow:hidden; }
.app-shell,.documents-app { width:100%;height:100vh;min-height:0;margin:0;border:0;border-radius:0;background:var(--ui-panel);box-shadow:none;grid-template-rows:var(--ui-header-height) minmax(0,1fr); }

.app-header,.documents-header { position:relative;z-index:30;display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;align-items:center;gap:6px;min-height:var(--ui-header-height);height:var(--ui-header-height);border-bottom:1px solid var(--ui-line);padding:5px 8px;color:var(--ui-ink);background:var(--ui-header);box-shadow:none; }
.app-header .brand-block,.documents-brand { width:132px;min-width:132px;padding:0 5px 0 2px; }
.app-header .brand-block h1,.documents-brand h1 { margin:0;color:var(--ui-ink);font-size:14px;font-weight:700;line-height:1;letter-spacing:-.02em;white-space:nowrap; }
.app-header .product-badge,.app-header .brand-block p { display:none; }

.app-header .view-tabs,.documents-main-nav { display:flex;width:auto;min-width:0;max-width:100%;align-items:center;gap:2px;border:0;border-radius:0;padding:0;overflow-x:auto;overflow-y:hidden;background:transparent;box-shadow:none;scrollbar-width:none; }
.app-header .view-tabs::-webkit-scrollbar,.documents-main-nav::-webkit-scrollbar { display:none; }
.app-header .view-tabs>.tab-button,.app-header .nav-dropdown-summary,.documents-main-nav>a,.documents-nav-dropdown>summary,.header-utilities>.tab-button,.header-utilities>a { min-height:30px;height:30px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--ui-radius);padding:0 8px;color:#52606d;background:transparent;box-shadow:none;font-size:11px;font-weight:600;line-height:28px;text-decoration:none;white-space:nowrap; }
.app-header .view-tabs>.tab-button:hover,.app-header .nav-dropdown-summary:hover,.documents-main-nav>a:hover,.documents-nav-dropdown>summary:hover,.header-utilities>.tab-button:hover,.header-utilities>a:hover { border-color:#dce3ea;color:#24313d;background:#eef2f6; }
.app-header .view-tabs>.tab-button.active,.app-header .nav-dropdown.active .nav-dropdown-summary,.documents-main-nav>a.active { border-color:#d5e2e8;color:var(--ui-accent-strong);background:var(--ui-accent-soft);box-shadow:inset 0 -2px 0 var(--ui-accent); }
.app-header .tab-icon,.app-header .ui-icon,.app-header .nav-gap,.app-header .nav-separator { display:none; }
.app-header .nav-dropdown-panel,.documents-nav-dropdown>div { border:1px solid var(--ui-line);border-radius:7px;padding:5px;background:var(--ui-panel);box-shadow:var(--ui-shadow-menu); }
.app-header .sub-tab-button,.documents-nav-dropdown>div a { min-height:28px;border-radius:5px;padding:5px 9px;color:#52606d;font-size:10px;font-weight:600; }
.app-header .sub-tab-button:hover,.documents-nav-dropdown>div a:hover { background:#eef2f4; }
.app-header .language-switch select,.documents-language-pill { width:64px;min-width:64px;height:30px;border:1px solid #d7dee6;border-radius:var(--ui-radius);padding:0 7px;color:#52606d;background:#fff;font-size:10px; }
.documents-language-pill { display:inline-grid;place-items:center; }
.header-utilities { display:flex;min-width:0;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap; }
.header-utilities .language-switch { display:flex;height:30px;min-height:30px;align-items:center;margin:0;padding:0;border:0;background:transparent;box-shadow:none; }
.header-utilities .header-graph-button,.header-utilities .standalone-advanced-button { min-width:48px; }
.header-utilities #migrateButton { min-width:48px;padding:0 8px; }
.documents-sidebar-cloud-status { display:block;min-height:16px;border-top:1px solid #e1e7ec;padding:5px 2px 0;color:#5c7b69;font-size:9px;white-space:nowrap; }
.documents-sidebar-cloud-status[data-state="saving"] { color:#94713d; }
.documents-sidebar-cloud-status[data-state="error"] { color:#a95555; }

#projectsView,.checklist-view,.documents-layout { grid-template-columns:var(--ui-sidebar-width) minmax(0,1fr);min-width:0;min-height:0;background:var(--ui-panel); }
#projectsView.projects-collapsed,.checklist-view.checklist-collapsed,.documents-layout.sidebar-collapsed { grid-template-columns:var(--ui-rail-width) minmax(0,1fr); }
#projectsView .project-pane,.checklist-pane,.documents-sidebar { position:relative;min-width:0;min-height:0;border-right:1px solid var(--ui-line);padding:5px 26px 5px 8px;background:var(--ui-sidebar); }
#projectsView .project-pane-header,.checklist-pane .project-pane-header { display:none; }
#projectsView .project-list,.checklist-list,.document-list { gap:0;min-height:0;padding:1px 0; }
#projectsView .project-item,#projectsView .project-item.all-project-item,#projectsView .project-item.unfiled-project-item,.checklist-pane .checklist-item,.document-list-item { min-height:27px;border:0;border-radius:0;color:var(--ui-ink);background:transparent;box-shadow:none;font-size:10.5px;font-weight:650; }
#projectsView .project-item:hover,.checklist-pane .checklist-item:hover,.document-list-item:hover,.document-folder-header:hover { background:var(--ui-row-hover); }
#projectsView .project-item.active,#projectsView .project-item.all-project-item.active,#projectsView .project-item.unfiled-project-item.active,.checklist-pane .checklist-item.active,.document-list-item.active { color:var(--ui-accent-strong);background:var(--ui-row-active);box-shadow:inset 2px 0 0 var(--ui-accent); }

#projectsView .project-pane-rail-toggle,.checklist-pane-rail-toggle,.documents-sidebar-toggle { position:absolute;z-index:6;top:0;right:0;bottom:0;width:var(--ui-rail-width);height:auto;min-height:100%;border:0;border-left:1px solid #d8e0e8;border-radius:0;padding:0;background:#eef3f7;box-shadow:inset 1px 0 0 rgba(255,255,255,.7); }
#projectsView .project-pane-rail-toggle:hover,.checklist-pane-rail-toggle:hover,.documents-sidebar-toggle:hover { border-color:#9fc7d3;background:#e1f0f4; }
#projectsView.projects-collapsed .project-pane,.checklist-view.checklist-collapsed .checklist-pane,.documents-layout.sidebar-collapsed .documents-sidebar { display:block;width:var(--ui-rail-width);padding:0;overflow:visible;background:transparent; }

#projectsView .table-pane,.checklist-workspace,.document-workspace { min-width:0;min-height:0;color:var(--ui-ink);background:var(--ui-panel); }
#projectsView .toolbar,.checklist-page-header,.document-editor-header { min-height:48px;border-bottom:1px solid var(--ui-line);padding:6px 10px!important;background:var(--ui-panel); }
#projectsView .project-title h2,.checklist-title-editor h2,.document-identity input { color:var(--ui-ink);font-size:15px;font-weight:700;line-height:1.15; }
#projectsView .toolbar button,#projectsView .toolbar summary,.checklist-page-header button,.checklist-page-header input,.mobile-entry-trigger,.document-editor-header button,.editor-mode-tabs button,.documents-sidebar-tools button,.documents-sidebar-tools input { min-height:var(--ui-control-height);height:var(--ui-control-height);border-radius:var(--ui-radius);font-size:10px; }
#projectsView .toolbar .secondary-button,.checklist-page-header button,.mobile-entry-trigger,.document-editor-header button,.editor-mode-tabs button { border:1px solid #d8e0e7;color:#52606d;background:#fff;box-shadow:none; }
#projectsView .toolbar .secondary-button:hover,.checklist-page-header button:hover,.mobile-entry-trigger:hover,.document-editor-header button:hover,.editor-mode-tabs button:hover { border-color:#b9ccd5;color:var(--ui-accent-strong);background:#edf4f6; }
.checklist-search-field input,#projectsView .controls input[type="search"],.documents-sidebar-tools input { border:1px solid #d7dee6;border-radius:var(--ui-radius);color:var(--ui-ink);background:#fff;box-shadow:none; }
.checklist-search-field input:focus,#projectsView .controls input[type="search"]:focus,.documents-sidebar-tools input:focus,.document-identity input:focus { border-color:#7697a6;box-shadow:0 0 0 2px rgba(57,118,138,.12);outline:0; }

.checklist-page-header { display:grid;grid-template-columns:minmax(150px,1fr) minmax(140px,320px) max-content max-content;align-items:center;gap:7px; }
.checklist-title-editor { display:flex;min-width:0;align-items:center;gap:5px; }
.checklist-title-editor h2 { min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.checklist-page-header .readonly-meta { min-width:0;color:var(--ui-muted);font-size:9px; }
.checklist-page-header .readonly-meta>span { display:none; }
.checklist-page-header .readonly-meta strong { font-size:10px;font-weight:600; }
.checklist-top-panel { grid-template-rows:minmax(0,1fr);padding:0; }
.checklist-table-wrap { border:0; }
.checklist-log-panel,.editor-mode-tabs { background:var(--ui-subtle); }

.document-editor-header { display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:center;gap:10px; }
.document-identity { display:grid;grid-template-columns:max-content minmax(160px,560px) max-content;align-items:center;gap:7px; }
.document-identity>span,.document-identity input,.document-identity small { grid-row:1; }
.document-identity input { grid-column:2;min-width:0;border:0;padding:3px 0;background:transparent; }
.document-identity small { grid-column:3;color:var(--ui-muted);font-size:9px;white-space:nowrap; }
.editor-mode-tabs { min-height:32px;padding:3px 10px; }
.editor-mode-tabs button { border-color:transparent;background:transparent; }
.editor-mode-tabs button.active { border-color:#d5e2e8;color:var(--ui-accent-strong);background:var(--ui-accent-soft); }

#projectsView table,.checklist-table { border-collapse:separate;border-spacing:0; }
#projectsView th,.checklist-table th { height:31px;border-color:#e2e7ed;padding:5px 6px;color:#5b6672;background:#f5f7f9;font-size:10px;font-weight:700;letter-spacing:.02em; }
#projectsView td,.checklist-table td { border-color:#e7ebf0; }
.markdown-editor-pane textarea,.markdown-preview { background:#fff; }

@media(max-width:900px){
  .header-utilities .language-switch,.documents-language-pill{display:none}
  .checklist-page-header{grid-template-columns:minmax(120px,1fr) minmax(100px,220px) max-content}
  .checklist-page-header .readonly-meta{display:none}
  .document-identity small{display:none}
  .document-identity{grid-template-columns:max-content minmax(120px,1fr)}
}

@media(max-width:700px){
  :root{--ui-sidebar-width:176px}
  .app-header,.documents-header{gap:5px;padding:5px 6px}
  .app-header .brand-block,.documents-brand{width:82px;min-width:82px}
  .app-header .brand-block h1,.documents-brand h1{max-width:76px;overflow:hidden;text-overflow:ellipsis}
  .app-header .view-tabs>.tab-button,.documents-main-nav>a{padding-inline:6px}
  .header-utilities>.tab-button,.header-utilities>a{padding-inline:6px}
  .checklist-page-header{grid-template-columns:minmax(90px,1fr) minmax(80px,1fr) max-content}
  .document-editor-header{grid-template-columns:minmax(0,1fr)}
  .document-actions{justify-content:flex-start}
}
