:root {
  color-scheme: light;
  --brand-950: #063750;
  --brand-900: #074b72;
  --brand-800: #075b8c;
  --brand-700: #0b6d9f;
  --brand-600: #1183b8;
  --brand-100: #dff1f8;
  --brand-50: #eef8fc;
  --ink-950: #14212b;
  --ink-800: #293844;
  --ink-600: #586873;
  --ink-500: #71808b;
  --line: #dce5ea;
  --line-strong: #c9d6dd;
  --canvas: #f3f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --success: #168553;
  --success-soft: #e8f7ef;
  --warning: #a86008;
  --warning-soft: #fff4d9;
  --danger: #b33b3b;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 1px 2px rgba(13, 47, 66, 0.06), 0 4px 14px rgba(13, 47, 66, 0.05);
  --shadow-lg: 0 20px 55px rgba(6, 55, 80, 0.18);
  --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: var(--canvas);
}

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;
}

.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%),
    var(--canvas);
}

.boot-label {
  margin: 18px 0 0;
  color: var(--ink-600);
  font-weight: 700;
}

.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(53, 187, 224, 0.28), transparent 32%),
    radial-gradient(circle at 100% 85%, rgba(53, 187, 224, 0.17), transparent 28%),
    linear-gradient(145deg, var(--brand-950), var(--brand-800));
  color: white;
}

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

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

.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(255, 255, 255, 0.16);
  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: var(--surface-soft);
}

.auth-card,
.password-card {
  width: min(100%, 460px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  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: 72px;
  padding: 10px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(13, 47, 66, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

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

.topbar-brand strong {
  font-size: 1.04rem;
}

.topbar-brand small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.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 - 72px);
  min-height: calc(100dvh - 72px);
}

.sidebar {
  display: flex;
  position: sticky;
  top: 72px;
  flex-direction: column;
  align-self: start;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
  background: #f9fbfc;
}

.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);
}

.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 {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.task-card:hover {
  border-color: #c6d7df;
  box-shadow: 0 7px 22px rgba(13, 47, 66, 0.08);
}

.task-card--urgent {
  border-left: 4px solid var(--danger);
}

.task-card--high {
  border-left: 4px solid #df8e26;
}

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

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

.task-card__topline {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

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

.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--high {
  border-color: #eed5ae;
  background: var(--warning-soft);
  color: #95580b;
}

.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 {
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.task-card__customer-row {
  justify-content: space-between;
  gap: 16px;
}

.task-card__customer-row h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
}

.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: var(--surface-soft);
  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: 20px 0 0;
  padding: 16px;
  border: 1px solid #e2e9ed;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-800);
  font-size: 0.92rem;
  line-height: 1.65;
  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 #d5e5ec;
  border-radius: 11px;
  background: #f8fbfc;
}

.progress-notes--read-only {
  border-color: var(--line);
  background: var(--surface-soft);
}

.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: white;
}

.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: #f5f9fb;
}

.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 var(--line);
  background: #fbfcfd;
}

.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 var(--line);
  background: var(--brand-50);
}

.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__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 {
  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);
}

.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: 72px;
    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 {
    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: 64px;
    padding: 8px 12px;
  }

  .topbar-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .topbar-brand strong {
    font-size: 0.92rem;
  }

  .topbar-brand small,
  .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 - 64px);
  }

  .sidebar {
    top: 64px;
    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;
  }

  .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;
  }

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

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

  .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;
  }
}

@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;
  }
}
