:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #102b34;
  background: #eef4f5;
  font-synthesis: none;
  --ink: #102b34;
  --muted: #5f747b;
  --navy: #073f52;
  --navy-dark: #052d3b;
  --teal: #007f78;
  --teal-soft: #dff3f0;
  --blue: #1768ac;
  --blue-soft: #e8f1fb;
  --green: #227a52;
  --green-soft: #e6f4ec;
  --amber: #a7630a;
  --amber-soft: #fff4d9;
  --red: #a33131;
  --red-soft: #fdeaea;
  --line: #cedcdf;
  --surface: #ffffff;
  --surface-soft: #f6f9fa;
  --shadow: 0 1.25rem 3rem rgb(7 63 82 / 12%);
  --radius: 1.1rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgb(0 127 120 / 10%), transparent 28rem),
    linear-gradient(180deg, #f7fafb 0, #edf3f4 100%);
}

button, input, select, textarea { font: inherit; }
button, label, input[type="radio"] { -webkit-tap-highlight-color: transparent; }
button {
  touch-action: manipulation;
  transition: border-color 160ms ease, outline-color 160ms ease, filter 160ms ease;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: .18rem solid #38b9ad;
  outline-offset: .15rem;
}

a { color: var(--blue); }

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--ink); line-height: 1.12; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.35rem); letter-spacing: -.035em; }
h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -.02em; }
h3 { margin: 0; font-size: 1.12rem; }
p { line-height: 1.55; }

.startup-screen,
.login-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
}

.startup-screen p { color: var(--muted); }

.brand-mark {
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  border-radius: 1.45rem;
  color: #fff;
  background: linear-gradient(145deg, var(--navy), var(--teal));
  box-shadow: 0 1rem 2rem rgb(7 63 82 / 22%);
  font-size: 1.65rem;
  font-weight: 850;
  letter-spacing: -.04em;
}

.eyebrow {
  margin: 0 0 .55rem;
  color: var(--teal);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.login-layout {
  width: min(100%, 67rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, .95fr);
  overflow: hidden;
  border: 1px solid rgb(206 220 223 / 80%);
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}

.login-hero {
  min-height: 35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4rem);
  color: #fff;
  background:
    linear-gradient(145deg, rgb(5 45 59 / 97%), rgb(0 127 120 / 90%)),
    var(--navy);
}

.login-hero h1, .login-hero p { color: #fff; }
.login-hero .eyebrow { color: #91eee1; }
.login-hero .brand-mark { background: rgb(255 255 255 / 15%); box-shadow: none; }
.login-hero-copy { max-width: 34rem; font-size: 1.08rem; color: rgb(255 255 255 / 83%); }

.route-line {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 2rem;
  color: rgb(255 255 255 / 75%);
  font-size: .88rem;
  font-weight: 700;
}

.route-line span {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #8ef0df;
  box-shadow: 0 0 0 .35rem rgb(142 240 223 / 14%);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
}

.login-panel > p { margin: .75rem 0 1.75rem; color: var(--muted); }

.app-frame { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.75rem;
  padding: .75rem max(1rem, calc((100vw - 76rem) / 2));
  color: #fff;
  background: rgb(5 45 59 / 96%);
  backdrop-filter: blur(1rem);
  box-shadow: 0 .25rem 1.25rem rgb(7 63 82 / 14%);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.topbar-brand .brand-mark {
  width: 2.8rem;
  height: 2.8rem;
  margin: 0;
  border-radius: .8rem;
  font-size: 1rem;
  box-shadow: none;
}

.topbar-title { color: #fff; font-size: 1rem; font-weight: 800; }
.topbar-subtitle { color: rgb(255 255 255 / 66%); font-size: .75rem; }

.topbar-actions { display: flex; align-items: center; gap: .65rem; }

.connection-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}

.connection-badge::before {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #7ee6aa;
  content: "";
}

.connection-badge.offline::before { background: #ffbf66; }

.page {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.25rem);
}

.page.admin-page { width: min(100%, 90rem); }

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.page-heading p { margin: .5rem 0 0; color: var(--muted); }

.panel,
.metric-card,
.action-card,
.scenario-card,
.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 .6rem 1.6rem rgb(7 63 82 / 7%);
}

.panel { padding: clamp(1.1rem, 2.5vw, 1.75rem); }
.panel + .panel { margin-top: 1rem; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1.25rem;
}

.metric-card { padding: 1.15rem; box-shadow: none; }
.metric-label { color: var(--muted); font-size: .8rem; font-weight: 750; }
.metric-value { display: block; margin-top: .25rem; font-size: 1.8rem; font-weight: 850; }
.metric-card.attention { border-color: #efd098; background: var(--amber-soft); }
.metric-card.danger { border-color: #edc4c4; background: var(--red-soft); }
.metric-note { display: block; margin-top: .2rem; color: var(--muted); font-size: .72rem; }

.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.action-card {
  min-height: 12.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.35rem;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.action-card:hover { transform: translateY(-2px); border-color: #9bbfc3; box-shadow: 0 1rem 2rem rgb(7 63 82 / 11%); }
.action-card:disabled { cursor: not-allowed; opacity: .46; transform: none; box-shadow: none; }
.action-card.primary { color: #fff; border-color: var(--navy); background: linear-gradient(145deg, var(--navy), #0a6070); }
.action-card.primary h3, .action-card.primary p { color: #fff; }
.action-card.sync { background: linear-gradient(145deg, #edf8f4, #fff); }
.action-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  margin-bottom: auto;
  border-radius: .9rem;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 1.2rem;
  font-weight: 900;
}
.primary .action-icon { color: #fff; background: rgb(255 255 255 / 15%); }
.action-card h3 { margin-top: 1rem; }
.action-card p { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; }

.home-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px dashed #b9cccf;
  border-radius: .85rem;
  color: var(--muted);
  background: rgb(255 255 255 / 48%);
  font-size: .84rem;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid > .full { grid-column: 1 / -1; }
.form-field { display: grid; gap: .45rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field > label, .field-label { font-weight: 780; }
.field-help { margin: 0; color: var(--muted); font-size: .8rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 3.4rem;
  padding: .8rem .95rem;
  border: 1px solid #adc2c6;
  border-radius: .72rem;
  outline: none;
  color: var(--ink);
  background: #fff;
}

textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 .22rem rgb(0 127 120 / 13%); }
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--red);
  background: #fffafa;
  box-shadow: 0 0 0 .22rem rgb(179 55 55 / 12%);
}

.password-control { position: relative; min-width: 0; width: 100%; }
.password-control input { padding-right: 6.4rem; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: .45rem;
  min-height: 2.55rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .55rem;
  border: 0;
  border-radius: .55rem;
  color: var(--navy);
  background: #edf4f5;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
  transform: translateY(-50%);
}
.password-toggle:hover { background: var(--teal-soft); }
.password-toggle:focus-visible { outline: .18rem solid rgb(0 127 120 / 28%); outline-offset: .1rem; }
.password-toggle .ui-icon { width: 1.1rem; height: 1.1rem; }
.password-control.compact input { padding-right: 3.3rem; }
.password-control.compact .password-toggle { width: 2.55rem; justify-content: center; }
.password-requirements { margin: -.2rem 0 0; color: var(--muted); font-size: .78rem; }

.choice-grid,
.radio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.radio-option,
.likert-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 4.2rem;
  padding: .85rem 1rem;
  border: 1px solid #bacdd0;
  border-radius: .85rem;
  background: #fff;
  cursor: pointer;
}

.radio-option:has(input:checked),
.likert-option:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.radio-option input,
.likert-option input { width: 1.3rem; height: 1.3rem; accent-color: var(--teal); flex: 0 0 auto; }

.form-error {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border-radius: .7rem;
  color: var(--red);
  background: var(--red-soft);
  font-weight: 700;
}

.field-error {
  margin: .15rem 0 0;
  color: var(--red);
  font-size: .85rem;
  font-weight: 780;
}

.form-field.needs-attention,
.likert-question.needs-attention {
  border-color: var(--red);
  border-radius: .9rem;
  box-shadow: 0 0 0 .22rem rgb(163 49 49 / 13%);
}

.form-field.needs-attention { padding: .7rem; background: var(--red-soft); }
.likert-question.needs-attention { background: var(--red-soft); }

.form-guidance {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: 0 0 1.15rem;
  padding: .8rem .9rem;
  border-radius: .75rem;
  color: #27574f;
  background: var(--teal-soft);
}
.form-guidance .ui-icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; margin-top: .15rem; }
.form-guidance p { margin: 0; font-size: .86rem; }

.search-control { position: relative; }
.search-control .ui-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: .9rem;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}
.search-control input { padding-left: 2.75rem; }
.search-control + select { margin-top: .2rem; }

.survey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.survey-meta { color: var(--muted); font-size: .8rem; }
.survey-header-status { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.draft-save-indicator {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  color: #226247;
  background: var(--green-soft);
  font-size: .76rem;
  font-weight: 760;
}
.draft-save-indicator .ui-icon { width: 1rem; height: 1rem; }
.draft-save-indicator.saving { color: #275881; background: var(--blue-soft); }
.draft-save-indicator.saving .ui-icon { animation: spin 900ms linear infinite; }
.draft-save-indicator.error { color: var(--red); background: var(--red-soft); }
@keyframes spin { to { transform: rotate(360deg); } }

.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .35rem;
  margin-bottom: 1.2rem;
}

.step {
  min-width: 0;
  padding: .55rem .4rem;
  border-radius: .55rem;
  color: #71858b;
  background: #e7eef0;
  text-align: center;
  font-size: .72rem;
  font-weight: 780;
}

.step.current { color: #fff; background: var(--navy); }
.step.complete { color: #145b3b; background: var(--green-soft); }

.panel-heading { margin-bottom: 1.25rem; }
.panel-heading p { margin: .45rem 0 0; color: var(--muted); }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: 1.5rem;
}

.button {
  min-height: 3.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .75rem 1.1rem;
  border: 1px solid transparent;
  border-radius: .72rem;
  color: #fff;
  background: var(--navy);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { filter: brightness(1.06); }
.button:disabled { cursor: not-allowed; opacity: .48; filter: none; }
.button.secondary { color: var(--navy); border-color: #a9bec3; background: #fff; }
.button.ghost { color: inherit; border-color: transparent; background: transparent; }
.button.danger { color: var(--red); border-color: #e4b3b3; background: #fff; }
.button.success { background: var(--green); }
.button.small { min-height: 2.55rem; padding: .5rem .75rem; font-size: .82rem; }
.button.topbar-button { min-height: 2.5rem; color: #fff; border-color: rgb(255 255 255 / 22%); background: transparent; }

.scenario-progress {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.progress-track {
  height: .65rem;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9eb;
}

.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #3fae8b); transition: width 180ms ease; }

.section-progress {
  display: grid;
  gap: .65rem;
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface-soft);
}
.section-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-progress strong { color: var(--ink); }
.section-progress span { color: var(--muted); font-size: .78rem; }

.scenario-intro {
  margin-bottom: 1rem;
  padding: .9rem 1rem;
  border-left: .28rem solid var(--blue);
  border-radius: .45rem;
  color: #324a52;
  background: var(--blue-soft);
}

.scenario-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.scenario-card {
  padding: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 27rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: none;
}

.scenario-card.bus { border-color: #a8c5df; }
.scenario-card.metro { border-color: #9ecbb7; }
.scenario-card.selected { border-width: 3px; border-color: var(--teal); box-shadow: 0 0 0 .3rem rgb(0 127 120 / 10%); }

.scenario-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.1rem 1.2rem;
  background: var(--blue-soft);
}

.scenario-card.metro .scenario-title { background: var(--green-soft); }
.scenario-label { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.scenario-title h3 { margin-top: .2rem; font-size: 1.25rem; }

.scenario-radio {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #7c969d;
  border-radius: 50%;
  background: #fff;
}

.scenario-card.selected .scenario-radio { border-color: var(--teal); background: var(--teal); }
.scenario-card.selected .scenario-radio::after { color: #fff; content: "✓"; font-weight: 900; }

.attribute-list { display: grid; gap: .1rem; margin: 0; padding: .85rem 1.2rem 1.2rem; }
.attribute-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  min-height: 4.25rem;
  padding: .7rem 0;
  border-bottom: 1px solid #e5edef;
}
.attribute-row:last-child { border-bottom: 0; }
.attribute-row dt { color: #40575f; line-height: 1.35; }
.attribute-row dd { margin: 0; padding: .35rem .6rem; border-radius: .5rem; background: var(--surface-soft); font-size: 1.1rem; font-weight: 850; white-space: nowrap; }
.scenario-card.bus .attribute-row dd { color: #134f83; background: var(--blue-soft); }
.scenario-card.metro .attribute-row dd { color: #145b3b; background: var(--green-soft); }

.likert-list { display: grid; gap: 1rem; }
.likert-question {
  min-inline-size: 0;
  margin: 0;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface-soft);
}
.likert-question legend {
  float: left;
  display: block;
  width: 100%;
  margin: 0 0 .85rem;
  padding: 0;
  font-weight: 780;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.likert-question legend + .likert-scale { clear: both; }
.likert-question::after { display: block; clear: both; content: ""; }
.likert-question.answered { border-color: #a9d5c3; }
.likert-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .45rem; }
.likert-option { min-height: 5rem; flex-direction: column; justify-content: center; gap: .3rem; padding: .55rem .35rem; text-align: center; font-size: .72rem; line-height: 1.25; }
.likert-value { font-size: 1.05rem; font-weight: 900; }

.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.review-card { padding: 1.15rem; box-shadow: none; }
.review-card h3 { margin-bottom: .8rem; }
.review-list { margin: 0; padding-left: 1.1rem; color: #3f575e; }
.review-list li + li { margin-top: .4rem; }
.review-complete {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  margin-left: .35rem;
  padding: .2rem .45rem;
  border-radius: 999px;
  color: #216044;
  background: var(--green-soft);
  font-size: .66rem;
  font-weight: 800;
  vertical-align: middle;
}
.review-complete .ui-icon { width: .85rem; height: .85rem; }

.callout {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: .8rem;
  background: var(--blue-soft);
  color: #1b4f72;
}
.callout.warning { color: #734507; background: var(--amber-soft); }
.callout.error { color: var(--red); background: var(--red-soft); }
.callout.success { color: #145b3b; background: var(--green-soft); }
.callout p { margin: 0; }

.sync-panel { text-align: center; }
.sync-number { display: block; margin: 1rem 0 .15rem; font-size: clamp(3rem, 8vw, 5rem); line-height: 1; font-weight: 900; color: var(--navy); }
.sync-list { display: grid; gap: .55rem; margin: 1rem 0; text-align: left; }
.sync-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: .7rem; background: #fff; }
.sync-item code { color: #425960; }

.admin-grid { display: grid; grid-template-columns: minmax(20rem, .7fr) minmax(0, 1.3fr); gap: 1rem; align-items: start; }
.stack { display: grid; gap: 1rem; }

.cloud-dashboard { margin-bottom: 1.75rem; }
.compact-actions { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.inline-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.inline-heading > div > p:last-child { margin-bottom: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 1.5rem 0 1rem; }
.section-heading h2 { font-size: 1.45rem; }
.phase-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; }
.phase-tab {
  min-height: 2.65rem;
  padding: .55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: var(--surface-soft);
  font-weight: 800;
  cursor: pointer;
}
.phase-tab:hover { border-color: var(--teal); }
.phase-tab.active { border-color: var(--navy); color: #fff; background: var(--navy); }
.cloud-metrics { margin: 0 0 1rem; }
.dashboard-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-bottom: 1rem; color: var(--muted); font-size: .78rem; }
.quality-warning { color: var(--amber); font-weight: 800; }
.dashboard-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.dashboard-chart { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface-soft); }
.dashboard-chart h3 { margin-bottom: .9rem; }
.bar-list { display: grid; gap: .7rem; }
.bar-row { min-width: 0; }
.bar-label { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .25rem; font-size: .78rem; }
.bar-label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label strong { flex: none; color: var(--muted); font-size: .72rem; }
.bar-track { height: .42rem; overflow: hidden; border-radius: 999px; background: #dfeaec; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--blue)); }
.dashboard-empty, .dashboard-loading { padding: 2.25rem 1rem; color: var(--muted); text-align: center; }
.dashboard-loading { display: grid; justify-items: center; gap: .75rem; }
.spinner { width: 2rem; height: 2rem; border: .25rem solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .75s linear infinite; }
.empty-state.compact { padding: 1rem .25rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.researcher-management { margin-bottom: 1.75rem; }
.researcher-create-form { align-items: end; margin: 1rem 0 .35rem; }
.form-field-action { align-self: end; }
.form-field-action .button { width: 100%; }
.researcher-list { display: grid; gap: .7rem; margin-top: 1.25rem; }
.researcher-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; box-shadow: none; }
.researcher-identity { display: grid; gap: .15rem; min-width: 0; }
.researcher-identity span { color: var(--muted); overflow-wrap: anywhere; }
.researcher-identity small { color: var(--muted); }
.researcher-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; flex-wrap: wrap; }
.researcher-reset-form { display: flex; align-items: center; gap: .45rem; }
.researcher-reset-form input { min-width: 12rem; }
.researcher-card.editing { display: block; border-color: #9fc7bd; background: #f8fcfa; }
.managed-user-edit-form { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.managed-user-edit-form .compact-actions { justify-content: flex-end; grid-column: 1 / -1; }
.form-inline-error[hidden] { display: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .8rem; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: .75rem .7rem; border-bottom: 1px solid #e4ecee; text-align: left; white-space: nowrap; }
th { color: #4f666d; background: #f1f6f7; font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }

.status-badge { min-height: 1.65rem; color: #345159; background: #edf3f4; }
.status-badge.pending, .status-badge.error { color: #7b4d0e; background: var(--amber-soft); }
.status-badge.synced { color: #145b3b; background: var(--green-soft); }
.status-badge.deleted { color: var(--red); background: var(--red-soft); }

.definition-list { margin: 0; }
.definition-list div { display: grid; grid-template-columns: minmax(9rem, .45fr) minmax(0, 1fr); gap: 1rem; padding: .65rem 0; border-bottom: 1px solid #e5edef; }
.definition-list div:last-child { border-bottom: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: grid; gap: .5rem; width: min(26rem, calc(100vw - 2rem)); }
.toast { padding: .9rem 1rem; border-radius: .75rem; color: #fff; background: var(--navy); box-shadow: var(--shadow); animation: toast-in 180ms ease-out; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toast-in { from { transform: translateY(.75rem); opacity: 0; } }

.empty-state { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.noscript { margin: 2rem; padding: 1rem; color: var(--red); background: var(--red-soft); }

.ui-icon { width: 1.35rem; height: 1.35rem; flex: 0 0 auto; }

/* Acesso */
.login-screen {
  align-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 50% -15%, rgb(0 127 120 / 15%), transparent 35rem),
    linear-gradient(155deg, #f7fafb 0%, #eaf1f2 100%);
}

.login-card {
  width: min(100%, 30rem);
  overflow: hidden;
  border: 1px solid rgb(175 196 200 / 75%);
  border-radius: 1.4rem;
  background: var(--surface);
  box-shadow: 0 1.8rem 5rem rgb(5 45 59 / 16%);
  text-align: left;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.6rem 1.8rem;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-dark), #075f68);
}

.login-brand .brand-mark { width: 3.7rem; height: 3.7rem; margin: 0; border-radius: 1rem; background: rgb(255 255 255 / 13%); box-shadow: none; font-size: 1.15rem; }
.login-brand .eyebrow { margin-bottom: .25rem; color: #8ce6d9; }
.login-brand h1 { max-width: 20rem; color: #fff; font-size: 1.25rem; letter-spacing: -.015em; }
.login-card .login-panel { padding: 2rem 1.8rem 1.8rem; }
.login-card .login-panel h2 { font-size: 1.65rem; }
.login-card .login-panel > p { margin: .55rem 0 1.45rem; }
.login-submit, .install-button { width: 100%; }
.install-action { display: grid; gap: .65rem; margin-top: .8rem; }
.install-help { padding: .85rem 1rem; border: 1px solid #c7d9dc; border-radius: .75rem; color: #35525a; background: var(--surface-soft); }
.install-help p { margin: .25rem 0 0; font-size: .84rem; }
.login-footer { margin: 1.1rem 0 0; color: #73868b; font-size: .76rem; }
.login-theme { position: fixed; top: 1rem; right: 1rem; z-index: 2; }
.account-email { margin-bottom: .25rem !important; color: var(--teal) !important; font-weight: 750; }
.page-heading > .install-action { margin: 0; }

/* Cartões de escolha */
.mode-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: .85rem;
  color: #175b91;
  background: rgb(255 255 255 / 72%);
}
.scenario-card.metro .mode-icon { color: #1b6747; }
.mode-icon .ui-icon { width: 1.75rem; height: 1.75rem; }
.scenario-title > div { flex: 1; min-width: 0; }
.attribute-row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; }
.attribute-icon { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border-radius: .7rem; color: #47666e; background: #edf3f4; }
.attribute-icon .ui-icon { width: 1.25rem; height: 1.25rem; }
.attribute-row dt { display: grid; gap: .15rem; }
.attribute-row dt small { color: #789096; font-size: .68rem; font-weight: 650; }
.attribute-row.subattribute {
  min-height: 3.65rem;
  margin: 0 -.45rem;
  padding-inline: .45rem;
  border-bottom-color: transparent;
  border-radius: .65rem;
  background: #f5faf7;
}
.attribute-row.subattribute + .attribute-row:not(.subattribute) { margin-top: .15rem; }
.attribute-row.subattribute .attribute-icon { color: #226548; background: #e3f2e9; }

/* Painel administrativo */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); background: #f3f6f7; }
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1rem;
  color: #fff;
  background: linear-gradient(180deg, #062f3d 0%, #052732 100%);
  box-shadow: .4rem 0 1.8rem rgb(5 45 59 / 8%);
}
.admin-brand { display: flex; align-items: center; gap: .8rem; padding: .25rem .4rem 1.4rem; border-bottom: 1px solid rgb(255 255 255 / 10%); }
.admin-brand .brand-mark { width: 2.85rem; height: 2.85rem; margin: 0; border-radius: .8rem; background: linear-gradient(145deg, #0c8e84, #1680a0); box-shadow: none; font-size: .95rem; }
.admin-brand > div:last-child { display: grid; gap: .1rem; min-width: 0; }
.admin-brand strong { font-size: 1.05rem; }
.admin-brand span { color: rgb(255 255 255 / 58%); font-size: .72rem; }
.admin-nav { display: grid; gap: .35rem; margin-top: 1.25rem; }
.admin-nav-item { width: 100%; min-height: 3rem; display: flex; align-items: center; gap: .8rem; padding: .65rem .75rem; border: 0; border-radius: .7rem; color: rgb(255 255 255 / 68%); background: transparent; font-weight: 720; text-align: left; cursor: pointer; }
.admin-nav-item:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.admin-nav-item.active { color: #fff; background: linear-gradient(90deg, rgb(0 127 120 / 62%), rgb(0 127 120 / 22%)); box-shadow: inset 3px 0 #65d7c6; }
.admin-account { min-width: 0; display: grid; gap: .2rem; margin-top: auto; padding: 1rem .55rem 0; border-top: 1px solid rgb(255 255 255 / 10%); }
.admin-account span, .admin-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-account span { font-weight: 750; }
.admin-account small { color: rgb(255 255 255 / 53%); }
.admin-account button { justify-self: start; margin-top: .45rem; padding: 0; border: 0; color: #a9ded7; background: transparent; cursor: pointer; font-size: .8rem; font-weight: 750; }
.admin-main { min-width: 0; }
.admin-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; padding: 1.7rem clamp(1.25rem, 3vw, 2.6rem); border-bottom: 1px solid #dbe5e7; background: rgb(255 255 255 / 88%); backdrop-filter: blur(1rem); }
.admin-toolbar h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); }
.admin-toolbar p:not(.eyebrow) { margin: .4rem 0 0; color: var(--muted); }
.admin-toolbar-actions { display: flex; align-items: center; gap: .65rem; flex: 0 0 auto; }
.admin-toolbar .connection-badge { color: #28505a; background: #edf4f4; }
.admin-content { width: min(100%, 100rem); min-width: 0; padding: clamp(1.25rem, 3vw, 2.6rem); }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.central-status { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; padding: .8rem 1rem; border: 1px solid #cde1dc; border-radius: .8rem; color: #245746; background: #f1f9f5; }
.central-status > div { min-width: 0; display: grid; gap: .1rem; }
.central-status span:last-child { color: #5f7c74; font-size: .78rem; }
.live-dot { width: .65rem; height: .65rem; flex: 0 0 auto; border-radius: 50%; background: #29a36a; box-shadow: 0 0 0 .3rem rgb(41 163 106 / 13%); }
.admin-metrics { margin-bottom: 1rem; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(12rem, .7fr)); gap: 1rem; margin-bottom: 1rem; }
.overview-grid .daily-chart { grid-row: span 1; }
.insight-card { min-width: 0; display: flex; align-items: center; gap: 1rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.insight-card.warning { border-color: #e8cf9d; background: #fffaf0; }
.insight-icon { width: 2.8rem; height: 2.8rem; display: grid; place-items: center; flex: 0 0 auto; border-radius: .8rem; color: var(--teal); background: var(--teal-soft); font-weight: 900; }
.insight-card > div { min-width: 0; display: grid; }
.insight-card span:not(.insight-icon) { color: var(--muted); font-size: .75rem; font-weight: 750; }
.insight-card strong { font-size: 1.75rem; }
.insight-card small { color: var(--muted); overflow-wrap: anywhere; }
.admin-section { margin-top: 1rem; }
.analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.users-layout { display: grid; grid-template-columns: minmax(19rem, .65fr) minmax(0, 1.6fr); gap: 1rem; align-items: start; }
.users-layout.read-only { grid-template-columns: minmax(0, 1fr); }
.create-user-panel { position: sticky; top: 1rem; }
.researcher-create-form { grid-template-columns: 1fr; margin-top: 0; }
.team-panel { min-width: 0; }
.researcher-identity > div { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.account-status { padding: .2rem .5rem; border-radius: 999px; color: #7a4c10 !important; background: var(--amber-soft); font-size: .66rem; font-weight: 800; }
.account-status.active { color: #17603f !important; background: var(--green-soft); }
.role-badge { padding: .2rem .5rem; border-radius: 999px; color: #28505a !important; background: #e7eef0; font-size: .66rem; font-weight: 800; }
.role-badge.superuser { color: #68430d !important; background: #fff0cc; }
.role-badge.admin { color: #185380 !important; background: var(--blue-soft); }
.role-badge.researcher { color: #17603f !important; background: var(--green-soft); }
.callout.neutral { color: #405a61; background: var(--surface-soft); }
.export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.export-card { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 .6rem 1.6rem rgb(7 63 82 / 5%); }
.export-card > span { width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: .85rem; color: var(--teal); background: var(--teal-soft); }
.export-card h2 { font-size: 1.1rem; }
.export-card p { margin: .3rem 0 0; color: var(--muted); font-size: .8rem; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.settings-grid .panel + .panel { margin-top: 0; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0 0; }
.mini-metrics div { padding: .7rem; border-radius: .65rem; background: var(--surface-soft); }
.mini-metrics dt { color: var(--muted); font-size: .7rem; }
.mini-metrics dd { margin: .15rem 0 0; font-size: 1.25rem; font-weight: 850; }
.table-person { min-width: 10rem; display: grid; gap: .15rem; }
.table-person span { max-width: 18rem; overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; }
.admin-table td { height: 3.8rem; }
.danger-text { color: var(--red); font-weight: 850; }

.icon-button { width: 2.6rem; padding-inline: .55rem; }

/* Modal de criação de usuários */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(3 24 31 / 62%);
  backdrop-filter: blur(.35rem);
}
.modal-card {
  width: min(100%, 38rem);
  max-height: min(90vh, 52rem);
  overflow: auto;
  padding: clamp(1.15rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--surface);
  box-shadow: 0 2rem 5rem rgb(0 0 0 / 28%);
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.modal-description { margin: .45rem 0 1.2rem; color: var(--muted); }
.modal-close {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: .7rem;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

/* Análises de preferência declarada */
.analytics-section-heading { margin: 1.75rem 0 .9rem; }
.analytics-section-heading h2 { font-size: 1.45rem; }
.analytics-section-heading > p:last-child:not(.eyebrow) { margin: .4rem 0 0; color: var(--muted); }
.chart-description { margin: -.45rem 0 .9rem; color: var(--muted); font-size: .78rem; }
.analytics-filter {
  display: grid;
  gap: .8rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
}
.analytics-filter > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.analytics-filter > div:first-child span { color: var(--muted); font-size: .8rem; }
.filter-chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.filter-chip {
  min-height: 2.6rem;
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
}
.filter-chip.active { color: #fff; border-color: var(--teal); background: var(--teal); }
.choice-analytics-grid .psychometric-profile-list { min-height: 0; }
.choice-legend { display: flex; gap: 1rem; margin: -.2rem 0 .9rem; color: var(--muted); font-size: .72rem; }
.choice-legend span::before {
  width: .65rem;
  height: .65rem;
  display: inline-block;
  margin-right: .3rem;
  border-radius: .2rem;
  content: "";
}
.choice-legend .bus::before, .choice-stack .bus { background: #397fae; }
.choice-legend .metro::before, .choice-stack .metro { background: #2f9b73; }
.choice-stack-list { display: grid; gap: .9rem; }
.choice-stack-row { display: grid; gap: .35rem; }
.choice-stack {
  height: 1.7rem;
  display: flex;
  overflow: hidden;
  border-radius: .45rem;
  background: var(--surface);
}
.choice-stack span {
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: .68rem;
  font-weight: 850;
  white-space: nowrap;
}
.chart-title-with-score { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.chart-title-with-score > strong { color: var(--teal); font-size: 2rem; }
.score-list { display: grid; gap: .85rem; }
.score-row { display: grid; gap: .28rem; }
.score-label { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .55rem; }
.score-label span { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.score-label b { font-size: .8rem; }
.score-track { height: .48rem; overflow: hidden; border-radius: 999px; background: #dce8ea; }
.score-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #57b48d); }
.score-row small { color: var(--muted); font-size: .65rem; }
.psychometric-profile-list { display: grid; gap: .65rem; }
.psychometric-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface);
}
.psychometric-profile-row > div { display: grid; gap: .15rem; }
.psychometric-profile-row > div span { color: var(--muted); font-size: .7rem; }
.psychometric-profile-row dl { display: flex; gap: .45rem; margin: 0; }
.psychometric-profile-row dl div { min-width: 4.5rem; padding: .45rem; border-radius: .55rem; background: var(--surface-soft); text-align: center; }
.psychometric-profile-row dt { color: var(--muted); font-size: .62rem; }
.psychometric-profile-row dd { margin: .1rem 0 0; font-weight: 850; }
.attribute-analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.attribute-analysis-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--surface-soft);
}
.attribute-analysis-card > div:first-child { min-height: 3.5rem; }
.attribute-analysis-card > div:first-child span { color: var(--muted); font-size: .7rem; }
.attribute-level-list { display: grid; gap: .8rem; margin-top: .8rem; }
.attribute-level { display: grid; gap: .28rem; }
.attribute-level small { color: var(--muted); font-size: .65rem; }

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover:not(:focus-visible) {
    border-color: var(--teal);
    outline: .12rem solid rgb(56 185 173 / 38%);
    outline-offset: .08rem;
  }
  :is(
    .metric-card,
    .action-card,
    .scenario-card,
    .review-card,
    .dashboard-chart,
    .insight-card,
    .researcher-card,
    .export-card,
    .attribute-analysis-card,
    .settings-grid > .panel
  ) {
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    transform-origin: center;
  }
  :is(
    .metric-card,
    .action-card,
    .scenario-card,
    .review-card,
    .dashboard-chart,
    .insight-card,
    .researcher-card,
    .export-card,
    .attribute-analysis-card,
    .settings-grid > .panel
  ):hover {
    z-index: 2;
    border-color: var(--teal);
    box-shadow: 0 .9rem 2rem rgb(7 63 82 / 12%);
    transform: translateY(-.16rem) scale(1.004);
  }
  .action-card:disabled:hover { box-shadow: none; transform: none; }
}

html[data-theme="dark"] {
  --ink: #e7f3f4;
  --muted: #9fb5ba;
  --navy: #0e697c;
  --navy-dark: #071d26;
  --teal: #49c7ba;
  --teal-soft: #123b3b;
  --blue: #65aee8;
  --blue-soft: #132f47;
  --green: #4eae7a;
  --green-soft: #153929;
  --amber: #e0a94d;
  --amber-soft: #3b2d12;
  --red: #ff9898;
  --red-soft: #432323;
  --line: #31505a;
  --surface: #102a33;
  --surface-soft: #0c222b;
  --shadow: 0 1.25rem 3rem rgb(0 0 0 / 25%);
  color: var(--ink);
  background: #071b22;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 0%, rgb(73 199 186 / 9%), transparent 28rem),
    linear-gradient(180deg, #0a242d 0, #071a21 100%);
}
html[data-theme="dark"] .login-screen {
  background:
    radial-gradient(circle at 50% -15%, rgb(73 199 186 / 12%), transparent 35rem),
    linear-gradient(155deg, #0b252e 0%, #071920 100%);
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .radio-option,
html[data-theme="dark"] .likert-option,
html[data-theme="dark"] .sync-item {
  color: var(--ink);
  border-color: #41616a;
  background: #0a2028;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #789197; }
html[data-theme="dark"] input[aria-invalid="true"],
html[data-theme="dark"] select[aria-invalid="true"],
html[data-theme="dark"] textarea[aria-invalid="true"] { background: #351f23; }
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .button.danger { color: var(--ink); border-color: #4e6b73; background: #102a33; }
html[data-theme="dark"] .password-toggle,
html[data-theme="dark"] .attribute-icon { color: var(--ink); background: #18343d; }
html[data-theme="dark"] .home-footer { border-color: #46626a; background: rgb(16 42 51 / 65%); }
html[data-theme="dark"] .step { color: #9bb0b5; background: #18343d; }
html[data-theme="dark"] .step.current { color: #fff; }
html[data-theme="dark"] .progress-track { background: #29444d; }
html[data-theme="dark"] .scenario-intro { color: #c3deef; }
html[data-theme="dark"] .scenario-card.bus { border-color: #315b7b; }
html[data-theme="dark"] .scenario-card.metro { border-color: #366c54; }
html[data-theme="dark"] .scenario-radio { background: #0b2028; }
html[data-theme="dark"] .attribute-row { border-color: #29444d; }
html[data-theme="dark"] .attribute-row dt,
html[data-theme="dark"] .review-list { color: #c1d1d5; }
html[data-theme="dark"] .attribute-row.subattribute { background: #102d24; }
html[data-theme="dark"] .attribute-row.subattribute .attribute-icon { color: #83d3a6; background: #173d2c; }
html[data-theme="dark"] .mode-icon { background: rgb(8 30 38 / 70%); }
html[data-theme="dark"] .install-help { color: #bed0d4; border-color: var(--line); }
html[data-theme="dark"] .admin-shell { background: #071b22; }
html[data-theme="dark"] .admin-toolbar { border-color: var(--line); background: rgb(12 34 43 / 91%); }
html[data-theme="dark"] .admin-toolbar .connection-badge { color: #c4d8dc; background: #17343d; }
html[data-theme="dark"] .central-status { color: #a8dbc5; border-color: #285b48; background: #102d24; }
html[data-theme="dark"] .central-status span:last-child { color: #96b4aa; }
html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .export-card { background: var(--surface); }
html[data-theme="dark"] .insight-card.warning { border-color: #65522b; background: #302713; }
html[data-theme="dark"] .role-badge { color: #d2e0e3 !important; background: #29424a; }
html[data-theme="dark"] .callout.neutral { color: #c2d3d6; }
html[data-theme="dark"] .callout.warning { color: #f3cd86; }
html[data-theme="dark"] .callout.error { color: #ffb2b2; }
html[data-theme="dark"] .callout.success { color: #a8dfbf; }
html[data-theme="dark"] .scenario-card.bus .attribute-row dd { color: #9dcaf0; }
html[data-theme="dark"] .scenario-card.metro .attribute-row dd { color: #a8dfbf; }
html[data-theme="dark"] .draft-save-indicator { color: #a8dfbf; }
html[data-theme="dark"] .draft-save-indicator.saving { color: #a9d2f1; }
html[data-theme="dark"] .draft-save-indicator.error { color: #ffb2b2; }
html[data-theme="dark"] .score-track { background: #29444d; }
html[data-theme="dark"] .filter-chip.active { color: #06242c; }

@media (max-width: 1180px) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid .daily-chart { grid-column: 1 / -1; }
  .users-layout { grid-template-columns: 1fr; }
  .create-user-panel { position: static; }
  .export-card { grid-template-columns: auto minmax(0, 1fr); }
  .export-card .button { grid-column: 1 / -1; }
  .attribute-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-hero { min-height: auto; padding: 2rem; }
  .login-hero-copy { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
  .managed-user-edit-form { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 5rem minmax(0, 1fr); }
  .admin-sidebar { padding-inline: .65rem; }
  .admin-brand { justify-content: center; padding-inline: 0; }
  .admin-brand > div:last-child, .admin-nav-item span, .admin-account span, .admin-account small { display: none; }
  .admin-nav-item { justify-content: center; padding-inline: .5rem; }
  .admin-account { justify-items: center; padding-inline: 0; }
  .admin-account button { justify-self: center; font-size: 0; }
  .admin-account button::after { content: "Sair"; font-size: .72rem; }
  .admin-toolbar { gap: 1rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .attribute-analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { min-height: 4.15rem; }
  .topbar-subtitle, .connection-badge span { display: none; }
  .page-heading { display: block; }
  .form-grid, .choice-grid, .radio-grid, .scenario-options, .review-grid { grid-template-columns: 1fr; }
  .actions-grid { grid-template-columns: 1fr; }
  .action-card { min-height: 9.5rem; }
  .scenario-card { min-height: auto; }
  .step { font-size: 0; min-height: .65rem; padding: 0; border-radius: 999px; }
  .likert-scale { grid-template-columns: 1fr; }
  .likert-option { min-height: 3.4rem; flex-direction: row; justify-content: flex-start; text-align: left; }
  .home-footer, .survey-header, .form-actions { align-items: stretch; flex-direction: column; }
  .survey-header-status { justify-content: space-between; }
  .section-progress > div:first-child { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .inline-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { justify-content: stretch; }
  .heading-actions .button { flex: 1; }
  .researcher-card, .researcher-actions, .researcher-reset-form { align-items: stretch; flex-direction: column; }
  .researcher-reset-form input { min-width: 0; width: 100%; }
  .form-actions .button { width: 100%; }
  .login-card .login-panel, .login-brand { padding-inline: 1.25rem; }
  .login-brand h1 { font-size: 1.08rem; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar-actions { justify-content: space-between; }
  .admin-content { padding: 1rem; }
  .admin-metrics, .overview-grid, .export-grid { grid-template-columns: 1fr; }
  .overview-grid .daily-chart { grid-column: auto; }
  .export-card { grid-template-columns: auto minmax(0, 1fr); }
  .researcher-card, .researcher-actions, .researcher-reset-form { align-items: stretch; flex-direction: column; }
  .attribute-row { grid-template-columns: 2.25rem minmax(0, 1fr) auto; }
  .login-theme { top: .65rem; right: .65rem; }
  .analytics-filter > div:first-child { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .filter-chips { display: grid; grid-template-columns: 1fr; }
  .psychometric-profile-row { grid-template-columns: 1fr; }
  .psychometric-profile-row dl { width: 100%; }
  .psychometric-profile-row dl div { flex: 1; }
  .modal-backdrop { padding: .5rem; }
  .modal-card { max-height: 96vh; padding: 1rem; border-radius: .9rem; }
}

@media (orientation: landscape) and (min-width: 700px) and (max-height: 850px) {
  .page { padding-top: 1rem; }
  .scenario-card { min-height: 23rem; }
  .attribute-row { min-height: 3.5rem; }
  .login-hero { min-height: 29rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
