:root {
  color-scheme: light;
  --brand-950: #062f4a;
  --brand-900: #074a70;
  --brand-800: #075a87;
  --brand-700: #0a6d9d;
  --brand-600: #1182b3;
  --brand-100: #dceff6;
  --brand-50: #edf7fa;
  --gold-700: #96712b;
  --gold-500: #c9a95f;
  --gold-100: #f5e9c9;
  --gold-50: #fcf7ea;
  --ink-950: #102432;
  --ink-800: #263b48;
  --ink-600: #596c78;
  --ink-500: #596c78;
  --line: #d8e3e8;
  --line-strong: #c6d4dc;
  --canvas: #f2f6f7;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --success: #168553;
  --success-soft: #e8f7ef;
  --warning: #a86008;
  --warning-soft: #fff4d9;
  --danger: #b33b3b;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 1px 2px rgba(7, 46, 70, 0.06), 0 8px 24px rgba(7, 46, 70, 0.055);
  --shadow-lg: 0 28px 70px rgba(6, 47, 74, 0.19);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --focus: 0 0 0 3px rgba(17, 131, 184, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink-950);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 5%, rgba(201, 169, 95, 0.08), transparent 24rem),
    linear-gradient(180deg, #f7fafb 0, var(--canvas) 22rem);
}

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

button,
select {
  cursor: pointer;
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-900);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 140ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

h1,
h2,
h3 {
  color: var(--ink-950);
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.28rem;
  line-height: 1.25;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.06rem;
  line-height: 1.3;
}

.muted {
  margin-bottom: 0;
  color: var(--ink-600);
  line-height: 1.55;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--brand-700);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #a8e4f5;
}

.brand-mark {
  display: inline-flex;
  position: relative;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand-600), var(--brand-900));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark span {
  position: absolute;
  left: 11px;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: white;
}

.brand-mark span::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -5px;
  width: 6px;
  height: 6px;
  border: 2px solid white;
  border-radius: 50%;
  background: transparent;
}

.brand-mark span:nth-child(1) {
  top: 12px;
}

.brand-mark span:nth-child(2) {
  top: 20px;
}

.brand-mark span:nth-child(3) {
  top: 28px;
}

.brand-mark--large {
  width: 62px;
  height: 62px;
  border-radius: 18px;
}

.brand-mark--large span {
  left: 18px;
  width: 28px;
  height: 4px;
}

.brand-mark--large span::before {
  top: -3px;
  left: -7px;
  width: 8px;
  height: 8px;
}

.brand-mark--large span:nth-child(1) {
  top: 17px;
}

.brand-mark--large span:nth-child(2) {
  top: 29px;
}

.brand-mark--large span:nth-child(3) {
  top: 41px;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  clip-path: circle(45% at 50% 50%);
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(2, 31, 49, 0.18));
}

.brand-logo--boot {
  width: 104px;
  height: 104px;
  filter: none;
}

.brand-logo--hero {
  width: clamp(96px, 9vw, 136px);
  height: clamp(96px, 9vw, 136px);
  filter: drop-shadow(0 20px 36px rgba(2, 23, 39, 0.34));
}

.brand-logo--small {
  width: 50px;
  height: 50px;
}

.brand-logo--topbar {
  width: 66px;
  height: 66px;
  filter: drop-shadow(0 6px 12px rgba(2, 31, 49, 0.2));
}

.centered-view {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-content: center;
  padding: 28px;
  text-align: center;
}

.centered-view--soft {
  background:
    radial-gradient(circle at top left, rgba(17, 131, 184, 0.12), transparent 38%),
    radial-gradient(circle at bottom right, rgba(201, 169, 95, 0.13), transparent 34%),
    var(--canvas);
}

.boot-view {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(17, 130, 179, 0.14), transparent 25rem),
    radial-gradient(circle at 86% 88%, rgba(201, 169, 95, 0.2), transparent 23rem),
    linear-gradient(145deg, #f8fbfc 0%, #edf5f7 54%, #f8f6ef 100%);
}

.boot-view::before,
.boot-view::after {
  position: absolute;
  z-index: -1;
  width: 32rem;
  height: 32rem;
  border: 1px solid rgba(7, 90, 135, 0.08);
  border-radius: 50%;
  content: "";
}

.boot-view::before {
  top: -21rem;
  left: -15rem;
}

.boot-view::after {
  right: -18rem;
  bottom: -20rem;
}

.boot-card {
  position: relative;
  width: min(100%, 420px);
  padding: clamp(34px, 7vw, 48px);
  overflow: hidden;
  border: 1px solid rgba(190, 211, 220, 0.86);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 80px rgba(6, 47, 74, 0.16);
  backdrop-filter: blur(18px);
}

.boot-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-800), var(--brand-600), var(--gold-500));
  content: "";
}

.boot-logo-frame {
  display: grid;
  width: 118px;
  height: 118px;
  margin: 0 auto 24px;
  place-items: center;
  border: 1px solid rgba(201, 169, 95, 0.48);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #f7f1df);
  box-shadow:
    0 16px 34px rgba(6, 47, 74, 0.15),
    inset 0 0 0 6px rgba(255, 255, 255, 0.78);
}

.boot-kicker {
  margin: 0 0 9px;
  color: var(--gold-700);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.boot-card h1 {
  margin-bottom: 10px;
  color: var(--brand-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 8vw, 3rem);
  letter-spacing: -0.045em;
}

.boot-label {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.92rem;
  font-weight: 650;
}

.boot-progress {
  width: min(100%, 220px);
  height: 4px;
  margin: 25px auto 17px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1ebef;
}

.boot-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-800), var(--brand-600), var(--gold-500));
  animation: boot-progress 1.25s ease-in-out infinite alternate;
}

.boot-version {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes boot-progress {
  from {
    transform: translateX(-30%);
  }

  to {
    transform: translateX(170%);
  }
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 7vw, 96px);
  overflow: hidden;
  background:
    radial-gradient(circle at 5% 5%, rgba(60, 181, 218, 0.24), transparent 31%),
    radial-gradient(circle at 100% 85%, rgba(228, 201, 137, 0.2), transparent 29%),
    linear-gradient(145deg, #042d47 0%, #064c70 58%, #0a658a 100%);
  color: white;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 44px;
}

.auth-brand h1 {
  margin: 0;
  color: white;
  font-size: clamp(3rem, 5vw, 5.4rem);
  line-height: 1.02;
}

.auth-subtitle {
  margin: 10px 0 0;
  color: var(--gold-100);
  font-size: clamp(1rem, 1.4vw, 1.28rem);
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-lead {
  max-width: 650px;
  margin-bottom: 44px;
  color: #d9f0f8;
  font-size: clamp(1.08rem, 1.5vw, 1.35rem);
  line-height: 1.65;
}

.auth-assurance {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  max-width: 520px;
  padding: 18px 20px;
  border: 1px solid rgba(245, 233, 201, 0.26);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
}

.auth-assurance p {
  margin: 0;
  color: #cce7f1;
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-assurance strong {
  display: block;
  margin-bottom: 3px;
  color: white;
}

.assurance-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #b6f0d2;
  color: #0d7045;
  font-weight: 900;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(circle at 85% 15%, rgba(201, 169, 95, 0.11), transparent 19rem),
    var(--surface-soft);
}

.auth-card,
.password-card {
  width: min(100%, 460px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid #d5e0e4;
  border-top-color: var(--gold-500);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.auth-card h2 {
  font-size: 1.75rem;
}

.auth-help {
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-600);
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: center;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 32px;
  color: var(--brand-900);
  font-weight: 850;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.form-stack-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
}

.field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.field label {
  color: var(--ink-800);
  font-size: 0.84rem;
  font-weight: 780;
}

.field label .optional {
  margin-left: 5px;
  color: var(--ink-500);
  font-size: 0.72rem;
  font-weight: 650;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--ink-950);
  line-height: 1.45;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

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

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: #9eb3bf;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand-600);
  box-shadow: var(--focus);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-help {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.78rem;
  line-height: 1.45;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 66px;
}

.show-password {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 34px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--brand-800);
  font-size: 0.78rem;
  font-weight: 800;
  transform: translateY(-50%);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  background: var(--danger-soft);
  color: #8f2828;
  font-size: 0.84rem;
  line-height: 1.45;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 100ms ease, background 120ms ease, border-color 120ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button--wide {
  width: 100%;
}

.button--primary {
  border-color: var(--brand-800);
  background: var(--brand-800);
  color: white;
  box-shadow: 0 5px 12px rgba(7, 91, 140, 0.18);
}

.button--primary:hover:not(:disabled) {
  border-color: var(--brand-900);
  background: var(--brand-900);
}

.button--secondary {
  border-color: #9dbac8;
  background: var(--brand-50);
  color: var(--brand-900);
}

.button--secondary:hover:not(:disabled) {
  background: var(--brand-100);
}

.button--quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-800);
}

.button--quiet:hover:not(:disabled) {
  border-color: #aebfc8;
  background: var(--surface-soft);
}

.button--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: white;
}

.button--danger-quiet {
  border-color: #edc1c1;
  background: var(--danger-soft);
  color: #912e2e;
}

.button--small {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 0.84rem;
}

.portal {
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  position: sticky;
  z-index: 50;
  top: 0;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  padding: 10px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid #d7e1e5;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.985), rgba(251, 249, 242, 0.97));
  box-shadow: 0 8px 28px rgba(8, 50, 75, 0.075);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-950);
  text-decoration: none;
}

.topbar-brand__text,
.topbar-brand strong,
.topbar-brand small,
.topbar-brand__text > span {
  display: block;
}

.topbar-brand strong {
  color: var(--brand-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.topbar-brand small {
  margin-bottom: 3px;
  color: var(--gold-700);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar-brand__text > span {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.025em;
}

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

.connection {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 0.76rem;
  font-weight: 760;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b9ba4;
}

.connection--connected {
  border-color: #b9e1ce;
  background: var(--success-soft);
  color: #126a44;
}

.connection--connected .connection-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 133, 83, 0.12);
}

.connection--reconnecting,
.connection--connecting {
  border-color: #ead5aa;
  background: var(--warning-soft);
  color: #895207;
}

.connection--reconnecting .connection-dot,
.connection--connecting .connection-dot {
  background: #d18a1e;
  animation: pulse 1.6s ease-in-out infinite;
}

.connection--offline {
  border-color: #efc6c6;
  background: var(--danger-soft);
  color: #912e2e;
}

.connection--offline .connection-dot {
  background: var(--danger);
}

.account-menu {
  position: relative;
}

.account-button {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 9px;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-800);
  text-align: left;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-soft);
}

.avatar {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-100);
  color: var(--brand-900);
  font-size: 0.76rem;
  font-weight: 900;
}

.account-name-wrap strong,
.account-name-wrap small {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name-wrap strong {
  font-size: 0.84rem;
}

.account-name-wrap small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 0.68rem;
}

.account-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 7px);
  right: 0;
  width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.account-popover button {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-800);
  text-align: left;
}

.account-popover button:hover,
.account-popover button:focus-visible {
  background: var(--surface-soft);
}

.portal-body {
  display: grid;
  grid-template-columns: 265px minmax(0, 1fr);
  min-height: calc(100vh - 94px);
  min-height: calc(100dvh - 94px);
}

.sidebar {
  display: flex;
  position: sticky;
  top: 94px;
  flex-direction: column;
  align-self: start;
  height: calc(100vh - 94px);
  height: calc(100dvh - 94px);
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(249, 251, 251, 0.98), rgba(244, 248, 249, 0.98));
}

.sidebar-section + .sidebar-section {
  margin-top: 26px;
}

.sidebar-label {
  margin: 0 10px 9px;
  color: var(--ink-500);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.queue-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 46px;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-600);
  font-size: 0.84rem;
  font-weight: 720;
  text-align: left;
}

.nav-item:hover {
  background: #edf3f6;
  color: var(--ink-950);
}

.nav-item.is-active {
  border-color: #c8e4ef;
  background: var(--brand-100);
  color: var(--brand-950);
  font-weight: 830;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: #e6eef2;
  color: var(--ink-600);
  font-size: 0.9rem;
}

.nav-item.is-active .nav-icon {
  background: var(--brand-800);
  color: white;
}

.nav-count {
  min-width: 25px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e7eef2;
  color: var(--ink-600);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.nav-item.is-active .nav-count {
  background: white;
  color: var(--brand-900);
}

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid #d7e9ef;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand-800);
}

.sidebar-note p {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.72rem;
  line-height: 1.45;
}

.sidebar-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--brand-900);
}

.sidebar-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(198, 212, 220, 0.8);
}

.brand-logo--sidebar {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 5px 10px rgba(2, 31, 49, 0.14));
}

.sidebar-footer p {
  min-width: 0;
  margin: 0;
  line-height: 1.25;
}

.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.sidebar-footer strong {
  color: var(--brand-950);
  font-size: 0.7rem;
  font-weight: 850;
}

.sidebar-footer span {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.025em;
}

.content {
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 52px);
}

.content-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.task-list {
  display: grid;
  gap: 16px;
}

.task-card {
  --task-accent: #48a773;
  --task-border: #a9dac0;
  --task-bg: #edf9f2;
  --task-layer: rgba(255, 255, 255, 0.62);
  overflow: hidden;
  border: 1px solid var(--task-border);
  border-radius: 16px;
  background: var(--task-bg);
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.task-card:hover {
  border-color: var(--task-accent);
  box-shadow: 0 14px 34px rgba(13, 47, 66, 0.1);
  transform: translateY(-1px);
}

.task-card--normal {
  --task-accent: #39a96b;
  --task-border: #9bd3b3;
  --task-bg: #eaf8ef;
  --task-layer: rgba(255, 255, 255, 0.6);
}

.task-card--high {
  --task-accent: #dc8d23;
  --task-border: #efc88f;
  --task-bg: #fff3df;
  --task-layer: rgba(255, 255, 255, 0.58);
}

.task-card--urgent {
  --task-accent: #dd5252;
  --task-border: #eda6a6;
  --task-bg: #ffebeb;
  --task-layer: rgba(255, 255, 255, 0.56);
}

.task-card__body {
  position: relative;
  padding: clamp(18px, 2.5vw, 25px);
}

.task-card__topline,
.task-card__header,
.task-card__customer-row,
.task-card__footer,
.task-card__actions,
.task-card__meta {
  display: flex;
  align-items: center;
}

.task-card__topline,
.task-card__header {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.task-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  margin-bottom: 10px;
}

.task-card__header-aside {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.task-card__title {
  max-width: min(100%, 980px);
  margin: 0;
  color: #152b37;
  font-size: clamp(1.18rem, 2.1vw, 1.58rem);
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.task-card__badges,
.task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.task-card__badges {
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 0.7rem;
  font-weight: 800;
}

.badge--urgent {
  border-color: #efc0c0;
  background: var(--danger-soft);
  color: #9a3030;
}

.badge--overdue {
  min-height: 36px;
  padding: 7px 13px;
  border-color: #c92525;
  background: #c92525;
  color: #fff;
  box-shadow: 0 6px 14px rgba(169, 31, 31, 0.2);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.055em;
}

.task-due--overdue {
  color: #9d1e1e;
  font-weight: 850;
}

.badge--high {
  border-color: #eed5ae;
  background: var(--warning-soft);
  color: #95580b;
}

.badge--normal {
  border-color: #a7d8bd;
  background: #e3f6eb;
  color: #197044;
}

.badge--mine {
  border-color: #b8ddca;
  background: var(--success-soft);
  color: #116e46;
}

.badge--claimed {
  border-color: #c4dce8;
  background: var(--brand-50);
  color: var(--brand-900);
}

.task-id {
  padding: 4px 0;
  color: var(--ink-600);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.task-card__customer-row {
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(122, 149, 162, 0.27);
  border-radius: 11px;
  background: var(--task-layer);
}

.task-card__customer-row--empty {
  opacity: 0.76;
}

.task-card__customer-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.task-card__customer-text strong {
  color: var(--ink-800);
  font-size: 0.91rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.task-card__context-label {
  display: block;
  color: var(--ink-500);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.075em;
  line-height: 1.3;
  text-transform: uppercase;
}

.copy-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 38px;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-900);
  font-size: 0.78rem;
  font-weight: 800;
}

.copy-button:hover {
  border-color: #b5ceda;
  background: var(--brand-50);
}

.task-card__meta {
  margin-top: 12px;
  color: var(--ink-600);
  font-size: 0.78rem;
}

.task-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.task-card__meta .task-route {
  color: var(--brand-900);
  font-weight: 800;
}

.task-notes {
  margin: 12px 0 0;
  padding: 13px 14px;
  border: 1px solid rgba(122, 149, 162, 0.27);
  border-radius: 10px;
  background: var(--task-layer);
  color: var(--ink-800);
  font-size: 0.92rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.task-notes p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.task-notes--empty {
  color: var(--ink-500);
  font-style: italic;
}

.task-title {
  margin: 19px 0 -9px;
  color: var(--ink-800);
  font-size: 0.95rem;
  letter-spacing: 0;
}

.progress-notes {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(122, 149, 162, 0.3);
  border-radius: 11px;
  background: var(--task-layer);
}

.progress-notes--read-only {
  border-color: rgba(122, 149, 162, 0.28);
  background: rgba(255, 255, 255, 0.46);
}

.progress-notes__heading,
.progress-notes__controls {
  display: flex;
  align-items: center;
}

.progress-notes__heading {
  justify-content: space-between;
  gap: 14px;
}

.progress-notes__heading h3 {
  margin: 0 0 3px;
  color: var(--ink-800);
  font-size: 0.9rem;
}

.progress-notes__help,
.progress-notes__empty {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.76rem;
  line-height: 1.45;
}

.progress-notes__controls {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.progress-notes__count {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-900);
  font-size: 0.7rem;
  font-weight: 800;
}

.progress-notes__empty {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.load-comments-button {
  margin-top: 12px;
}

.comment-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.comment {
  padding: 11px 13px;
  border-left: 3px solid #cfe3ec;
  border-radius: 3px 9px 9px 3px;
  background: rgba(255, 255, 255, 0.72);
}

.comment__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--ink-500);
  font-size: 0.69rem;
}

.comment__meta strong {
  color: var(--ink-800);
}

.comment__body {
  margin: 0;
  color: var(--ink-800);
  font-size: 0.84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.task-card__footer {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 13px clamp(18px, 2.5vw, 25px);
  border-top: 1px solid rgba(122, 149, 162, 0.28);
  background: rgba(255, 255, 255, 0.42);
}

.task-card__status {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.78rem;
  line-height: 1.4;
}

.task-card__status strong {
  color: var(--ink-800);
}

.task-card__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.inline-composer {
  display: grid;
  gap: 10px;
  padding: 15px clamp(18px, 2.5vw, 25px);
  border-top: 1px solid rgba(122, 149, 162, 0.3);
  background: rgba(237, 247, 250, 0.86);
}

.inline-composer label {
  color: var(--ink-800);
  font-size: 0.82rem;
  font-weight: 800;
}

.completion-route-note {
  margin: 0;
  color: var(--brand-900);
  font-size: 0.82rem;
  font-weight: 800;
}

.inline-composer textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid #aac5d2;
  border-radius: 9px;
  resize: vertical;
}

.inline-composer__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.state-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(24px, 5vw, 42px);
  border: 1px dashed #c5d5dc;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.state-card h2 {
  margin-bottom: 5px;
}

.state-card p {
  margin-bottom: 14px;
  color: var(--ink-600);
  line-height: 1.5;
}

.state-card--error {
  border-color: #ecc0c0;
  background: var(--danger-soft);
}

.state-icon {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: #f4dada;
  color: var(--danger);
  font-weight: 900;
}

.state-icon--success {
  background: var(--success-soft);
  color: var(--success);
}

.task-loading {
  display: grid;
  gap: 16px;
}

.skeleton-card {
  height: 225px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(95deg, #e9eff2 25%, #f6f9fa 42%, #e9eff2 63%);
  background-size: 400% 100%;
  animation: skeleton 1.25s ease infinite;
}

.management-panel {
  max-width: 1100px;
}

.surface-form {
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.compact-form {
  margin-bottom: 20px;
  border-color: #c5dfeb;
  background: var(--brand-50);
}

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

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

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

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

.user-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.75fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.user-card--deleted {
  border-style: dashed;
  background: var(--surface-soft);
  opacity: 0.82;
}

.user-card__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.user-card__identity strong,
.user-card__identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card__identity small,
.user-card__role {
  color: var(--ink-500);
  font-size: 0.76rem;
}

.user-card__identity small {
  margin-top: 2px;
}

.user-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.status-active,
.status-inactive,
.status-deleted {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 780;
}

.status-active {
  color: var(--success);
}

.status-inactive {
  color: var(--danger);
}

.status-deleted {
  color: var(--ink-600);
}

.modal {
  width: min(calc(100% - 30px), 520px);
  max-height: min(90vh, 760px);
  max-height: min(90dvh, 760px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(10, 26, 36, 0.54);
  backdrop-filter: blur(2px);
}

.modal-card {
  display: grid;
  gap: 17px;
  padding: clamp(22px, 5vw, 34px);
  background: var(--surface);
}

.modal-card--small {
  min-height: 250px;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.icon-button {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 1.35rem;
}

.credential-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.credential-box input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #a9c5d2;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-950);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.toast-region {
  display: grid;
  position: fixed;
  z-index: 200;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(calc(100% - 36px), 380px);
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid #b6dbca;
  border-radius: 12px;
  background: #f4fcf8;
  box-shadow: var(--shadow-lg);
  color: #145d3e;
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.45;
  animation: toast-in 180ms ease both;
}

.toast--error {
  border-color: #ecc0c0;
  background: var(--danger-soft);
  color: #8d2b2b;
}

.toast--info {
  border-color: #bbd9e5;
  background: var(--brand-50);
  color: var(--brand-900);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes skeleton {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

@media (max-width: 920px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 340px;
    padding: 40px clamp(24px, 7vw, 64px);
  }

  .auth-brand,
  .auth-lead {
    margin-bottom: 24px;
  }

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

  .auth-panel {
    padding: 30px 20px 50px;
  }

  .portal-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: block;
    position: sticky;
    z-index: 40;
    top: 94px;
    width: 100%;
    height: auto;
    padding: 10px 16px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-section,
  .queue-nav {
    display: flex;
    width: max-content;
    gap: 6px;
  }

  .sidebar-section + .sidebar-section {
    margin: 0 0 0 6px;
  }

  .sidebar-label,
  .sidebar-note,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    display: flex;
    width: auto;
    min-height: 42px;
    padding: 6px 10px;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .content {
    max-width: none;
  }

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

@media (max-width: 640px) {
  .topbar {
    min-height: 72px;
    padding: 8px 12px;
  }

  .brand-logo--topbar {
    width: 46px;
    height: 46px;
  }

  .topbar-brand strong {
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: -0.02em;
  }

  .topbar-brand small,
  .topbar-brand__text > span,
  .connection-label,
  .account-name-wrap {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .connection {
    width: 34px;
    min-height: 34px;
    justify-content: center;
    padding: 0;
  }

  .account-button {
    gap: 4px;
  }

  .portal-body {
    min-height: calc(100dvh - 72px);
  }

  .sidebar {
    top: 72px;
    padding: 8px 10px;
  }

  .nav-item {
    font-size: 0.78rem;
  }

  .nav-count {
    display: none;
  }

  .content {
    padding: 24px 14px 50px;
  }

  .content-heading {
    align-items: stretch;
    gap: 14px;
  }

  .content-heading h1 {
    font-size: 1.65rem;
  }

  #refresh-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  #refresh-button span {
    color: var(--ink-800);
    font-size: 1.1rem;
  }

  .task-card__customer-row {
    align-items: flex-start;
  }

  .task-card__header {
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-card__header-aside {
    gap: 6px;
  }

  .task-card__title {
    font-size: 1.16rem;
  }

  .progress-notes__heading {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-notes__controls {
    justify-content: space-between;
  }

  .add-note-button {
    flex: 1 1 auto;
  }

  .copy-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    justify-content: center;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  .copy-button span {
    color: var(--brand-900);
    font-size: 1rem;
  }

  .task-card__footer,
  .task-card__actions {
    align-items: stretch;
  }

  .task-card__footer {
    display: grid;
  }

  .task-card__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-left: 0;
  }

  .task-card__actions .button:only-child {
    grid-column: 1 / -1;
  }

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

  .field--wide {
    grid-column: auto;
  }

  .user-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .user-card__actions {
    justify-content: flex-start;
  }

  .auth-intro {
    min-height: auto;
    padding: 28px 20px;
  }

  .auth-brand {
    align-items: flex-start;
  }

  .brand-logo--hero {
    width: 74px;
    height: 74px;
  }

  .auth-brand h1 {
    font-size: 2.35rem;
  }

  .auth-subtitle {
    font-size: 0.72rem;
  }

  .auth-lead,
  .auth-assurance {
    display: none;
  }

  .auth-panel {
    align-items: start;
    padding: 24px 14px 42px;
  }

  .auth-card,
  .password-card {
    padding: 26px 20px;
  }

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

  .credential-box {
    grid-template-columns: 1fr;
  }
}

/* Ecosystem-only identity landing */
.portal--identity-only .portal-body {
  grid-template-columns: 1fr;
}

.portal--identity-only .content {
  display: grid;
  min-height: calc(100vh - 94px);
  min-height: calc(100dvh - 94px);
  max-width: none;
  place-items: center;
}

.ecosystem-panel {
  width: min(100%, 720px);
}

.ecosystem-card {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: clamp(30px, 6vw, 58px);
  border: 1px solid #c8dde6;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 10%, rgba(201, 169, 95, 0.16), transparent 34%),
    linear-gradient(145deg, #fff, #f4fafc);
  box-shadow: var(--shadow-lg);
}

.ecosystem-card__icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--brand-600), var(--brand-900));
  box-shadow: 0 12px 28px rgba(7, 91, 140, 0.2);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
}

.ecosystem-card h1 {
  margin: 0;
  color: var(--brand-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.3rem);
  letter-spacing: -0.045em;
}

.ecosystem-card .muted {
  max-width: 58ch;
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
}

.ecosystem-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .portal--identity-only .content {
    min-height: calc(100vh - 72px);
    min-height: calc(100dvh - 72px);
  }

  .ecosystem-card {
    padding: 28px 22px;
    border-radius: 18px;
  }

  .ecosystem-card__actions,
  .ecosystem-card__actions .button {
    width: 100%;
  }
}

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

@media print {
  .topbar,
  .sidebar,
  .task-card__actions,
  .add-note-button,
  .copy-button,
  .toast-region {
    display: none !important;
  }

  .portal-body {
    display: block;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .task-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
