:root {
  color-scheme: light;
  --ink: #192d43;
  --muted: #526a80;
  --nav: #101f33;
  --accent: #08796b;
  --mint: #7ce2c7;
  --paper: #fff;
  --canvas: #f1f5f9;
  --line: #d9e3ed;
  font: 15px/1.5 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; background: var(--accent); color: white; font-weight: 650; }
button:hover { background: #075f56; }
button:disabled { opacity: .54; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #56b9a7; outline-offset: 2px; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 42px; border: 1px solid #c4d2df;
  border-radius: 8px; background: white; color: var(--ink); padding: 9px 11px;
}
textarea { resize: vertical; min-height: 82px; }
label { display: block; font-size: 13px; font-weight: 650; }
label + input, label + select, label + textarea, label select, label input { margin-top: 5px; }
body:not(.active) { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 75% 10%, #1b4f55, var(--nav) 65%); color: #d4e3ef; }
body:not(.active) main { width: min(100%, 460px); }
body:not(.active) main > h1 { color: var(--mint); font-size: clamp(27px, 6vw, 36px); margin-bottom: 4px; }
body:not(.active) main > section { background: white; color: var(--ink); padding: 28px; border-radius: 18px; margin: 20px 0 12px; box-shadow: 0 12px 50px #08121e66; }
body:not(.active) main > p:last-child { color: #b8cbd8; font-size: 13px; }
#login h2 { margin-bottom: 18px; font-size: 23px; }
#login input { display: block; margin-bottom: 15px; }
#enter { width: 100%; margin-top: 4px; }
#msg:not(:empty) { margin: 12px 0 0; }
body.active main > h1, body.active main > p, body.active #msg { display: none; }
#shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
#sidebar { height: 100dvh; position: sticky; top: 0; overflow: auto; padding: 24px 16px; color: #d6e3ee; background: linear-gradient(160deg,#111f33,#132c40); scrollbar-width: thin; scrollbar-color: #405369 transparent; }
.brand { color: var(--mint); font-size: 28px; font-weight: 800; letter-spacing: .03em; padding: 0 10px 17px; }
.brand span { font-size: 21px; }
.brand small { display: block; color: #b3c6d8; font-size: 10px; font-weight: 650; letter-spacing: .11em; }
#navToggle { display: none; }
nav section { margin: 4px 0 12px; }
nav h3 { color: #aabed0; text-transform: uppercase; font-size: 10px; letter-spacing: .115em; padding: 7px 10px 4px; }
nav button { display: block; width: 100%; text-align: left; color: #deebf5; background: transparent; padding: 7px 11px; margin: 2px 0; font-size: 14px; font-weight: 500; }
nav button:hover { background: #294157; }
nav button.selected { background: #205347; color: #d3fff1; font-weight: 700; box-shadow: inset 3px 0 var(--mint); }
#workspace { padding: clamp(15px, 3vw, 38px); min-width: 0; width: 100%; max-width: 1580px; margin: 0 auto; }
.workspace-header { display: grid; grid-template-columns: minmax(0,1fr) minmax(160px,300px) auto; align-items: center; gap: 18px; padding: 19px 23px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 4px 18px #172b4307; }
.workspace-header h2 { font-size: clamp(23px, 3vw, 32px); line-height: 1.2; }
.eyebrow { margin-bottom: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 750; }
#exit, .directory-actions button[type=button], .directory-pages button, #records td button { background: #e9f0f5; color: #234158; }
#exit:hover, .directory-actions button[type=button]:hover, .directory-pages button:hover, #records td button:hover { background: #dbe9ee; }
#companies:empty, #viewStatus:empty, #records:empty, .directory-note:empty, #cards:empty { display: none; }
#companies, #viewStatus { margin: 14px 0; color: var(--muted); }
#cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
#cards article { min-width: 0; padding: 17px; background: white; border-radius: 13px; border: 1px solid var(--line); border-top: 3px solid #1b9d87; box-shadow: 0 4px 16px #172b4307; }
#cards article button { border: 0; display: block; text-align: left; color: var(--ink); padding: 0; background: none; font-weight: 700; }
#cards article button:hover { color: var(--accent); text-decoration: underline; }
#cards article strong { display: block; margin-top: 6px; font-size: clamp(17px, 2.5vw, 29px); color: var(--accent); overflow-wrap: anywhere; }
#records { margin-top: 19px; }
.directory-form, .directory-filters, .directory-table, .directory-pages { background: white; border: 1px solid var(--line); }
.directory-form, .directory-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); gap: 15px; padding: 19px; }
.directory-form { border-radius: 14px; box-shadow: 0 4px 18px #172b4308; margin-bottom: 15px; }
.directory-form h3, .directory-actions, .question-editor { grid-column: 1/-1; }
.directory-actions, .directory-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.directory-actions { margin-top: 2px; }
.directory-filters { border-radius: 13px 13px 0 0; align-items: end; }
.directory-table { overflow: auto; border-top: 0; }
.directory-pages { padding: 10px 16px; border-top: 0; border-radius: 0 0 13px 13px; font-size: 13px; color: var(--muted); }
.directory-note { color: var(--muted); padding: 10px 16px; margin: 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-transform: uppercase; font-size: 11px; letter-spacing: .045em; background: #eaf1f6; color: #3d5870; }
td, th { padding: 12px 14px; border-bottom: 1px solid #e3ebf1; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
td { min-width: 84px; white-space: pre-wrap; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #eef8f6; }
#records td button { white-space: nowrap; margin: 0 3px 4px 0; padding: 6px 10px; }
.question-editor { min-width: 0; border: 1px solid #c4d2df; border-radius: 9px; padding: 10px 12px; }
.question-line { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); align-items: center; gap: 8px; margin-bottom: 8px; }
@media(max-width:1050px) { #cards { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) {
  #shell { display: block; }
  #sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px 14px; }
  .brand { padding: 0; font-size: 23px; }
  #navToggle { display: block; background: #244257; color: white; }
  nav { display: none; grid-column: 1/-1; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; padding-top: 10px; }
  #navToggle[aria-expanded=true] + nav { display: grid; }
  .workspace-header { grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 15px; }
  .company-picker { grid-row: 2; grid-column: 1/-1; }
}
@media print {
  #sidebar, #exit, .company-picker, .directory-filters, #msg { display: none !important; }
  #shell { display: block; }
  #workspace { padding: 0; }
  .workspace-header { border: 0; box-shadow: none; display: block; padding: 0; }
  .directory-table { overflow: visible; }
  td, th { padding: 5px; }
}
nav details { margin: 4px 0 10px; }
nav summary { cursor: pointer; border-radius: 8px; color: #d9eaf5; padding: 9px 10px; font-weight: 700; font-size: 13px; }
nav summary:hover, nav summary:focus-visible { background: #294157; }
nav details[open] summary { color: #a5edda; }
nav details button { padding-left: 20px; }
#accessProfile { display:block; color:var(--muted); margin-top:4px; }
.help-steps { margin: 0; padding: 20px 28px 20px 44px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.help-steps li + li { margin-top: 10px; }
.help-steps p { color: var(--muted); }
.checklist-editor p { color: var(--accent); font-weight: 700; }
.checklist-item { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.checklist-dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: min(90vw,650px); max-height: 80vh; }
.checklist-dialog::backdrop { background: #10233888; }
.checklist-dialog h3 { margin-bottom: 12px; }
.checklist-dialog > div { margin-bottom: 12px; }

.report-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; }
.report-tabs button { background: #e4edf4; color: #29485f; }
.report-tabs button[aria-pressed=true] { color: white; background: var(--accent); }
.competency-filters { border-radius: 13px; }
.report-status { color: var(--muted); padding: 12px 3px; margin: 0; }
.report-results { display: grid; gap: 15px; }
.report-panel { border: 1px solid var(--line); border-radius: 14px; background: white; min-width: 0; padding: 18px; }
.report-panel h3 { margin: 0 0 12px; font-size: 17px; }
.report-rankings { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,295px),1fr)); gap: 14px; }
.index-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.index-bars { margin: 0; padding: 0; list-style: none; }
.index-bars li { margin: 10px 0; }
.index-bars li > div:first-child { display: flex; justify-content: space-between; gap: 10px; overflow-wrap: anywhere; }
.index-track { height: 10px; border-radius: 6px; background: #eaf0f6; margin-top: 4px; overflow: hidden; }
.index-track span { display: block; height: 100%; background: #168978; }
.ranking-low .index-track span { background: #b26a26; }
.competency-chart-layout { display: grid; grid-template-columns: minmax(180px,380px) minmax(180px,1fr); gap: 16px; align-items: center; }
.competency-chart canvas { display: block; width: 100%; max-width: 380px; height: auto; }
.competency-chart ol { margin: 0; padding-left: 28px; }
.competency-chart li { padding: 3px 0; }
.competency-chart li i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.competency-chart li strong { margin-left: 8px; }
@media(max-width:570px) { .competency-chart-layout { grid-template-columns: 1fr; } }
@media print { .report-tabs { display: none; } .report-panel { break-inside: avoid; } }
.report-print-scope { display: none; }
@media print { .report-print-scope { display: block; } }

.swot-score-preview { grid-column:1/-1; color:var(--accent); padding:0; }
.swot-shortcut { margin-bottom:12px; }
.swot-results { margin-top:14px; }
.swot-kpis strong { font-size:clamp(18px,3vw,28px); color:var(--accent); }
.swot-kpis p, .swot-matrix p { color:var(--muted); margin:5px 0 0; }
.swot-matrix { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:14px; }
.swot-matrix .report-panel { border-inline-start:4px solid #188577; }
.swot-matrix [data-quadrant=W] { border-inline-start-color:#a85f20; }
.swot-matrix [data-quadrant=O] { border-inline-start-color:#4372a6; }
.swot-matrix [data-quadrant=T] { border-inline-start-color:#ab5558; }
.swot-matrix ol { padding-inline-start:19px; }
.swot-matrix li { margin:6px 0; }
.swot-matrix li strong { margin-inline-start:8px; }
.swot-matrix li button, .swot-table td button { padding:4px 7px; text-align:left; white-space:normal !important; color:var(--ink); background:#eef4f8; }
.swot-table { margin-top:12px; overflow:auto; }
.swot-results .report-panel > button + p { margin-top:12px; }
@media print { .swot-results button { color:var(--ink); background:white; } }

.survey-dialog { border:1px solid var(--line); border-radius:14px; width:min(94vw,760px); max-height:90vh; color:var(--ink); }
.survey-dialog::backdrop { background:#10233888; }
.survey-dialog header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.survey-dialog select { margin-bottom:10px; }
.survey-dialog iframe { width:100%; height:70vh; border:1px solid var(--line); border-radius:8px; }
.survey-activation button { margin-top:10px; }
