/* ============================================================
   N4Gas Access Portal — app.css
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-primary:    #ffffff;
  --bg-secondary:  #f5f5f3;
  --bg-tertiary:   #eeece8;
  --text-primary:  #1a1a18;
  --text-secondary:#5a5956;
  --text-tertiary: #999895;
  --border-light:  rgba(0,0,0,.09);
  --border-med:    rgba(0,0,0,.16);
  --accent:        #1a5c96;
  --accent-light:  #e4eef8;
  --accent-dark:   #0f3d66;
  --amber:         #b06d10;
  --amber-light:   #fdf0d8;
  --green:         #2e6b0e;
  --green-light:   #e6f3db;
  --red:           #9b2626;
  --red-light:     #fceaea;
  --teal:          #0a6655;
  --teal-light:    #e0f5f0;
  --radius-sm:5px; --radius-md:8px; --radius-lg:12px; --radius-xl:16px;
  --sidebar-w:220px; --topbar-h:52px;
}
html { font-size:16px; }
body { font-family:-apple-system,'Segoe UI',Helvetica,Arial,sans-serif; background:var(--bg-tertiary); color:var(--text-primary); line-height:1.6; -webkit-text-size-adjust:100%; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }

/* ---- Topbar ---------------------------------------------- */
.topbar { position:sticky; top:0; z-index:200; background:var(--bg-primary); border-bottom:0.5px solid var(--border-light); height:var(--topbar-h); display:flex; align-items:center; gap:12px; padding:0 16px; }
.logo { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:600; color:var(--text-primary); text-decoration:none; white-space:nowrap; flex-shrink:0; }
.logo:hover { text-decoration:none; }
.logo-icon { width:26px; height:26px; background:var(--accent); border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.logo-icon svg { width:14px; height:14px; }
.logo-text { display:none; }
.top-nav { display:none; gap:2px; flex:1; }
.top-nav a { font-size:13px; color:var(--text-secondary); padding:6px 10px; border-radius:var(--radius-md); white-space:nowrap; transition:background .12s,color .12s; }
.top-nav a:hover,.top-nav a.active { background:var(--bg-secondary); color:var(--text-primary); text-decoration:none; }
.top-nav a.active { font-weight:500; }
.topbar-right { display:flex; align-items:center; gap:8px; margin-left:auto; }
.search-bar { display:flex; align-items:center; gap:6px; background:var(--bg-secondary); border:0.5px solid var(--border-light); border-radius:var(--radius-md); padding:5px 9px; }
.search-bar input { border:none; background:transparent; font-size:13px; color:var(--text-primary); outline:none; width:120px; }
.search-bar svg { flex-shrink:0; color:var(--text-tertiary); }
.hamburger { display:flex; flex-direction:column; gap:4px; cursor:pointer; padding:6px; border-radius:var(--radius-md); border:none; background:transparent; }
.hamburger span { display:block; width:18px; height:2px; background:var(--text-secondary); border-radius:2px; transition:transform .2s,opacity .2s; }
.hamburger.open span:nth-child(1) { transform:translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity:0; }
.hamburger.open span:nth-child(3) { transform:translateY(-6px) rotate(-45deg); }
.user-menu { position:relative; }
.avatar { width:30px; height:30px; border-radius:50%; background:var(--accent); color:var(--accent-light); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; cursor:pointer; user-select:none; flex-shrink:0; overflow:hidden; }
.avatar img { width:100%; height:100%; object-fit:cover; }
.dropdown { display:none; position:absolute; right:0; top:100%; margin-top:4px; background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-lg); padding:10px 0; min-width:170px; box-shadow:0 4px 16px rgba(0,0,0,.1); z-index:300; }
.user-menu.open .dropdown { display:block; }
.dropdown-name { font-size:13px; font-weight:500; padding:4px 14px; }
.dropdown-role { font-size:11px; color:var(--text-tertiary); padding:0 14px 8px; border-bottom:0.5px solid var(--border-light); }
.dropdown a { display:block; font-size:13px; padding:7px 14px; color:var(--text-secondary); }
.dropdown a:hover { background:var(--bg-secondary); text-decoration:none; color:var(--text-primary); }
.btn-primary-sm { background:var(--accent); color:#fff; border-radius:var(--radius-md); padding:6px 12px; font-size:13px; font-weight:500; white-space:nowrap; }
.btn-primary-sm:hover { background:var(--accent-dark); text-decoration:none; color:#fff; }

/* ---- Mobile nav ------------------------------------------ */
.mobile-nav {
  display: none;
  position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  background: var(--bg-primary); z-index: 190;
  overflow-y: auto; padding: 16px;
  border-top: 0.5px solid var(--border-light);
}
.mobile-nav.open { display: block; }
.mobile-nav a { display:flex; align-items:center; gap:10px; padding:11px 12px; border-radius:var(--radius-md); font-size:15px; color:var(--text-secondary); border-bottom:0.5px solid var(--border-light); text-decoration:none; }
.mobile-nav a:last-child { border-bottom:none; }
.mobile-nav a:hover,.mobile-nav a.active { background:var(--bg-secondary); color:var(--text-primary); }
.mobile-nav a.active { font-weight:500; color:var(--accent); }
.mobile-nav svg { width:18px; height:18px; flex-shrink:0; opacity:.6; }
.mobile-nav-section { font-size:10px; font-weight:600; color:var(--text-tertiary); padding:14px 12px 4px; letter-spacing:.07em; text-transform:uppercase; }

/* ---- Layout ---------------------------------------------- */
.layout { display:flex; min-height:calc(100vh - var(--topbar-h) - 38px); }
.sidebar { display:none; width:var(--sidebar-w); min-width:var(--sidebar-w); flex-shrink:0; background:var(--bg-primary); border-right:0.5px solid var(--border-light); padding:14px 10px; flex-direction:column; gap:2px; }
.sidebar-section { font-size:10px; font-weight:600; color:var(--text-tertiary); padding:10px 8px 4px; letter-spacing:.07em; text-transform:uppercase; margin-top:6px; }
.sidebar-section:first-child { margin-top:0; }
.sidebar-item { display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:var(--radius-md); font-size:13px; color:var(--text-secondary); transition:background .1s,color .1s; text-decoration:none; }
.sidebar-item:hover { background:var(--bg-secondary); color:var(--text-primary); text-decoration:none; }
.sidebar-item.active { background:var(--accent-light); color:var(--accent); font-weight:500; }
.sidebar-item svg { width:15px; height:15px; flex-shrink:0; opacity:.65; }
.sidebar-item.active svg { opacity:1; }
.main { flex:1; padding:20px 16px; min-width:0; }
.page-header { margin-bottom:20px; }
.page-header h1 { font-size:20px; font-weight:600; margin-bottom:3px; }
.page-header p  { font-size:14px; color:var(--text-secondary); }
.section-title { font-size:13px; font-weight:500; color:var(--text-secondary); margin-bottom:10px; display:flex; align-items:center; justify-content:space-between; }
.section-title a { font-size:12px; color:var(--accent); }

/* ---- Cards ----------------------------------------------- */
.cards-grid { display:grid; grid-template-columns:1fr; gap:10px; margin-bottom:24px; }
.doc-card { background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-lg); padding:14px; display:block; text-decoration:none; color:inherit; transition:border-color .15s; position:relative; }
.doc-card:hover { border-color:var(--border-med); text-decoration:none; }
.doc-card-inner { display:flex; align-items:flex-start; gap:12px; }
.doc-icon { width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.doc-icon.blue { background:var(--accent-light); }
.doc-icon.green { background:var(--green-light); }
.doc-icon.amber { background:var(--amber-light); }
.doc-icon.red { background:var(--red-light); }
.doc-icon.teal { background:var(--teal-light); }
.doc-card-text { flex:1; min-width:0; }
.doc-card h3 { font-size:14px; font-weight:500; margin-bottom:3px; line-height:1.3; }
.doc-card p  { font-size:12px; color:var(--text-secondary); line-height:1.4; margin-bottom:8px; }
.doc-meta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.doc-tag { font-size:11px; padding:2px 7px; border-radius:20px; font-weight:500; }
.doc-tag.pdf { background:var(--red-light); color:var(--red); }
.doc-tag.editorjs { background:var(--accent-light); color:var(--accent); }
.doc-tag.locked { background:var(--amber-light); color:var(--amber); }
.lock-badge { position:absolute; top:12px; right:12px; opacity:.3; }
.lock-badge svg { width:16px; height:16px; }
.hidden-badge { position:absolute; top:12px; right:32px; opacity:.4; }


/* ---- Table of contents ----------------------------------- */
.doc-toc {
  background: var(--bg-secondary);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 28px;
  display: inline-block;
  min-width: 240px;
  max-width: 100%;
}
.doc-toc-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
}
.doc-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc-counter;
}
.doc-toc-item {
  counter-increment: toc-counter;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 0.5px solid var(--border-light);
}
.doc-toc-item:last-child {
  border-bottom: none;
}
.doc-toc-item::before {
  content: counter(toc-counter);
  font-size: 11px;
  color: var(--text-tertiary);
  min-width: 16px;
  flex-shrink: 0;
}
.doc-toc-item a {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.4;
}
.doc-toc-item a:hover {
  text-decoration: underline;
}
.doc-toc-sub {
  padding-left: 20px;
}
.doc-toc-sub::before {
  content: '';
  min-width: 16px;
}
.doc-toc-sub a {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Panels ---------------------------------------------- */
.two-col { display:grid; grid-template-columns:1fr; gap:14px; margin-bottom:24px; }
.panel { background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-lg); overflow:hidden; }
.panel-header { padding:12px 16px; border-bottom:0.5px solid var(--border-light); display:flex; align-items:center; justify-content:space-between; }
.panel-header h2 { font-size:14px; font-weight:500; }
.panel-body { padding:4px 0; }
.list-item { display:flex; align-items:center; gap:10px; padding:10px 16px; text-decoration:none; color:inherit; transition:background .1s; border-bottom:0.5px solid var(--border-light); }
.list-item:last-child { border-bottom:none; }
.list-item:hover { background:var(--bg-secondary); text-decoration:none; }
.list-item-icon { width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.li-blue { background:var(--accent-light); }
.li-amber { background:var(--amber-light); }
.li-green { background:var(--green-light); }
.list-item-text { flex:1; min-width:0; }
.list-item-name { font-size:13px; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-item-sub  { font-size:11px; color:var(--text-tertiary); margin-top:1px; }
.list-item-lock svg { width:14px; height:14px; opacity:.3; }

/* ---- Notices --------------------------------------------- */
.announcement { background:var(--accent-light); border:0.5px solid #b5d0ec; border-radius:var(--radius-lg); padding:12px 14px; margin-bottom:16px; display:flex; gap:10px; }
.ann-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); flex-shrink:0; margin-top:6px; }
.ann-text { font-size:13px; color:var(--accent-dark); line-height:1.5; }
.public-notice { background:var(--accent-light); border:0.5px solid #b5d0ec; border-radius:var(--radius-lg); padding:14px 16px; margin-bottom:20px; font-size:13px; color:var(--accent-dark); display:flex; gap:10px; align-items:flex-start; }
.public-notice svg { flex-shrink:0; margin-top:1px; }

/* ---- Badges ---------------------------------------------- */
.badge { display:inline-block; font-size:11px; font-weight:500; padding:2px 8px; border-radius:20px; }
.badge-blue  { background:var(--accent-light); color:var(--accent); }
.badge-teal  { background:var(--teal-light);   color:var(--teal); }
.badge-amber { background:var(--amber-light);  color:var(--amber); }
.badge-red   { background:var(--red-light);    color:var(--red); }
.badge-green { background:var(--green-light);  color:var(--green); }
.badge-gray  { background:var(--bg-secondary); color:var(--text-secondary); }

/* ---- Tabs ------------------------------------------------ */
.tabs { display:flex; gap:2px; margin-bottom:16px; flex-wrap:wrap; }
.tab { font-size:13px; color:var(--text-secondary); padding:6px 12px; border-radius:var(--radius-md); border:none; background:transparent; font-family:inherit; cursor:pointer; transition:background .12s,color .12s; white-space:nowrap; }
.tab:hover,.tab.active { background:var(--bg-secondary); color:var(--text-primary); }
.tab.active { font-weight:500; }

/* ---- Forms ----------------------------------------------- */
.form-panel { background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-lg); padding:20px; margin-bottom:16px; }
.form-panel h3 { font-size:15px; font-weight:500; margin-bottom:4px; }
.form-panel > p { font-size:13px; color:var(--text-secondary); margin-bottom:16px; }
.form-row { margin-bottom:13px; }
.form-row label { font-size:12px; color:var(--text-secondary); display:block; margin-bottom:5px; font-weight:500; }
.form-row input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="date"]):not([type="time"]),
.form-row select,
.form-row textarea {
  width: 100%; padding: 9px 11px;
  border: 0.5px solid var(--border-med); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; color: var(--text-primary);
  background: var(--bg-primary); transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  width: 100%;
  padding: 9px 11px;
  border: 0.5px solid var(--border-med);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
}
.form-row select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; padding-right:28px; }
.form-row input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="date"]):not([type="time"]):focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-row textarea { resize:vertical; min-height:90px; }
.form-grid-2 { display:grid; grid-template-columns:1fr; gap:0; }
.star-row { display:flex; gap:5px; margin-top:4px; }
.star { font-size:26px; cursor:pointer; color:var(--border-med); transition:color .1s; }
.star.lit { color:var(--amber); }
.submit-row { display:flex; justify-content:flex-end; margin-top:8px; gap:8px; flex-wrap:wrap; }
.alert-success { font-size:13px; color:var(--green); background:var(--green-light); border-radius:var(--radius-md); padding:10px 14px; margin-bottom:12px; }
.alert-error   { font-size:13px; color:var(--red);   background:var(--red-light);   border-radius:var(--radius-md); padding:10px 14px; margin-bottom:12px; }
.alert-info    { font-size:13px; color:var(--accent); background:var(--accent-light); border-radius:var(--radius-md); padding:10px 14px; margin-bottom:16px; }

/* ---- Buttons --------------------------------------------- */
.btn-primary { background:var(--accent); color:#fff; border:none; border-radius:var(--radius-md); padding:10px 20px; font-size:14px; font-weight:500; cursor:pointer; font-family:inherit; transition:background .15s; white-space:nowrap; display:inline-flex; align-items:center; gap:6px; }
.btn-primary:hover { background:var(--accent-dark); text-decoration:none; color:#fff; }
.btn-secondary { background:transparent; color:var(--text-secondary); border:0.5px solid var(--border-med); border-radius:var(--radius-md); padding:10px 20px; font-size:14px; cursor:pointer; font-family:inherit; transition:background .15s; white-space:nowrap; display:inline-flex; align-items:center; gap:6px; }
.btn-secondary:hover { background:var(--bg-secondary); text-decoration:none; }
.btn-danger { background:var(--red); color:#fff; border:none; border-radius:var(--radius-md); padding:10px 20px; font-size:14px; cursor:pointer; font-family:inherit; }
.btn-sm { padding:6px 14px; font-size:12px; }

/* ---- Document viewer ------------------------------------- */
.doc-layout { display:flex; flex-direction:column; gap:16px; }
.doc-main { flex:1; min-width:0; }
.doc-viewer { background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-lg); overflow:hidden; }
.doc-viewer-header { padding:14px 18px; border-bottom:0.5px solid var(--border-light); }
.doc-viewer-header h1 { font-size:18px; font-weight:600; margin-bottom:6px; line-height:1.3; }
.doc-viewer-meta { font-size:12px; color:var(--text-tertiary); display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.doc-viewer-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.doc-breadcrumb { font-size:12px; color:var(--text-tertiary); margin-bottom:8px; }
.doc-breadcrumb a { color:var(--text-tertiary); }

/* EditorJS rendered content */
.doc-body { padding:22px 18px; line-height:1.75; font-size:15px; color:var(--text-primary); overflow-x:auto; }
.doc-body h1 { font-size:22px; font-weight:600; margin:0 0 16px; }
.doc-body h2 { font-size:17px; font-weight:600; margin:28px 0 10px; padding-bottom:6px; border-bottom:0.5px solid var(--border-light); }
.doc-body h3 { font-size:15px; font-weight:600; margin:20px 0 8px; }
.doc-body h4 { font-size:14px; font-weight:600; margin:16px 0 6px; }
.doc-body p  { margin:0 0 14px; }
.doc-body ul,.doc-body ol { margin:0 0 14px 22px; }
.doc-body li { margin-bottom:5px; }
.doc-body table { width:100%; border-collapse:collapse; margin:16px 0; font-size:14px; display:block; overflow-x:auto; }
.doc-body th { background:var(--bg-secondary); font-weight:500; text-align:left; padding:8px 12px; border:0.5px solid var(--border-light); white-space:nowrap; }
.doc-body td { padding:8px 12px; border:0.5px solid var(--border-light); vertical-align:top; }
.doc-body tr:hover td { background:var(--bg-secondary); }
.doc-body blockquote { border-left:3px solid var(--accent); padding:8px 16px; color:var(--text-secondary); margin:16px 0; background:var(--accent-light); border-radius:0 var(--radius-sm) var(--radius-sm) 0; font-style:italic; }
.doc-body code { background:var(--bg-secondary); border-radius:4px; padding:2px 5px; font-family:monospace; font-size:13px; }
.doc-body pre { background:var(--bg-secondary); border-radius:var(--radius-md); padding:14px 16px; overflow-x:auto; margin:14px 0; }
.doc-body pre code { background:none; padding:0; }
.doc-body strong { font-weight:600; }
.doc-body hr { border:none; border-top:0.5px solid var(--border-light); margin:24px 0; }
.doc-body mark { background:#fffab0; border-radius:2px; padding:0 2px; }
.doc-body .doc-warning { background:var(--amber-light); border-left:3px solid var(--amber); border-radius:0 var(--radius-sm) var(--radius-sm) 0; padding:10px 14px; margin:14px 0; }
.doc-body .doc-warning strong { color:var(--amber); }
.doc-body .checklist { list-style:none; margin-left:0; }
.doc-body .checklist-item { display:flex; align-items:center; gap:8px; padding:3px 0; }
.doc-body .check-box { width:16px; height:16px; border:1.5px solid var(--border-med); border-radius:3px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:11px; }
.doc-body .checklist-item.checked .check-box { background:var(--accent); border-color:var(--accent); color:#fff; }

/* EditorJS editor wrapper */
.editorjs-wrapper { border:0.5px solid var(--border-med); border-radius:var(--radius-md); min-height:400px; background:var(--bg-primary); }
.editorjs-wrapper .codex-editor { padding:12px; }
.editorjs-wrapper .ce-block__content { max-width:100%; }
.editorjs-wrapper .ce-toolbar__content { max-width:100%; }

/* Annotation panel */
.annotation-panel { background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-lg); overflow:hidden; }
.annotation-panel-header { padding:12px 14px; border-bottom:0.5px solid var(--border-light); display:flex; align-items:center; justify-content:space-between; }
.annotation-panel-header h3 { font-size:13px; font-weight:500; }
.annotation-list { max-height:400px; overflow-y:auto; }
.annotation-item { padding:10px 14px; border-bottom:0.5px solid var(--border-light); font-size:13px; }
.annotation-item:last-child { border-bottom:none; }
.annotation-block-ref { font-size:11px; color:var(--accent); margin-bottom:3px; }
.annotation-note  { color:var(--text-primary); line-height:1.4; margin-bottom:4px; }
.annotation-meta  { font-size:11px; color:var(--text-tertiary); }
.annotation-empty { padding:18px 14px; font-size:13px; color:var(--text-tertiary); text-align:center; }
.annotation-add-form { padding:12px 14px; border-top:0.5px solid var(--border-light); }
.annotation-add-form textarea { width:100%; font-size:13px; border:0.5px solid var(--border-med); border-radius:var(--radius-md); padding:7px 9px; font-family:inherit; resize:none; height:68px; }
.block-annotate-btn { display:none; position:absolute; right:-36px; top:50%; transform:translateY(-50%); background:var(--accent); color:#fff; border:none; border-radius:20px; width:26px; height:26px; font-size:14px; cursor:pointer; z-index:10; align-items:center; justify-content:center; }
.ce-block:hover .block-annotate-btn { display:flex; }
.block-has-annotation { border-left:3px solid var(--amber) !important; padding-left:8px; background:rgba(176,109,16,.04); }

/* PDF */
.pdf-embed { width:100%; height:78vh; border:none; }

/* Login */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg-tertiary); padding:20px; }
.login-card { background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-xl); padding:28px 24px; width:100%; max-width:400px; }
.login-logo { display:flex; align-items:center; gap:10px; margin-bottom:24px; font-size:16px; font-weight:600; }

/* Admin */
.data-table { width:100%; border-collapse:collapse; font-size:13px; }
.data-table th { font-weight:500; text-align:left; padding:9px 12px; border-bottom:0.5px solid var(--border-med); color:var(--text-secondary); white-space:nowrap; }
.data-table td { padding:9px 12px; border-bottom:0.5px solid var(--border-light); vertical-align:middle; }
.data-table tr:hover td { background:var(--bg-secondary); }
.table-wrap { overflow-x:auto; }

/* Search */
.search-result { background:var(--bg-primary); border:0.5px solid var(--border-light); border-radius:var(--radius-lg); padding:14px 16px; margin-bottom:10px; }
.search-result h3 { font-size:15px; font-weight:500; margin-bottom:4px; }
.search-result p  { font-size:13px; color:var(--text-secondary); }
.search-result mark { background:#fffab0; border-radius:2px; }

/* Footer */
.site-footer { background:var(--bg-primary); border-top:0.5px solid var(--border-light); padding:10px 16px; font-size:12px; color:var(--text-tertiary); display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px; }


/* ---- Restore native checkbox and radio appearance -------- */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  flex-shrink: 0;
}
/* ---- Responsive ------------------------------------------ */
@media (min-width:640px) {
  .logo-text { display:inline; }
  .cards-grid { grid-template-columns:repeat(2,1fr); }
  .form-grid-2 { grid-template-columns:1fr 1fr; gap:12px; }
  .doc-body { padding:28px 28px; }
  .doc-viewer-actions { margin-top:0; }
  .doc-viewer-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
  .doc-viewer-header-left { flex:1; }
  .main { padding:24px 24px; }
}

@media (max-width: 639px) {
  .col-location { display: none; }
}
@media (min-width:900px) {
  .topbar { padding:0 20px; gap:16px; }
  .hamburger { display:none; }
  .top-nav { display:flex; }
  .sidebar { display:flex; }
  .cards-grid { grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); }
  .two-col { grid-template-columns:1fr 1fr; }
  .doc-layout { flex-direction:row; align-items:flex-start; }
  .annotation-panel { width:270px; flex-shrink:0; position:sticky; top:calc(var(--topbar-h) + 16px); }
  .annotation-list { max-height:60vh; }
  .search-bar input { width:180px; }
  .main { padding:28px 32px; }
}
@media (min-width:1200px) {
  .cards-grid { grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); }
}
