/* ===== SHARED CSS — HubForge Shell & Comment System =====
   Used by both index.html (report) and guide.html (guide).
   Page-specific styles remain inline in each HTML file.
   ========================================================= */

/* ===== ROOT VARS ===== */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --surface3: #222233;
  --border: #2a2a3a;
  --text: #e4e4ef;
  --text-muted: #8888a0;
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --green: #00b894;
  --red: #e17055;
  --orange: #fdcb6e;
  --blue: #74b9ff;
  --cyan: #00cec9;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.7; }

/* ===== BASE TYPOGRAPHY ===== */
p { margin-bottom: 14px; }
strong { color: #fff; }
ul, ol { margin: 10px 0 18px 24px; }
li { margin-bottom: 7px; }

/* ===== BASE COMPONENTS ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; }
.card-header { font-weight: 700; font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.callout { background: var(--surface2); border-left: 4px solid var(--accent); padding: 18px 22px; border-radius: 0 8px 8px 0; margin: 20px 0; font-size: 16px; }

/* ===== LOGIN ===== */
#login-overlay { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: flex; align-items: center; justify-content: center; transition: opacity 0.4s, visibility 0.4s; }
#login-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 48px 40px; width: 100%; max-width: 420px; text-align: center; box-shadow: 0 40px 80px rgba(0,0,0,0.6); }
.login-box .icon { width: 72px; height: 72px; background: linear-gradient(135deg, var(--accent), var(--cyan)); border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 24px; box-shadow: 0 12px 40px rgba(108,92,231,0.3); }
.login-box h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; background: linear-gradient(135deg, #fff, var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-box .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.login-box input { width: 100%; padding: 14px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 15px; font-family: inherit; margin-bottom: 12px; outline: none; transition: border-color 0.2s; }
.login-box input:focus { border-color: var(--accent); }
.login-box button[type="submit"] { width: 100%; padding: 14px; border-radius: 10px; border: none; background: linear-gradient(135deg, var(--accent), #5a4bd1); color: white; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; margin-top: 4px; transition: transform 0.1s, box-shadow 0.2s; }
.login-box button[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,92,231,0.4); }
.login-box button[type="submit"]:active { transform: translateY(0); }
.login-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ===== AUTH TABS ===== */
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 10px; border: none; background: var(--surface2); color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.2s, color 0.2s; }
.auth-tab.active { background: var(--accent); color: white; }
.auth-tab:not(.active):hover { background: var(--surface3); color: var(--text); }

/* ===== TOP BAR ===== */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 102; background: rgba(10,10,15,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 54px; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.btn-sidebar-toggle { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: color 0.2s, background 0.2s; line-height: 1; }
.btn-sidebar-toggle:hover { color: var(--text); background: var(--surface2); }
.topbar-logo { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--cyan)); display: flex; align-items: center; justify-content: center; font-size: 16px; text-decoration: none; }
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 13px; color: var(--text-muted); padding: 4px 12px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--border); }
.btn-comments { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--accent); background: rgba(108,92,231,0.1); color: var(--accent2); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 6px; transition: background 0.2s; }
.btn-comments:hover { background: rgba(108,92,231,0.2); }
.btn-comments .count { background: var(--accent); color: white; padding: 1px 7px; border-radius: 10px; font-size: 11px; min-width: 20px; text-align: center; }
.btn-print { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: inherit; transition: border-color 0.2s, color 0.2s; }
.btn-print:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-logout { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: inherit; transition: border-color 0.2s, color 0.2s; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ===== AVATAR MENU ===== */
.avatar-menu-wrap { position: relative; }
.btn-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); background: var(--accent); color: white; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s; }
.btn-avatar:hover { border-color: var(--accent2); }
.avatar-dropdown { position: absolute; top: 42px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); min-width: 180px; z-index: 200; display: none; overflow: hidden; }
.avatar-dropdown.open { display: block; }
.avatar-dropdown-name { padding: 12px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.avatar-dropdown button { display: block; width: 100%; padding: 10px 16px; border: none; background: transparent; color: var(--text); font-size: 13px; font-family: inherit; cursor: pointer; text-align: left; transition: background 0.15s; }
.avatar-dropdown button:hover { background: var(--surface2); }
.avatar-dropdown-danger { color: var(--red) !important; }
.avatar-dropdown-danger:hover { background: rgba(225,112,85,0.1) !important; }
.profile-avatar-large { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: white; background: var(--accent); }

/* ===== SEARCH BUTTON ===== */
.btn-search { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer; font-family: inherit; transition: border-color 0.2s, color 0.2s; line-height: 1; }
.btn-search:hover { border-color: var(--accent); color: var(--accent2); }

/* ===== SEARCH OVERLAY ===== */
.search-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-overlay.open { display: flex; }
.search-modal { width: min(600px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); overflow: hidden; max-height: 70vh; display: flex; flex-direction: column; }
.search-modal-header { display: flex; align-items: center; border-bottom: 1px solid var(--border); padding: 4px; }
.search-modal-header input { flex: 1; padding: 14px 16px; border: none; background: transparent; color: var(--text); font-size: 16px; font-family: inherit; outline: none; }
.search-modal-header input::placeholder { color: var(--text-muted); }
.search-modal-close { width: 36px; height: 36px; border-radius: 8px; border: none; background: var(--surface2); color: var(--text-muted); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; margin-right: 4px; flex-shrink: 0; }
.search-modal-close:hover { color: var(--text); }
.search-results { overflow-y: auto; padding: 8px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--surface3) transparent; }
.search-hint { text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 14px; }
.search-result { display: block; padding: 10px 14px; border-radius: 8px; text-decoration: none; color: var(--text); transition: background 0.15s; }
.search-result:hover { background: var(--surface2); }
.search-result-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.search-type { font-size: 14px; }
.search-page { font-weight: 600; color: var(--accent2); }
.search-ctx { color: var(--text-muted); }
.search-result-text { font-size: 14px; line-height: 1.4; color: var(--text); }

/* ===== SIDEBAR ===== */
.sidebar { position: fixed; top: 54px; left: 0; bottom: 0; width: 260px; z-index: 101; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 12px 0; scrollbar-width: thin; scrollbar-color: var(--surface3) transparent; transform: translateX(0); transition: transform 0.25s ease; }
.sidebar.hidden { transform: translateX(-100%); }
.sidebar-group { margin-bottom: 10px; }
.sidebar-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); padding: 14px 20px 8px; }
.sidebar-link { display: block; padding: 7px 20px 7px 32px; font-size: 15px; color: var(--text-muted); text-decoration: none; transition: background 0.15s, color 0.15s; border-left: 2px solid transparent; }
.sidebar-link:hover { background: var(--surface2); color: var(--text); }
.sidebar-link.active { color: var(--accent2); border-left-color: var(--accent); background: rgba(108,92,231,0.08); }
.sidebar-link.page-link { padding-left: 20px; font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.sidebar-link.page-link:hover { color: var(--accent2); }
.sidebar-link.page-link.current { color: var(--accent2); }
.sidebar-divider { height: 1px; background: var(--border); margin: 10px 18px; }

/* ===== COMMENTS PANEL ===== */
.comments-panel { position: fixed; top: 54px; right: 0; bottom: 0; width: 400px; z-index: 200; background: var(--surface); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform 0.3s ease; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,0.4); overscroll-behavior: contain; }
.comments-panel.open { transform: translateX(0); }
.comments-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.comments-header h3 { font-size: 16px; font-weight: 700; }
.comments-close { width: 30px; height: 30px; border-radius: 6px; border: none; background: var(--surface2); color: var(--text-muted); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.comments-filter { padding: 10px 20px; border-bottom: 1px solid var(--border); }
.comments-filter select { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 13px; font-family: inherit; outline: none; cursor: pointer; }
.comments-filter select:focus { border-color: var(--accent); }
.comments-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 20px; overscroll-behavior: contain; scrollbar-width: none; }
.comments-list::-webkit-scrollbar { display: none; }
.comment-group-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 12px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.comment-group-header:first-child { padding-top: 0; }
.comment-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; position: relative; }
.comment-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.comment-author { font-size: 12px; font-weight: 600; color: var(--accent2); display: flex; align-items: center; gap: 5px; }
.comment-author .avatar { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; }
.comment-time { font-size: 10px; color: var(--text-muted); }
.comment-quote { border-left: 3px solid var(--cyan); padding: 6px 10px; margin: 6px 0 8px; font-size: 13px; color: var(--cyan); font-style: italic; background: rgba(0,206,201,0.05); border-radius: 0 6px 6px 0; }
.comment-text { font-size: 13px; line-height: 1.4; color: var(--text); }
.comment-actions { display: flex; gap: 2px; justify-content: flex-end; margin-top: 4px; }
.comment-edit, .comment-delete { font-size: 13px; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 3px 5px; border-radius: 4px; transition: color 0.2s, background 0.2s; line-height: 1; }
.comment-edit:hover { color: var(--accent2); background: rgba(108,92,231,0.1); }
.comment-delete:hover { color: var(--red); background: rgba(225,112,85,0.1); }
.comment-edit-form { margin-top: 8px; }
.comment-edit-form textarea { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit; resize: vertical; min-height: 50px; outline: none; }
.comment-edit-form textarea:focus { border-color: var(--accent); }
.comment-edit-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.comment-edit-actions button { padding: 5px 12px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.comment-edit-save { background: var(--accent); color: white; }
.comment-edit-cancel { background: transparent; border: 1px solid var(--border) !important; color: var(--text-muted); }
.comment-edited { font-size: 10px; color: var(--text-muted); font-style: italic; margin-left: 6px; }
.comment-pinned { border-color: var(--accent) !important; background: rgba(108,92,231,0.08) !important; }
.comment-pin { font-size: 12px; margin-left: 4px; }
.gutter-dot-pinned { box-shadow: 0 0 0 3px var(--accent), 0 0 12px rgba(108,92,231,0.4); transform: scale(1.15); }
.comment-highlighted { border-color: var(--orange) !important; background: rgba(253,203,110,0.08) !important; }

/* ===== ITEM HIGHLIGHT (persistent selection) ===== */
.item-highlighted { outline: 2px solid var(--orange) !important; outline-offset: 4px !important; box-shadow: 0 0 16px rgba(253,203,110,0.25) !important; }
.card.item-highlighted, .highlight-box.item-highlighted, .callout.item-highlighted,
.pro-card.item-highlighted, .con-card.item-highlighted, .tier.item-highlighted,
.persona.item-highlighted, .wireless-card.item-highlighted, .stat-box.item-highlighted,
.challenge-card.item-highlighted, .budget-item.item-highlighted, .analogy.item-highlighted,
.timeline-item.item-highlighted, .challenge-section.item-highlighted,
a.glossary-item.item-highlighted, .ref-card.item-highlighted { outline: none !important; border-color: var(--orange) !important; box-shadow: 0 0 0 2px var(--orange), 0 0 16px rgba(253,203,110,0.25) !important; }
tr.item-highlighted { outline: none !important; box-shadow: none !important; background: rgba(253,203,110,0.15) !important; }
h2.item-highlighted, h3.item-highlighted, h4.item-highlighted { outline: none !important; box-shadow: none !important; color: var(--orange) !important; }
.no-comments { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }

/* ===== HIGHLIGHT POPUP ===== */
.highlight-popup { position: fixed; z-index: 300; background: var(--accent); color: white; padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px rgba(108,92,231,0.5); display: none; white-space: nowrap; font-family: inherit; border: none; transition: transform 0.1s; }
.highlight-popup:hover { transform: scale(1.05); }
.highlight-popup::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid var(--accent); }

/* ===== COMMENT POPUP (floating, on gutter dot click) ===== */
.comment-popup-float { position: fixed; z-index: 310; width: 340px; max-height: 400px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); animation: popSlideUp 0.2s ease; scrollbar-width: none; overscroll-behavior: contain; }
.comment-popup-float::-webkit-scrollbar { display: none; }
.cpf-user-group { margin-bottom: 10px; }
.cpf-user-group:last-child { margin-bottom: 0; }
.cpf-user { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent2); margin-bottom: 6px; }
.cpf-user .avatar { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; }
.cpf-comment { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 4px; }
.cpf-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.cpf-time { font-size: 10px; color: var(--text-muted); }
.cpf-text { font-size: 13px; line-height: 1.4; color: var(--text); }
.cpf-actions { display: flex; gap: 2px; }
.cpf-actions button { font-size: 12px; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 2px 4px; border-radius: 4px; line-height: 1; }
.cpf-actions button:first-child:hover { color: var(--accent2); }
.cpf-actions button:last-child:hover { color: var(--red); }

/* ===== COMMENTABLE ELEMENTS ===== */
[data-cid] { cursor: pointer; outline: 2px solid transparent; outline-offset: 4px; border-radius: 6px; transition: outline-color 0.3s ease; scroll-margin-top: 70px; }
[data-cid]:hover { outline-color: rgba(108,92,231,0.35); }
[data-cid]:hover:has([data-cid]:hover) { outline-color: transparent; }
/* Cards/bordered elements: highlight border instead of outline */
.card[data-cid], .highlight-box[data-cid], .callout[data-cid], .pro-card[data-cid], .con-card[data-cid],
.tier[data-cid], .persona[data-cid], .wireless-card[data-cid], .stat-box[data-cid],
.challenge-card[data-cid], .budget-item[data-cid], .analogy[data-cid],
.timeline-item[data-cid], .challenge-section[data-cid],
a.glossary-item[data-cid], .ref-card[data-cid] { outline: none !important; outline-color: transparent !important; transition: border-color 0.3s ease; }
.card[data-cid]:hover, .highlight-box[data-cid]:hover, .callout[data-cid]:hover, .pro-card[data-cid]:hover, .con-card[data-cid]:hover,
.tier[data-cid]:hover, .persona[data-cid]:hover, .wireless-card[data-cid]:hover, .stat-box[data-cid]:hover,
.challenge-card[data-cid]:hover, .budget-item[data-cid]:hover, .analogy[data-cid]:hover,
.timeline-item[data-cid]:hover, .challenge-section[data-cid]:hover,
a.glossary-item[data-cid]:hover, .ref-card[data-cid]:hover { outline: none !important; outline-color: transparent !important; border-color: var(--accent) !important; }
/* Headers: no outline, no position override */
h2[data-cid], h3[data-cid], h4[data-cid],
h2[data-cid]:hover, h3[data-cid]:hover, h4[data-cid]:hover { outline: none !important; outline-color: transparent !important; }
h3[data-cid]:hover, h4[data-cid]:hover { color: var(--accent2); }
/* Table rows: highlight background instead of outline */
tr[data-cid], tr[data-cid]:hover { outline: none !important; outline-color: transparent !important; }
tr[data-cid]:hover { background: rgba(108,92,231,0.12) !important; transition: background 0.2s ease; }

/* ===== ITEM POPOVER ===== */
.item-popover { position: fixed; z-index: 300; bottom: 16px; width: min(600px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; box-shadow: 0 -8px 30px rgba(0,0,0,0.5); animation: popSlideUp 0.2s ease; }
@keyframes popSlideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pop-actions { display: flex; gap: 4px; margin-bottom: 0; }
.pop-actions.has-form { margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.pop-btn { padding: 8px 14px; border-radius: 7px; border: none; background: transparent; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 0.15s; flex: 1; justify-content: center; }
.pop-btn:hover { background: var(--surface2); }
.pop-btn-comment { color: var(--accent2); }
.pop-btn-link { color: var(--cyan); }
.pop-divider { width: 1px; background: var(--border); margin: 4px 0; }
.pop-form { display: none; }
.pop-form.open { display: block; }
.pop-form textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 14px; font-family: inherit; resize: vertical; min-height: 60px; outline: none; transition: border-color 0.2s; }
.pop-form textarea:focus { border-color: var(--accent); }
.pop-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pop-form .pop-post { padding: 7px 16px; border-radius: 8px; border: none; background: var(--accent); color: white; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity 0.15s; }
.pop-form .pop-post:hover { opacity: 0.85; }
.pop-form .pop-post:disabled { opacity: 0.5; cursor: not-allowed; }
.pop-form .pop-cancel { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: inherit; }

/* ===== COMMENT GUTTER ===== */
#comment-gutter { position: absolute; top: 0; right: -56px; width: 48px; pointer-events: none; }
.gutter-dot { position: absolute; right: 2px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; cursor: pointer; pointer-events: auto; border: 2px solid var(--bg); transition: transform 0.15s; z-index: 1; }
.gutter-dot:hover { transform: scale(1.2); z-index: 10; }
.gutter-dot-active { transform: scale(1.4); z-index: 20; box-shadow: 0 0 0 3px var(--orange), 0 0 12px rgba(253,203,110,0.4); }
.gutter-dot .dot-count { position: absolute; top: -5px; right: -5px; background: var(--red); color: white; width: 16px; height: 16px; border-radius: 50%; font-size: 9px; display: flex; align-items: center; justify-content: center; }

/* ===== PAGE FOOTER ===== */
.page-footer { text-align: center; font-size: 13px; color: var(--text-muted); padding: 30px 0 10px; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 600; z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ===== RESPONSIVE — SIDEBAR & TOPBAR ===== */
@media (max-width: 1199px) { .sidebar { transform: translateX(-100%); } .sidebar.mobile-open { transform: translateX(0); } .main { margin-left: auto; padding-top: 76px; } }
@media (max-width: 1100px) { .main { margin-right: auto; } .gutter-dot-inline { width: 22px; height: 22px; font-size: 10px; pointer-events: auto; } .gutter-dot-inline .dot-count { width: 13px; height: 13px; font-size: 7px; top: -4px; right: -4px; } }
@media (max-width: 768px) {
  .comments-panel { width: 100%; }
  .topbar { padding: 0 12px; }
  .topbar-user { display: none; }
  html, body { font-size: 14px; line-height: 1.6; overflow-x: hidden; scrollbar-width: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
  p { margin-bottom: 10px; }
  ul, ol { margin: 8px 0 14px 20px; }
  li { margin-bottom: 5px; }
  .comment-popup-float { width: min(340px, calc(100vw - 24px)); }
  .item-popover { width: calc(100% - 24px); left: 12px; }
  .sidebar { box-shadow: 8px 0 30px rgba(0,0,0,0.5); }
  .sidebar.hidden { box-shadow: none; }
  .btn-print, .btn-logout { display: none; }
  .comments-label { display: none; }
  .btn-comments { padding: 6px 10px; min-width: 0; }
  .topbar-title { font-size: 14px; white-space: nowrap; }
}

/* ===== PRINT ===== */
@media print {
  body { background: white; color: #111; font-size: 11pt; line-height: 1.5; }
  #login-overlay, #topbar, #comments-panel, #comment-gutter,
  .highlight-popup, .toast, .btn-print, .btn-comments, .btn-logout,
  .topbar, .sidebar, .cover-icon,
  .item-popover, .gutter-dot { display: none !important; }
  .main { max-width: 100%; margin: 0 !important; padding: 0; }
  .section { padding: 20px 0; border-bottom: 1px solid #ccc; }
  h2 { color: #111; border-bottom-color: #333; font-size: 18pt; }
  h2 .num { background: #333; }
  h3 { color: #333; }
  strong { color: #111; }
  .card, .callout { background: white; border: 1px solid #ccc; color: #111; box-shadow: none; }
  .cover h1 { -webkit-text-fill-color: #111; background: none; }
  a { color: #111; text-decoration: none; }
  .page-footer { color: #999; }
}
