/* ── Site Nav ─────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(130deg, var(--hero-a), var(--hero-b));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 12px rgba(14, 30, 58, 0.28);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #f0f8ff;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: #9be7d8;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  color: rgba(210, 235, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 150ms ease, color 150ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f8ff;
}

.nav-link:focus-visible {
  outline: 2px solid #9be7d8;
  outline-offset: 2px;
}

.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 10px 5px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #e8f4ff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
  flex-shrink: 0;
}

.nav-profile-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(155, 231, 216, 0.5);
}

.nav-profile-btn:focus-visible {
  outline: 2px solid #9be7d8;
  outline-offset: 2px;
}

.nav-profile-btn[data-authed="true"] {
  border-color: rgba(155, 231, 216, 0.45);
  background: rgba(15, 118, 110, 0.22);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms ease;
}

.nav-profile-btn[data-authed="true"] .nav-avatar {
  background: var(--accent);
  border-color: rgba(255, 122, 102, 0.7);
  box-shadow: 0 0 8px rgba(229, 72, 58, 0.45);
}

.nav-avatar-icon {
  width: 15px;
  height: 15px;
  stroke: rgba(220, 240, 255, 0.9);
}

.nav-avatar-initial {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
}

/* ── Hero Landing Section ─────────────────────────────────── */
.hero-ctas {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  padding: 11px 24px;
  background: linear-gradient(135deg, #e5483a 0%, #c43224 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(229, 72, 58, 0.38);
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-hero-primary:hover {
  background: linear-gradient(135deg, #ff5c4d 0%, #e5483a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 72, 58, 0.52);
}

.btn-hero-primary:focus-visible {
  outline: 2px solid #ff7a66;
  outline-offset: 2px;
  border-radius: 10px;
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  color: #f4f2ec;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 180ms ease;
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 122, 102, 0.55);
  color: #fff;
  transform: translateY(-1px);
}

.btn-hero-secondary:focus-visible {
  outline: 2px solid #9be7d8;
  outline-offset: 2px;
  border-radius: 8px;
}

:root {
  /* Shared core tokens live in /brand/tokens.css — do not redefine here. */
  --card: #ffffff;
  --accent-2: #e5483a;
  --hero-a: #16181d;
  --hero-b: #242933;
  --tab-bg: #fdfcf9;
}

[data-theme="dark"] {
  /* Shared dark tokens live in /brand/tokens.css — do not redefine here. */
  --card: #1b1f28;
  --accent-2: #ff6b5e;
  --hero-a: #0d0f14;
  --hero-b: #161a22;
  --tab-bg: #171b23;
}

* { box-sizing: border-box; }

*::selection {
  background: rgba(229, 72, 58, 0.22);
  color: #16181d;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI Variable Text", "Bahnschrift", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

body::before {
  inset: auto auto -120px -120px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 72, 58, 0.12), transparent 70%);
}

body::after {
  inset: -100px -120px auto auto;
  width: 420px;
  height: 420px;
  border-radius: 38% 62% 58% 42% / 42% 48% 52% 58%;
  background: radial-gradient(circle, rgba(255, 122, 102, 0.10), transparent 75%);
}

/* ── Floating pixel particle motif (Hat family signature) ── */
.pixel-matrix-decoration {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  vertical-align: middle;
  margin-left: 8px;
}

.pixel-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(229, 72, 58, 0.45);
  animation: pulse-pixel 2.2s infinite ease-in-out;
}

.pixel-dot:nth-child(2) {
  animation-delay: 0.35s;
  background: var(--accent-light);
  transform: translateY(-2px);
}

.pixel-dot:nth-child(3) {
  animation-delay: 0.7s;
  background: var(--accent-dark);
  transform: translateY(-5px);
}

.pixel-dot:nth-child(4) {
  animation-delay: 1.05s;
  background: #f4f2ec;
  border: 1px solid var(--accent);
  transform: translateY(-8px);
}

@keyframes pulse-pixel {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px 24px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, #16181d 0%, #20242d 55%, #2c1a1b 100%);
  color: #f4f2ec;
}

/* Subtle dynamic geometric grid in hero backdrop */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(229, 72, 58, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(229, 72, 58, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.8;
}

.hero::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(229, 72, 58, 0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(20px);
}

body.portal-compact-mode .hero {
  padding: 10px 24px;
}

body.portal-compact-mode .hero .eyebrow,
body.portal-compact-mode .hero .lede,
body.portal-compact-mode .hero .hero-ctas {
  display: none;
}

body.portal-compact-mode .hero h1 {
  margin: 2px 0;
  font-size: 24px;
  line-height: 1.12;
}

.hero-links {
  margin-top: 14px;
}

.hero-links a {
  color: #9be7d8;
  text-decoration: none;
  font-weight: 700;
}

.hero-links a:hover {
  text-decoration: underline;
}

.hero-links a:focus-visible,
.inline-link a:focus-visible,
.technical-details summary:focus-visible {
  outline: 2px solid #9be7d8;
  outline-offset: 2px;
  border-radius: 8px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(233, 242, 255, 0.85);
}

h1 {
  margin: 6px 0;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.lede {
  margin: 0;
  max-width: 780px;
  color: rgba(242, 248, 255, 0.9);
}

.hero-kicker {
  margin: 14px 0 0;
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  color: #d9f8f0;
  font-size: 12px;
  font-weight: 700;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.portal-layout {
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid rgba(139, 158, 184, 0.28);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 3px 10px rgba(17, 31, 53, 0.06);
  animation: panel-in 220ms ease-out;
}

.card.wide {
  grid-column: span 2;
}

.card-intro {
  grid-column: span 2;
}

.workspace-switcher {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: #edf3f8;
  border: 1px solid #d7e0ea;
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid #c6d4e2;
  background: var(--tab-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.workspace-tab:hover {
  border-color: #8ca8c7;
  transform: translateY(-1px);
}

.workspace-tab.active {
  border-color: #0d4e5f;
  background: linear-gradient(125deg, #123151, #0d5d68);
  color: #ecf8ff;
}

.workspace-context {
  margin: 10px 0 0;
  color: #2a4f71;
  font-size: 13px;
  font-weight: 700;
}

.workspace-hub {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.96)),
    var(--card);
}

body.portal-compact-mode .workspace-hub {
  padding-top: 12px;
  padding-bottom: 12px;
}

body.portal-compact-mode .workspace-hub h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

body.portal-compact-mode .workspace-context,
body.portal-compact-mode #workspace-hub-help {
  display: none;
}

.workspace-subnav-shell {
  grid-column: span 2;
  padding: 14px;
  border-color: rgba(17, 49, 81, 0.12);
  background: #f8fbfe;
}

.workspace-subnav-group[hidden] {
  display: none;
}

.workspace-subnav-header {
  margin-bottom: 14px;
}

.workspace-subnav-kicker {
  margin: 0 0 4px;
  color: #0f6670;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-subnav-header h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.request-tools-toggle-row,
.mailbox-tools-toggle-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-tools-toggle-row .btn,
.mailbox-tools-toggle-row .btn {
  font-size: 12px;
  padding: 6px 10px;
}

.mailbox-search-row {
  margin-top: 10px;
}

.mailbox-search-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.mailbox-search-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mailbox-search-controls input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  color: #1e293b;
}

.mailbox-search-controls input[type="search"]:focus {
  outline: 2px solid #0f675f;
  outline-offset: 1px;
}

.mailbox-search-controls .btn {
  font-size: 12px;
  padding: 6px 10px;
}

.mailbox-search-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

[data-theme="dark"] .mailbox-search-controls input[type="search"] {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #475569;
}

[data-theme="dark"] .mailbox-search-controls input[type="search"]:focus {
  outline-color: #9fd8cd;
}

.disclosure-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.disclosure-chevron {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  transition: transform 150ms ease;
}

.disclosure-btn[data-expanded="false"] .disclosure-chevron {
  transform: rotate(-90deg);
}

.mailbox-inline-hint[hidden] {
  display: none !important;
}

.mailbox-detail-block {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid #d6e1eb;
  border-radius: 10px;
  background: #f8fbff;
}

.mailbox-detail-block[hidden] {
  display: none !important;
}

.mailbox-tools-toggle-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.request-secondary-panel,
.mailbox-secondary-panel {
  border-style: dashed;
  border-color: #c8d4e0;
  background: #fbfdff;
}

#request-subnav .workspace-subnav {
  display: none;
}

#mailbox-subnav .workspace-subnav {
  display: none;
}

.workspace-subnav-shell .workspace-subnav {
  display: none;
}

.request-progress {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-progress[hidden] {
  display: none !important;
}

.request-progress-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #c9d8e6;
  background: #f3f8fd;
  color: #46617f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.request-progress-pill[data-state="current"] {
  border-color: #0d4e5f;
  background: #e7f4f7;
  color: #0d4e5f;
}

.request-progress-pill[data-state="done"] {
  border-color: #127463;
  background: #e9f7f3;
  color: #127463;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ecf4fb;
  border: 1px solid #d1dfec;
  color: #1a4c72;
  font-size: 14px;
  line-height: 1;
}

.workspace-subnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.workspace-subnav-btn {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d4dfe9;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.workspace-subnav-btn:hover {
  transform: translateY(-1px);
  border-color: #8faecc;
  box-shadow: 0 10px 22px rgba(17, 49, 81, 0.08);
}

.workspace-subnav-btn.active {
  border-color: #0d4e5f;
  background: linear-gradient(135deg, #123151, #0f5a67);
  color: #eff8ff;
}

.workspace-subnav-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf4fb;
  color: #17496d;
}

.workspace-subnav-btn.active .workspace-subnav-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.workspace-subnav-icon svg {
  width: 18px;
  height: 18px;
}

.workspace-subnav-copy strong,
.workspace-subnav-copy small {
  display: block;
}

.workspace-subnav-copy strong {
  font-size: 14px;
}

.workspace-subnav-copy small {
  margin-top: 3px;
  color: #58708a;
  font-size: 12px;
  line-height: 1.35;
}

.workspace-subnav-btn.active .workspace-subnav-copy small {
  color: rgba(235, 247, 255, 0.82);
}

.workspace-subnav-badge {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf5fb;
  color: #17496d;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.workspace-subnav-btn.active .workspace-subnav-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* ─── Request Step Rail ──────────────────────────────────────────────── */
/* Override the auto-fit grid to always be a single column vertical rail */
.workspace-subnav.request-steps {
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
}

/* Connecting line running through step node centers */
.workspace-subnav.request-steps::before {
  content: "";
  position: absolute;
  /* left: 14px (button padding) + 19px (half of 38px icon) - 1px (half line width) */
  left: 32px;
  /* top: 12px (button padding-top) + 19px (half icon height) */
  top: 31px;
  /* bottom mirrors top so the line ends at the last node center */
  bottom: 31px;
  width: 2px;
  background: linear-gradient(180deg, #d0dde8 0%, #d0dde8 100%);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.workspace-subnav.request-steps .workspace-subnav-btn {
  width: 100%;
  position: relative;
  z-index: 1;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 14px;
  margin-bottom: 0;
}

.workspace-subnav.request-steps .workspace-subnav-btn:hover {
  background: rgba(255, 255, 255, 0.86);
  border-color: #c4d4e3;
  transform: translateX(2px);
}

/* Step node: the numbered circle inside workspace-subnav-icon */
.workspace-subnav.request-steps .workspace-subnav-icon {
  background: #f0f4f8;
  border: 2px solid #c5d4e3;
  color: #6a849e;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  z-index: 1;
}

.step-num {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  display: block;
}

/* Upcoming state: default, no extra styling needed */

/* Current step: filled dark teal */
.workspace-subnav.request-steps .workspace-subnav-btn[data-step-state="current"] .workspace-subnav-icon,
.workspace-subnav.request-steps .workspace-subnav-btn.active .workspace-subnav-icon {
  background: linear-gradient(135deg, #123151, #0f5a67);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 78, 95, 0.28);
}

/* Done step: filled teal, show checkmark instead of number */
.workspace-subnav.request-steps .workspace-subnav-btn[data-step-state="done"] .workspace-subnav-icon {
  background: #0f766e;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.22);
}

.workspace-subnav.request-steps .workspace-subnav-btn[data-step-state="done"] .step-num {
  font-size: 0;
  line-height: 0;
}

.workspace-subnav.request-steps .workspace-subnav-btn[data-step-state="done"] .step-num::before {
  content: "✓";
  font-size: 16px;
  line-height: 1;
}

/* Keep the copy legible in all states for the step rail */
.workspace-subnav.request-steps .workspace-subnav-btn .workspace-subnav-copy strong {
  font-size: 13px;
}

.workspace-subnav.request-steps .request-step-state {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #ccdae7;
  background: #f2f6fb;
  color: #4f6780;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-subnav.request-steps .workspace-subnav-btn[data-step-state="current"] .request-step-state,
.workspace-subnav.request-steps .workspace-subnav-btn.active .request-step-state {
  border-color: #96b8d1;
  background: #e6f2fb;
  color: #1c4a6b;
}

.workspace-subnav.request-steps .workspace-subnav-btn[data-step-state="done"] .request-step-state {
  border-color: #7dc7ba;
  background: #e7f7f2;
  color: #0f675f;
}

/* Active state within the step rail: just use current style, add text emphasis */
.workspace-subnav.request-steps .workspace-subnav-btn.active {
  background: rgba(255, 255, 255, 0.9);
  border-color: #94b3cc;
}

.workspace-subnav.request-steps .workspace-subnav-btn.active .workspace-subnav-copy strong {
  color: #173f5b;
}

.workspace-subnav.request-steps .workspace-subnav-btn.active .workspace-subnav-copy small {
  color: #4a6a88;
}

.workspace-subnav.request-steps .workspace-subnav-btn.active .workspace-subnav-badge {
  background: #e6f0f8;
  color: #275172;
}

/* Connecting line color update: done segments teal */
.workspace-subnav.request-steps .workspace-subnav-btn[data-step-state="done"] + .workspace-subnav-btn::before {
  content: "";
  position: absolute;
  left: 32px;
  top: -1px;
  bottom: calc(50% + 0px);
  width: 2px;
  background: #0f766e;
  z-index: 0;
  pointer-events: none;
}
/* ─────────────────────────────────────────────────────────────────────── */

.request-section,
.mailbox-section {
  align-self: start;
}

#section-organizer {
  order: 1;
}

#section-inbox {
  order: 2;
}

#section-contacts {
  order: 3;
}

#section-outbox {
  order: 4;
}

.card-activity {
  grid-column: 2;
  grid-row: span 2;
  position: sticky;
  top: 74px;
  align-self: start;
  border-color: rgba(13, 78, 95, 0.2);
  box-shadow: 0 4px 14px rgba(14, 48, 76, 0.08);
  background: #ffffff;
}

.activity-help {
  margin-bottom: 12px;
}

.workspace-panel[hidden] {
  display: none;
}

h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.hero-help {
  margin-bottom: 12px;
}

.journey-list {
  margin: 0 0 12px;
  padding-left: 22px;
}

.journey-list li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #c6ddd9;
  border-radius: 10px;
  background: #f4fbfa;
  color: #144f4a;
}

.mailbox-unlock-row {
  margin-top: 12px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

input, textarea {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  font-size: 14px;
  font-family: Consolas, "Courier New", monospace;
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: none;
  border-color: #0e6f82;
  box-shadow: 0 0 0 3px rgba(14, 111, 130, 0.18);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.btn {
  border: 1px solid #0d3654;
  background: linear-gradient(120deg, #0f2945, #16486d);
  color: #fff;
  border-radius: 11px;
  padding: 9px 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  border-color: #c43224;
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: #c5d0db;
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
}

#section-challenge h2::before,
#section-verify h2::before,
#section-call h2::before {
  display: inline-flex;
  margin-right: 10px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e6f6fb;
  background: #185f7a;
}

#section-challenge h2::before {
  content: "Step 1";
}

#section-verify h2::before {
  content: "Step 2";
}

#section-call h2::before {
  content: "Step 3";
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mission-control-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mission-control-toggle {
  font-size: 11px;
  padding: 5px 9px;
}

.mission-control-toggle[hidden] {
  display: none !important;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pill.ok {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: #ecf9f6;
}

.pill.error {
  color: var(--danger);
  border-color: var(--danger);
  background: #fff1f1;
}

.card-activity.mission-collapsed {
  grid-row: span 1;
}

.card-activity.mission-collapsed .activity-help,
.card-activity.mission-collapsed .result-summary,
.card-activity.mission-collapsed .technical-details,
.card-activity.mission-collapsed .action-note {
  display: none;
}

.card-activity.mission-collapsed #copy-challenge-id {
  display: none;
}

.card-activity.mission-collapsed .result-actions {
  margin: 8px 0 0;
}

.result-summary h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.result-summary p {
  margin: 0 0 12px;
  color: var(--muted);
}

.next-steps {
  margin: 0 0 14px;
  padding-left: 20px;
}

.next-steps li {
  margin-bottom: 7px;
  line-height: 1.45;
}

.result-facts {
  display: grid;
  gap: 8px;
}

.fact-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.fact-label {
  color: var(--muted);
  font-weight: 700;
}

.fact-value {
  text-align: right;
  word-break: break-word;
}

.technical-details {
  margin-top: 14px;
}

.technical-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-2);
}

.subcard {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d5e0eb;
  border-radius: 10px;
  background: #f7fbff;
}

.call-payment-gate {
  border-style: dashed;
}

#challenge-thread-advanced-panel[hidden] {
  display: none;
}

#call-flow-panel[hidden] {
  display: none;
}

#call-payment-panel[hidden] {
  display: none;
}

.subcard h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

#section-account .subcard {
  margin-top: 8px;
}

.account-auth-note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #d8e8e5;
  border-radius: 8px;
  background: #f5fbfa;
  color: #15514c;
  font-size: 13px;
  font-weight: 700;
}

.step-actions-secondary {
  margin-top: 6px;
  margin-bottom: 8px;
}

#section-account input[type="password"] {
  letter-spacing: 0.02em;
}

.outbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.outbox-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(17, 49, 81, 0.04);
}

.outbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.outbox-type {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.outbox-ref-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: monospace;
  color: var(--muted);
  background: #f5f7fa;
}

.outbox-status-chip {
  border: 1px solid #c4d8e4;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2f607f;
  background: #eef7fc;
  margin-left: auto;
}

.outbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.outbox-event {
  font-size: 12px;
  color: var(--muted);
}

.outbox-when {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.outbox-thread-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: monospace;
  color: var(--muted);
  background: #f5f7fa;
}

.outbox-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.outbox-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.inline-checkbox input {
  width: auto;
  margin: 0;
}

.mailbox-page-hint {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.mailbox-page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.mailbox-page-size {
  width: auto;
  min-width: 72px;
  padding: 6px 8px;
}

.inbox-filter-state {
  margin: 4px 0 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #b9d4df;
  border-radius: 999px;
  background: #ecf7fb;
  color: #0c5164;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}

.inbox-summary {
  margin: 8px 0 10px;
  border: 1px solid #d8e8e5;
  border-radius: 8px;
  background: #f5fbfa;
  color: #15514c;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.inbox-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.inbox-sidebar {
  padding: 10px;
  border: 1px solid #d7e3ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbfe, #f2f7fc);
}

.inbox-sidebar-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #55718c;
}

.inbox-main {
  min-width: 0;
}

.inbox-quick-folders {
  margin: 0 0 12px;
  display: grid;
  gap: 8px;
}

.inbox-folder-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #c2d3e4;
  border-radius: 12px;
  background: #f2f7fc;
  color: #224966;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.inbox-folder-label {
  text-align: left;
}

.inbox-folder-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d3e0eb;
  color: #355774;
  font-size: 11px;
  text-align: center;
}

.inbox-folder-btn:hover {
  border-color: #89abc7;
  background: #e8f1fa;
}

.inbox-folder-btn.active {
  border-color: #0f766e;
  background: #e8f7f1;
  color: #0f675f;
}

.inbox-folder-btn.active .inbox-folder-count {
  border-color: #90cdbc;
  background: #ffffff;
  color: #0f675f;
}

.inbox-keyboard-hint {
  margin: 0;
  color: #55718c;
  font-size: 12px;
  line-height: 1.45;
}

.inbox-compact-toast {
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 1px solid #9bc7bb;
  border-radius: 9px;
  background: #edf8f5;
  color: #0f675f;
  font-size: 12px;
  font-weight: 700;
}

.inbox-undo-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 1px solid #9bc7bb;
  border-radius: 9px;
  background: #edf8f5;
  color: #0f675f;
  font-size: 12px;
  font-weight: 700;
}

.inbox-undo-toast[hidden] {
  display: none;
}

.inbox-undo-toast-btn {
  border: 1px solid #0f675f;
  border-radius: 7px;
  background: #ffffff;
  color: #0f675f;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  cursor: pointer;
}

.inbox-undo-toast-btn:hover {
  background: #0f675f;
  color: #ffffff;
}

[data-theme="dark"] .inbox-undo-toast {
  background: #12322d;
  color: #9fd8cd;
  border-color: #2b5a52;
}

[data-theme="dark"] .inbox-undo-toast-btn {
  background: transparent;
  color: #9fd8cd;
  border-color: #2b5a52;
}

[data-theme="dark"] .inbox-undo-toast-btn:hover {
  background: #2b5a52;
  color: #eafaf6;
}

.inbox-selection-toolbar {
  position: sticky;
  top: 64px;
  z-index: 15;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #c4d9e8;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f3f8fd);
  box-shadow: 0 8px 18px rgba(17, 49, 81, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inbox-selection-count {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: #24435d;
}

.inbox-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.inbox-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(17, 49, 81, 0.04);
}

.inbox-list.compact {
  gap: 6px;
}

.inbox-list.compact .inbox-item {
  border-radius: 8px;
  padding: 7px 10px;
}

.inbox-list.compact .inbox-item-header {
  gap: 6px;
}

.inbox-list.compact .inbox-item-lead,
.inbox-list.compact .inbox-title-wrap {
  gap: 6px;
}

.inbox-list.compact .inbox-item-icon {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

.inbox-list.compact .inbox-body {
  margin: 5px 0 4px;
  line-height: 1.3;
  font-size: 13px;
}

.inbox-list.compact .inbox-next-step {
  margin: 0 0 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.inbox-list.compact .inbox-item-footer {
  margin-top: 6px;
}

.inbox-list.compact .inbox-type-chip,
.inbox-list.compact .inbox-thread-chip,
.inbox-list.compact .inbox-when {
  font-size: 10px;
}

.inbox-item.selected {
  border-color: #89adc9;
  box-shadow: 0 0 0 2px rgba(40, 87, 121, 0.14);
}

.inbox-item.unread {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.inbox-item-lead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inbox-item-select {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #0f766e;
  flex-shrink: 0;
}

.inbox-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
  flex-shrink: 0;
}

.inbox-unread-dot[hidden] {
  display: none;
}

.inbox-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inbox-item-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #bcd3e4;
  background: #f2f8ff;
  color: #1d4868;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.inbox-item.unread .inbox-item-icon {
  border-color: #74b89e;
  background: #e8f7f1;
  color: #0f675f;
}

.inbox-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.inbox-item.unread .inbox-badge {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: #ecf9f6;
}

.inbox-body {
  margin: 8px 0 6px;
  color: var(--ink);
  line-height: 1.4;
}

.inbox-next-step {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px dashed #c6ddd9;
  border-radius: 8px;
  background: #f4fbfa;
  color: #144f4a;
  font-size: 13px;
}

.inbox-meta {
  color: var(--muted);
  font-size: 12px;
}

.inbox-item-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.inbox-type-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f5f7fa;
}

.inbox-when {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.inbox-thread-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: monospace;
  color: var(--muted);
  background: #f5f7fa;
}

.inbox-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .inbox-sidebar {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .inbox-quick-folders {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .inbox-selection-toolbar {
    top: 56px;
    flex-direction: column;
    align-items: flex-start;
  }
}

.organizer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.organizer-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(17, 49, 81, 0.04);
}

.organizer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.organizer-route {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}

.organizer-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.organizer-status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
  background: #f5f7fa;
}

.organizer-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.organizer-stat {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--muted);
  background: #f8f9fb;
  line-height: 1.2;
  min-width: 44px;
  text-align: center;
}

.organizer-stat b {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.organizer-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.organizer-badge-hot {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: #ecf9f6;
}

.organizer-next {
  margin: 0;
  padding: 8px 10px;
  border: 1px dashed #c6ddd9;
  border-radius: 8px;
  background: #f4fbfa;
  color: #144f4a;
  font-size: 13px;
}

.organizer-actions {
  margin-top: 8px;
}

.contacts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.contacts-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(17, 49, 81, 0.04);
}

.contacts-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.contacts-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.contacts-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.contacts-star {
  font-size: 14px;
  color: #e6a817;
  line-height: 1;
}

.contacts-channel {
  border: 1px solid #c4d8e4;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: #2f607f;
  background: #eef7fc;
}

.contacts-route-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 0;
}

.contacts-route-chip {
  border: 1px solid #d0e0eb;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: #1e4d69;
  background: #f0f8ff;
  font-family: monospace;
}

.contacts-route-none {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.contacts-micro-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
}

.contacts-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.contacts-stat b {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.contacts-stat-sep {
  color: var(--line);
  font-size: 14px;
}

.contacts-last-touch {
  font-size: 11px;
  color: var(--muted);
}

.contacts-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.contacts-notes {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px dashed #c5d5e3;
  border-radius: 8px;
  background: #f7fbff;
  color: #1f4561;
  font-size: 13px;
}

.contacts-actions {
  margin-top: 8px;
}

.contacts-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.contacts-learning-status {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px dashed #c5d5e3;
  border-radius: 8px;
  background: #f7fbff;
  color: #395468;
  font-size: 13px;
  line-height: 1.4;
}

.contacts-learning-status[data-state="updated"] {
  border-color: #b8d9c9;
  background: #f2fbf5;
  color: #1f5d3f;
}

.contacts-learning-status[data-state="skipped"] {
  border-color: #e3d3a7;
  background: #fffaf0;
  color: #7b5b12;
}

.inbox-learning-status,
.inbox-learning-inline {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px dashed #c5d5e3;
  border-radius: 8px;
  background: #f7fbff;
  color: #395468;
  font-size: 13px;
  line-height: 1.4;
}

.inbox-learning-status[data-state="updated"],
.inbox-learning-inline[data-state="updated"] {
  border-color: #b8d9c9;
  background: #f2fbf5;
  color: #1f5d3f;
}

.inbox-learning-status[data-state="skipped"],
.inbox-learning-inline[data-state="skipped"] {
  border-color: #e3d3a7;
  background: #fffaf0;
  color: #7b5b12;
}

.btn-queue-active {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: #ecf9f6;
}

.mailbox-empty-note {
  border: 1px dashed #c5d5e3;
  border-radius: 10px;
  background: #f7fbff;
  padding: 10px 12px;
  line-height: 1.4;
}

.inline-link {
  margin: 8px 0 0;
}

.inline-link a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

.inline-link a:hover {
  text-decoration: underline;
}

.result-actions {
  margin-bottom: 6px;
}

.action-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#result {
  margin: 0;
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  background: #0f1729;
  color: #d4e3ff;
  border-radius: 10px;
  padding: 10px;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .card.wide { grid-column: span 1; }
  .card-intro { grid-column: span 1; }
  .grid2 { grid-template-columns: 1fr; }
  .workspace-subnav-shell { grid-column: span 1; }
  .workspace-subnav { grid-template-columns: 1fr; }
  .workspace-subnav-btn { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .card-activity {
    grid-column: span 1;
    grid-row: auto;
    position: static;
    top: auto;
  }
  h1 { font-size: 30px; }
  .hero { padding: 28px 16px 18px; }
  .nav-inner { padding: 0 16px; gap: 12px; }
  .nav-links { gap: 0; }
  .nav-link { padding: 6px 8px; font-size: 12px; }
  #nav-profile-label { display: none; }
  .nav-profile-btn { padding: 5px; gap: 0; }
  .workspace-switcher {
    gap: 8px;
    border-radius: 14px;
  }
  .workspace-tab {
    flex: 1 1 100%;
    text-align: center;
  }
  #section-challenge h2::before,
  #section-verify h2::before,
  #section-call h2::before {
    margin-right: 8px;
    margin-bottom: 4px;
  }
  .fact-item,
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .fact-value,
  .detail-value,
  .detail-label {
    width: 100%;
    text-align: left;
    padding-left: 0;
  }
}

/* Status Lookup Page Styles */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

.hero-header {
  padding: 32px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff7e8 0%, #eef9f6 100%);
}

.hero-header h1 {
  margin: 0 0 8px;
  font-size: 36px;
}

.hero-header p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

main {
  padding: 24px;
}

.status-lookup-section {
  max-width: 600px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.btn-primary {
  background: var(--accent-2);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #c43224;
}

.btn-primary:active {
  transform: translateY(1px);
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  border: 2px solid;
}

.status-pill.ok {
  background: #ecf9f6;
  color: #0f766e;
  border-color: #0f766e;
}

.status-pill.warning {
  background: #fef3c7;
  color: #b45309;
  border-color: #b45309;
}

.status-pill.inactive {
  background: #f3f4f6;
  color: #5a6475;
  border-color: #5a6475;
}

.status-pill.default {
  background: #f0f0f0;
  color: var(--ink);
  border-color: var(--line);
}

.status-interpretation {
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid #c8ddd9;
  border-radius: 10px;
  background: #f3faf8;
}

.status-interpretation h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.status-interpretation p {
  margin: 0 0 10px;
  color: var(--muted);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--muted);
  width: 40%;
}

.detail-value {
  font-weight: 500;
  word-break: break-all;
  text-align: right;
  width: 60%;
  padding-left: 16px;
}

.detail-value a {
  color: var(--accent-2);
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

#challenge-details h3,
#call-details h3 {
  margin: 16px 0 12px;
  font-size: 16px;
}

#challenge-details h4,
#call-details h4 {
  margin: 12px 0 8px;
  font-size: 14px;
  color: var(--muted);
}

#results-panel hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 12px;
}

.alert-error {
  background: #fff1f1;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-error strong {
  display: block;
  margin-bottom: 4px;
}

.alert-error p {
  margin: 0;
}

.help-section {
  margin-top: 32px;
  background: linear-gradient(135deg, #eef9f6 0%, #fff7e8 100%);
}

.help-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.help-section ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.help-section li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.help-section p {
  margin: 0;
  text-align: center;
}

.help-section a {
  color: var(--accent-2);
  text-decoration: none;
}

.help-section a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Subscription & Pricing Styles
   --------------------------------------------------------------------------- */

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.sub-status-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  background: var(--surface-2, #1f2937);
  border: 1px solid var(--line, #374151);
  border-radius: 8px;
  padding: 6px 12px;
}

.sub-tier-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-1, #10b981);
}

.sub-expiry-label {
  font-size: 0.75rem;
  color: var(--muted, #9ca3af);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pricing-card {
  position: relative;
  background: var(--card-bg, #111827);
  border: 1px solid var(--line, #1f2937);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pricing-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-1, #10b981);
}

.pricing-card.popular {
  border-color: var(--accent-1, #10b981);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--accent-1, #10b981);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}

.pricing-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.pricing-cost {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--ink, #f9fafb);
}

.pricing-cost span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted, #9ca3af);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  flex: 1;
}

.pricing-features li {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--muted, #d1d5db);
}

.pricing-features li::before {
  content: "✓ ";
  color: var(--accent-1, #10b981);
  font-weight: 700;
}

.btn-plan {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Modal backdrop & card */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--card-bg, #111827);
  border: 1px solid var(--line, #374151);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted, #9ca3af);
  cursor: pointer;
}

.checkout-summary-box {
  background: var(--surface-2, #1f2937);
  border: 1px solid var(--line, #374151);
  border-radius: 8px;
  padding: 1rem;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.checkout-row:last-child {
  margin-bottom: 0;
}


/* ── Dark theme surface overrides (for hardcoded light backgrounds) ─────── */

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #22262f;
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] .modal-card,
[data-theme="dark"] .action-note,
[data-theme="dark"] .help-section {
  background: var(--card);
  color: var(--ink);
}

[data-theme="dark"] *::selection {
  background: rgba(255, 107, 94, 0.35);
  color: #ffffff;
}

@media (max-width: 480px) {
  .hero {
    padding: 22px 12px 14px;
  }

  h1 {
    font-size: 26px;
  }

  .card {
    padding: 14px;
  }

  .nav-inner {
    padding: 0 10px;
    gap: 8px;
  }

  .workspace-subnav-btn {
    padding: 8px;
  }

  .mailbox-search-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .inbox-selection-toolbar {
    top: 8px;
  }

  .outbox-head,
  .contacts-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

.portal-error-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--danger);
  border-radius: 10px;
  background: var(--surface);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(17, 31, 53, 0.06);
}

.portal-error-banner[hidden] {
  display: none;
}

.portal-error-message {
  flex: 1;
  min-width: 200px;
}

.portal-error-btn {
  border: 1px solid var(--danger);
  border-radius: 7px;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  cursor: pointer;
}

.portal-error-btn:hover {
  background: var(--danger);
  color: var(--surface);
}

[data-theme="dark"] .portal-error-banner {
  background: #12141a;
  color: #f87171;
  border-color: #7f1d1d;
  box-shadow: none;
}

[data-theme="dark"] .portal-error-btn {
  color: #f87171;
  border-color: #7f1d1d;
}

[data-theme="dark"] .portal-error-btn:hover {
  background: #7f1d1d;
  color: #ffe8e8;
}

/* AutoMono SSO widget (<automono-auth>) — theme it to match the portal.
   The component reads these custom properties through its shadow boundary. */
.sso-widget-wrap {
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  max-width: 420px;
}

.sso-widget-wrap automono-auth {
  --automono-auth-font-family: "Aptos", "Segoe UI Variable Text", "Bahnschrift", "Trebuchet MS", sans-serif;
  --automono-auth-max-width: 100%;
  --automono-auth-radius: 8px;
  --automono-auth-primary-bg: var(--accent);
  --automono-auth-primary-fg: #ffffff;
  --automono-auth-secondary-bg: var(--surface);
  --automono-auth-secondary-fg: var(--ink);
  --automono-auth-input-bg: var(--surface-alt);
  --automono-auth-input-fg: var(--ink);
  --automono-auth-border: var(--line);
  --automono-auth-link: var(--muted);
  --automono-auth-text: var(--ink);
  --automono-auth-muted: var(--muted);
  --automono-auth-divider: var(--line);
  --automono-auth-error: var(--danger);
}
