:root {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  color-scheme: light;
  --bg: #f4f7f7;
  --text: #203944;
  --navy: #183e50;
  --muted: #596d76;
  --line: #dae4e4;
  --line-soft: #e8efec;
  --surface: #fff;
  --surface-hover: #eaf4f1;
  --surface-soft: #f4f7f6;
  --field-muted-bg: #f6f8f8;
  --field-line: #b8c9ce;
  --teal: #087765;
  --accent-bg: #087765;
  --accent-bg-hover: #075f51;
  --accent-strong: #075f51;
  --on-accent: #fff;
  --tab-active-bg: #183e50;
  --focus: #c47917;
  --eyebrow: #537268;
  --nav-text: #566b74;
  --nav-hover: #f1f7f5;
  --nav-current-bg: #e5f2ed;
  --avatar-bg: #e6f1eb;
  --soft-green-bg: #edf5ef;
  --danger: #a92b35;
  --danger-line: #e7b7bc;
  --tone-blue-bg: #e6f1f4;
  --tone-blue: #2d6585;
  --tone-amber-bg: #fff3dd;
  --tone-amber: #936021;
  --tone-green-bg: #e7f5ec;
  --tone-green: #147352;
  --tone-purple-bg: #f0eafb;
  --tone-purple: #775b9a;
  --pill-bg: #edf1f4;
  --pill-text: #395c74;
  --pill-green-bg: #e4f3e9;
  --pill-green: #236941;
  --pill-amber-bg: #fff0d8;
  --pill-amber: #875b19;
  --pill-red-bg: #fce8e7;
  --pill-red: #9f3637;
  --pill-purple-bg: #eeebf8;
  --pill-purple: #694a94;
  --notice-bg: #edf5f2;
  --notice-line: #cde0d7;
  --notice-text: #325e50;
  --warning-bg: #fff7e6;
  --warning-line: #ead6ac;
  --warning-text: #785321;
  --column-bg: #eaf0ef;
  --column-line: #dde6e2;
  --step-line: #d4dfdc;
  --step-text: #61746d;
  --step-bg: #e6eeea;
  --upload-line: #9bbfb2;
  --upload-bg: #f5faf7;
  --placeholder-bg: #eef3f1;
  --badge-bg: #f5f0df;
  --badge-line: #e8dcb6;
  --badge-text: #75591c;
  --shadow: 0 4px 20px #1a453a06;
}
/* Dark palette: follows the system unless the viewer picked a theme in
   Ajustes (html[data-theme]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1a1e;
    --text: #d7e4e7;
    --navy: #e6f0f2;
    --muted: #9fb3ba;
    --line: #2a3b41;
    --line-soft: #223238;
    --surface: #152328;
    --surface-hover: #1e3238;
    --surface-soft: #1a2b31;
    --field-muted-bg: #1a2a30;
    --field-line: #3f555c;
    --teal: #5fd0b3;
    --accent-bg: #0b7a66;
    --accent-bg-hover: #0e8f78;
    --accent-strong: #8ee3cb;
    --on-accent: #fff;
    --tab-active-bg: #0b7a66;
    --focus: #f2ad45;
    --eyebrow: #93b8ab;
    --nav-text: #a9bdc3;
    --nav-hover: #1b2d33;
    --nav-current-bg: #173c35;
    --avatar-bg: #1c3a33;
    --soft-green-bg: #17302a;
    --danger: #ff9aa2;
    --danger-line: #6d3036;
    --tone-blue-bg: #1b3140;
    --tone-blue: #93c8ea;
    --tone-amber-bg: #3a2e17;
    --tone-amber: #f1c579;
    --tone-green-bg: #173a2a;
    --tone-green: #85d9a7;
    --tone-purple-bg: #2e2542;
    --tone-purple: #c9b1f0;
    --pill-bg: #22343c;
    --pill-text: #bcd1dc;
    --pill-green-bg: #173a2a;
    --pill-green: #8fe0b0;
    --pill-amber-bg: #3a2e17;
    --pill-amber: #f1c579;
    --pill-red-bg: #401f23;
    --pill-red: #ffa4aa;
    --pill-purple-bg: #2e2542;
    --pill-purple: #cdb6f3;
    --notice-bg: #132e28;
    --notice-line: #285045;
    --notice-text: #addfcb;
    --warning-bg: #33291a;
    --warning-line: #5e4b27;
    --warning-text: #f2d292;
    --column-bg: #121f24;
    --column-line: #26383e;
    --step-line: #2f4248;
    --step-text: #9fb3ba;
    --step-bg: #22343a;
    --upload-line: #3f6d5f;
    --upload-bg: #142824;
    --placeholder-bg: #1c2d33;
    --badge-bg: #332c18;
    --badge-line: #5d502b;
    --badge-text: #ead38c;
    --shadow: 0 4px 20px #0006;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1a1e;
  --text: #d7e4e7;
  --navy: #e6f0f2;
  --muted: #9fb3ba;
  --line: #2a3b41;
  --line-soft: #223238;
  --surface: #152328;
  --surface-hover: #1e3238;
  --surface-soft: #1a2b31;
  --field-muted-bg: #1a2a30;
  --field-line: #3f555c;
  --teal: #5fd0b3;
  --accent-bg: #0b7a66;
  --accent-bg-hover: #0e8f78;
  --accent-strong: #8ee3cb;
  --on-accent: #fff;
  --tab-active-bg: #0b7a66;
  --focus: #f2ad45;
  --eyebrow: #93b8ab;
  --nav-text: #a9bdc3;
  --nav-hover: #1b2d33;
  --nav-current-bg: #173c35;
  --avatar-bg: #1c3a33;
  --soft-green-bg: #17302a;
  --danger: #ff9aa2;
  --danger-line: #6d3036;
  --tone-blue-bg: #1b3140;
  --tone-blue: #93c8ea;
  --tone-amber-bg: #3a2e17;
  --tone-amber: #f1c579;
  --tone-green-bg: #173a2a;
  --tone-green: #85d9a7;
  --tone-purple-bg: #2e2542;
  --tone-purple: #c9b1f0;
  --pill-bg: #22343c;
  --pill-text: #bcd1dc;
  --pill-green-bg: #173a2a;
  --pill-green: #8fe0b0;
  --pill-amber-bg: #3a2e17;
  --pill-amber: #f1c579;
  --pill-red-bg: #401f23;
  --pill-red: #ffa4aa;
  --pill-purple-bg: #2e2542;
  --pill-purple: #cdb6f3;
  --notice-bg: #132e28;
  --notice-line: #285045;
  --notice-text: #addfcb;
  --warning-bg: #33291a;
  --warning-line: #5e4b27;
  --warning-text: #f2d292;
  --column-bg: #121f24;
  --column-line: #26383e;
  --step-line: #2f4248;
  --step-text: #9fb3ba;
  --step-bg: #22343a;
  --upload-line: #3f6d5f;
  --upload-bg: #142824;
  --placeholder-bg: #1c2d33;
  --badge-bg: #332c18;
  --badge-line: #5d502b;
  --badge-text: #ead38c;
  --shadow: 0 4px 20px #0006;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
a {
  color: var(--teal);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 15px;
  background: var(--surface);
  color: var(--navy);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: var(--surface-hover);
  text-decoration: none;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.primary {
  background: var(--accent-bg);
  border-color: var(--accent-bg);
  color: var(--on-accent);
}
.primary:hover {
  background: var(--accent-bg-hover);
}
.danger {
  color: var(--danger);
  border-color: var(--danger-line);
}
.quiet {
  background: transparent;
  border-color: transparent;
}
input,
textarea,
select {
  display: block;
  border: 1px solid var(--field-line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--navy);
  background: var(--surface);
  width: 100%;
  min-height: 44px;
}
textarea {
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  width: 19px;
  min-height: 19px;
  accent-color: var(--teal);
  flex-shrink: 0;
}
input[type="file"] {
  padding: 12px;
  max-width: 100%;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
label.check {
  flex-direction: row;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
}
h2 {
  font-size: 19px;
  line-height: 1.4;
}
h3 {
  font-size: 16px;
  line-height: 1.45;
}
p {
  margin-bottom: 14px;
}
small,
.small {
  font-size: 12px;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 12px;
  font-weight: 750;
  color: var(--eyebrow);
  margin-bottom: 10px;
}
.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}
.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  background: var(--surface);
  padding: 15px;
  z-index: 100;
}
.skip:focus {
  top: 10px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.sidebar {
  width: 250px;
  background: var(--surface);
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 30px 18px;
  z-index: 30;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--navy);
  margin: 0 5px 38px;
}
.brand strong {
  font-size: 23px;
  letter-spacing: -1px;
}
.brand small {
  font-size: 12px;
  display: block;
  letter-spacing: -0.2px;
}
.brand-mark {
  width: 41px;
  height: 44px;
  background: var(--accent-bg);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  font-size: 25px;
  font-weight: 800;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.sidebar nav a {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--nav-text);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
}
.sidebar nav a:hover {
  background: var(--nav-hover);
  text-decoration: none;
}
.sidebar nav a[aria-current="page"] {
  background: var(--nav-current-bg);
  color: var(--accent-strong);
  font-weight: 750;
}
.sidebar nav a.report-link {
  margin: 7px 0 14px;
  background: var(--accent-bg);
  color: var(--on-accent);
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 25px;
}
.user-card {
  border-top: 1px solid var(--line);
  padding: 18px 5px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.user-card strong {
  display: block;
  font-size: 13px;
}
.user-card small {
  font-size: 12px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--avatar-bg);
  border-radius: 50%;
  font-weight: 750;
  color: var(--teal);
  object-fit: cover;
}
.workspace {
  margin-left: 250px;
}
.topbar {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 34px;
  gap: 18px;
}
.topbar p {
  margin: 0;
}
.topbar .top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mode-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.topbar .search {
  max-width: 390px;
  flex: 1;
}
.topbar input {
  background: var(--field-muted-bg);
  font-size: 12px;
}
.mobile-menu,
.mobile-nav {
  display: none;
}
.content {
  max-width: 1450px;
  margin: auto;
  padding: 35px 36px 55px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.heading p:last-child {
  margin-bottom: 0;
}
.level-card {
  background: linear-gradient(110deg, #143c50, #126954);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  gap: 22px;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 26px;
}
.level-card .icon {
  width: 42px;
  height: 42px;
  color: #d8b46d;
}
.level-card p,
.level-card small {
  color: #d8e7e4;
  margin: 0;
}
.level-card h2 {
  margin: 2px 0 10px;
}
.level-card .level-body {
  flex: 1;
}
.level-card a {
  color: var(--on-accent);
  font-size: 13px;
}
.level-card .points {
  font-size: 27px;
  font-weight: 750;
  white-space: nowrap;
}
.level-card progress {
  accent-color: #90d7b1;
  height: 9px;
  width: 100%;
  display: block;
  margin: 10px 0 8px;
}
progress {
  width: 100%;
  height: 10px;
  accent-color: var(--teal);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 26px;
}
.stat {
  background: var(--surface);
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 3px 12px;
}
.stat-icon {
  grid-row: 1/4;
  background: var(--tone-blue-bg);
  color: var(--tone-blue);
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.stat:nth-child(2) .stat-icon {
  color: var(--tone-amber);
  background: var(--tone-amber-bg);
}
.stat:nth-child(3) .stat-icon {
  color: var(--tone-green);
  background: var(--tone-green-bg);
}
.stat:nth-child(4) .stat-icon {
  color: var(--tone-purple);
  background: var(--tone-purple-bg);
}
.stat strong {
  font-size: 29px;
  line-height: 1.3;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.stat small {
  font-size: 12px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  padding: 23px;
  margin-bottom: 20px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.panel-head h2 {
  margin: 0;
}
.panel-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
.grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 16px;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  position: relative;
  margin: 0 0 0 8px;
  padding: 0 0 22px 22px;
  border-left: 2px solid var(--line-soft);
}
.timeline li:before {
  content: "";
  width: 9px;
  height: 9px;
  background: #40977b;
  border-radius: 50%;
  position: absolute;
  left: -5px;
  top: 6px;
}
.timeline p {
  margin: 3px 0 4px;
  overflow-wrap: anywhere;
}
.timeline small {
  font-size: 12px;
}
.activity {
  display: flex;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.activity:last-child {
  border: 0;
}
.activity strong {
  font-size: 13px;
}
.activity p {
  margin: 4px 0;
  font-size: 12px;
  color: var(--muted);
}
.activity .activity-icon {
  background: var(--soft-green-bg);
  padding: 10px;
  height: 44px;
  border-radius: 10px;
  color: var(--teal);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}
.pill.green {
  background: var(--pill-green-bg);
  color: var(--pill-green);
}
.pill.amber {
  background: var(--pill-amber-bg);
  color: var(--pill-amber);
}
.pill.red {
  background: var(--pill-red-bg);
  color: var(--pill-red);
}
.pill.purple {
  background: var(--pill-purple-bg);
  color: var(--pill-purple);
}
.summary-states {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.summary-states a {
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--navy);
  font-size: 12px;
}
.summary-states strong {
  font-size: 18px;
}
.notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-left: 3px solid #2c9275;
  border-radius: 8px;
  padding: 15px;
  color: var(--notice-text);
  margin: 16px 0;
  font-size: 13px;
}
.notice.warning {
  background: var(--warning-bg);
  border-color: var(--warning-line);
  color: var(--warning-text);
}
.error-text {
  color: var(--danger);
}
.empty {
  text-align: center;
  padding: 32px 18px;
  color: var(--muted);
}
.empty > .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: #65917c;
}
.empty h3 {
  color: var(--navy);
  margin: 0 0 8px;
}
.empty p {
  margin: 0;
}
.case-list {
  display: grid;
  gap: 12px;
}
.case-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 11px;
  padding: 17px;
}
.case-card h3 {
  margin: 5px 0 8px;
}
.case-card p {
  font-size: 12px;
  margin: 7px 0;
  color: var(--muted);
}
.case-card .case-foot {
  border-top: 1px solid var(--line);
  margin-top: 13px;
  padding-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.case-card small {
  font-size: 12px;
}
.case-card .cover {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 7px;
  margin-bottom: 10px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.filters .wide {
  grid-column: 1 / -1;
}
.more-filters {
  margin-bottom: 14px;
}
.more-filters summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 12px;
  width: fit-content;
}
.kanban {
  /* Containing block for .sr-only labels, so they stay inside the scroller. */
  position: relative;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 5px 1px 22px;
  min-height: 380px;
  scroll-snap-type: x proximity;
}
.kanban-column {
  background: var(--column-bg);
  border: 1px solid var(--column-line);
  border-radius: 12px;
  flex: 0 0 265px;
  padding: 12px;
  scroll-snap-align: start;
}
.kanban-column > h2 {
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  padding: 5px 2px;
}
.kanban-column .case-card {
  margin-bottom: 12px;
}
.kanban-column .case-card h3 {
  font-size: 14px;
}
.kanban-column .move-button {
  width: 100%;
  margin-top: 12px;
}
.kanban-column.drag-over {
  outline: 2px dashed var(--teal);
}
.stepper {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 auto 25px;
  max-width: 850px;
  gap: 8px;
}
.stepper li {
  flex: 1;
  border-top: 3px solid var(--step-line);
  padding-top: 12px;
  color: var(--step-text);
  font-size: 12px;
}
.stepper li.active {
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 700;
}
.stepper b {
  display: inline-grid;
  place-items: center;
  background: var(--step-bg);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  margin-right: 7px;
}
.stepper .active b {
  background: var(--accent-bg);
  color: var(--on-accent);
}
.wizard {
  max-width: 850px;
  margin: 0 auto;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.upload {
  border: 2px dashed var(--upload-line);
  border-radius: 12px;
  background: var(--upload-bg);
  padding: 27px;
  text-align: center;
  margin: 18px 0;
}
.upload > .icon {
  width: 36px;
  height: 36px;
  color: var(--teal);
  margin-bottom: 10px;
}
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0;
}
.gallery figure {
  margin: 0;
  width: 140px;
}
.gallery img {
  width: 140px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--placeholder-bg);
}
.gallery figcaption {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.gallery button {
  font-size: 12px;
  padding: 4px 9px;
  min-height: 34px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr);
  gap: 22px;
}
.detail-grid dt {
  color: var(--muted);
  font-size: 12px;
}
.detail-grid dd {
  margin: 3px 0 17px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.detail-title h1 {
  margin: 0;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.module-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.module-card .module-no {
  font-size: 12px;
  color: var(--eyebrow);
  margin-bottom: 18px;
}
.module-card h2 {
  font-size: 17px;
}
.module-card p {
  font-size: 13px;
  color: var(--muted);
}
.module-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 23px;
}
.module-reader {
  max-width: 820px;
  margin: auto;
}
.module-reader p {
  font-size: 16px;
  line-height: 1.85;
}
.quiz-options {
  display: grid;
  gap: 12px;
}
.quiz-options label {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tabs a {
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--navy);
  font-size: 12px;
}
.tabs a.active {
  background: var(--tab-active-bg);
  color: var(--on-accent);
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
td button {
  font-size: 12px;
  padding: 6px 10px;
  min-height: 36px;
}
td small {
  display: block;
}
.bar-row {
  display: grid;
  grid-template-columns: 1fr 80px 30px;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-size: 12px;
}
.bar-row meter {
  width: 100%;
  height: 15px;
}
.badge-item {
  background: var(--badge-bg);
  padding: 16px;
  border: 1px solid var(--badge-line);
  border-radius: 10px;
  color: var(--badge-text);
}
.certificate {
  background: var(--surface);
  padding: 50px;
  border: 5px double #9c8148;
  text-align: center;
  max-width: 900px;
  margin: 20px auto;
}
.certificate h1 {
  font-family: Georgia, serif;
  font-size: 38px;
}
.certificate h2 {
  font-size: 27px;
}
.certificate .icon {
  width: 62px;
  height: 62px;
  color: #9c8148;
}
.login {
  max-width: 1120px;
  margin: 7vh auto;
  padding: 25px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 50px;
  align-items: center;
}
.login-intro {
  padding: 24px 10px;
}
.login-intro h1 {
  font-size: 48px;
  line-height: 1.13;
  letter-spacing: -2px;
}
.login-intro h1 em {
  font-style: normal;
  color: var(--teal);
}
.login-intro > p {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.8;
}
.login .brand {
  margin: 0 0 45px;
}
.login .panel {
  padding: 28px;
}
.profile-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  margin-top: 10px;
  justify-content: flex-start;
}
.profile-choice small {
  display: block;
  font-weight: 400;
}
.login-steps {
  display: flex;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
}
.login-steps > div {
  flex: 1;
}
.login-steps span {
  color: var(--teal);
  font-size: 21px;
  font-weight: 750;
}
.login-steps p {
  font-size: 12px;
  margin-top: 7px;
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  width: min(680px, calc(100vw - 30px));
  max-height: 90vh;
  box-shadow: 0 25px 90px #0b2b3540;
}
dialog::backdrop {
  background: #173c4a80;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 17px;
}
.modal-head h2 {
  margin: 0;
}
.modal-head button {
  font-size: 24px;
  border: 0;
  padding: 3px 12px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #163f35;
  color: var(--on-accent);
  padding: 15px 22px;
  border-radius: 10px;
  box-shadow: 0 6px 25px #0003;
  z-index: 100;
  max-width: calc(100vw - 30px);
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 200%);
}
#toast:empty {
  padding: 0;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%);
}
#toast.error {
  background: #8f2f39;
}
.storage-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 14px 25px;
  border-bottom: 1px solid var(--warning-line);
}
.long-code {
  overflow-wrap: anywhere;
}
.print-only {
  display: none;
}
/* Photos load asynchronously from IndexedDB: show a neutral placeholder (not
   the alt text) until they arrive, and the alt text if the file is missing. */
img[data-blob] {
  background: var(--placeholder-bg);
}
img[data-blob]:not([src]) {
  color: transparent;
}
img[data-blob][data-missing] {
  color: var(--muted);
  font-size: 12px;
  display: grid;
  place-items: center;
  text-align: center;
}
.more {
  text-align: center;
  margin: 20px 0 0;
}
@media (min-width: 1500px) {
  .content {
    padding-top: 45px;
  }
  .stats {
    gap: 22px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 215px;
    padding: 25px 12px;
  }
  .workspace {
    margin-left: 215px;
  }
  .content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 16px 24px;
  }
  .brand small {
    font-size: 12px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .topbar .search {
    display: none;
  }
  .heading {
    align-items: flex-start;
  }
  .heading h1 {
    font-size: 27px;
  }
}
@media (max-width: 760px) {
  body {
    font-size: 14px;
  }
  .sidebar {
    display: none;
    box-shadow: 20px 0 80px #153d4d30;
    width: 270px;
  }
  .sidebar.open {
    display: flex;
    overflow-y: auto;
    z-index: 60;
  }
  .drawer-backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: #173c4a80;
  }
  /* iOS Safari zooms into fields smaller than 16px. */
  input,
  select,
  textarea,
  .topbar input {
    font-size: 16px;
  }
  .gallery button,
  td button {
    min-height: 44px;
  }
  .workspace {
    margin: 0;
  }
  .topbar {
    padding: 13px 18px;
    min-height: 68px;
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .mobile-menu {
    display: inline-flex;
    padding: 6px;
    background: transparent;
    border: 0;
  }
  .topbar .mode-label {
    margin-right: auto;
  }
  .topbar .mode-label .municipality {
    display: none;
  }
  .topbar .top-actions {
    gap: 4px;
  }
  .topbar .top-actions .avatar {
    display: none;
  }
  .content {
    padding: 25px 17px 100px;
  }
  .heading {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
  }
  .heading .button {
    width: 100%;
  }
  h1 {
    font-size: 27px;
  }
  .level-card {
    padding: 20px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .level-card > .icon {
    display: none;
  }
  .level-card .level-body {
    min-width: 180px;
  }
  .level-card .points {
    font-size: 23px;
  }
  .level-card > a {
    width: 100%;
  }
  .stats {
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 13px;
    grid-template-columns: 1fr;
  }
  .stat-icon {
    grid-row: auto;
    width: 30px;
    height: 30px;
    margin-bottom: 5px;
  }
  .stat strong {
    font-size: 26px;
  }
  .stat span {
    font-size: 12px;
  }
  .stat small {
    font-size: 12px;
  }
  .grid-2,
  .grid-3,
  .grid-equal,
  .module-grid,
  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 18px;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .summary-states {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 8px 5px max(8px, env(safe-area-inset-bottom));
    justify-content: space-around;
    min-height: 65px;
  }
  .mobile-nav a {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px;
  }
  .mobile-nav a[aria-current="page"] {
    color: var(--teal);
    font-weight: 800;
  }
  .stepper {
    gap: 5px;
  }
  .stepper li {
    font-size: 12px;
    text-align: center;
  }
  .stepper b {
    display: grid;
    margin: 0 auto 5px;
  }
  .wizard {
    padding: 19px;
  }
  .upload {
    padding: 18px 12px;
  }
  .login {
    margin: 0 auto;
    display: block;
    padding: 24px 19px;
  }
  .login-intro {
    padding: 15px 0;
  }
  .login-intro h1 {
    font-size: 38px;
    letter-spacing: -1.5px;
  }
  .login .brand {
    margin-bottom: 26px;
  }
  .login-intro > p {
    font-size: 15px;
  }
  .login-steps {
    display: none;
  }
  .login .panel {
    padding: 20px;
  }
  .certificate {
    padding: 25px 16px;
  }
  .certificate h1 {
    font-size: 28px;
  }
  .certificate h2 {
    font-size: 23px;
  }
  .row.wrap button {
    flex: 1 1 auto;
  }
  .bar-row {
    grid-template-columns: 1fr 60px 25px;
  }
  #toast {
    bottom: 85px;
  }
  .panel-head {
    align-items: flex-start;
  }
  .panel-head a {
    font-size: 12px;
    white-space: nowrap;
  }
  .table-wrap {
    margin: 0 -5px;
  }
  .case-card .case-foot {
    flex-wrap: wrap;
  }
  .tabs {
    gap: 6px;
  }
  .tabs a {
    padding: 8px 10px;
  }
  dialog {
    padding: 20px;
  }
}
@media print {
  /* Always print on the light palette. */
  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #f4f7f7;
    --text: #203944;
    --navy: #183e50;
    --muted: #596d76;
    --line: #dae4e4;
    --line-soft: #e8efec;
    --surface: #fff;
    --surface-hover: #eaf4f1;
    --surface-soft: #f4f7f6;
    --field-muted-bg: #f6f8f8;
    --field-line: #b8c9ce;
    --teal: #087765;
    --accent-bg: #087765;
    --accent-bg-hover: #075f51;
    --accent-strong: #075f51;
    --on-accent: #fff;
    --tab-active-bg: #183e50;
    --focus: #c47917;
    --eyebrow: #537268;
    --nav-text: #566b74;
    --nav-hover: #f1f7f5;
    --nav-current-bg: #e5f2ed;
    --avatar-bg: #e6f1eb;
    --soft-green-bg: #edf5ef;
    --danger: #a92b35;
    --danger-line: #e7b7bc;
    --tone-blue-bg: #e6f1f4;
    --tone-blue: #2d6585;
    --tone-amber-bg: #fff3dd;
    --tone-amber: #936021;
    --tone-green-bg: #e7f5ec;
    --tone-green: #147352;
    --tone-purple-bg: #f0eafb;
    --tone-purple: #775b9a;
    --pill-bg: #edf1f4;
    --pill-text: #395c74;
    --pill-green-bg: #e4f3e9;
    --pill-green: #236941;
    --pill-amber-bg: #fff0d8;
    --pill-amber: #875b19;
    --pill-red-bg: #fce8e7;
    --pill-red: #9f3637;
    --pill-purple-bg: #eeebf8;
    --pill-purple: #694a94;
    --notice-bg: #edf5f2;
    --notice-line: #cde0d7;
    --notice-text: #325e50;
    --warning-bg: #fff7e6;
    --warning-line: #ead6ac;
    --warning-text: #785321;
    --column-bg: #eaf0ef;
    --column-line: #dde6e2;
    --step-line: #d4dfdc;
    --step-text: #61746d;
    --step-bg: #e6eeea;
    --upload-line: #9bbfb2;
    --upload-bg: #f5faf7;
    --placeholder-bg: #eef3f1;
    --badge-bg: #f5f0df;
    --badge-line: #e8dcb6;
    --badge-text: #75591c;
    --shadow: 0 4px 20px #1a453a06;
  }
  body {
    background: #fff;
    color: #000;
  }
  .sidebar,
  .topbar,
  .mobile-nav,
  .no-print,
  .filters,
  .tabs,
  button,
  .skip,
  #toast,
  .form-actions {
    display: none !important;
  }
  .workspace {
    margin: 0;
  }
  .content {
    padding: 0;
    max-width: none;
  }
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }
  .certificate {
    margin: 0;
    border-color: #555;
  }
  .print-only {
    display: block;
  }
  .heading {
    display: block;
  }
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
  a {
    color: #000;
  }
  .grid-2 {
    display: block;
  }
}
@media (prefers-reduced-motion: no-preference) {
  img[data-blob]:not([src]):not([data-missing]) {
    background: linear-gradient(
        90deg,
        var(--placeholder-bg) 30%,
        var(--surface-soft) 50%,
        var(--placeholder-bg) 70%
      )
      0 0 / 200% 100%;
    animation: shimmer 1.2s linear infinite;
  }
  @keyframes shimmer {
    to {
      background-position: -200% 0;
    }
  }
  button,
  a {
    transition: background 0.15s ease;
  }
  .panel,
  .module-card {
    animation: appear 0.18s ease;
  }
  @keyframes appear {
    from {
      opacity: 0.6;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
.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;
}
.detail-grid {
  margin-top: 22px;
}
.module-no {
  display: block;
}
.form-actions button {
  flex-shrink: 0;
}
.topbar .button[aria-label] {
  min-width: 44px;
}
