:root {
  color-scheme: light;
  --ink: #112250;
  --slate: #3c507d;
  --steel: #64759c;
  --mist: #d9cbc2;
  --paper: #f5f0e9;
  --line: #d9cbc2;
  --white: #ffffff;
  --gold: #e0c58f;
  --green: #2f8f83;
  --danger: #a94442;
  --shadow: 0 16px 48px rgba(17, 34, 80, 0.14);
  --radius: 8px;
  --text: "Lato", "Segoe UI", Arial, sans-serif;
  --title: "Lora", Georgia, "Times New Roman", serif;
  --brand: "Cinzel", Georgia, serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(17, 34, 80, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 34, 80, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--text);
  overflow-x: hidden;
}

body.is-app-active {
  height: 100dvh;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-content: center;
  justify-items: center;
  min-height: 100vh;
  width: min(760px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0;
}

.auth-brand {
  display: grid;
  gap: 12px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.auth-brand .brand-logo-large {
  width: 86px;
  height: 86px;
  box-shadow: 0 18px 42px rgba(17, 34, 80, 0.22);
}

.auth-brand h1 {
  margin: 0;
  font-family: var(--brand);
  font-size: clamp(2.15rem, 5vw, 3.85rem);
  letter-spacing: 0;
}

.auth-brand p {
  margin: 0;
  color: var(--slate);
  font-family: var(--title);
  font-size: clamp(1.05rem, 2vw, 1.55rem);
}

.auth-card,
.verify-card {
  display: grid;
  gap: 13px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  padding: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--slate);
  font-weight: 900;
}

.auth-tabs button.is-active {
  background: var(--ink);
  color: var(--gold);
}

.login-role-switch {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(100, 117, 156, 0.24);
  border-radius: var(--radius);
  background: rgba(245, 240, 233, 0.82);
}

.login-role-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--slate);
  font-size: 0.84rem;
  font-weight: 900;
}

.login-role-switch button.is-active {
  background: var(--ink);
  color: var(--gold);
  box-shadow: 0 8px 22px rgba(17, 34, 80, 0.16);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label,
.verify-card label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--slate);
  font-size: 0.82rem;
  font-weight: 900;
}

.auth-form input,
.auth-form select,
.verify-card input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--paper);
  color: var(--ink);
}

.auth-form select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--slate) 50%),
    linear-gradient(135deg, var(--slate) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 16px,
    calc(100% - 11px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.auth-form input:focus,
.auth-form select:focus,
.verify-card input:focus {
  border-color: var(--steel);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(125, 132, 145, 0.16);
}

.auth-form .checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0;
  font-weight: 800;
}

.auth-form .checkline input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin-top: 2px;
  border-radius: 3px;
  accent-color: var(--ink);
}

.privacy-consent {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 3px 5px;
  padding: 4px 0;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
}

.privacy-consent input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 2px 5px 0 0;
  padding: 0;
  accent-color: var(--ink);
}

.privacy-consent label {
  display: inline;
  margin: 0;
}

.privacy-consent a {
  color: var(--sapphire);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-consent a:hover,
.privacy-consent a:focus-visible {
  color: var(--ink);
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.email-verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.auth-actions {
  display: grid;
  gap: 8px;
}

.auth-card .send-button,
.auth-card .outline-button {
  min-height: 40px;
}

.inline-status {
  margin: 0;
  color: var(--steel);
  font-size: 0.8rem;
  line-height: 1.4;
}

.inline-status.is-ok {
  color: var(--green);
  font-weight: 900;
}

.inline-status.is-error {
  color: var(--danger);
  font-weight: 900;
}

.password-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  list-style: none;
}

.password-rules li {
  position: relative;
  padding-left: 22px;
  color: var(--steel);
  font-size: 0.78rem;
  line-height: 1.28;
}

.password-rules li[data-rule="match"] {
  grid-column: 1 / -1;
}

.password-rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--mist);
  border-radius: 50%;
  background: var(--white);
}

.password-rules li.is-ok {
  color: var(--green);
  font-weight: 900;
}

.password-rules li.is-ok::before {
  border-color: var(--green);
  background: var(--green);
}

.text-link {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--slate);
  font-size: 0.86rem;
  font-weight: 900;
}

.recovery-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(17, 34, 80, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 34, 80, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

.recovery-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
  width: min(920px, 100%);
  padding: 24px;
  border: 1px solid rgba(217, 203, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.recovery-brand {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 100%;
  padding: 20px;
  border: 1px solid rgba(224, 197, 143, 0.52);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--ink), var(--slate));
  color: var(--paper);
}

.recovery-brand strong {
  display: block;
  font-family: var(--brand);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.95;
}

.recovery-brand span {
  display: block;
  margin-top: 8px;
  color: rgba(245, 240, 233, 0.84);
  font-family: var(--title);
  font-size: 1.05rem;
}

.recovery-view {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.recovery-view h1 {
  margin: 0;
  font-family: var(--title);
  font-size: clamp(1.85rem, 4vw, 3.1rem);
  line-height: 1.06;
}

.recovery-view p {
  margin: 0;
  color: var(--slate);
  line-height: 1.55;
}

.recovery-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.recovery-choice-row .send-button,
.recovery-choice-row .outline-button {
  min-height: 58px;
}

.support-box {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(224, 197, 143, 0.72);
  border-radius: var(--radius);
  background: #fffaf3;
  color: var(--ink);
}

.support-box span {
  color: var(--slate);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.support-box strong {
  font-family: var(--title);
  font-size: clamp(1.5rem, 4vw, 2.35rem);
}

.support-box small {
  color: var(--steel);
  line-height: 1.45;
}

.verify-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.verify-dialog::backdrop {
  background: rgba(26, 29, 41, 0.55);
  backdrop-filter: blur(4px);
}

.verify-card h2 {
  margin: 0;
  font-family: var(--title);
}

.verify-card p {
  margin: 0;
  color: var(--slate);
  line-height: 1.5;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  height: 100dvh;
  max-width: 100vw;
  overflow: hidden;
}

.rail {
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  height: 100vh;
  padding: 18px 12px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 8px 0 28px rgba(17, 34, 80, 0.24);
}

.rail-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(224, 197, 143, 0.42);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.brand-logo,
.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(224, 197, 143, 0.46);
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  object-fit: cover;
}

.rail-logo .brand-logo {
  width: 48px;
  height: 48px;
}

.rail-action {
  color: var(--mist);
}

.rail-action:hover,
.rail-action.is-active {
  background: rgba(224, 197, 143, 0.14);
  color: var(--gold);
  transform: translateY(-1px);
}

.rail-bottom {
  margin-top: auto;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  height: 100dvh;
  max-width: 100%;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 233, 0.9);
  backdrop-filter: blur(18px);
}

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

.brand .brand-mark {
  flex: 0 0 auto;
  background: var(--ink);
}

.brand .brand-logo {
  flex: 0 0 auto;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-family: var(--brand);
  font-size: clamp(1rem, 1.6vw, 1.45rem);
}

.brand-copy small,
.status-pill,
.session-pill,
.eyebrow,
.timeline small,
.drop-zone small,
.summary-label {
  color: var(--steel);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill,
.session-pill,
.terminal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.85rem;
  white-space: nowrap;
}

.session-pill {
  color: var(--slate);
  font-weight: 800;
}

.pulse-dot,
.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(47, 143, 131, 0.38);
  animation: pulse 1.8s ease-out infinite;
}

.terminal-dot {
  background: var(--gold);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: currentColor;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.topbar .icon-button,
.composer .icon-button {
  border-color: var(--line);
  background: var(--white);
  color: var(--slate);
}

.menu-toggle {
  display: none;
}

.intake-toggle {
  display: inline-grid;
  flex: 0 0 auto;
}

.intake-toggle.is-active {
  border-color: rgba(224, 197, 143, 0.8);
  background: var(--ink);
  color: var(--gold);
}

.workbench {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 1460px;
  margin: 0 auto;
  padding: 14px;
  overflow: hidden;
  transition: grid-template-columns 260ms ease, gap 260ms ease;
}

.workbench > * {
  min-width: 0;
}

.workbench.is-intake-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 260px;
  gap: 14px;
}

.workbench.is-intake-collapsed .intake-panel {
  min-width: 0;
  padding-inline: 0;
  border-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
}

.complaint-view {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  background: var(--white);
}

.followups-view {
  display: grid;
  align-content: start;
  gap: 18px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.followups-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(224, 197, 143, 0.45);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--ink), var(--slate));
  color: var(--paper);
  box-shadow: var(--shadow);
}

.followups-hero .eyebrow {
  color: var(--gold);
}

.followups-hero h1 {
  margin: 4px 0 8px;
  font-family: var(--title);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.followups-hero p {
  max-width: 740px;
  margin: 0;
  color: rgba(245, 240, 233, 0.84);
  line-height: 1.45;
}

.followups-hero .outline-button {
  border-color: rgba(224, 197, 143, 0.55);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

.followups-board {
  display: grid;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.complaint-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px clamp(24px, 6vw, 86px);
  background:
    linear-gradient(135deg, rgba(17, 34, 80, 0.94), rgba(60, 80, 125, 0.88)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 34px);
  color: var(--paper);
}

.complaint-hero .eyebrow {
  color: var(--gold);
}

.complaint-hero h1 {
  margin: 4px 0 8px;
  font-family: var(--title);
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.complaint-hero p {
  max-width: 760px;
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.4;
}

.complaint-hero .outline-button {
  flex: 0 0 auto;
  border-color: rgba(224, 197, 143, 0.52);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

.complaint-form {
  display: grid;
  gap: 28px;
  width: min(1180px, calc(100vw - 48px));
  margin: 34px auto 56px;
}

.privacy-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px 22px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
}

.privacy-strip .checkline {
  color: var(--paper);
  font-weight: 900;
}

.privacy-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #00b050;
  border-radius: 50%;
  color: #00b050;
  font-weight: 900;
}

.complaint-section {
  display: grid;
  gap: 22px;
  padding: 28px 14px;
  border-top: 6px solid var(--gold);
  background: var(--white);
}

.complaint-section h2 {
  margin: 0;
  font-family: var(--title);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.section-kicker {
  color: var(--slate);
  font-weight: 900;
  text-transform: uppercase;
}

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

.complaint-grid label,
.complaint-form .complaint-radio-row,
.complaint-form .anonymous-line {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.complaint-grid input,
.complaint-grid select,
.complaint-grid textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid #b7bbc4;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.complaint-grid input,
.complaint-grid select {
  min-height: 38px;
}

.complaint-grid textarea {
  min-height: 132px;
  padding: 10px 0;
  border: 1px solid #d7d9df;
  background: #fff;
  resize: vertical;
}

.complaint-grid input:focus,
.complaint-grid select:focus,
.complaint-grid textarea:focus {
  border-color: #d7942d;
  box-shadow: 0 2px 0 #d7942d;
}

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

.evidence-section {
  padding: 42px 14px;
  background: #f3f5fb;
  border-top-color: transparent;
}

.complaint-upload-grid {
  display: grid;
  gap: 22px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.complaint-upload {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 110px;
  padding: 24px 28px;
  border: 1px solid #e3e6ec;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 14px 36px rgba(17, 34, 80, 0.08);
  font-size: 1.05rem;
}

.complaint-upload input {
  display: none;
}

.upload-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  color: var(--danger);
  font-weight: 900;
}

.complaint-upload strong {
  justify-self: end;
  padding: 11px 16px;
  border: 1px solid #9f2241;
  border-radius: 4px;
  color: #9f2241;
  font-size: 0.95rem;
}

.complaint-files {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 8px;
  border-top: 1px solid #d7d9df;
  color: var(--ink);
  font-weight: 800;
}

.complaint-file-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
}

.complaint-file-pill span {
  color: var(--steel);
  font-size: 0.82rem;
}

.complaint-radio-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.complaint-radio-row label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 500;
}

.anonymous-line {
  display: flex !important;
}

.complaint-submit-row {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 20px 0 48px;
}

.complaint-submit {
  min-width: 180px;
  min-height: 46px;
  border: 0;
  border-radius: 4px;
  background: #9f2241;
  color: var(--white);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(159, 34, 65, 0.28);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  animation: rise 420ms ease both;
}

.intake-panel,
.process-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  transition: opacity 220ms ease, transform 220ms ease, padding 220ms ease, border-color 220ms ease;
}

.intake-panel {
  min-width: 0;
  overflow-x: hidden;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.panel-title {
  display: grid;
  gap: 4px;
}

.panel-title h2,
.chat-head h1 {
  margin: 0;
  font-family: var(--title);
}

.panel-title h2 {
  font-size: 1.12rem;
}

.eyebrow {
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.registry-card,
.evidence-card {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.registry-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  min-width: 0;
}

.segmented button {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--slate);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented button.is-active {
  background: var(--ink);
  color: var(--white);
}

.mode-note,
.form-alert {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--slate);
  font-size: 0.88rem;
  line-height: 1.45;
}

.form-alert {
  display: none;
  border-color: rgba(169, 68, 66, 0.28);
  background: rgba(169, 68, 66, 0.08);
  color: var(--danger);
}

.form-alert.is-visible {
  display: block;
}

.personal-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.personal-fields[hidden] {
  display: none;
}

.personal-fields label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--slate);
  font-size: 0.82rem;
  font-weight: 800;
}

.personal-fields input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--white);
}

.personal-fields input:focus,
.composer-input textarea:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(125, 132, 145, 0.16);
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--slate);
  font-size: 0.88rem;
  line-height: 1.4;
}

.checkline input {
  accent-color: var(--ink);
  margin-top: 2px;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 130px;
  padding: 14px;
  border: 1px dashed var(--steel);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf3, #f5f0e9);
  color: var(--ink);
  text-align: center;
  min-width: 0;
}

.drop-zone input {
  display: none;
}

.drop-zone strong {
  font-size: 1rem;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate);
}

.evidence-card.is-disabled {
  opacity: 0.62;
}

.evidence-card.is-disabled .drop-zone {
  border-style: solid;
  color: var(--steel);
}

.file-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

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

.file-item small {
  color: var(--steel);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--ink), var(--slate));
  color: var(--paper);
  min-width: 0;
}

.chat-head .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.chat-head > div:first-child {
  min-width: 0;
}

.chat-head h1 {
  font-size: clamp(1.2rem, 1.7vw, 1.58rem);
  overflow-wrap: anywhere;
}

.terminal-badge {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.message-stream {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 8%, rgba(224, 197, 143, 0.16), transparent 26%),
    linear-gradient(180deg, #fffaf3, #f5f0e9);
}

.message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  animation: messageIn 260ms ease both;
}

.user-message {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.user-message .avatar {
  grid-column: 2;
  background: var(--slate);
}

.user-message .bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  max-width: 780px;
  background: var(--ink);
  color: var(--paper);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
}

.bubble {
  max-width: 840px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 12px 30px rgba(26, 29, 41, 0.08);
  line-height: 1.55;
}

.bubble p {
  margin: 0;
}

.terminal-output {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 0.94rem;
  line-height: 1.62;
  letter-spacing: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 9px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(47, 143, 131, 0.12);
  color: #217368;
  font-size: 0.75rem;
  font-weight: 900;
}

.composer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--white);
  min-width: 0;
}

.composer.is-locked {
  background: #f0f2f5;
}

.composer-input textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-height: 150px;
  min-height: 44px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.35;
}

.send-button,
.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.send-button {
  border: 0;
  background: var(--ink);
  color: var(--gold);
}

.send-button:hover:not(:disabled),
.outline-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.send-button:disabled,
.outline-button:disabled {
  opacity: 0.55;
}

.outline-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--slate);
}

.full {
  width: 100%;
  max-width: 100%;
}

.case-summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.case-summary strong {
  font-size: 1rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-label {
  margin-top: 6px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.user-followups-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.compact-title {
  gap: 2px;
}

.compact-title h2 {
  font-size: 1.08rem;
}

.user-complaint-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.user-complaint-list-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.user-complaint-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.user-complaint-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.user-complaint-head strong,
.user-complaint-card small,
.user-followup-thread p {
  overflow-wrap: anywhere;
}

.user-complaint-card > small {
  color: var(--steel);
  font-weight: 800;
}

.user-followup-thread {
  display: grid;
  gap: 5px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(217, 203, 194, 0.82);
  border-radius: var(--radius);
  background: var(--paper);
}

.user-followup-thread p {
  margin: 0;
  color: var(--slate);
  font-size: 0.78rem;
  line-height: 1.38;
}

.user-complaint-card textarea {
  width: 100%;
  min-height: 62px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  resize: vertical;
  background: var(--paper);
  color: var(--ink);
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 0 0 18px 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--mist);
  border-radius: 50%;
  background: var(--white);
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 17px;
  width: 2px;
  height: calc(100% - 18px);
  background: var(--line);
}

.timeline li:last-child::after {
  display: none;
}

.timeline li.is-done::before {
  border-color: var(--green);
  background: var(--green);
}

.timeline li.is-active::before {
  border-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(185, 149, 70, 0.16);
}

.law-box {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
}

.law-box .eyebrow,
.law-box p {
  color: rgba(255, 255, 255, 0.72);
}

.law-box p {
  margin: 0;
  line-height: 1.45;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(270px, 370px) 1fr;
  pointer-events: none;
  visibility: hidden;
}

.drawer::after {
  content: "";
  background: rgba(26, 29, 41, 0.42);
  opacity: 0;
  transition: opacity 240ms ease;
}

.drawer-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  padding: 18px;
  background: var(--white);
  transform: translateX(-100%);
  transition: transform 240ms ease;
}

.drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.drawer.is-open::after {
  opacity: 1;
}

.drawer.is-open .drawer-panel {
  transform: translateX(0);
}

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

.drawer-nav {
  display: grid;
  gap: 8px;
}

.drawer-nav a {
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--slate);
  font-weight: 800;
}

.internal-access {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.internal-access strong {
  font-family: var(--title);
  font-size: 1.05rem;
}

.internal-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.staff-login-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.staff-workspace {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.staff-dashboard {
  display: grid;
  gap: 18px;
  width: min(1260px, 100%);
  margin: 0 auto;
}

.staff-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(224, 197, 143, 0.4);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--ink), var(--slate));
  color: var(--paper);
  box-shadow: var(--shadow);
}

.staff-hero .eyebrow {
  color: var(--gold);
}

.staff-hero h1,
.staff-panel h2 {
  margin: 0;
  font-family: var(--title);
}

.staff-hero h1 {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
}

.staff-hero p {
  max-width: 760px;
  margin: 8px 0 0;
  color: rgba(245, 240, 233, 0.82);
  line-height: 1.5;
}

.staff-hero .outline-button {
  border-color: rgba(224, 197, 143, 0.5);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

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

.metric-card,
.staff-panel,
.coordinator-card,
.complaint-case-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span,
.coordinator-card dt,
.complaint-case-card dt {
  color: var(--steel);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  overflow-wrap: anywhere;
  font-family: var(--title);
  font-size: 1.55rem;
}

.staff-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.coordinator-form {
  display: grid;
  gap: 14px;
}

.license-line {
  padding: 12px;
  border: 1px solid rgba(224, 197, 143, 0.6);
  border-radius: var(--radius);
  background: #fffaf3;
  color: var(--ink);
  font-weight: 900;
}

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

.staff-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--slate);
  font-size: 0.82rem;
  font-weight: 900;
}

.staff-form-grid input,
.staff-form-grid select,
.complaint-actions select,
.complaint-actions textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--paper);
  color: var(--ink);
}

.staff-form-grid input:focus,
.staff-form-grid select:focus,
.complaint-actions select:focus,
.complaint-actions textarea:focus {
  border-color: var(--steel);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(100, 117, 156, 0.14);
}

.staff-form-grid input[readonly] {
  border-color: rgba(100, 117, 156, 0.2);
  background: rgba(224, 197, 143, 0.14);
  color: var(--ink);
}

.dev-console-view {
  animation: rise 260ms ease both;
}

.coordinator-list,
.complaint-case-list {
  display: grid;
  gap: 12px;
}

.coordinator-board {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  min-height: 360px;
}

.complaint-case-list {
  max-height: calc(100dvh - 330px);
  min-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.status-filter-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.status-filter-bar button {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--slate);
  text-align: left;
  font-weight: 900;
}

.status-filter-bar button.is-active {
  border-color: rgba(224, 197, 143, 0.74);
  background: var(--ink);
  color: var(--gold);
}

.status-filter-bar button span,
.status-filter-bar button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordinator-board .status-filter-bar {
  grid-template-columns: 1fr;
  align-content: start;
  position: sticky;
  top: 0;
  max-height: calc(100dvh - 330px);
  overflow-y: auto;
}

.coordinator-board .status-filter-bar button {
  min-height: 66px;
  padding: 12px;
}

.coordinator-board .complaint-case-list {
  max-height: calc(100dvh - 330px);
}

.coordinator-card,
.complaint-case-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.coordinator-card {
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr);
}

.coordinator-card-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
}

.coordinator-card-actions .send-button,
.coordinator-card-actions .outline-button {
  min-height: 38px;
}

.coordinator-card h3,
.complaint-case-card h3 {
  margin: 8px 0 4px;
  font-family: var(--title);
}

.coordinator-card p,
.complaint-case-card p {
  margin: 0;
  color: var(--slate);
  line-height: 1.5;
}

.coordinator-card dl,
.complaint-case-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.coordinator-card dd,
.complaint-case-card dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(100, 117, 156, 0.28);
  border-radius: 999px;
  background: rgba(100, 117, 156, 0.12);
  color: var(--slate);
  font-size: 0.78rem;
  font-weight: 900;
}

.status-chip.is-active {
  border-color: rgba(47, 143, 131, 0.34);
  background: rgba(47, 143, 131, 0.12);
  color: #217368;
}

.status-chip.is-inactive {
  border-color: rgba(169, 68, 66, 0.32);
  background: rgba(169, 68, 66, 0.1);
  color: var(--danger);
}

.complaint-case-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.followup-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--steel);
}

.complaint-actions {
  display: grid;
  grid-template-columns: minmax(170px, 0.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.complaint-actions textarea {
  min-height: 70px;
  padding: 10px;
  resize: vertical;
}

.committee-case-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.committee-case-left {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(224, 197, 143, 0.55);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf3, var(--paper));
}

.committee-area {
  overflow-wrap: anywhere;
  font-family: var(--title);
  font-size: 1.1rem;
  font-weight: 900;
}

.committee-field {
  display: grid;
  gap: 4px;
}

.committee-field dt,
.committee-detail-grid label,
.committee-description,
.committee-evidence strong,
.committee-contact strong {
  color: var(--steel);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.committee-field dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.committee-status-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.committee-status-list strong {
  color: var(--ink);
}

.committee-status-list small {
  color: var(--steel);
  line-height: 1.4;
}

.committee-case-right {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.committee-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.committee-detail-grid label,
.committee-description {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.committee-detail-grid input,
.committee-description textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.committee-detail-grid input {
  min-height: 34px;
  padding: 0 2px;
}

.committee-description textarea {
  min-height: 104px;
  padding: 8px 2px;
  resize: vertical;
  line-height: 1.5;
}

.committee-evidence,
.committee-contact {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 240, 233, 0.66);
}

.committee-evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.committee-evidence-row span,
.committee-contact span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 800;
}

.committee-evidence-row small,
.committee-contact small {
  color: var(--steel);
  font-weight: 800;
}

.committee-evidence-unavailable {
  justify-self: end;
  text-align: right;
}

.committee-evidence-row .outline-button {
  min-height: 36px;
}

.stats-view {
  height: 100%;
  min-height: 0;
  overflow: auto;
  background: rgba(245, 240, 233, 0.42);
}

.stats-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 36px clamp(24px, 6vw, 86px);
  background:
    linear-gradient(135deg, rgba(17, 34, 80, 0.95), rgba(60, 80, 125, 0.9)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 34px);
  color: var(--paper);
}

.stats-hero .eyebrow {
  color: var(--gold);
}

.stats-hero h1 {
  margin: 4px 0 8px;
  font-family: var(--title);
  font-size: clamp(1.9rem, 4vw, 3.1rem);
}

.stats-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(245, 240, 233, 0.84);
  line-height: 1.45;
}

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

.stats-hero .outline-button {
  border-color: rgba(224, 197, 143, 0.55);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

.stats-board {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100vw - 48px));
  margin: 28px auto 56px;
  padding: 20px;
}

.staff-workspace .stats-board {
  width: 100%;
  margin: 0;
}

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

.stats-board-head h2,
.stats-chart-card h3,
.stats-side-card h3,
.stats-recent-card h3 {
  margin: 0;
  font-family: var(--title);
}

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

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 16px;
  min-width: 0;
}

.stats-chart-card,
.stats-side-card,
.stats-recent-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.stats-chart-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid rgba(217, 203, 194, 0.72);
  border-radius: var(--radius);
  background: var(--white);
}

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

.stats-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.stats-bar-row span,
.stats-mini-list span b,
.stats-recent-row span,
.stats-recent-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-bar-row span {
  color: var(--slate);
  font-weight: 900;
}

.stats-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100, 117, 156, 0.16);
}

.stats-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ink), var(--gold));
}

.stats-bar-row strong {
  font-family: var(--title);
}

.stats-side-card {
  align-content: start;
}

.stats-mini-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(217, 203, 194, 0.82);
  border-radius: var(--radius);
  background: var(--paper);
}

.stats-mini-list > strong {
  color: var(--ink);
}

.stats-mini-list span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--slate);
  font-size: 0.92rem;
}

.stats-mini-list em {
  font-style: normal;
  font-weight: 900;
}

.stats-mini-list small {
  color: var(--steel);
  font-weight: 800;
}

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

.stats-recent-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr) minmax(210px, 0.6fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(217, 203, 194, 0.82);
  border-radius: var(--radius);
  background: var(--paper);
}

.stats-recent-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--title);
}

.stats-recent-row span {
  color: var(--ink);
  font-weight: 900;
}

.stats-recent-row small {
  color: var(--steel);
  font-weight: 800;
}

.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--slate);
  font-weight: 800;
}

.law-box-primary {
  margin-top: 0;
  background: linear-gradient(145deg, var(--ink), var(--slate));
}

.stats-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.stats-chart-grid .stats-chart-card {
  align-content: start;
}

.stats-donut-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.stats-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: min(190px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
}

.stats-donut::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: var(--white);
}

.stats-donut > span {
  z-index: 1;
  display: grid;
  text-align: center;
}

.stats-donut strong {
  font-family: var(--title);
  font-size: 1.6rem;
}

.stats-donut small {
  color: var(--steel);
}

.stats-donut-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.stats-donut-legend span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

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

.stats-donut-legend b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--slate);
  font-size: 0.78rem;
}

.stats-donut-legend em {
  font-style: normal;
  font-weight: 900;
}

.stats-advice-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-left: 4px solid var(--gold);
  background: rgba(245, 240, 233, 0.78);
}

.stats-advice-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--slate);
  line-height: 1.55;
}

.stats-advice-list li::marker {
  color: var(--green);
}

.staff-shell.is-coordinator-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

.staff-shell.is-coordinator-shell .rail {
  align-items: stretch;
  gap: 10px;
  padding-inline: 12px;
}

.staff-shell.is-coordinator-shell .rail-logo,
.staff-shell.is-coordinator-shell .rail > .rail-action {
  align-self: center;
}

.coordinator-status-nav {
  display: grid;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0;
}

.coordinator-status-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(224, 197, 143, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 240, 233, 0.82);
  text-align: left;
  font-weight: 800;
}

.coordinator-status-button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.coordinator-status-button strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: rgba(224, 197, 143, 0.16);
  color: var(--gold);
}

.coordinator-status-button:hover,
.coordinator-status-button.is-active {
  border-color: rgba(224, 197, 143, 0.72);
  background: var(--gold);
  color: var(--ink);
}

.coordinator-status-button.is-active strong {
  background: var(--ink);
}

.staff-shell.is-coordinator-shell .staff-dashboard {
  width: 100%;
}

.staff-shell.is-coordinator-shell .coordinator-board {
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100dvh - 330px);
}

.staff-shell.is-coordinator-shell .complaint-case-list {
  max-height: calc(100dvh - 330px);
}

.server-monitor {
  gap: 24px;
}

.server-monitor-head,
.server-monitor-actions,
.server-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.server-monitor-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--steel);
  font-weight: 800;
}

.monitor-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.monitor-metric {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  background: var(--white);
}

.monitor-metric span,
.runtime-facts dt {
  color: var(--steel);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.monitor-metric strong {
  overflow-wrap: anywhere;
  font-family: var(--title);
  font-size: 1.7rem;
}

.monitor-metric small {
  overflow-wrap: anywhere;
  color: var(--slate);
}

.monitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.35fr);
  gap: 24px;
  min-width: 0;
}

.monitor-chart-section,
.runtime-facts,
.server-log-section {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.resource-chart {
  width: 100%;
  height: 270px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, rgba(245, 240, 233, 0.62));
}

.resource-chart-grid path {
  fill: none;
  stroke: rgba(100, 117, 156, 0.18);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.chart-line.is-cpu,
.chart-legend .is-cpu::before {
  stroke: #112250;
  background: #112250;
}

.chart-line.is-memory,
.chart-legend .is-memory::before {
  stroke: #2f8f83;
  background: #2f8f83;
}

.chart-line.is-storage,
.chart-legend .is-storage::before {
  stroke: #e0c58f;
  background: #e0c58f;
}

.chart-line.is-gpu,
.chart-legend .is-gpu::before {
  stroke: #a94442;
  background: #a94442;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--slate);
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend span::before {
  content: "";
  width: 24px;
  height: 4px;
}

.runtime-facts dl {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.runtime-facts dl div {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.runtime-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.server-log-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.server-log-toolbar label {
  display: grid;
  gap: 5px;
  margin-left: auto;
  color: var(--steel);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.server-log-toolbar select {
  min-width: 220px;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.server-log-output {
  max-height: 360px;
  min-height: 260px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(224, 197, 143, 0.34);
  background: #0b1633;
  color: #dbe8e5;
  font: 0.82rem/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(47, 143, 131, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 143, 131, 0);
  }
}

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

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

@media (min-width: 981px) and (max-height: 760px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: min(720px, calc(100vw - 64px));
    padding: 16px 0;
  }

  .auth-brand {
    gap: 10px;
  }

  .auth-brand .brand-logo-large {
    width: 48px;
    height: 48px;
  }

  .auth-brand h1 {
    font-size: clamp(2rem, 4.2vw, 3.25rem);
  }

  .auth-brand p {
    font-size: clamp(0.96rem, 1.5vw, 1.22rem);
  }

  .auth-card,
  .verify-card {
    gap: 10px;
    padding: 14px;
  }

  .auth-form {
    gap: 8px;
  }

  .auth-tabs button {
    min-height: 36px;
  }

  .auth-form input,
  .verify-card input {
    min-height: 36px;
  }

  .password-rules {
    gap: 4px 10px;
    padding: 8px 10px;
  }

  .password-rules li {
    font-size: 0.75rem;
  }
}

@media (max-width: 1180px) {
  .workbench {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
    align-content: start;
  }

  .process-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .workbench.is-intake-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

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

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

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

  .monitor-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body.is-app-active {
    height: auto;
    overflow: auto;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 28px 0;
  }

  .auth-brand {
    gap: 10px;
  }

  .recovery-card,
  .committee-case-grid,
  .committee-detail-grid,
  .coordinator-board {
    grid-template-columns: 1fr;
  }

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

  .email-verify-row {
    grid-template-columns: 1fr;
  }

  .workbench {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .workbench.is-intake-collapsed {
    grid-template-columns: 1fr;
  }

  .workbench.is-intake-collapsed .intake-panel {
    display: none;
  }

  .complaint-hero,
  .stats-hero {
    display: grid;
  }

  .followups-hero {
    display: grid;
    align-items: start;
  }

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

  .metric-grid,
  .stats-metric-grid,
  .stats-layout,
  .stats-chart-grid,
  .monitor-metric-grid,
  .stats-recent-row,
  .staff-form-grid,
  .coordinator-card,
  .coordinator-card dl,
  .complaint-case-card dl,
  .status-filter-bar,
  .complaint-actions {
    grid-template-columns: 1fr;
  }

  .coordinator-board .status-filter-bar,
  .coordinator-board .complaint-case-list {
    max-height: none;
    overflow: visible;
  }

  .staff-hero {
    display: grid;
    align-items: start;
  }

  .server-monitor-head,
  .server-log-toolbar {
    display: grid;
    align-items: start;
  }

  .server-log-toolbar label {
    margin-left: 0;
  }

  .stats-board {
    width: min(100%, calc(100vw - 28px));
    margin: 18px auto 36px;
    padding: 14px;
  }

  .stats-hero-actions {
    justify-content: flex-start;
  }

  .span-2 {
    grid-column: auto;
  }

  .intake-panel,
  .chat-panel,
  .process-panel {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .workspace {
    height: auto;
    overflow: visible;
  }

  .rail {
    display: none;
  }

  .staff-shell.is-coordinator-shell {
    grid-template-columns: 1fr;
  }

  .staff-shell.is-coordinator-shell .rail {
    position: sticky;
    top: 0;
    z-index: 7;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto;
    padding: 8px;
    overflow-x: auto;
  }

  .staff-shell.is-coordinator-shell .rail-logo,
  .staff-shell.is-coordinator-shell .rail > .rail-action:not(#staffStatsNavButton),
  .staff-shell.is-coordinator-shell .rail-bottom {
    display: none;
  }

  .staff-shell.is-coordinator-shell .coordinator-status-nav {
    display: flex;
    flex: 1 0 auto;
    overflow: visible;
    padding: 0;
  }

  .staff-shell.is-coordinator-shell .coordinator-status-button {
    grid-template-columns: auto auto;
    min-width: max-content;
  }

  .staff-shell.is-coordinator-shell #staffStatsNavButton {
    flex: 0 0 auto;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .topbar {
    padding: 12px;
  }

  .status-pill {
    display: none;
  }

  .workbench {
    grid-template-columns: 1fr;
    width: 100%;
    padding: 12px;
  }

  .intake-panel,
  .chat-panel,
  .process-panel {
    min-height: auto;
  }

  .personal-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand-copy small,
  .session-pill {
    display: none;
  }

  .composer {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .monitor-metric-grid {
    grid-template-columns: 1fr;
  }

  .stats-donut-layout {
    grid-template-columns: 1fr;
  }

  .server-log-toolbar select {
    min-width: 0;
    width: 100%;
  }

  .complaint-form {
    width: min(100% - 24px, 1180px);
    margin-top: 18px;
  }

  .complaint-hero {
    padding: 26px 18px;
  }

  .privacy-strip {
    grid-template-columns: 1fr;
  }

  .complaint-upload {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .complaint-upload strong {
    justify-self: start;
  }

  .internal-role-grid {
    grid-template-columns: 1fr;
  }

  .login-role-switch,
  .recovery-choice-row,
  .committee-evidence-row {
    grid-template-columns: 1fr;
  }

  .recovery-shell {
    padding: 14px;
  }

  .recovery-card,
  .recovery-brand {
    padding: 16px;
  }

  .staff-workspace {
    padding: 12px;
  }

  .staff-panel,
  .staff-hero {
    padding: 16px;
  }

  .send-button {
    grid-column: 1 / -1;
  }

  .message {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

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

  .avatar {
    width: 34px;
    height: 34px;
    font-size: 0.68rem;
  }
}

/* Consola de operaciones para desarrolladores */
.server-monitor {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(224, 197, 143, 0.38);
  border-radius: var(--radius);
  background: #112250;
  color: var(--paper);
  box-shadow: var(--shadow);
}

.server-monitor .panel-title h2,
.server-monitor .panel-title h3,
.server-monitor .eyebrow {
  color: var(--paper);
}

.server-monitor .live-indicator {
  color: #d8e7e3;
}

.server-monitor .outline-button {
  border-color: rgba(224, 197, 143, 0.56);
  color: var(--gold);
}

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

.monitor-gauge-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(217, 203, 194, 0.22);
  border-radius: 4px;
  background: #203765;
  text-align: center;
}

.monitor-gauge-card > small {
  min-height: 30px;
  color: #c8d2e4;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.monitor-card-label {
  justify-self: start;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.monitor-gauge {
  --gauge-color: #7aa42d;
  position: relative;
  width: min(170px, 100%);
  height: 88px;
  overflow: hidden;
}

.monitor-gauge::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 50%;
  width: 166px;
  height: 166px;
  border-radius: 50%;
  background: conic-gradient(from 270deg, var(--gauge-color) 0 calc(var(--value) * 1.8deg), rgba(245, 240, 233, 0.13) 0 180deg, transparent 180deg);
  transform: translateX(-50%);
  mask: radial-gradient(circle, transparent 0 54%, #000 55% 100%);
}

.monitor-gauge > div {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  justify-items: center;
}

.monitor-gauge strong {
  font-family: var(--title);
  font-size: 1.65rem;
}

.monitor-gauge small {
  color: #aebbd3;
  font-size: 0.65rem;
  font-weight: 900;
}

.monitor-gauge.is-green { --gauge-color: var(--green); }
.monitor-gauge.is-gold { --gauge-color: var(--gold); }
.monitor-gauge.is-sapphire { --gauge-color: #6f89bd; }

.monitor-fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(217, 203, 194, 0.22);
  background: rgba(217, 203, 194, 0.2);
}

.monitor-fact-strip div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  background: #1b305d;
}

.monitor-fact-strip span {
  color: #aebbd3;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.monitor-fact-strip strong {
  overflow-wrap: anywhere;
  color: var(--paper);
  font-size: 0.9rem;
}

.monitor-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.server-monitor .monitor-chart-section {
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(217, 203, 194, 0.22);
  border-radius: 4px;
  background: #1b305d;
}

.monitor-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--paper);
}

.monitor-chart-head span {
  color: #aebbd3;
  font-size: 0.7rem;
}

.server-monitor .resource-chart {
  height: 190px;
  border-color: rgba(217, 203, 194, 0.25);
  background: #172951;
}

.server-monitor .resource-chart-grid path {
  stroke: rgba(245, 240, 233, 0.16);
}

.server-monitor .chart-line.is-cpu { stroke: #8bc53f; }
.server-monitor .chart-line.is-memory { stroke: #46b6a8; }
.server-monitor .chart-line.is-storage { stroke: #f1d056; }
.server-monitor .chart-line.is-gpu { stroke: #e0c58f; }
.server-monitor .chart-line.is-download { stroke: #55d6c2; }
.server-monitor .chart-line.is-upload { stroke: #f1d056; }

.critical-alerts {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 2px solid #ff5b65;
  background: #3b1219;
  color: #fff5f5;
  box-shadow: 0 0 0 4px rgba(255, 91, 101, 0.12);
}

.critical-alerts[hidden] {
  display: none;
}

.critical-alerts-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.critical-alerts-head div {
  display: grid;
  gap: 2px;
}

.critical-alerts-head span:not(.critical-alert-icon) {
  color: #ffadb2;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.critical-alert-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: #ff6872;
  font-size: 1.35rem;
  font-weight: 900;
}

#monitorAlertList {
  display: grid;
  gap: 8px;
}

.critical-alert-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid rgba(255, 173, 178, 0.32);
}

.critical-alert-item span,
.critical-alert-item small {
  color: #ffdadd;
}

.network-monitor {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #46536b;
  background: #24282f;
}

.network-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #46536b;
}

.network-metric-grid article {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 18px;
  background: #2d3239;
}

.network-metric-grid span,
.network-metric-grid small {
  color: #aebbd3;
}

.network-metric-grid span {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.network-metric-grid strong {
  color: var(--paper);
  font-family: var(--title);
  font-size: 1.55rem;
  overflow-wrap: anywhere;
}

.network-status-line {
  padding: 10px 12px;
  border-left: 4px solid var(--green);
  background: rgba(47, 143, 131, 0.12);
  color: #b8f4ea;
  font-weight: 800;
}

.network-status-line.is-offline {
  border-left-color: #ff5b65;
  background: rgba(255, 91, 101, 0.12);
  color: #ffb8bd;
}

.network-chart-section {
  width: 100%;
}

.monitor-runtime {
  padding: 0;
  border: 1px solid rgba(217, 203, 194, 0.22);
}

.monitor-runtime dl {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 0;
}

.monitor-runtime dl div {
  padding: 9px 12px;
  border: 0;
  border-right: 1px solid rgba(217, 203, 194, 0.22);
}

.monitor-runtime dt { color: #aebbd3; }
.monitor-runtime dd { color: var(--paper); }

.server-monitor .server-log-section {
  padding-top: 12px;
  border-color: rgba(217, 203, 194, 0.24);
}

.server-monitor .server-log-toolbar label {
  color: #aebbd3;
}

.server-monitor .server-log-toolbar select {
  border-color: rgba(217, 203, 194, 0.3);
  background: #1b305d;
  color: var(--paper);
}

.server-monitor .server-log-output {
  min-height: 170px;
  max-height: 260px;
  background: #09152f;
}

.dev-support-view {
  gap: 18px;
}

.staff-dashboard.is-technical-view > .staff-hero,
.staff-dashboard.is-technical-view > .metric-grid {
  display: none;
}

.dev-support-view .server-monitor-actions label {
  display: grid;
  gap: 5px;
  color: var(--steel);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dev-support-view select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

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

.support-feedback-item {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--white);
}

.support-feedback-item header,
.support-feedback-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.support-feedback-item h3,
.support-feedback-item p {
  margin: 0;
}

.support-feedback-item h3 {
  font-family: var(--title);
  font-size: 1.15rem;
}

.support-feedback-item time,
.support-feedback-meta {
  color: var(--steel);
  font-size: 0.76rem;
}

.support-feedback-item p {
  min-height: 72px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.support-feedback-item label {
  display: grid;
  grid-template-columns: auto minmax(130px, 190px);
  align-items: center;
  justify-content: end;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .monitor-gauge-grid,
  .monitor-fact-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitor-chart-grid,
  .support-feedback-list {
    grid-template-columns: 1fr;
  }

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

  .critical-alert-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .server-monitor-head,
  .server-monitor-actions,
  .server-log-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .monitor-gauge-grid,
  .monitor-fact-strip,
  .monitor-runtime dl,
  .network-metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* Cambios 2: navegación enfocada, estados del asesor y soporte */
#appShell .rail-action:not(.rail-menu-action):not(#logoutButton) {
  display: none;
}

#appShell .rail-menu-action {
  margin-top: 6px;
}

#appShell .workbench {
  grid-template-columns: minmax(0, 1fr) 260px;
  max-width: none;
}

#appShell .chat-panel {
  min-width: 0;
}

.composer {
  grid-template-columns: 42px 42px minmax(0, 1fr) auto;
}

.new-case-action {
  color: var(--ink) !important;
}

.new-case-action:hover {
  border-color: var(--gold) !important;
  background: #fffaf3 !important;
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  color: var(--green);
}

.thinking-stage {
  min-width: 126px;
  font-size: 0.9rem;
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.thinking-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: thinking-dot 1.1s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 150ms;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes thinking-dot {
  0%, 65%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.timeline li.is-active::before {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(47, 143, 131, 0.16);
  animation: pulse 1.8s ease-out infinite;
}

.drawer-panel {
  overflow-y: auto;
}

.drawer-nav a,
.drawer-nav button {
  width: 100%;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate);
  font-weight: 800;
  text-align: left;
}

.drawer-nav a:hover,
.drawer-nav button:hover {
  border-color: var(--gold);
  background: #fffaf3;
  color: var(--ink);
}

.drawer-profile {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.drawer-profile .evidence-card {
  display: grid;
  gap: 12px;
}

.drawer-profile .drop-zone {
  min-height: 132px;
}

/* Cambios 3: perfil independiente, evidencia contextual y menu del coordinador */
.profile-view {
  display: grid;
  gap: 18px;
  padding: 24px;
  min-height: calc(100dvh - 70px);
  align-content: start;
}

.profile-view[hidden] {
  display: none;
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 30px 36px;
  background: var(--royal);
  color: var(--swan);
}

.profile-hero h1 {
  margin: 4px 0 8px;
  color: var(--swan);
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.profile-hero p {
  margin: 0;
  color: rgba(245, 240, 233, 0.86);
}

.profile-content {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.profile-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 34px;
  margin: 0;
}

.profile-data-grid div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.profile-data-grid dt {
  color: var(--sapphire);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-data-grid dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.evidence-dialog .support-dialog-card {
  width: min(640px, calc(100vw - 28px));
}

.evidence-dialog .drop-zone {
  min-height: 180px;
}

.staff-shell.is-coordinator-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.staff-shell.is-coordinator-shell .rail {
  align-items: center;
  gap: 10px;
  padding: 16px 10px;
}

.staff-shell.is-coordinator-shell .rail > .rail-action:not(.staff-menu-action):not(#staffLogoutButton) {
  display: none;
}

.staff-shell.is-coordinator-shell .staff-menu-action,
.staff-shell.is-coordinator-shell #staffLogoutButton {
  display: grid;
}

.staff-drawer .drawer-panel {
  overflow-y: auto;
}

.staff-drawer-filters {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.staff-drawer .coordinator-status-nav {
  display: grid;
  gap: 8px;
  overflow: visible;
}

.staff-drawer .coordinator-status-button {
  border-color: var(--line);
  background: var(--white);
  color: var(--slate);
}

.staff-drawer .coordinator-status-button strong {
  background: var(--shellstone);
  color: var(--royal);
}

.staff-drawer .coordinator-status-button:hover,
.staff-drawer .coordinator-status-button.is-active {
  border-color: var(--gold);
  background: var(--royal);
  color: var(--swan);
}

.staff-drawer .coordinator-status-button.is-active strong {
  background: var(--gold);
  color: var(--royal);
}

@media (max-width: 980px) {
  #appShell #logoutButton {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 12;
    display: grid;
    background: var(--royal);
    box-shadow: 0 8px 24px rgba(17, 34, 80, 0.24);
  }

  .staff-shell.is-coordinator-shell {
    grid-template-columns: 1fr;
  }

  .staff-shell.is-coordinator-shell .rail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 12;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 64px;
    padding: 8px 16px;
    background: var(--royal);
  }

  .staff-shell.is-coordinator-shell .rail-logo {
    display: none;
  }

  .staff-shell.is-coordinator-shell .workspace {
    padding-bottom: 64px;
  }

  .profile-data-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .profile-view {
    padding: 14px;
  }

  .profile-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 24px;
  }
}

.support-dialog {
  width: min(680px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
}

.support-dialog::backdrop {
  background: rgba(17, 34, 80, 0.58);
  backdrop-filter: blur(3px);
}

.support-dialog-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.support-dialog-card h2,
.support-dialog-card p {
  margin: 0;
}

.support-dialog-card h2 {
  font-family: var(--title);
  font-size: 1.65rem;
}

.support-dialog-card label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.support-dialog-card input,
.support-dialog-card textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.support-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.recovery-shell {
  padding: 16px;
}

.recovery-card {
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  width: min(780px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 16px;
  overflow-y: auto;
}

.recovery-brand {
  gap: 10px;
  padding: 16px;
}

.recovery-brand .brand-logo-large {
  width: 58px;
  height: 58px;
}

.recovery-brand strong {
  font-size: 2rem;
}

.recovery-view {
  gap: 10px;
}

.recovery-view h1 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.recovery-view p {
  line-height: 1.4;
}

.recovery-view .auth-form {
  gap: 9px;
}

.recovery-view .password-rules {
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
  padding: 10px;
}

.recovery-view .password-rules li {
  font-size: 0.72rem;
}

@media (max-width: 980px) {
  #appShell .rail {
    display: none;
  }

  #appShell.app-shell {
    grid-template-columns: 1fr;
  }

  #appShell .menu-toggle {
    display: inline-grid;
  }

  #appShell .workbench {
    grid-template-columns: minmax(0, 1fr) 230px;
  }
}

/* Cambios 4: navegación móvil, perfil simplificado y bandeja amplia */
#developerShell .rail-action-label {
  display: none;
}

.profile-view {
  width: min(1180px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 22px);
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.profile-hero {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  padding: clamp(20px, 3.5vw, 30px);
  border: 1px solid rgba(224, 197, 143, 0.46);
  border-radius: 16px;
  background:
    radial-gradient(circle at 82% 12%, rgba(224, 197, 143, 0.22), transparent 30%),
    linear-gradient(135deg, var(--ink), #294474);
  color: var(--paper);
  box-shadow: 0 22px 54px rgba(17, 34, 80, 0.22);
}

.profile-hero::after {
  content: "";
  position: absolute;
  right: -72px;
  bottom: -116px;
  width: 290px;
  height: 290px;
  border: 1px solid rgba(224, 197, 143, 0.32);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(224, 197, 143, 0.05);
}

.profile-hero-copy,
.profile-hero .outline-button {
  position: relative;
  z-index: 1;
}

.profile-hero .eyebrow {
  color: var(--gold);
}

.profile-hero h1 {
  color: var(--paper);
  font-size: clamp(2.25rem, 4.5vw, 3.55rem);
  line-height: 1;
}

.profile-hero p {
  max-width: 610px;
  color: rgba(245, 240, 233, 0.82);
  font-size: 1rem;
  line-height: 1.55;
}

.profile-hero .outline-button {
  border-color: rgba(224, 197, 143, 0.66);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

.profile-content {
  gap: 18px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 48px rgba(17, 34, 80, 0.12);
}

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

.profile-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(224, 197, 143, 0.72);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--ink), var(--slate));
  color: var(--gold);
  box-shadow: 0 12px 28px rgba(17, 34, 80, 0.2);
}

.profile-avatar svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-summary .panel-title p {
  margin: 6px 0 0;
  color: var(--steel);
  line-height: 1.45;
}

.profile-data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-data-grid div {
  gap: 7px;
  min-height: 82px;
  padding: 16px 18px;
  border: 1px solid rgba(100, 117, 156, 0.2);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, rgba(245, 240, 233, 0.72));
}

.profile-data-grid .profile-primary-field {
  grid-column: 1 / -1;
  min-height: 94px;
  border-left: 5px solid var(--gold);
}

.profile-data-grid dt {
  color: var(--steel);
  letter-spacing: 0.04em;
}

.profile-data-grid dd {
  color: var(--ink);
  font-family: var(--title);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
}

.profile-data-grid .profile-primary-field dd {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.staff-shell.is-coordinator-shell .staff-workspace {
  padding: 20px 24px 44px;
  scroll-padding-top: 20px;
}

.staff-shell.is-coordinator-shell #coordinatorDashboard {
  gap: 16px;
}

.staff-shell.is-coordinator-shell #coordinatorDashboard .staff-hero {
  padding: 22px 26px;
}

.staff-shell.is-coordinator-shell #coordinatorDashboard > .staff-panel {
  min-height: calc(100dvh - 210px);
  align-content: start;
  padding: 24px;
}

.staff-shell.is-coordinator-shell #coordinatorDashboard .coordinator-board {
  min-height: calc(100dvh - 330px);
}

.staff-shell.is-coordinator-shell #coordinatorDashboard .complaint-case-list {
  min-height: calc(100dvh - 330px);
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.staff-shell.is-coordinator-shell #coordinatorDashboard .complaint-case-card {
  box-shadow: 0 12px 34px rgba(17, 34, 80, 0.1);
}

@media (max-width: 860px) {
  #developerShell.app-shell {
    grid-template-columns: 1fr;
    height: 100dvh;
    overflow: hidden;
  }

  #developerShell .workspace {
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 72px;
  }

  #developerShell > .rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(6, minmax(54px, 1fr));
    align-items: stretch;
    gap: 4px;
    width: 100%;
    height: 72px;
    padding: 6px 8px;
    overflow-x: hidden;
    overflow-y: hidden;
    background: var(--ink);
    box-shadow: 0 -10px 28px rgba(17, 34, 80, 0.24);
  }

  #developerShell > .rail .rail-logo {
    display: none;
  }

  #developerShell > .rail .rail-action {
    display: grid;
    grid-template-rows: 24px auto;
    place-items: center;
    gap: 2px;
    width: auto;
    min-width: 52px;
    height: 58px;
    padding: 5px 7px;
    border-radius: 8px;
  }

  #developerShell > .rail .rail-action svg {
    width: 22px;
    height: 22px;
  }

  #developerShell .rail-action-label {
    display: block;
    max-width: 60px;
    overflow: hidden;
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #developerShell > .rail .rail-bottom {
    margin-top: 0;
  }

  #developerShell .staff-workspace {
    height: 100%;
    padding-bottom: 24px;
    overflow-y: auto;
  }
}

@media (max-width: 620px) {
  .profile-view {
    padding: 10px 10px 24px;
  }

  .profile-hero {
    min-height: 0;
    align-items: stretch;
    padding: 20px 18px;
  }

  .profile-hero .outline-button {
    width: 100%;
  }

  .profile-content {
    padding: 16px;
  }

  .profile-summary {
    grid-template-columns: 1fr;
  }

  .profile-data-grid {
    grid-template-columns: 1fr;
  }

  .profile-data-grid .profile-primary-field {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .staff-shell.is-coordinator-shell .staff-workspace {
    padding: 14px 14px 84px;
  }

  .staff-shell.is-coordinator-shell #coordinatorDashboard > .staff-panel,
  .staff-shell.is-coordinator-shell #coordinatorDashboard .coordinator-board,
  .staff-shell.is-coordinator-shell #coordinatorDashboard .complaint-case-list {
    min-height: 58dvh;
  }
}

@media (max-width: 760px) {
  #appShell .workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  #appShell .process-panel {
    display: none;
  }

  .support-identity-grid,
  .recovery-card,
  .recovery-view .password-rules {
    grid-template-columns: 1fr;
  }

  .recovery-brand {
    grid-template-columns: auto 1fr;
    min-height: auto;
    align-items: center;
  }

  .recovery-brand strong {
    font-size: 1.7rem;
  }
}

@media (max-width: 560px) {
  .composer {
    grid-template-columns: 38px 38px minmax(0, 1fr);
  }

  .composer .send-button {
    grid-column: 1 / -1;
  }

  .support-dialog-card {
    padding: 18px;
  }
}

@media (max-width: 980px) {
  #appShell .rail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 12;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 62px;
    padding: 8px 14px;
    background: var(--royal);
  }

  #appShell .rail-logo {
    display: none;
  }

  #appShell #logoutButton {
    position: static;
    margin: 0 0 0 auto;
    box-shadow: none;
  }

  #appShell .workspace {
    padding-bottom: 62px;
  }
}
