@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #f8f8f6;
  --surface: #fff;
  --surface-2: #f2f2f0;
  --border: #e4e4e0;
  --border-strong: #c8c8c2;
  --text: #1a1a18;
  --text-muted: #6b6b65;
  --text-light: #9b9b93;
  --accent: #1a1a18;
  --accent-soft: #f0f0ec;
  --critical: #c0392b;
  --high: #d35400;
  --medium: #b7950b;
  --low: #1e8449;
  --critical-bg: #fdf2f0;
  --high-bg: #fdf5f0;
  --medium-bg: #fefdf0;
  --low-bg: #f0fdf4;
  --progress-track: #e8e8e4;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --header-h: 60px;
  --nav-h: 52px;
  --sidebar-w: 220px;
  --sidebar-w-collapsed: 44px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; min-height: 100vh }

/* ── HEADER ── */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow) }
.header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 12px }
.header-title { font-family: 'DM Serif Display', serif; font-size: 17px; letter-spacing: -.3px; white-space: nowrap }
.header-title span { color: var(--text-muted); font-style: italic; font-size: 13px }
.header-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1; text-decoration: none }
.btn:hover { background: var(--surface-2); border-color: var(--accent) }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent) }
.btn-primary:hover { background: #333 }
.btn-danger { border-color: #e0c0bc; color: var(--critical) }
.btn-danger:hover { background: var(--critical-bg) }
.btn-success { background: #1e8449; color: #fff; border-color: #1e8449 }
.btn-success:hover { background: #186038 }
.btn-warning { background: #d35400; color: #fff; border-color: #d35400 }
.btn-warning:hover { background: #b34500 }

/* ── LAYOUT ── */
.main-container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 0; }
/* Sidebar row sits naturally inside container padding — no negative margins */
.main-with-sidebar {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--header-h) - 49px);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: clip;
  margin-bottom: 49px;
  background: var(--surface);
}
/* Sidebar starts flush — no gap between it and the card above */
.main-content { flex: 1; min-width: 0; padding: 12px 20px 60px 20px; }

/* ── STATUS BAR ── */
.status-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 20px; font-size: 12px; color: var(--text-muted) }
.status-bar .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-light); flex-shrink: 0 }
.status-bar .status-dot.saving { background: var(--medium); animation: pulse 1s infinite }
.status-bar .status-dot.saved { background: var(--low) }
.status-bar .status-dot.error { background: var(--critical) }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.4 } }
.status-bar .share-info { margin-left: auto; display: flex; gap: 8px; align-items: center }

/* ── SCORE DASHBOARD ── */
.score-dashboard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 26px; margin-bottom: 22px; box-shadow: var(--shadow) }
.score-grid { display: grid; grid-template-columns: 170px 1fr auto; gap: 24px; align-items: center }
.score-dial { display: flex; flex-direction: column; align-items: center; gap: 4px }
.dial-ring { width: 120px; height: 120px; position: relative }
.dial-ring svg { width: 120px; height: 120px; transform: rotate(-90deg) }
.dial-track { fill: none; stroke: var(--progress-track); stroke-width: 10 }
.dial-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1), stroke .4s ease }
.dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center }
.dial-score { font-family: 'DM Serif Display', serif; font-size: 30px; line-height: 1 }
.dial-max { font-size: 10px; color: var(--text-muted) }
.dial-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-align: center }
.maturity-badge { margin-top: 5px; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase }
.score-breakdown { display: flex; flex-direction: column; gap: 8px }
.breakdown-row { display: grid; grid-template-columns: 195px 1fr 48px; gap: 10px; align-items: center; cursor: pointer }
.breakdown-row:hover .breakdown-label { color: var(--text) }
.breakdown-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s }
.breakdown-bar-wrap { height: 5px; background: var(--progress-track); border-radius: 3px; overflow: hidden }
.breakdown-bar { height: 100%; border-radius: 3px; transition: width .5s ease; background: var(--accent) }
.breakdown-bar.bm { background: #2980b9; opacity: .5 }
.breakdown-pct { font-size: 11px; font-weight: 600; text-align: right; color: var(--text-muted) }

/* Benchmark panel */
.benchmark-panel { background: #eaf4fb; border: 1px solid #aad4ee; border-radius: 8px; padding: 14px 18px; margin-top: 14px }
.benchmark-panel h4 { font-size: 12px; font-weight: 600; color: #1a6dad; margin-bottom: 8px; display: flex; align-items: center; gap: 6px }
.bm-total { font-family: 'DM Serif Display', serif; font-size: 22px; color: #1a6dad }
.bm-count { font-size: 11px; color: #2980b9 }
.bm-diff { font-size: 12px; font-weight: 600; margin-left: 8px }
.bm-diff.positive { color: var(--low) }
.bm-diff.negative { color: var(--critical) }

/* Submit section */
.submit-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin-bottom: 22px; box-shadow: var(--shadow) }
.submit-panel h3 { font-family: 'DM Serif Display', serif; font-size: 16px; margin-bottom: 6px }
.submit-panel p { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px }
.submit-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.submit-note { font-size: 11px; color: var(--text-light) }

/* ── SIDEBAR LAYOUT ── */

/* Sidebar */
.section-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h) - 49px);
  align-self: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .22s cubic-bezier(.4,0,.2,1);
  z-index: 90;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.section-sidebar.collapsed { width: var(--sidebar-w-collapsed) }
.section-sidebar.collapsed .sidebar-item { padding: 8px 0; justify-content: center; gap: 0 }
.section-sidebar.collapsed .sidebar-item-num { width: 44px; text-align: center }
.section-sidebar.collapsed .sidebar-toggle { justify-content: center; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 8px 6px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-toggle button {
  width: 26px; height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all .15s;
  flex-shrink: 0;
}
.sidebar-toggle button:hover { background: var(--border); color: var(--text) }
.sidebar-toggle-icon { transition: transform .22s }
.section-sidebar.collapsed .sidebar-toggle-icon { transform: rotate(180deg) }

.sidebar-nav { flex: 1; padding: 2px 0; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background .12s;
  border-left: 3px solid transparent;
  min-height: 40px;
  overflow: hidden;
  position: relative;
}
.sidebar-item:hover { background: var(--accent-soft) }
.sidebar-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.sidebar-item.active .sidebar-item-name { color: var(--text); font-weight: 600 }

.sidebar-item-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-item-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: opacity .18s;
}
.section-sidebar.collapsed .sidebar-item-body { width: 0; opacity: 0; pointer-events: none; overflow: hidden; margin: 0; }

.sidebar-item-name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 3px;
}
.sidebar-bar-wrap {
  height: 3px;
  background: var(--progress-track);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}
.sidebar-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width .4s ease;
}
.sidebar-pct {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 28px;
  text-align: right;
  transition: opacity .18s;
}
.section-sidebar.collapsed .sidebar-pct { width: 0; opacity: 0; overflow: hidden; }

/* Tooltip when collapsed */
.sidebar-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-w-collapsed) + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.section-sidebar:not(.collapsed) .sidebar-item::after { display: none !important }

/* Main content area beside sidebar */
.sidebar-content {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 120px 24px;
}

/* ── SEARCH & FILTER BAR ── */
.filter-bar {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: var(--header-h);
  z-index: 85;
}
.filter-bar.visible { display: flex }
.filter-search {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
}
.filter-search input {
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  width: 100%;
}
.filter-search input::placeholder { color: var(--text-light) }
.filter-search svg { color: var(--text-light); flex-shrink: 0 }
.filter-chips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center }
.filter-chip {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .12s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text) }
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent) }
.filter-chip.critical.active { background: var(--critical); border-color: var(--critical) }
.filter-chip.high.active     { background: var(--high);     border-color: var(--high) }
.filter-chip.medium.active   { background: var(--medium);   border-color: var(--medium) }
.filter-chip.low.active      { background: var(--low);      border-color: var(--low) }
.filter-divider { width: 1px; height: 18px; background: var(--border); flex-shrink: 0 }
.filter-count { font-size: 11px; color: var(--text-light); white-space: nowrap; margin-left: 4px }
.filter-clear { font-size: 11px; color: var(--text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; background: none; border: none; font-family: 'DM Sans', sans-serif; padding: 0 }
.filter-clear:hover { color: var(--text) }

/* Hidden checks when filtered */
.check-item.filter-hidden { display: none }
.check-group.filter-all-hidden .check-group-header { display: none }
.check-group.filter-all-hidden { border-top: none }
.filter-no-results { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; display: none }

/* ── SECTIONS ── */
.assessment-section { display: none }
.assessment-section.active { display: block }
.section-header { background: var(--surface); border: 1px solid var(--border); border-radius: 10px 10px 0 0; padding: 14px 20px; border-bottom: none; position: sticky; top: var(--header-h); z-index: 80; box-shadow: 0 2px 8px rgba(0,0,0,.06) }
.section-header-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px }
.section-title { font-family: 'DM Serif Display', serif; font-size: 18px; margin-bottom: 2px }
.section-desc { font-size: 11.5px; color: var(--text-muted); max-width: 560px }
.section-score-pill { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px }
.pill-pct { font-family: 'DM Serif Display', serif; font-size: 24px; line-height: 1 }
.pill-label { font-size: 10px; color: var(--text-muted); font-weight: 500 }

/* ── CHECKS ── */
.checks-container { background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; overflow: visible; margin-bottom: 24px }
.check-group { border-top: 1px solid var(--border) }
.check-group:first-child { border-top: none }
.check-group-header { padding: 8px 20px; background: var(--surface-2); font-size: 10.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border) }
.check-item { display: grid; grid-template-columns: 38px 1fr auto; align-items: start; border-bottom: 1px solid var(--border); transition: background .1s }
.check-item:last-child { border-bottom: none }
.check-item:hover { background: var(--accent-soft) }
.check-number { padding: 14px 0 12px 20px; font-size: 10px; color: var(--text-light); font-weight: 600 }
.check-body { padding: 12px 10px 10px 10px }
.check-text { font-size: 13px; line-height: 1.5; color: var(--text); margin-bottom: 5px }
.check-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px }
.tag { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; letter-spacing: .4px; text-transform: uppercase }
.tag-critical { background: var(--critical-bg); color: var(--critical) }
.tag-high { background: var(--high-bg); color: var(--high) }
.tag-medium { background: var(--medium-bg); color: var(--medium) }
.tag-low { background: var(--low-bg); color: var(--low) }
.tag-role { background: var(--surface-2); color: var(--text-muted) }
.check-explain-toggle { font-size: 11px; color: var(--text-light); cursor: pointer; background: none; border: none; padding: 0; font-family: 'DM Sans', sans-serif; display: inline-flex; align-items: center; gap: 3px; transition: color .15s }
.check-explain-toggle:hover { color: var(--text-muted) }
.check-explain { display: none; margin-top: 7px; padding: 8px 11px; background: var(--surface-2); border-left: 3px solid var(--border-strong); border-radius: 0 5px 5px 0; font-size: 12px; color: var(--text-muted); line-height: 1.55 }
.check-controls { padding: 10px 14px 10px 0; display: flex; flex-direction: column; gap: 5px; align-items: flex-end }
.status-select { appearance: none; -webkit-appearance: none; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; padding: 5px 22px 5px 8px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6b65'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; transition: border-color .15s; min-width: 124px }
.status-select:focus { outline: none; border-color: var(--accent) }
.status-select.s-done { border-color: var(--low); background-color: var(--low-bg); color: var(--low) }
.status-select.s-partial { border-color: var(--medium); background-color: var(--medium-bg); color: var(--medium) }
.status-select.s-planned { border-color: #2980b9; background-color: #eaf4fb; color: #2980b9 }
.status-select.s-na { border-color: var(--border-strong); background-color: var(--surface-2); color: var(--text-muted) }
.status-select.s-notdone { border-color: #ddd }
.notes-toggle { font-size: 11px; color: var(--text-muted); cursor: pointer; background: none; border: none; padding: 0; font-family: 'DM Sans', sans-serif; text-decoration: underline; text-underline-offset: 2px; transition: color .15s }
.notes-toggle:hover { color: var(--text) }
.notes-area { display: none; padding: 7px 20px 11px 56px; background: var(--surface); border-top: 1px solid var(--border) }
.notes-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px }
.notes-area textarea { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text); background: var(--surface-2); resize: vertical; min-height: 52px; transition: border-color .15s }
.notes-area textarea:focus { outline: none; border-color: var(--accent); background: var(--surface) }
.notes-area textarea::placeholder { color: var(--text-light) }

/* ── ACTION PLAN ── */
.action-panel { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 22px; box-shadow: var(--shadow); overflow: hidden }
.action-panel.visible { display: block }
.action-panel-header { padding: 16px 22px; background: linear-gradient(135deg,#1a1a18,#2d2d2a); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 16px }
.action-panel-header h3 { font-family: 'DM Serif Display', serif; font-size: 16px }
.action-panel-header p { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 2px }
.action-section-wrap { border-top: 1px solid var(--border) }
.action-section-wrap:first-child { border-top: none }
.action-section-title { padding: 10px 20px; background: var(--surface-2); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none }
.action-section-title:hover { background: #ebebea }
.action-section-title .chevron { transition: transform .2s; font-size: 10px }
.action-section-title.collapsed .chevron { transform: rotate(-90deg) }
.action-item { display: grid; grid-template-columns: 16px 1fr; gap: 11px; padding: 9px 20px; border-bottom: 1px solid var(--border); align-items: start }
.action-item:last-child { border-bottom: none }
.action-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0 }
.action-dot.critical { background: var(--critical) }
.action-dot.high { background: var(--high) }
.action-dot.medium { background: var(--medium) }
.action-dot.low { background: var(--low) }
.action-title { font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 4px }
.action-steps { font-size: 11.5px; color: var(--text-muted); line-height: 1.55; padding-left: 14px }
.action-steps li { margin-bottom: 2px }

/* ── META FORM ── */
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow) }
.info-card h3 { font-family: 'DM Serif Display', serif; font-size: 15px; margin-bottom: 14px }
.info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px }
.info-field label { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px }
.info-field input, .info-field select, .info-field textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 10px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text); background: var(--surface); transition: border-color .15s }
.info-field input:focus, .info-field select:focus, .info-field textarea:focus { outline: none; border-color: var(--accent) }
.info-field.full { grid-column: 1/-1 }
.info-field.half { grid-column: span 1 }

/* ── MODAL ── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 200; align-items: center; justify-content: center }
.modal-backdrop.open { display: flex }
.modal { background: var(--surface); border-radius: 12px; padding: 24px 26px; max-width: 480px; width: 90%; box-shadow: var(--shadow-md) }
.modal h3 { font-family: 'DM Serif Display', serif; font-size: 18px; margin-bottom: 7px }
.modal p { color: var(--text-muted); font-size: 13px; margin-bottom: 14px }
.modal .share-link-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-family: monospace; font-size: 12px; word-break: break-all; margin-bottom: 14px; color: var(--text) }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end }

/* ── BACK TO TOP ── */
#back-to-top { position: fixed; bottom: 66px; right: 26px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; border: none; cursor: pointer; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-md); transition: opacity .2s, transform .2s; z-index: 150 }
#back-to-top.visible { display: flex }
#back-to-top:hover { background: #333; transform: translateY(-2px) }

/* ── TOAST ── */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1a1a18; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 300; pointer-events: none }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) }

/* ── FOOTER ── */
footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 95; box-shadow: 0 -1px 0 var(--border); }

/* ── PRINT ── */
@media print {
  *, *::before, *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important }
  .site-header, .section-nav, .header-actions, .notes-toggle, .check-controls, .btn,
  .modal-backdrop, #back-to-top, .check-explain-toggle, .action-section-title, footer,
  .status-bar, .submit-panel, .toast { display: none !important }
  body { background: white; font-size: 11px }
  .main-container { padding: 0; max-width: 100% }
  .assessment-section { display: block !important }
  .section-header { position: static; box-shadow: none }
  .score-dashboard { box-shadow: none; border: 1px solid #ddd; break-inside: avoid }
  .check-item { break-inside: avoid }
  .notes-area { display: block !important }
  .notes-area textarea { border: none; background: transparent; resize: none; padding: 0 }
  .check-explain { display: block !important }
  .section-header { break-after: avoid }
  .print-header { display: block !important; text-align: center; padding: 14px 0 10px; border-bottom: 2px solid #ddd; margin-bottom: 14px }
  .status-select { border: 1px solid #ddd !important; background: white !important; color: black !important }
  .action-panel.visible { display: block !important }
  @page { margin: 1.5cm }
}
.print-header { display: none }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  /* Auto-collapse sidebar on smaller screens */
  .section-sidebar { width: var(--sidebar-w-collapsed) }
  .section-sidebar .sidebar-item-body { opacity: 0; pointer-events: none }
  .section-sidebar .sidebar-pct { opacity: 0 }
}
@media (max-width: 780px) {
  .score-grid { grid-template-columns: 1fr }
  .info-grid { grid-template-columns: 1fr 1fr }
  .breakdown-row { grid-template-columns: 130px 1fr 44px }
  .check-item { grid-template-columns: 32px 1fr }
  .check-controls { grid-column: 1/-1; flex-direction: row; padding: 0 12px 10px 32px }
  .header-title span { display: none }
  #back-to-top { bottom: 62px; right: 16px }
  .main-content { padding: 0 14px }
}
@media (max-width: 520px) {
  .info-grid { grid-template-columns: 1fr }
  .score-grid .benchmark-panel { grid-column: 1/-1 }
}

/* ── INFO CARD COLLAPSED ── */
.info-card.collapsed .info-grid { display: none }
.info-card.collapsed { padding: 12px 22px }
.info-card.collapsed h3 { margin-bottom: 0 }
#btn-info-toggle svg { transition: transform .2s }
.info-card.collapsed #btn-info-toggle svg { transform: rotate(180deg) }
.info-card.collapsed #btn-info-toggle { }

/* ── SESSION PANEL ── */
.session-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow) }
.session-panel h3 { font-family: 'DM Serif Display', serif; font-size: 15px; margin-bottom: 14px }
.session-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap }
.session-field { display: flex; flex-direction: column; gap: 4px; min-width: 180px }
.session-field label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px }
.session-field input { border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 10px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text); background: var(--surface); transition: border-color .15s; width: 100% }
.session-field input:focus { outline: none; border-color: var(--accent) }
.session-field.uid-field { flex: 1; min-width: 220px }
.session-field.pw-field  { flex: 1; min-width: 200px }
/* On narrow screens: fields stack, buttons move to their own row */
@media (max-width: 560px) {
  .session-row { flex-direction: column; align-items: stretch }
  .session-row .btn { width: 100%; justify-content: center }
  .session-row > span { display: none }
}

/* Credential display box */
.cred-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px }
.cred-box h4 { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px }
.cred-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px }
.cred-row:last-child { margin-bottom: 0 }
.cred-label { font-size: 11px; color: var(--text-muted); width: 72px; flex-shrink: 0 }
.cred-value { font-family: 'DM Mono', 'Courier New', monospace; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .5px; flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 5px 10px }
.cred-copy { flex-shrink: 0 }
.cred-warning { font-size: 11.5px; color: var(--high); background: var(--high-bg); border: 1px solid #f0c89a; border-radius: 6px; padding: 8px 12px; margin-top: 10px }

/* Status badge */
.assessment-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase }
.assessment-status.open   { background: #eaf4fb; color: #1a6dad }
.assessment-status.closed { background: var(--low-bg); color: var(--low) }
.assessment-status.shared { background: var(--medium-bg); color: var(--medium) }

/* Lifecycle bar */
.lifecycle-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; font-size: 12px }
.lifecycle-bar .lc-status { font-weight: 600 }
.lifecycle-bar .lc-actions { margin-left: auto; display: flex; gap: 8px }

/* Closed overlay hint */
.closed-hint { text-align: center; padding: 10px; font-size: 12px; color: var(--text-muted); background: var(--surface-2); border-radius: 0 0 10px 10px; border: 1px solid var(--border); border-top: none; margin-bottom: 24px }
