:root {
  color-scheme: light;
  --blue: #4A6FA5;
  --green: #6A994E;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-soft: #F9FAFB;
  --ink: #1F2933;
  --text: #1F2933;
  --muted: #697586;
  --line: #E5E7EB;
  --line-strong: #D8DEE8;
  --warning: #A56F3F;
  --danger: #A54A4A;
  --shadow: 0 10px 24px rgba(31, 41, 51, 0.10);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background:
    linear-gradient(rgba(245, 247, 250, 0.94), rgba(245, 247, 250, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='120' viewBox='0 0 180 120'%3E%3Cpath d='M0 92c24-18 48-19 72-4s48 14 72-2 48-17 72-3' fill='none' stroke='%234A6FA5' stroke-opacity='.08'/%3E%3Ccircle cx='36' cy='34' r='3' fill='%236A994E' fill-opacity='.08'/%3E%3Ccircle cx='128' cy='60' r='4' fill='%234A6FA5' fill-opacity='.07'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.5;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

#app,
.app {
  min-height: 100vh;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
}

.muted {
  color: var(--muted);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 500;
  background: var(--blue);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.portal-app {
  min-height: 100vh;
  background:
    linear-gradient(rgba(245, 247, 250, 0.90), rgba(245, 247, 250, 0.90)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='220' viewBox='0 0 320 220'%3E%3Cpath d='M18 154c42-28 82-30 121-6 39 25 79 24 120-3 25-17 49-22 73-14' fill='none' stroke='%234A6FA5' stroke-opacity='.10'/%3E%3Cpath d='M32 88c35-20 71-18 106 8 34 25 68 27 103 5 22-14 44-18 66-12' fill='none' stroke='%236A994E' stroke-opacity='.08'/%3E%3Ccircle cx='72' cy='74' r='5' fill='%234A6FA5' fill-opacity='.08'/%3E%3Ccircle cx='238' cy='142' r='6' fill='%236A994E' fill-opacity='.08'/%3E%3C/svg%3E");
}

.portal-top,
.portal,
.hero,
.shell,
.footer-note,
.student-login-shell,
.student-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.portal-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 16px;
}

.portal-badge {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
}

.portal {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 24px;
  align-items: center;
  padding-top: 18px;
  padding-bottom: 34px;
}

.portal-copy h2 {
  max-width: 760px;
  margin: 8px 0 14px;
  color: var(--ink);
  font-size: clamp(32px, 4.4vw, 52px);
}

.portal-copy p {
  max-width: 680px;
  font-size: 15px;
}

.portal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 12px;
  margin-top: 18px;
}

.portal-metrics span,
.panel,
.card,
.portal-card,
.student-paper,
.student-login-card,
.student-login-hero,
.login-card,
.sidebar,
.measure-card,
.mini-stat,
.question,
.risk-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.portal-metrics span {
  min-height: 86px;
  padding: 14px;
}

.portal-metrics em,
.stat-card i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 10px;
  color: #fff;
  font-style: normal;
  background: var(--blue);
}

.portal-metrics span:nth-child(3) em,
.stat-card:nth-child(3) i {
  background: var(--green);
}

.portal-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 26px;
  font-weight: 500;
}

.portal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.portal-summary p {
  min-height: 74px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.portal-summary strong,
.portal-summary span {
  display: block;
}

.portal-summary strong {
  color: var(--blue);
  font-size: 24px;
  font-weight: 500;
}

.portal-summary span {
  color: var(--muted);
  font-size: 13px;
}

.portal-card {
  padding: 16px;
}

.portal-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.portal-card h3 {
  margin: 0;
  font-size: 22px;
}

.portal-card p {
  margin: 0;
}

.portal-roles,
.role-list {
  display: grid;
  gap: 10px;
}

.portal-role,
.role-button {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.portal-role:hover,
.role-button:hover,
.btn:hover,
.nav-button:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 24px rgba(31, 41, 51, 0.10);
}

.portal-role:active,
.role-button:active,
.btn:active,
.nav-button:active,
.scale-options label:active {
  transform: scale(0.97);
}

.portal-role::after,
.role-button::after,
.btn::after,
.nav-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(74, 111, 165, 0.18);
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
}

.portal-role:active::after,
.role-button:active::after,
.btn:active::after,
.nav-button:active::after {
  opacity: 1;
  animation: ripple 420ms ease-out;
}

.role-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 500;
  background: var(--blue);
}

.portal-role:nth-child(4) .role-icon,
.role-button:nth-child(4) .role-icon {
  background: var(--green);
}

.portal-role strong,
.portal-role small,
.role-button strong,
.role-button span span {
  display: block;
}

.portal-role small,
.role-button span span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.btn,
.nav-button {
  position: relative;
  overflow: hidden;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
}

.btn.small {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.btn.primary,
.nav-button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 10px;
}

.hero-card,
.login-card,
.panel,
.card,
.student-paper,
.student-login-card,
.student-login-hero {
  padding: 16px;
}

.hero-card h2 {
  max-width: 760px;
  margin: 6px 0 10px;
  font-size: 28px;
}

.hero-card p {
  max-width: 760px;
}

.grid,
.hero-grid {
  display: grid;
  gap: 14px;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: stretch;
}

.hero-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-stat,
.stat-card {
  padding: 12px;
}

.mini-stat strong,
.stat-number {
  display: block;
  color: var(--ink);
  font-size: 28px;
  font-weight: 500;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  padding-top: 8px;
  padding-bottom: 36px;
}

.sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 14px;
  min-width: 0;
}

.nav-button {
  width: 100%;
  text-align: left;
}

.content {
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.section-head p,
.panel p,
.card p,
.login-card p {
  margin: 0;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.step {
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.step strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.step span {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.compact {
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.12);
}

.stage-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
}

.stage-checks input {
  width: auto;
  min-height: auto;
  accent-color: var(--blue);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-soft);
}

tr:last-child td {
  border-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  background: #EEF2F6;
}

.tag.ok {
  color: #fff;
  background: var(--green);
}

.tag.warn {
  color: #fff;
  background: var(--warning);
}

.tag.risk {
  color: #fff;
  background: var(--danger);
}

.tag.info {
  color: #fff;
  background: var(--blue);
}

.measure-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 190px;
  gap: 10px;
  margin-bottom: 14px;
}

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

.measure-card {
  min-height: 168px;
  padding: 15px;
}

.measure-card h3 {
  min-height: 48px;
  margin: 0 0 8px;
  font-size: 16px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #E9EEF4;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  animation: loadWidth 700ms ease both;
}

.risk-list {
  display: grid;
  gap: 10px;
}

.risk-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.risk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.archive-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.archive-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.timeline-item span,
.timeline-item p {
  color: var(--muted);
}

.timeline-item span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.timeline-item p {
  margin: 0;
}

.risk-track {
  display: grid;
  gap: 12px;
}

.risk-dot {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.risk-dot:last-child {
  border-bottom: 0;
}

.risk-dot i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
}

.risk-dot.warn i {
  background: var(--warning);
}

.risk-dot.risk i {
  background: var(--danger);
}

.risk-dot span {
  font-weight: 500;
}

.risk-dot small {
  color: var(--muted);
}

.backend-note {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius);
  color: #2F4668;
  background: rgba(74, 111, 165, 0.10);
}

.org-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.org-metrics span {
  min-height: 58px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
}

.org-metrics strong {
  display: block;
  color: var(--blue);
  font-size: 22px;
  font-weight: 500;
}

.grade-card {
  min-height: 170px;
}


.student-login-shell {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: center;
  padding-top: 26px;
  padding-bottom: 40px;
}

.student-login-hero {
  position: relative;
  overflow: hidden;
}

.student-login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.88), rgba(255,255,255,.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='160' viewBox='0 0 280 160'%3E%3Cpath d='M0 124c40-26 80-28 120-6 39 22 78 20 117-6 22-15 44-20 67-13' fill='none' stroke='%234A6FA5' stroke-opacity='.12'/%3E%3Cpath d='M26 62c32-18 64-17 96 4 31 21 62 22 94 2' fill='none' stroke='%236A994E' stroke-opacity='.10'/%3E%3Ccircle cx='68' cy='48' r='4' fill='%234A6FA5' fill-opacity='.10'/%3E%3Ccircle cx='212' cy='102' r='5' fill='%236A994E' fill-opacity='.10'/%3E%3C/svg%3E");
}

.student-login-hero > * {
  position: relative;
  z-index: 1;
}

.student-login-hero h2 {
  margin: 6px 0 10px;
  font-size: 32px;
}

.login-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.login-flow span {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: var(--radius);
  color: var(--blue);
  text-align: center;
  background: rgba(74, 111, 165, 0.10);
}

.student-shell {
  max-width: 860px;
  padding-top: 24px;
  padding-bottom: 40px;
}

.question {
  padding: 14px;
}

.question strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.question p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.scale-options label {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
  line-height: 1.35;
  font-size: 13px;
}

.scale-options.text-options {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.scale-options label:has(input:checked) {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.result-box,
.open-result {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(106, 153, 78, 0.22);
  border-radius: var(--radius);
  color: #38552E;
  background: rgba(106, 153, 78, 0.08);
}

.login-error {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(165, 74, 74, 0.24);
  border-radius: var(--radius);
  color: var(--danger);
  background: rgba(165, 74, 74, 0.08);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid rgba(74, 111, 165, 0.24);
  border-radius: var(--radius);
  color: #2F4668;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 41, 51, .32);
  backdrop-filter: blur(4px);
}

.password-modal {
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(216, 222, 232, .9);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 48px rgba(31, 41, 51, .18);
}

.password-modal .panel-head {
  margin-bottom: 8px;
}

.panel,
.card,
.mini-stat,
.measure-card,
.screen-card,
.risk-item,
.question,
.portal-metrics span,
.portal-summary p {
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.panel:hover,
.card:hover,
.mini-stat:hover,
.measure-card:hover,
.screen-card:hover,
.risk-item:hover,
.portal-metrics span:hover,
.portal-summary p:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 111, 165, 0.28);
}

.portal-card,
.portal-metrics span,
.portal-summary p,
.panel,
.card,
.measure-card,
.student-paper,
.student-login-card,
.student-login-hero {
  animation: subtleIn 260ms ease both;
}

.task-choice-panel {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.task-choice-panel h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.task-choice {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  display: grid;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(80, 96, 120, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.task-choice:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 111, 165, .38);
  box-shadow: 0 16px 34px rgba(74, 111, 165, .14);
}

.task-choice strong {
  font-size: 15px;
  font-weight: 500;
}

.task-choice span {
  color: var(--muted);
  font-size: 13px;
}

@keyframes ripple {
  from {
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(28);
  }
}

@keyframes subtleIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analytics-screen {
  display: grid;
  gap: 14px;
}

.screen-hero,
.screen-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.screen-hero {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: center;
  padding: 22px;
  overflow: hidden;
}

.screen-hero h3,
.screen-card h3 {
  margin-bottom: 10px;
}

.screen-hero strong {
  display: block;
  color: var(--blue);
  font-size: 56px;
  font-weight: 500;
}

.ring-chart {
  width: 210px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: end;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--surface) 0 58%, transparent 59%),
    conic-gradient(var(--blue) 0 var(--rate, 320deg), #E8EDF3 var(--rate, 321deg) 360deg);
  animation: ringIn 900ms ease both;
}

.ring-chart span {
  color: var(--ink);
  font-size: 30px;
  font-weight: 500;
}

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

.screen-card {
  padding: 18px;
  animation: cardIn 320ms ease both;
}

.screen-card.wide {
  grid-column: span 2;
}

.stack-bar {
  height: 18px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #E8EDF3;
}

.stack-bar i {
  display: block;
  animation: loadWidth 800ms ease both;
}

.stack-bar i:nth-child(1) {
  background: var(--green);
}

.stack-bar i:nth-child(2) {
  background: var(--blue);
}

.stack-bar i:nth-child(3) {
  background: var(--warning);
}

.legend {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.metric-list p:last-child {
  border-bottom: 0;
}

.metric-list strong {
  color: var(--blue);
  font-size: 24px;
  font-weight: 500;
}

.grade-bars {
  display: grid;
  gap: 12px;
}

.grade-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 48px 84px;
  gap: 10px;
  align-items: center;
}

.grade-row span,
.grade-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.grade-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #E8EDF3;
}

.grade-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  animation: loadWidth 900ms ease both;
}

.radar-list {
  display: grid;
  gap: 13px;
}

.radar-list p {
  margin: 0;
  color: var(--muted);
}

.radar-list span {
  display: block;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--green);
  animation: loadWidth 900ms ease both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loadWidth {
  from {
    max-width: 0;
  }
  to {
    max-width: 100%;
  }
}

@keyframes ringIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.h5-screen {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(135, 153, 180, 0.22);
  border-radius: var(--radius);
  color: #EAF0F7;
  background: #17202B;
  box-shadow: 0 18px 44px rgba(31, 41, 51, 0.18);
}

.h5-screen-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(74, 111, 165, 0.18), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(106, 153, 78, 0.18), transparent 28%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
}

.h5-screen > *:not(.h5-screen-bg) {
  position: relative;
  z-index: 1;
}

.h5-screen .eyebrow,
.h5-screen p {
  color: rgba(234, 240, 247, 0.68);
}

.h5-screen-head,
.h5-kpis,
.h5-layout,
.h5-bottom-grid,
.h5-feed > div {
  display: grid;
  gap: 12px;
}

.h5-screen-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.h5-screen-head h2 {
  margin: 2px 0 4px;
  color: #fff;
  font-size: 28px;
}

.screen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.empty-state {
  border-style: dashed;
  background: rgba(246, 248, 251, 0.78);
}

.empty-state h3 {
  margin-bottom: 6px;
}

.empty-state p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.btn.ghost {
  color: #EAF0F7;
  border-color: rgba(234, 240, 247, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.h5-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.h5-kpis article,
.h5-card,
.h5-core {
  border: 1px solid rgba(234, 240, 247, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(10px);
  animation: subtleIn 260ms ease both;
}

.h5-kpis article {
  min-height: 98px;
  padding: 13px;
}

.h5-kpis span,
.h5-kpis small,
.h5-card-title span,
.h5-grade-list span,
.h5-class-list span,
.h5-warning-list span,
.h5-task-list span,
.h5-feed span {
  color: rgba(234, 240, 247, 0.66);
}

.h5-kpis strong {
  display: block;
  margin: 5px 0 2px;
  color: #fff;
  font-size: 30px;
  font-weight: 500;
}

.h5-layout {
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  align-items: start;
}

.h5-column,
.h5-main {
  display: grid;
  gap: 12px;
}

.h5-card,
.h5-core {
  padding: 14px;
}

.h5-card-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.h5-card h3,
.h5-card-title h3,
.h5-core h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
}

.h5-grade-list,
.h5-class-list,
.h5-warning-list,
.h5-task-list,
.h5-dimension-list {
  display: grid;
  gap: 8px;
}

.h5-grade-list button,
.h5-class-list button,
.h5-warning-list button,
.h5-task-list button,
.h5-feed button {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(234, 240, 247, 0.10);
  border-radius: var(--radius);
  color: #EAF0F7;
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.h5-grade-list button:hover,
.h5-class-list button:hover,
.h5-warning-list button:hover,
.h5-task-list button:hover,
.h5-feed button:hover,
.h5-grade-list button.active {
  border-color: rgba(106, 153, 78, 0.55);
  background: rgba(106, 153, 78, 0.12);
  transform: translateY(-1px);
}

.h5-grade-list i,
.h5-class-list i,
.h5-task-list i,
.h5-dimension-list i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(234, 240, 247, 0.12);
}

.h5-grade-list b,
.h5-class-list b,
.h5-task-list b,
.h5-dimension-list b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  animation: loadWidth 760ms ease both;
}

.h5-class-list b,
.h5-dimension-list b {
  background: var(--green);
}

.h5-core {
  min-height: 380px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: center;
}

.h5-ring {
  width: 220px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: end;
  border-radius: 50%;
  background:
    radial-gradient(circle, #17202B 0 57%, transparent 58%),
    conic-gradient(var(--green) 0 var(--low), var(--blue) var(--low) var(--mid), var(--warning) var(--mid) var(--high), var(--danger) var(--high) 100%);
  animation: ringIn 900ms ease both;
}

.h5-ring span,
.h5-ring small {
  grid-area: 1 / 1;
}

.h5-ring span {
  color: #fff;
  font-size: 36px;
  font-weight: 500;
  transform: translateY(-8px);
}

.h5-ring small {
  color: rgba(234, 240, 247, 0.62);
  transform: translateY(25px);
}

.h5-risk-split {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.h5-risk-split span {
  min-height: 44px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-radius: var(--radius);
  color: rgba(234, 240, 247, 0.78);
  background: rgba(255, 255, 255, 0.06);
}

.h5-risk-split i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.h5-risk-split span:nth-child(2) i {
  background: var(--blue);
}

.h5-risk-split span:nth-child(3) i {
  background: var(--warning);
}

.h5-risk-split span:nth-child(4) i {
  background: var(--danger);
}

.h5-bottom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.h5-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.h5-chip-grid span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius);
  color: rgba(234, 240, 247, 0.74);
  background: rgba(255, 255, 255, 0.06);
}

.h5-chip-grid strong,
.h5-warning-list strong,
.h5-task-list strong,
.h5-feed strong,
.h5-dimension-list strong {
  color: #fff;
  font-weight: 500;
}

.h5-dimension-list p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 120px) 24px;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.h5-warning-list .tag,
.h5-feed .tag {
  justify-self: start;
}

.h5-feed > div {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.h5-feed button {
  min-height: 86px;
}


.footer-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  margin-bottom: 28px;
  padding-top: 18px;
  padding-bottom: 18px;
  border: 1px solid rgba(74, 111, 165, 0.10);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
    linear-gradient(90deg, rgba(74, 111, 165, 0.04), rgba(106, 153, 78, 0.04));
  box-shadow: 0 18px 44px rgba(42, 56, 74, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.footer-brand,
.footer-links,
.footer-record {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.footer-brand {
  min-width: 252px;
}

.footer-logo {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 10px 20px rgba(74, 111, 165, 0.16);
}

.footer-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.footer-brand strong {
  color: var(--text);
  font-weight: 500;
}

.footer-brand small,
.footer-links a,
.footer-record a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links {
  flex: 1;
  justify-content: center;
  gap: 8px;
}

.footer-links a,
.footer-record a {
  padding: 8px 11px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.footer-links a {
  border: 1px solid rgba(74, 111, 165, 0.08);
  color: #5f6f83;
  background: rgba(255, 255, 255, 0.72);
}

.footer-links a:hover,
.footer-record a:hover {
  color: var(--blue);
  background: rgba(74, 111, 165, 0.08);
  transform: translateY(-1px);
}

.footer-record a {
  display: grid;
  gap: 4px;
  min-width: 260px;
  padding: 11px 14px;
  border: 1px solid rgba(74, 111, 165, 0.18);
  border-radius: 14px;
  color: var(--blue);
  background: linear-gradient(180deg, rgba(74, 111, 165, 0.08), rgba(74, 111, 165, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.footer-record a span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.footer-record a em {
  font-style: normal;
  color: var(--green);
  font-size: 12px;
}

.footer-record a small {
  color: var(--muted);
  font-size: 12px;
}

.footer-record a em::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 999px;
  background: currentColor;
  vertical-align: 1px;
}

.footer-record a:hover small {
  color: var(--blue);
}

.legal-app {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(245, 247, 250, 0.96)),
    radial-gradient(circle at 8% 8%, rgba(74, 111, 165, 0.09), transparent 26%),
    radial-gradient(circle at 92% 14%, rgba(106, 153, 78, 0.09), transparent 24%),
    var(--bg);
}

.legal-top,
.legal-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
  padding-bottom: 20px;
}

.legal-brand,
.legal-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-brand {
  color: var(--text);
  text-decoration: none;
}

.legal-brand span:last-child {
  display: grid;
  gap: 2px;
}

.legal-brand small {
  color: var(--muted);
}

.legal-tabs {
  padding: 5px;
  border: 1px solid rgba(74, 111, 165, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(42, 56, 74, 0.06);
}

.legal-tabs a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease, background 0.2s ease;
}

.legal-tabs a:hover,
.legal-tabs a.active {
  color: var(--blue);
  background: rgba(74, 111, 165, 0.09);
}

.legal-shell {
  display: grid;
  gap: 16px;
  padding-bottom: 8px;
  max-width: 980px;
}

.legal-hero,
.legal-document {
  border: 1px solid rgba(74, 111, 165, 0.10);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 18px 46px rgba(42, 56, 74, 0.07);
}

.legal-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  overflow: hidden;
  padding: 30px;
}

.legal-hero::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 28px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(74, 111, 165, 0.10), transparent 68%);
  pointer-events: none;
}

.legal-hero h1 {
  margin: 6px 0 10px;
  font-size: 34px;
  font-weight: 500;
}

.legal-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.legal-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.legal-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(74, 111, 165, 0.08);
  font-size: 13px;
}

.legal-document {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px;
  overflow: visible;
}

.legal-document article,
.legal-notice {
  padding: 19px 20px;
  border: 1px solid rgba(74, 111, 165, 0.08);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.66);
}

.legal-document h2 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 500;
}

.legal-document p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.legal-notice {
  grid-column: 1 / -1;
  background: rgba(106, 153, 78, 0.07);
}

.legal-back {
  position: relative;
  z-index: 1;
  padding: 9px 14px;
  border: 1px solid rgba(74, 111, 165, 0.12);
  border-radius: 999px;
  color: var(--blue);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  transition: transform 0.2s ease, background 0.2s ease;
}

.legal-back:hover {
  background: rgba(74, 111, 165, 0.08);
  transform: translateY(-1px);
}

.login-portal {
  grid-template-columns: minmax(0, 1.08fr) 400px;
  align-items: stretch;
}

.login-panel {
  align-self: center;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.login-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
}

.login-tabs button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.internal-entry {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 26px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.internal-entry button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
}

.internal-entry button:hover {
  color: var(--blue);
}

.login-form {
  grid-template-columns: 1fr;
}

.demo-accounts,
.login-status-strip {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.demo-accounts span,
.login-status-strip span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,.82);
}

.login-status-strip i {
  color: var(--blue);
  font-style: normal;
  font-weight: 500;
}

.top-current {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--blue);
  background: rgba(74, 111, 165, 0.10);
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  transition: transform 140ms ease, border-color 140ms ease;
}

.compact-list button:hover {
  border-color: rgba(74, 111, 165, 0.32);
  transform: translateY(-1px);
}

.compact-list span {
  color: var(--muted);
  font-size: 13px;
}

.import-result {
  margin-bottom: 12px;
}

.import-result .compact-list {
  max-height: 220px;
  overflow: auto;
}

.import-result .compact-list p {
  margin: 0;
  color: var(--green);
}

.h5-screen {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(245,247,250,.96)),
    linear-gradient(120deg, rgba(74,111,165,.08), transparent);
  box-shadow: var(--shadow);
}

.h5-screen-bg {
  background:
    linear-gradient(rgba(74,111,165,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,111,165,.055) 1px, transparent 1px);
  background-size: 36px 36px;
}

.h5-screen .eyebrow {
  color: var(--blue);
}

.h5-screen p,
.h5-kpis span,
.h5-kpis small,
.h5-card-title span,
.h5-grade-list span,
.h5-class-list span,
.h5-warning-list span,
.h5-task-list span,
.h5-feed span {
  color: var(--muted);
}

.h5-screen-head h2,
.h5-card h3,
.h5-card-title h3,
.h5-core h3,
.h5-kpis strong,
.h5-chip-grid strong,
.h5-warning-list strong,
.h5-task-list strong,
.h5-feed strong,
.h5-dimension-list strong {
  color: var(--ink);
}

.h5-kpis article,
.h5-card,
.h5-core {
  border-color: var(--line);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.08);
}

.h5-layout {
  grid-template-columns: 260px minmax(0, 1fr) 280px;
}

.h5-core {
  min-height: 300px;
}

.h5-ring {
  width: 190px;
  background:
    radial-gradient(circle, #fff 0 57%, transparent 58%),
    conic-gradient(var(--green) 0 var(--low), var(--blue) var(--low) var(--mid), var(--warning) var(--mid) var(--high), var(--danger) var(--high) 100%);
}

.h5-ring span {
  color: var(--ink);
}

.h5-ring small {
  color: var(--muted);
}

.h5-risk-split span,
.h5-chip-grid span,
.h5-grade-list button,
.h5-class-list button,
.h5-warning-list button,
.h5-task-list button,
.h5-feed button {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-soft);
}

.h5-grade-list button:hover,
.h5-class-list button:hover,
.h5-warning-list button:hover,
.h5-task-list button:hover,
.h5-feed button:hover,
.h5-grade-list button.active {
  background: rgba(74,111,165,.08);
  border-color: rgba(74,111,165,.28);
}

/* Desktop-first compact board: reduce blank display-screen spacing. */
.h5-screen {
  gap: 10px;
  padding: 12px;
}

.h5-screen-head {
  align-items: center;
  padding: 2px 2px 0;
}

.h5-screen-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.h5-screen-head p {
  margin: 2px 0 0;
}

.h5-kpis {
  gap: 8px;
}

.h5-kpis article {
  min-height: 72px;
  padding: 10px 12px;
}

.h5-kpis strong {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.h5-layout {
  grid-template-columns: 1.05fr 1.35fr 1.05fr;
  gap: 10px;
}

.h5-column,
.h5-main,
.h5-bottom-grid,
.h5-feed > div {
  gap: 10px;
}

.h5-card,
.h5-core {
  padding: 10px;
}

.h5-card-title {
  margin-bottom: 8px;
}

.h5-core {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  align-items: start;
}

.h5-core p {
  font-size: 13px;
}

.h5-ring {
  width: 126px;
}

.h5-ring span {
  font-size: 24px;
}

.h5-ring small {
  transform: translateY(19px);
}

.h5-risk-split {
  gap: 6px;
}

.h5-risk-split span {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 12px;
}

.h5-grade-list,
.h5-class-list,
.h5-warning-list,
.h5-task-list,
.h5-dimension-list {
  gap: 6px;
}

.h5-grade-list,
.h5-class-list,
.h5-task-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.h5-grade-list,
.h5-class-list,
.h5-warning-list,
.h5-task-list,
.h5-dimension-list {
  max-height: 258px;
  overflow: auto;
  padding-right: 2px;
}

.h5-grade-list::-webkit-scrollbar,
.h5-class-list::-webkit-scrollbar,
.h5-warning-list::-webkit-scrollbar,
.h5-task-list::-webkit-scrollbar,
.h5-dimension-list::-webkit-scrollbar {
  width: 6px;
}

.h5-grade-list::-webkit-scrollbar-thumb,
.h5-class-list::-webkit-scrollbar-thumb,
.h5-warning-list::-webkit-scrollbar-thumb,
.h5-task-list::-webkit-scrollbar-thumb,
.h5-dimension-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(105, 117, 134, 0.22);
}

.h5-grade-list button,
.h5-class-list button,
.h5-warning-list button,
.h5-task-list button,
.h5-feed button {
  gap: 4px;
  padding: 7px 8px;
}

.h5-grade-list button,
.h5-class-list button,
.h5-task-list button {
  min-height: 48px;
}

.h5-grade-list button,
.h5-class-list button,
.h5-task-list button {
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
}

.h5-grade-list button i,
.h5-class-list button i,
.h5-task-list button i {
  grid-column: 1 / -1;
}

.h5-grade-list button strong,
.h5-class-list button strong,
.h5-task-list button strong {
  justify-self: end;
}

.h5-warning-list button {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.h5-warning-list button span {
  grid-column: 1 / -1;
}

.h5-chip-grid {
  gap: 6px;
}

.h5-chip-grid span {
  padding: 7px 8px;
}

.h5-feed {
  padding-bottom: 12px;
}

.h5-feed > div {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.h5-feed button {
  min-height: 62px;
}

.rank-screen {
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(74,111,165,.10), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(106,153,78,.14), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,248,251,.98)),
    linear-gradient(120deg, rgba(74,111,165,.08), transparent);
  perspective: 1200px;
}

.rank-screen .h5-screen-bg {
  background:
    linear-gradient(rgba(74,111,165,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,111,165,.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

.rank-screen .h5-screen-head {
  align-items: center;
  padding: 2px 2px 0;
}

.rank-screen .h5-screen-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

.rank-screen .h5-screen-head p,
.rank-screen .h5-kpis span,
.rank-screen .h5-kpis small,
.rank-screen .h5-card-title span {
  color: var(--muted);
}

.rank-screen .btn.ghost {
  color: var(--blue);
  border-color: rgba(74,111,165,.20);
  background: rgba(74,111,165,.08);
}

.rank-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.rank-kpis article {
  position: relative;
  transform-style: preserve-3d;
  min-height: 70px;
  padding: 10px 12px;
  border-color: var(--line);
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 18px rgba(31,41,51,.07);
}

.rank-kpis article::after,
.rank-card::after {
  content: "";
  position: absolute;
  inset: auto 10px -8px 10px;
  height: 12px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(74,111,165,.10);
  filter: blur(.2px);
  transform: translateZ(-10px) skewX(-18deg);
  pointer-events: none;
}

.rank-kpis strong {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.rank-card {
  position: relative;
  transform-style: preserve-3d;
  min-height: 0;
  padding: 10px;
  border-color: var(--line);
  background: rgba(255,255,255,.94);
  box-shadow: 0 16px 28px rgba(31,41,51,.10);
  transform: rotateX(.6deg) translateZ(0);
}

.rank-card:hover {
  transform: rotateX(0deg) translateY(-2px);
}

.rank-card h3 {
  color: var(--ink);
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-12 {
  grid-column: span 12;
}

.rank-list {
  display: grid;
  gap: 7px;
  max-height: 286px;
  overflow: auto;
  padding-right: 2px;
}

.rank-list::-webkit-scrollbar {
  width: 6px;
}

.rank-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(105,117,134,.22);
}

.rank-row {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(90px, 1fr) minmax(90px, 1.2fr) 54px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  box-shadow: inset 0 -2px 0 rgba(31,41,51,.035);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.rank-row:hover,
.rank-row.active {
  border-color: rgba(74,111,165,.30);
  background: rgba(74,111,165,.08);
  transform: translateY(-1px) translateZ(8px);
  box-shadow: 0 8px 16px rgba(31,41,51,.08);
}

.rank-row em {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  background: #EEF2F6;
}

.rank-row.top-1 em,
.rank-row.top-2 em,
.rank-row.top-3 em {
  color: #fff;
  background: var(--blue);
}

.rank-row.top-2 em {
  background: var(--green);
}

.rank-row.top-3 em {
  background: var(--warning);
}

.rank-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row i {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #E8EDF3;
  box-shadow: inset 0 2px 4px rgba(31,41,51,.08);
}

.rank-row b {
  position: relative;
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  animation: loadWidth 760ms ease both;
}

.rank-row b::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.36), rgba(255,255,255,0));
  transform: translateY(-1px);
}

.rank-row b::before {
  content: "";
  position: absolute;
  right: -3px;
  top: 1px;
  width: 6px;
  height: 7px;
  border-radius: 999px;
  background: rgba(31,41,51,.16);
}

.risk-rank .rank-row:nth-child(1) b,
.rank-row.top-2 b {
  background: var(--green);
}

.risk-rank .rank-row:nth-child(3) b,
.rank-row.top-3 b {
  background: var(--warning);
}

.risk-rank .rank-row:nth-child(4) b,
.warning-rank .rank-row b {
  background: var(--danger);
}

.rank-row strong {
  justify-self: end;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.warning-rank .rank-row {
  grid-template-columns: 30px minmax(82px, 1fr) minmax(70px, .8fr) 64px;
}

.screen-feed-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.screen-feed-row button {
  position: relative;
  min-height: 60px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  box-shadow: inset 0 -2px 0 rgba(31,41,51,.035);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.screen-feed-row button:hover {
  border-color: rgba(74,111,165,.30);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(31,41,51,.08);
}

@media (prefers-reduced-motion: reduce) {
  .rank-card,
  .rank-card:hover,
  .rank-row:hover,
  .rank-row.active,
  .screen-feed-row button:hover {
    transform: none;
  }
}

.screen-feed-row strong,
.screen-feed-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-feed-row span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .rank-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .span-3,
  .span-4 {
    grid-column: span 4;
  }

  .span-12 {
    grid-column: span 8;
  }

  .screen-feed-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .rank-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rank-grid {
    grid-template-columns: 1fr;
  }

  .span-3,
  .span-4,
  .span-6,
  .span-12 {
    grid-column: auto;
  }

  .rank-row,
  .warning-rank .rank-row {
    min-height: 48px;
    grid-template-columns: 28px minmax(0, 1fr) 52px;
    gap: 6px;
    padding: 7px;
  }

  .rank-row i {
    grid-column: 2 / -1;
  }

  .rank-row small {
    display: none;
  }
}

@media (max-width: 1180px) {
  .portal,
  .hero,
  .shell,
  .student-login-shell,
  .task-layout,
  .h5-layout,
  .h5-core {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(200px, .6fr) minmax(0, 1.4fr);
    align-items: stretch;
    gap: 10px;
    overflow: hidden;
  }

  .sidebar-menu {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sidebar-foot {
    display: none;
  }

  .nav-button {
    min-height: 58px;
  }

  .nav-text small {
    white-space: nowrap;
  }

  .grid.cols-4,
  .workflow,
  .measure-grid,
  .measure-brief-grid,
  .org-simple-layout,
  .org-template-layout,
  .org-layout,
  .org-admin-forms,
  .h5-kpis,
  .h5-feed > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-simple-layout,
  .org-template-layout,
  .org-layout,
  .org-admin-forms {
    grid-template-columns: 1fr;
  }

  .org-tree {
    max-height: none;
  }

  .h5-ring {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .portal-top,
  .topbar,
  .section-head,
  .archive-head {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-top,
  .portal,
  .hero,
  .shell,
  .student-login-shell,
  .student-shell,
  .footer-note {
    padding-left: 16px;
    padding-right: 16px;
  }

  .portal {
    gap: 18px;
    padding-top: 18px;
  }

  .footer-note,
  .footer-brand,
  .footer-links,
  .footer-record {
    justify-content: center;
    text-align: center;
  }

  .footer-note {
    flex-direction: column;
    gap: 10px;
  }

  .footer-brand {
    min-width: 0;
  }

  .legal-top {
    flex-direction: column;
    align-items: stretch;
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-tabs {
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 16px;
  }

  .legal-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .legal-hero h1 {
    font-size: 28px;
  }

  .legal-document {
    grid-template-columns: 1fr;
  }

  .legal-document article,
  .legal-document article:nth-child(1),
  .legal-document article:nth-child(2) {
    border-top: 1px solid rgba(74, 111, 165, 0.10);
    border-right: 0;
  }

  .legal-document article:first-child {
    border-top: 0;
  }

  .portal-copy h2 {
    font-size: 30px;
  }

  .portal-metrics,
  .portal-summary,
  .hero-grid,
  .org-kpis,
  .org-guide,
  .org-simple-layout,
  .org-count-row,
  .org-template-layout,
  .org-template-row,
  .org-detail-stats,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .screen-hero,
  .screen-grid,
  .workflow,
  .form-grid,
  .measure-toolbar,
  .measure-grid,
  .measure-brief-grid,
  .login-flow,
  .scale-options,
  .h5-screen-head,
  .h5-kpis,
  .h5-layout,
  .h5-core,
  .h5-risk-split,
  .h5-bottom-grid,
  .h5-chip-grid,
  .h5-feed > div {
    grid-template-columns: 1fr;
  }

  .sidebar {
    margin-left: -2px;
    margin-right: -2px;
    padding: 10px;
  }

  .sidebar-school {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .school-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .sidebar-menu {
    grid-auto-columns: minmax(150px, 78vw);
  }


  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-card.wide {
    grid-column: auto;
  }

  .ring-chart {
    justify-self: start;
    width: 180px;
  }

  .h5-screen {
    padding: 14px;
  }

  .h5-screen-head h2 {
    font-size: 23px;
  }

  .h5-kpis {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .h5-kpis article {
    min-width: 150px;
    scroll-snap-align: start;
  }

  .h5-core {
    min-height: auto;
  }

  .h5-ring {
    width: 190px;
  }

  .screen-actions {
    justify-content: stretch;
  }

  .screen-actions .btn {
    flex: 1;
  }

  .grade-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .risk-item,
  .risk-actions,
  .risk-dot {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .brand h1 {
    font-size: 17px;
  }

  .hero-card h2,
  .student-login-hero h2 {
    font-size: 24px;
  }
}

/* Compact desktop console redesign */
.shell {
  max-width: 1480px;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  padding-top: 10px;
}

.topbar {
  min-height: 58px;
  padding: 8px 20px;
}

.topbar .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.topbar .brand h1 {
  font-size: 16px;
}

.sidebar {
  top: 70px;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 20px rgba(31,41,51,.07);
}

.nav-button {
  min-height: 62px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
}

.content {
  display: grid;
  gap: 12px;
}

.sidebar-school {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(74, 111, 165, .14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(74,111,165,.08), rgba(106,153,78,.05));
}

.sidebar-school strong,
.sidebar-school small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-school strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.sidebar-school small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.school-avatar,
.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--blue);
}

.school-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-weight: 500;
}

.sidebar-menu {
  display: grid;
  gap: 8px;
}

.nav-button {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nav-button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-button:hover {
  transform: translateY(-1px);
  border-color: rgba(74,111,165,.14);
  background: rgba(74,111,165,.06);
  box-shadow: 0 8px 18px rgba(31,41,51,.06);
}

.nav-button.active {
  border-color: rgba(74,111,165,.20);
  background: rgba(74,111,165,.10);
  box-shadow: 0 8px 18px rgba(74,111,165,.10);
}

.nav-button.active::before {
  background: var(--blue);
}

.nav-button.active .nav-icon {
  background: var(--green);
}

.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.nav-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.nav-text strong,
.nav-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-text strong {
  font-weight: 500;
}

.nav-text small {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-foot {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.side-link {
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  text-align: left;
  background: transparent;
}

.side-link:hover {
  color: var(--blue);
  background: rgba(74,111,165,.06);
}

.measure-brief-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.measure-brief {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.measure-brief strong {
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}

.measure-brief p,
.measure-brief span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.measure-brief span {
  line-height: 1.45;
}

.org-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.org-kpis .panel {
  min-height: 88px;
  padding: 14px;
}

.org-guide,
.org-import-result {
  margin-bottom: 12px;
}

.org-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.org-guide span {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-soft);
}

.org-guide em {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  font-style: normal;
  background: var(--blue);
}

.org-import-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(106,153,78,.20);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(106,153,78,.08);
}

.org-import-result strong {
  color: var(--ink);
  font-weight: 500;
}

.org-import-result small {
  color: var(--warning);
}

.org-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.org-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.org-action-strip h3,
.org-action-strip p {
  margin: 0;
}

.org-action-strip p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.org-hidden-panel {
  margin-bottom: 12px;
  border-color: rgba(176, 120, 54, .20);
  background: rgba(255, 251, 245, .86);
}

.org-directory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.org-grade-list {
  display: grid;
  gap: 10px;
}

.org-grade-block {
  padding: 8px 10px 10px;
  border: 1px solid rgba(74, 111, 165, .10);
  border-radius: 12px;
  background: rgba(248, 250, 252, .78);
}

.org-grade-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.btn.tiny {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.org-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
}

.org-template-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 12px;
  margin-bottom: 12px;
}

.org-template-panel {
  min-width: 0;
}

.org-template-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.org-template-row {
  display: grid;
  grid-template-columns: minmax(120px, .9fr) 96px minmax(140px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.org-template-row .full {
  grid-column: 1 / -1;
}

.org-template-row textarea {
  min-height: 74px;
  resize: vertical;
}

.org-template-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.org-template-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.org-simple-layout {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr);
  gap: 12px;
  margin-bottom: 12px;
}

.org-simple-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.org-count-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 86px 92px;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.org-count-row span {
  display: grid;
  gap: 2px;
}

.org-count-row strong {
  font-weight: 500;
}

.org-count-row small,
.org-count-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.org-count-row input[type="number"] {
  min-height: 34px;
}

.org-class-table {
  max-height: 438px;
}

.org-class-table td:first-child {
  display: grid;
  gap: 2px;
}

.org-class-table td:first-child small {
  color: var(--muted);
}

.org-tree-panel,
.org-detail-panel {
  min-width: 0;
}

.org-tree {
  display: grid;
  gap: 10px;
  max-height: 640px;
  overflow: auto;
  padding-right: 2px;
}

.org-grade {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.org-grade-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.org-grade-head strong {
  font-weight: 500;
}

.org-grade-head span,
.org-class-list p {
  color: var(--muted);
  font-size: 12px;
}

.org-class-list {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.org-class-list button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.org-class-list button:hover,
.org-class-list button.active {
  border-color: rgba(74,111,165,.18);
  background: rgba(74,111,165,.08);
}

.org-class-list span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.org-empty,
.org-empty-detail {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
}

.org-class-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.org-class-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.org-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.org-detail-stats span {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-soft);
}

.org-detail-stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
}

.org-student-table {
  max-height: 340px;
}

.org-maintain,
.org-admin-forms details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.92);
}

.org-maintain {
  margin-top: 12px;
}

.org-maintain summary,
.org-admin-forms summary {
  cursor: pointer;
  padding: 12px;
  color: var(--ink);
  font-weight: 500;
}

.org-maintain form,
.org-admin-forms form {
  padding: 0 12px 12px;
}

.org-admin-forms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.compact-head {
  min-height: 40px;
  margin-bottom: 10px;
  align-items: center;
}

.compact-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.compact-head p:not(.eyebrow) {
  max-width: 720px;
  font-size: 13px;
}

.panel,
.card,
.measure-card,
.student-paper,
.student-login-card,
.student-login-hero {
  padding: 12px;
  box-shadow: 0 8px 20px rgba(31,41,51,.075);
}

.panel h3,
.card h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.3;
}

.grid,
.hero-grid {
  gap: 12px;
}

.table-wrap {
  max-width: 100%;
}

table {
  min-width: 680px;
}

th,
td {
  padding: 9px 10px;
  font-size: 13px;
}

.field {
  gap: 5px;
}

.field input,
.field select,
.field textarea {
  min-height: 36px;
  padding: 7px 9px;
}

.form-grid {
  gap: 10px;
}

.ops-board {
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) repeat(4, minmax(118px, .65fr));
  gap: 10px;
}

.ops-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ops-hero h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.stat-card {
  min-height: 92px;
  display: grid;
  align-content: center;
}

.stat-card i {
  width: 26px;
  height: 26px;
  margin-bottom: 5px;
  border-radius: 8px;
}

.mini-stat strong,
.stat-number {
  font-size: 23px;
  line-height: 1.15;
}

.compact-list {
  display: grid;
  gap: 7px;
  max-height: 252px;
  overflow: auto;
}

.compact-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 50px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
}

.compact-list strong,
.compact-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-list span {
  color: var(--muted);
  font-size: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.panel-head h3 {
  margin: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.rank-screen {
  min-height: calc(100vh - 118px);
  padding: 10px;
  border: 1px solid rgba(216,222,232,.82);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(74,111,165,.10), transparent 28%),
    linear-gradient(180deg, #FFFFFF, #F3F6FA);
  box-shadow: 0 18px 36px rgba(31,41,51,.10);
}

.rank-screen .h5-screen-head {
  min-height: 48px;
  padding: 0 2px;
}

.rank-screen .h5-screen-head h2 {
  font-size: 20px;
}

.rank-kpis {
  gap: 8px;
}

.rank-kpis article {
  min-height: 64px;
  padding: 9px 10px;
}

.rank-kpis strong {
  font-size: 22px;
}

.rank-grid {
  gap: 8px;
}

.span-5 {
  grid-column: span 5;
}

.rank-card {
  min-height: 226px;
  padding: 9px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(31,41,51,.09);
}

.rank-card::after,
.rank-kpis article::after {
  inset: auto 8px -6px 8px;
  height: 9px;
  opacity: .72;
}

.h5-card-title {
  margin-bottom: 7px;
}

.h5-card-title h3 {
  font-size: 15px;
}

.rank-list {
  max-height: 268px;
  gap: 6px;
}

.rank-row,
.warning-rank .rank-row {
  min-height: 38px;
  grid-template-columns: 30px minmax(96px, 1.1fr) minmax(118px, 1.45fr) 58px 44px;
  gap: 7px;
  padding: 6px 7px;
  border-radius: 10px;
  background: linear-gradient(180deg, #FFFFFF, #F6F8FB);
}

.rank-row em {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 11px;
}

.rank-row strong {
  justify-self: end;
}

.rank-action {
  justify-self: end;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--blue) !important;
  background: rgba(74,111,165,.09);
}

.screen-feed-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.screen-feed-row button {
  min-height: 54px;
}

.task-console {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 12px;
}

.task-side {
  display: grid;
  align-content: start;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: 12px;
}

.review-main .table-wrap {
  max-height: 520px;
}

.mini-dashboard {
  display: grid;
  gap: 8px;
}

.mini-dashboard p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.mini-dashboard strong {
  color: var(--blue);
  font-size: 24px;
  font-weight: 500;
}

.compact-steps {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.compact-steps span {
  padding: 9px 10px;
  border-left: 3px solid var(--blue);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(74,111,165,.08);
}

.roster-layout {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.roster-list .table-wrap,
.review-main .table-wrap {
  overflow: auto;
}

.compact-admin .panel {
  min-height: 0;
}

.grade-strip {
  max-height: 360px;
  overflow: auto;
}

.grade-card {
  min-height: 132px;
}

.org-metrics {
  gap: 6px;
  margin: 8px 0;
}

.org-metrics span {
  min-height: 46px;
  font-size: 12px;
}

.org-metrics strong {
  font-size: 18px;
}

.task-roster-preview {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(74,111,165,.16);
  border-radius: 12px;
  background: rgba(74,111,165,.07);
}

.task-roster-preview span,
.task-roster-preview small {
  color: var(--muted);
  font-size: 12px;
}

.task-roster-preview strong {
  color: var(--blue);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 500;
}

.task-detail-panel {
  margin-top: 14px;
}

.task-detail-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.task-detail-kpis article {
  padding: 12px;
  border: 1px solid rgba(216,222,232,.78);
  border-radius: 12px;
  background: var(--surface-soft);
}

.task-detail-kpis strong {
  display: block;
  color: var(--blue);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
}

.task-detail-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.archive-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.archive-student-list {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 122px);
  overflow: hidden;
}

.archive-search {
  margin: 10px 0;
}

.archive-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 235px);
  overflow: auto;
  padding-right: 2px;
}

.archive-student {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(216, 222, 232, .82);
  border-radius: 12px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.archive-student:hover,
.archive-student.active {
  border-color: rgba(74, 111, 165, .34);
  background: rgba(74, 111, 165, .07);
  transform: translateY(-1px);
}

.archive-student strong,
.archive-student span {
  min-width: 0;
}

.archive-student span {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
}

.archive-report {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.archive-profile {
  grid-column: 1 / -1;
}

.archive-card {
  min-height: 230px;
}

.intervention-form {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(74, 111, 165, .14);
  border-radius: 12px;
  background: rgba(74, 111, 165, .05);
}

.report-preview {
  grid-column: 1 / -1;
}

.archive-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.report-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-fields p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(216,222,232,.78);
  border-radius: 12px;
  background: var(--surface-soft);
}

.report-fields strong {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}

.report-fields span {
  color: var(--ink);
  line-height: 1.45;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
}

.timeline {
  max-height: 246px;
  overflow: auto;
  gap: 8px;
}

.timeline-item {
  padding: 9px;
  border-radius: 10px;
}

.backend-note {
  margin-top: 10px;
  padding: 10px;
}

@media (max-width: 1366px) {
  .shell {
    max-width: 1328px;
    grid-template-columns: 220px minmax(0, 1fr);
    padding-left: 14px;
    padding-right: 14px;
  }

  .rank-row,
  .warning-rank .rank-row {
    grid-template-columns: 28px minmax(82px, 1fr) minmax(92px, 1.25fr) 52px 38px;
  }

  .rank-card {
    min-height: 212px;
  }

  .rank-list {
    max-height: 246px;
  }

  th,
  td {
    padding: 8px;
  }
}

@media (max-width: 1180px) {
  .ops-board,
  .task-console,
  .review-layout,
  .roster-layout {
    grid-template-columns: 1fr;
  }

  .org-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-action-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .archive-summary-grid,
  .report-fields,
  .task-detail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-5 {
    grid-column: span 4;
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .footer-note,
  .footer-brand,
  .footer-links,
  .footer-record {
    justify-content: center;
    text-align: center;
  }

  .footer-note {
    flex-direction: column;
    gap: 10px;
  }

  .footer-brand {
    min-width: 0;
  }

  .legal-top {
    flex-direction: column;
    align-items: stretch;
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-tabs {
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 16px;
  }

  .legal-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .legal-hero h1 {
    font-size: 28px;
  }

  .legal-document {
    grid-template-columns: 1fr;
  }

  .legal-document article,
  .legal-document article:nth-child(1),
  .legal-document article:nth-child(2) {
    border-top: 1px solid rgba(74, 111, 165, 0.10);
    border-right: 0;
  }

  .legal-document article:first-child {
    border-top: 0;
  }

  .org-kpis,
  .org-guide {
    grid-template-columns: 1fr;
  }

  .org-import-actions {
    justify-content: flex-start;
  }

  .archive-layout,
  .archive-report {
    grid-template-columns: 1fr;
  }

  .archive-student-list {
    position: static;
    max-height: none;
  }

  .archive-list {
    max-height: 320px;
  }

  .archive-summary-grid,
  .report-fields,
  .task-detail-kpis {
    grid-template-columns: 1fr;
  }

  .rank-row,
  .warning-rank .rank-row {
    grid-template-columns: 28px minmax(0, 1fr) 50px;
  }

  .rank-action {
    display: none !important;
  }

  .archive-card {
    grid-column: span 12;
  }
}

/* Calm visual screen: less text, more breathing room */
.calm-screen {
  min-height: calc(100vh - 118px);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 82% 8%, rgba(106,153,78,.13), transparent 24%),
    linear-gradient(145deg, rgba(74,111,165,.08), transparent 36%),
    #F8FAFC;
  box-shadow: none;
  perspective: none;
}

.calm-screen .h5-screen-bg {
  display: none;
}

.calm-head {
  min-height: 54px;
  margin: 0;
  padding: 0;
}

.calm-head h2 {
  margin: 0;
  font-size: 25px !important;
  line-height: 1.25;
}

.calm-head p {
  margin-top: 3px;
  font-size: 13px;
}

.calm-screen .btn.ghost {
  min-height: 36px;
  border-color: rgba(74,111,165,.14);
  background: rgba(255,255,255,.78);
  box-shadow: 0 8px 18px rgba(31,41,51,.045);
}

.calm-hero {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(0, 1fr);
  gap: 16px;
}

.calm-ring-card,
.calm-kpis article,
.calm-card {
  border: 1px solid rgba(216,222,232,.76);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 28px rgba(31,41,51,.055);
  animation: subtleIn 260ms ease both;
}

.calm-ring-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
}

.calm-ring-card h3 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.3;
}

.calm-ring-card p {
  margin: 0;
  font-size: 14px;
}

.calm-ring {
  width: 164px;
  height: 164px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 55%, transparent 56%),
    conic-gradient(var(--blue) var(--rate), #E7EDF4 0);
  box-shadow: inset 0 0 0 1px rgba(74,111,165,.08), 0 14px 28px rgba(74,111,165,.14);
}

.calm-ring span,
.calm-ring small {
  grid-area: 1 / 1;
}

.calm-ring span {
  color: var(--blue);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
}

.calm-ring small {
  align-self: end;
  margin-bottom: 44px;
  color: var(--muted);
  font-size: 12px;
}

.calm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.calm-kpis article {
  min-height: 190px;
  display: grid;
  align-content: center;
  padding: 18px;
}

.calm-kpis span,
.calm-kpis small {
  color: var(--muted);
}

.calm-kpis span {
  font-size: 13px;
}

.calm-kpis strong {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
}

.calm-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.calm-card {
  min-height: 236px;
  padding: 16px;
}

.calm-card:hover,
.calm-kpis article:hover,
.calm-ring-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(31,41,51,.075);
}

.calm-card::after,
.calm-kpis article::after {
  display: none;
}

.calm-card .h5-card-title {
  margin-bottom: 14px;
}

.calm-card .h5-card-title h3 {
  font-size: 17px;
}

.calm-risk,
.calm-grade,
.calm-task {
  grid-column: span 4;
}

.calm-class,
.calm-warning,
.calm-feed {
  grid-column: span 4;
}

.visual-dots {
  min-height: 158px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.visual-dot {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.visual-dot i {
  width: var(--size);
  height: var(--size);
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 10px 18px rgba(106,153,78,.14);
}

.visual-dot.dot-2 i {
  background: var(--warning);
  box-shadow: 0 10px 18px rgba(165,111,63,.14);
}

.visual-dot.dot-3 i,
.visual-dot.dot-4 i {
  background: var(--danger);
  box-shadow: 0 10px 18px rgba(165,74,74,.14);
}

.visual-dot span {
  color: var(--muted);
  font-size: 12px;
}

.visual-dot strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
}

.visual-dot small {
  color: var(--muted);
  font-size: 12px;
}

.visual-bars {
  display: grid;
  gap: 12px;
}

.visual-bar {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) minmax(118px, 1.2fr) 50px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.visual-bar span {
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-bar em {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  font-style: normal;
  font-size: 11px;
  background: rgba(74,111,165,.10);
}

.visual-bar i {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #E9EEF4;
}

.visual-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), rgba(74,111,165,.72));
  animation: loadWidth 760ms ease both;
}

.soft-bars .visual-bar b {
  background: linear-gradient(90deg, var(--green), rgba(106,153,78,.72));
}

.visual-bar strong {
  justify-self: end;
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.visual-bar.active em,
.visual-bar:hover em {
  color: #fff;
  background: var(--blue);
}

.visual-people {
  display: grid;
  gap: 10px;
}

.visual-people button,
.calm-feed .screen-feed-row button {
  min-height: 58px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  text-align: left;
  background: #F6F8FB;
  box-shadow: none;
}

.visual-people button:hover,
.calm-feed .screen-feed-row button:hover,
.visual-bar:hover {
  transform: translateY(-1px);
}

.visual-people span,
.calm-feed .screen-feed-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calm-feed .screen-feed-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cockpit-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px auto;
  gap: 18px;
  align-items: center;
  margin-top: 12px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(74,111,165,.10), rgba(106,153,78,.08)),
    #fff;
}

.cockpit-entry h3 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.cockpit-entry p {
  margin: 0;
}

.entry-mini-chart {
  height: 78px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}

.entry-mini-chart i {
  display: block;
  min-height: 10px;
  border-radius: 999px 999px 6px 6px;
  background: var(--blue);
}

.entry-mini-chart i:nth-child(2) {
  background: var(--green);
}

.entry-mini-chart i:nth-child(3) {
  background: var(--warning);
}

.group-dashboard {
  min-height: calc(100vh - 118px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 85% 8%, rgba(106,153,78,.12), transparent 22%),
    radial-gradient(circle at 18% 0%, rgba(74,111,165,.12), transparent 26%),
    #F8FAFC;
}

.group-dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.group-dashboard-head h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.25;
}

.group-dashboard-head p {
  margin: 3px 0 0;
}

.cockpit-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.cockpit-kpis article,
.cockpit-card {
  border: 1px solid rgba(216,222,232,.76);
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 12px 28px rgba(31,41,51,.052);
}

.cockpit-kpis article {
  min-height: 92px;
  display: grid;
  align-content: center;
  padding: 14px;
}

.cockpit-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.cockpit-kpis strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

.cockpit-kpis .primary strong {
  color: var(--blue);
}

.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.cockpit-card {
  min-height: 248px;
  padding: 16px;
  overflow: hidden;
}

.cockpit-progress {
  grid-column: span 3;
}

.cockpit-risk,
.cockpit-grade {
  grid-column: span 3;
}

.cockpit-class-matrix {
  grid-column: span 6;
  min-height: 306px;
}

.cockpit-dimensions {
  grid-column: span 5;
  min-height: 292px;
}

.cockpit-tasks {
  grid-column: span 5;
  min-height: 292px;
}

.cockpit-feed {
  grid-column: span 2;
  min-height: 292px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
}

.card-title h3 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cockpit-ring {
  width: min(190px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 16px auto 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 56%, transparent 57%),
    conic-gradient(var(--blue) var(--rate), #E6ECF3 0);
  box-shadow: inset 0 0 0 1px rgba(74,111,165,.08), 0 14px 26px rgba(74,111,165,.13);
}

.cockpit-ring strong,
.cockpit-ring span {
  grid-area: 1 / 1;
}

.cockpit-ring strong {
  color: var(--blue);
  font-size: 38px;
  font-weight: 500;
}

.cockpit-ring span {
  align-self: end;
  margin-bottom: 44px;
  color: var(--muted);
  font-size: 12px;
}

.risk-stack {
  height: 34px;
  display: flex;
  overflow: hidden;
  margin: 22px 0 18px;
  border-radius: 999px;
  background: #E8EEF4;
}

.risk-stack i {
  display: block;
  min-width: 3px;
}

.risk-stack .untested,
.risk-legend .untested {
  background: #CBD5E1;
}

.risk-stack .low,
.risk-legend .low {
  background: var(--green);
}

.risk-stack .mid,
.risk-legend .mid {
  background: var(--warning);
}

.risk-stack .high,
.risk-legend .high {
  background: #B88967;
}

.risk-stack .crisis,
.risk-legend .crisis {
  background: var(--danger);
}

.risk-legend {
  display: grid;
  gap: 10px;
}

.risk-legend span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.risk-legend span {
  min-width: 0;
}

.risk-legend span > :nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.risk-legend strong {
  color: var(--ink);
  font-weight: 500;
}

.grade-bar-chart {
  display: grid;
  gap: 10px;
  max-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.grade-bar-row {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.grade-bar-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-bar-row i {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #E8EEF4;
}

.grade-bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), rgba(74,111,165,.62));
  animation: loadWidth 560ms ease both;
}

.grade-bar-row strong {
  justify-self: end;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.grade-bar-row.active b,
.grade-bar-row:hover b {
  background: linear-gradient(90deg, var(--green), rgba(106,153,78,.62));
}

.class-matrix {
  display: grid;
  gap: 10px;
  max-height: 232px;
  overflow: auto;
  padding-right: 2px;
}

.matrix-group {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.matrix-group > span {
  color: var(--muted);
  font-size: 12px;
}

.matrix-group > div {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 7px;
}

.matrix-cell {
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  text-align: center;
  background: #EEF3F7;
}

.matrix-cell strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-cell small {
  color: var(--muted);
  font-size: 11px;
}

.matrix-cell.ok {
  background: rgba(106,153,78,.15);
  border-color: rgba(106,153,78,.20);
}

.matrix-cell.pending {
  background: rgba(74,111,165,.12);
  border-color: rgba(74,111,165,.18);
}

.matrix-cell.attention {
  background: rgba(184,137,103,.18);
  border-color: rgba(184,137,103,.24);
}

.matrix-cell.crisis {
  background: rgba(165,74,74,.16);
  border-color: rgba(165,74,74,.24);
}

.dimension-bubbles {
  min-height: 218px;
  max-height: 230px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: center;
  align-items: center;
  justify-content: center;
}

.dimension-bubble {
  width: var(--size);
  height: var(--size);
  min-width: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 50%;
  text-align: center;
  background: rgba(74,111,165,.12);
  box-shadow: inset 0 0 0 1px rgba(74,111,165,.08);
}

.dimension-bubble:nth-child(2n) {
  background: rgba(106,153,78,.14);
}

.dimension-bubble:nth-child(3n) {
  background: rgba(184,137,103,.14);
}

.dimension-bubble strong {
  max-width: 78px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dimension-bubble span {
  color: var(--blue);
  font-size: 18px;
  font-weight: 500;
}

.task-cards {
  display: grid;
  gap: 8px;
  max-height: 222px;
  overflow: auto;
  padding-right: 2px;
}

.task-cards button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(216,222,232,.72);
  border-radius: 12px;
  color: var(--ink);
  text-align: left;
  background: #F8FAFC;
}

.task-cards button.behind {
  background: rgba(184,137,103,.11);
}

.task-cards span,
.task-cards small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-cards strong {
  color: var(--blue);
  font-size: 18px;
  font-weight: 500;
}

.task-cards i {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #E8EEF4;
}

.task-cards b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.feed-chips {
  display: grid;
  gap: 10px;
}

.feed-chips button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  text-align: left;
  background: #F6F8FB;
}

.feed-chips strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes loadHeight {
  from { height: 6px; opacity: .45; }
  to { opacity: 1; }
}

@media (max-width: 1366px) {
  .calm-screen {
    padding: 14px;
    gap: 12px;
  }

  .calm-ring-card,
  .calm-kpis article {
    min-height: 160px;
  }

  .calm-ring-card {
    grid-template-columns: 146px minmax(0, 1fr);
    gap: 16px;
  }

  .calm-ring {
    width: 138px;
    height: 138px;
  }

  .calm-ring span,
  .calm-kpis strong {
    font-size: 32px;
  }

  .calm-card {
    min-height: 214px;
  }

  .group-dashboard {
    padding: 14px;
    gap: 12px;
  }

  .cockpit-card {
    min-height: 218px;
  }

  .cockpit-ring {
    width: 154px;
  }

  .cockpit-ring strong {
    font-size: 32px;
  }
}

@media (max-width: 1180px) {
  .calm-hero {
    grid-template-columns: 1fr;
  }

  .calm-risk,
  .calm-grade,
  .calm-task,
  .calm-class,
  .calm-warning,
  .calm-feed {
    grid-column: span 6;
  }

  .cockpit-progress,
  .cockpit-risk,
  .cockpit-grade,
  .cockpit-tasks,
  .cockpit-dimensions,
  .cockpit-feed {
    grid-column: span 6;
  }

  .cockpit-class-matrix {
    grid-column: span 12;
  }

  .cockpit-entry {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .entry-mini-chart {
    display: none;
  }
}

@media (max-width: 820px) {
  .calm-kpis,
  .calm-grid,
  .visual-dots,
  .calm-feed .screen-feed-row {
    grid-template-columns: 1fr;
  }

  .calm-ring-card {
    grid-template-columns: 1fr;
  }

  .calm-risk,
  .calm-grade,
  .calm-task,
  .calm-class,
  .calm-warning,
  .calm-feed {
    grid-column: auto;
  }

  .visual-bar {
    grid-template-columns: 1fr 54px;
  }

  .visual-bar i {
    grid-column: 1 / -1;
  }

  .group-dashboard-head,
  .cockpit-entry {
    grid-template-columns: 1fr;
    display: grid;
  }

  .cockpit-kpis,
  .cockpit-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-progress,
  .cockpit-risk,
  .cockpit-grade,
  .cockpit-tasks,
  .cockpit-class-matrix,
  .cockpit-dimensions,
  .cockpit-feed {
    grid-column: auto;
  }

  .matrix-group {
    grid-template-columns: 1fr;
  }
}
