#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 50; background: #fff6cc; padding: 0.7rem 1rem; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

:root {
  --teal: #25797c;
  --teal-dark: #1a5c5f;
  --ink: #173033;
  --muted: #5d6f72;
  --paper: #f7f4ee;
  --white: #ffffff;
  --line: #e4ddd2;
  --sand: #efe7da;
  --gold: #c9852a;
  --danger: #9d2c2c;
  --ok: #1f7a4d;
  --admin: #886ab5;
  --admin-ink: #241c33;
  --sidebar: #1d2430;
  --header: 4.25rem;
  --sidebar-width: 16.25rem;
  --sheet: 1120px;
  --radius: 20px;
  --shadow: 0 18px 40px rgba(23, 48, 51, 0.08);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }
body.u-body img { max-width: none; display: unset; }

.ps-header, .ps-hero, .ps-section, .ps-footer { width: min(var(--sheet), calc(100% - 2rem)); margin-inline: auto; }
.ps-header { position: relative; display: flex; align-items: center; gap: 1.5rem; min-height: 4.5rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.brand-mark { width: 4.6rem; height: 1.7rem; object-fit: contain; background: #fff; border-radius: 0.35rem; display: block; }
.ps-nav { display: flex; gap: 1.1rem; margin-left: auto; align-items: center; }
.ps-nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.ps-nav a:hover { color: var(--teal-dark); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label { display: none; margin-left: auto; font-weight: 700; cursor: pointer; }

.ps-btn, .ps-btn-ghost, .ps-btn-line {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0.7rem 1.3rem; border-radius: 999px;
  text-decoration: none; border: 0; cursor: pointer; font-weight: 700; letter-spacing: 0.04em;
}
.ps-btn { background: white; color: var(--teal-dark); }
.ps-btn.solid, .ps-btn-solid { background: var(--teal); color: white; }
.ps-btn-ghost { background: transparent; color: white; border: 2px solid rgba(255,255,255,.7); }
.ps-btn-line { background: transparent; color: var(--teal-dark); border-bottom: 2px solid var(--teal); border-radius: 0; padding-inline: 0; }

.ps-hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem;
  min-height: 38rem; align-items: end; padding: 2rem 0 3rem;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600; color: var(--teal); margin: 0 0 0.8rem; }
.ps-hero h1, .ps-section h2, .login-card h1, .page-head h1 { font-weight: 560; letter-spacing: -0.03em; line-height: 1.05; }
.ps-hero h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); margin: 0; max-width: 12ch; }
.lede { font-size: 1.15rem; line-height: 1.7; color: var(--muted); max-width: 38rem; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-panel {
  background: linear-gradient(160deg, var(--teal) 0%, #143f41 100%);
  color: white; border-radius: 28px; padding: 1.6rem; min-height: 28rem;
  display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow);
}
.hero-panel strong { font-size: 2rem; display: block; }
.hero-panel p { margin: 0.3rem 0 0; opacity: 0.9; }

.ps-section { padding: 3.5rem 0; }
.ps-section h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0 0 0.6rem; }
.band { background: var(--teal-dark); color: white; border-radius: var(--radius); padding: 2rem; }
.band .lede { color: rgba(255,255,255,.82); }
.card-grid, .steps, .people, .quotes, .grade-grid, .stat-grid { display: grid; gap: 1rem; }
.card-grid, .people { grid-template-columns: repeat(2, 1fr); }
.steps, .quotes, .stat-grid { grid-template-columns: repeat(4, 1fr); }
.grade-grid { grid-template-columns: repeat(4, 1fr); }
.ps-card, .person, .quote, .grade, .stat-card, .panel {
  background: white; border-radius: var(--radius); padding: 1.2rem 1.25rem; box-shadow: var(--shadow);
}
.step-no {
  width: 3rem; height: 3rem; border-radius: 50%; background: var(--teal); color: white;
  display: grid; place-items: center; font-weight: 700;
}
.person-top { display: flex; gap: 0.9rem; align-items: center; }
.avatar, .avatar-img {
  width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--sand);
  display: grid; place-items: center; font-weight: 700; color: var(--teal-dark); object-fit: cover;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.chips span, .pill { background: var(--sand); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.82rem; }
.quote p { font-size: 1.05rem; line-height: 1.6; }
.grade small, .muted { color: var(--muted); }
.ps-footer { padding: 2rem 0 3rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; }

.dialog-back { position: fixed; inset: 0; background: rgba(23, 48, 51, 0.55); display: grid; place-items: center; padding: 1rem; z-index: 30; }
.dialog {
  width: min(680px, 100%); max-height: min(90vh, 860px); overflow: auto;
  background: white; border-radius: 24px; padding: 1.4rem; box-shadow: var(--shadow);
}
.dialog h2 { margin-top: 0; }
.stack { display: grid; gap: 0.75rem; }
label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 0.8rem; background: white; color: var(--ink);
}
textarea { min-height: 7rem; resize: vertical; }
.choice-row, .split { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.choice { border: 1px solid var(--line); border-radius: 14px; padding: 0.7rem 0.8rem; background: white; cursor: pointer; text-align: left; }
.choice.active { border-color: var(--teal); background: #e7f3f3; }
.slot { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.error { color: var(--danger); margin: 0; }
.note { background: #fff6e8; border-radius: 12px; padding: 0.7rem 0.8rem; }

.app-wrap { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) 1fr; grid-template-rows: var(--header) 1fr; background: #f3f5f8; color: var(--admin-ink); }
.app-header {
  grid-column: 2; min-width: 0; display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
  background: white; border-bottom: 1px solid rgba(0,0,0,.07);
}
.app-sidebar {
  grid-row: 1 / span 2; background: var(--sidebar); color: #d5dbe6; padding: 1rem 0.8rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.app-sidebar a, .app-sidebar button.linkish {
  color: inherit; text-decoration: none; border: 0; background: transparent; text-align: left;
  padding: 0.7rem 0.8rem; border-radius: 10px; font-weight: 600; cursor: pointer;
}
.app-sidebar a.active, .app-sidebar a:hover { background: rgba(136, 106, 181, 0.25); color: white; }
.side-brand { color: white; padding: 0.4rem 0.8rem 1rem; display: flex; gap: 0.6rem; align-items: center; }
.app-body { min-width: 0; padding: 1.25rem; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; }
.page-head h1 { margin: 0; font-size: 1.8rem; }
.crumb { color: var(--muted); font-size: 0.85rem; }
.stat-card strong { display: block; font-size: 1.7rem; margin-top: 0.3rem; }
.stat-card span { color: #6b6280; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.panel h2 { margin: 0 0 0.8rem; font-size: 1.1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: #6b6280; }
.menu-btn { display: none; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at top, #2f8b8e, #102325 55%); }
.login-card { width: min(420px, 100%); background: rgba(12, 24, 28, 0.72); color: white; border-radius: 24px; padding: 1.6rem; }
.login-card p { color: rgba(255,255,255,.72); }
.login-card input { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.2); }
.login-card .ps-btn { width: 100%; background: var(--admin); color: white; }

@media (max-width: 1199px) {
  .ps-hero { min-height: 32rem; }
  .steps, .quotes, .grade-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
  .ps-hero, .card-grid, .people, .grade-grid { grid-template-columns: 1fr; }
  .ps-hero { min-height: 0; }
  .nav-toggle-label { display: inline-flex; }
  .ps-nav { display: none; position: absolute; top: 4.2rem; left: 1rem; right: 1rem; background: white; border-radius: 16px; padding: 0.8rem; flex-direction: column; align-items: flex-start; box-shadow: var(--shadow); }
  .ps-header:has(.nav-toggle:checked) .ps-nav { display: flex; }
  .app-wrap { grid-template-columns: 1fr; }
  .app-sidebar { display: none; grid-row: auto; }
  .app-wrap:has(#admin-nav:checked) .app-sidebar { display: flex; grid-column: 1; }
  .app-header { grid-column: 1; }
  .menu-btn { display: inline-flex; }
}

@media (max-width: 767px) {
  .steps, .quotes, .stat-grid, .grade-grid { grid-template-columns: 1fr; }
  .ps-header, .ps-hero, .ps-section, .ps-footer { width: min(100% - 1.25rem, var(--sheet)); }
  .ps-hero h1 { font-size: 2.4rem; }
  .page-head, .ps-footer, .slot, .split { flex-direction: column; align-items: stretch; }
  .hero-actions .ps-btn, .hero-actions .ps-btn-ghost { width: 100%; }
}
