/* ============================================================
   XSD User Gateway — shared theme  (Design-system Pass 2)
   Re-skinned to match the TAK Admin Portal (Pass 1):
   IBM Plex (self-hosted), dark canvas, operational green +
   interactive blue, TAK reticle + command-grid atmosphere.
   Class names and the legacy CSS-variable names are preserved
   so landing.js / reset-password.js / dashboard.js / device.js
   keep working unchanged. Mobile-first throughout.
   ============================================================ */

/* ---- Self-hosted fonts (no CDN — safe for hardened deploys) ---- */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Variable.ttf") format("truetype-variations");
  font-weight: 100 700; font-stretch: 75% 100%; font-style: normal; font-display: swap;
}
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  /* ---- Pass 1 base tokens (admin-portal values) ---- */
  --bg: #0f1419;
  --panel: #1a212b;
  --panel-2: #232d3a;
  --border: #2c3848;
  --text: #e6edf3;
  --muted: #8b97a7;
  --accent: #3fb950;     /* operational green */
  --accent-2: #2f81f7;   /* interactive blue */
  --warn: #d29922;       /* caution amber */
  --danger: #f85149;     /* fault red */
  --code: #8fe6a0;       /* mono data green */

  /* ---- Legacy gateway aliases → Pass 1 (do NOT rename in HTML/JS) ----
     Kept so any remaining references resolve to the new palette. */
  --accent-amber: var(--accent-2);
  --accent-orange: var(--accent-2);
  --accent-blue: var(--accent-2);
  --brand-red: var(--danger);

  --bg-grid-opacity: 0.6;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-pad: max(16px, var(--safe-left));
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding:
    var(--safe-top)
    max(var(--page-pad), var(--safe-right))
    var(--safe-bottom)
    max(var(--page-pad), var(--safe-left));
}

/* Subtle green command wash + fixed command-grid graticule behind everything */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 120% 80% at 62% 18%, rgba(63, 185, 80, 0.07), transparent 60%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  opacity: var(--bg-grid-opacity);
  background-image: url("assets/command-grid.svg");
  background-size: cover;
  background-position: center;
  pointer-events: none;
}
.device-phone body::after { opacity: 0.4; }

@media (prefers-reduced-motion: reduce) {
  .typewriter::after { animation: none !important; }
  .card { animation: none !important; }
}

a {
  color: var(--accent-2);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 120ms cubic-bezier(.2,0,0,1);
}
a:hover { color: #79b8ff; }

code, .mono {
  font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  color: var(--code);
}

/* ---- Header / brand ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 20px;
  flex-wrap: wrap;
}
.site-header .brand { display: flex; align-items: center; gap: 12px; }
.site-header img.logo { height: 40px; width: auto; }
.device-phone .site-header img.logo { height: 34px; }
.site-header h1 {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-header .tag {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.site-header .tag-display-name {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}
.site-header .tag-email {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.container { width: 100%; max-width: 960px; margin: 0 auto; }

/* ---- Hero ---- */
.hero { text-align: center; margin-bottom: 28px; }
.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f4f8fb;
}
.hero .typewriter {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  color: var(--accent);
  min-height: 1.5em;
  letter-spacing: 0.06em;
}

/* ---- Cards ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  animation: fadeIn 0.5s ease both;
}
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
/* Dashboard: the announcement card leads (immediate); cascade the cards that
   follow it in just after, so the bulletin clearly lands first. (No effect on
   pages without an .announcement-card — landing / reset keep their stagger.) */
.announcement-card ~ .card { animation-delay: 0.5s; }
.announcement-card ~ .card ~ .card { animation-delay: 0.62s; }
.profile-card ~ .card { animation-delay: 0.58s; }
.profile-card ~ .card ~ .card { animation-delay: 0.7s; }

/* ---- Dashboard profile (portal-managed intake fields) ---- */
.profile-card h3 { margin-bottom: 14px; }
.profile-grid {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 10px 16px;
  margin: 0;
}
.profile-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-value {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.45;
}
.profile-value a {
  color: var(--accent-2);
  text-decoration: none;
}
.profile-value a:hover { text-decoration: underline; }
@media (max-width: 520px) {
  .profile-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .profile-label { margin-top: 8px; }
  .profile-label:first-child { margin-top: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.card p { margin: 0 0 12px; color: var(--text); }
.muted { color: var(--muted); font-size: 14px; }

/* ---- Forms ---- */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select {
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px; /* ≥16px prevents iOS zoom-on-focus */
  font-family: inherit;
  transition: border-color 120ms cubic-bezier(.2,0,0,1), box-shadow 120ms cubic-bezier(.2,0,0,1);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.15);
}
input::placeholder { color: #5b6675; }

/* ---- Buttons ---- */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--accent-2);
  color: #fff;
  margin-top: 14px;
  text-decoration: none;
  transition: opacity 120ms cubic-bezier(.2,0,0,1);
}
button.secondary, .btn.secondary {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
}
button.block, .btn.block { width: 100%; }
/* Compact controls for header/toolbars — default form buttons stay 44px min-height */
button.btn-compact, .btn.btn-compact {
  margin-top: 0;
  min-height: 38px;
  min-width: auto;
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}
#oidcLoginBtn:not(.hidden) { margin-bottom: 12px; }
button:hover, .btn:hover { opacity: 0.88; }
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- Banners (Pass 1 soft signal fills) ---- */
.banner {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid;
  word-wrap: break-word;
}
.banner.error { background: rgba(248, 81, 73, 0.13); border-color: rgba(248, 81, 73, 0.35); color: var(--danger); }
.banner.ok    { background: rgba(63, 185, 80, 0.15); border-color: rgba(63, 185, 80, 0.35); color: var(--accent); }

/* ---- Dashboard announcements (NC operational bulletins) — VISUAL ANCHOR ----
   Stronger than the Connection card, calmer than an alarm: accent-tinted
   border, a blue header wash, elevation, and a left accent rail. Subject →
   time → body hierarchy. Entrance/hover motion is gated behind
   prefers-reduced-motion: no-preference so the base state is always visible. */
.announcement-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding-left: 22px; /* room for the accent rail */
  background:
    linear-gradient(180deg, rgba(47, 129, 247, 0.07), rgba(47, 129, 247, 0) 132px),
    var(--panel);
  border-color: rgba(47, 129, 247, 0.30);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(47, 129, 247, 0.10);
  animation: announceCardIn 0.4s ease both;
}
.announcement-card.card { animation-delay: 0s; } /* lead, beats positional nth-child delay */
/* left accent rail (clipped to the card's rounded corners) */
.announcement-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-2), rgba(47, 129, 247, 0.20));
}
@keyframes announceCardIn { from { opacity: 0; } to { opacity: 1; } }

.announcement-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.announcement-label-icon { display: inline-flex; }
.announcement-label-icon svg { width: 16px; height: 16px; display: block; }

.announcements-list { display: flex; flex-direction: column; }

.announcement-item {
  padding: 9px 11px;
  margin: 0 -11px;
  border-radius: 8px;
  transition: background-color 140ms ease;
}
.announcement-item:hover { background: rgba(47, 129, 247, 0.05); }
.announcement-item:first-child .announcement-title { margin-top: 0; }

.announcement-title {
  margin: 0 0 6px;
  font-size: 1.18rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: #f4f8fb;
}
.announcement-time {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.announcement-time::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
}
.announcement-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.announcement-divider {
  border: 0;
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, var(--border) 12%, var(--border) 88%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .announcement-item {
    animation: announceItemIn 0.45s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 80ms + 110ms);
  }
}
@keyframes announceItemIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.hidden { display: none !important; }
.totp-qr { margin: 12px auto; border-radius: 8px; background: #fff; padding: 8px; max-width: 220px; }
.totp-qr:not(.hidden) { display: block; }
#totpStep button { margin-top: 8px; }

.login-wrap { max-width: 420px; margin: 0 auto; }
.turnstile-slot { margin: 12px 0; }

.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .login-wrap { padding: 0 8px; }
}

/* ---- Enrollment (dashboard — collapsed by default) ---- */
.enroll-section { margin-top: 8px; }
.enroll-section .enroll-toggle > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.enroll-section .enroll-toggle > summary::-webkit-details-marker { display: none; }
.enroll-section .enroll-toggle[open] > summary { margin-bottom: 16px; }
.enroll-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.enroll-chevron svg {
  width: 15px;
  height: 15px;
  display: block;
  transition: transform 120ms cubic-bezier(.2, 0, 0, 1);
}
.enroll-toggle[open] .enroll-chevron svg { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .enroll-chevron svg { transition: none; }
}
.enroll-section .qr-wrap img {
  max-width: 100%;
  width: 200px;
  height: auto;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.ob-wizard-host { margin-top: 4px; }
.ob-wizard-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
@media (min-width: 720px) {
  .ob-wizard-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ob-wizard-picker-btn {
  margin: 0;
  padding: 10px 12px;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
}
.ob-wizard-picker-btn.active {
  border-color: var(--accent-2);
  background: rgba(63, 185, 80, 0.12);
}
.ob-wizard-picker-label { font-weight: 600; font-size: 14px; }
.ob-wizard-picker-sub { font-size: 12px; color: var(--muted); }
.ob-wizard-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-wizard-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ob-wizard-step-warn {
  border-color: rgba(210, 153, 34, 0.55);
  background: rgba(210, 153, 34, 0.08);
}
.ob-wizard-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-wizard-step-title { display: block; margin-bottom: 4px; font-size: 14px; }
.ob-wizard-step-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.ob-auth-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.ob-auth-credentials { background: rgba(88, 166, 255, 0.15); color: #79c0ff; }
.ob-auth-softcert { background: rgba(63, 185, 80, 0.15); color: #8fe6a0; }
.ob-wizard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ob-wizard-actions button { margin-top: 0; }
.ob-wizard-intro { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.ob-wizard-creds { margin: 12px 0 16px; }
.ob-wizard-creds-label { margin: 0 0 8px; font-size: 13px; }
.ob-wizard-creds-missing {
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.ob-wizard-creds-missing p { margin: 0 0 10px; }
.ob-wizard-reset-inline { margin-top: 0 !important; }
.ob-wizard-steps-continued { margin-top: 0; }
.ob-wizard-qr { margin: 8px 0 16px; }

.ob-wizard-wintak-intro {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(47, 129, 247, 0.35);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(47, 129, 247, 0.14) 0%, rgba(47, 129, 247, 0.04) 100%);
  font-size: 13px;
  line-height: 1.55;
}
.ob-wizard-picker-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #79c0ff;
  background: rgba(88, 166, 255, 0.15);
  align-self: flex-start;
}
.platform-windows .ob-wizard-picker-btn[data-ob-client="wintak"]:not(.active) {
  border-color: rgba(47, 129, 247, 0.35);
}
.ob-wizard-download {
  position: relative;
  margin: 4px 0 16px;
  padding: 16px 18px 18px;
  border: 1px solid rgba(47, 129, 247, 0.35);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(47, 129, 247, 0.16) 0%, rgba(47, 129, 247, 0.04) 55%, var(--panel-2) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.ob-wizard-download::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.ob-wizard-download-head { margin-bottom: 14px; }
.ob-wizard-download-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #79c0ff;
}
.ob-wizard-download-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.ob-wizard-download-lead {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.ob-wizard-download-btn {
  width: 100%;
  margin: 0;
  min-height: 48px;
  font-size: 15px;
  font-weight: 600;
}
.ob-wizard-download-meta {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.ob-wizard-filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #c9d1d9;
}
.ob-wizard-download-link {
  margin: 8px 0 0;
  font-size: 12px;
}
.ob-wizard-download-link a {
  color: var(--accent-2);
  display: inline;
  min-height: 0;
}
.ob-wizard-actions-compact:empty,
.ob-wizard-actions-compact:not(:has(button:not(.hidden))) {
  display: none;
}

.secret {
  background: #141b24;
  border: 1px dashed var(--warn, #d29922);
  padding: 12px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  word-break: break-all;
  line-height: 1.7;
  white-space: pre-wrap;
}
.qr-block { margin: 12px 0; padding: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; text-align: center; }
.qr-label { font-size: 12px; color: var(--muted); margin: 0 0 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.qr-img { display: block; margin: 0 auto; background: #fff; padding: 8px; border-radius: 6px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }

.qr-wrap { text-align: center; margin: 12px 0; }
.qr-wrap img {
  max-width: 100%;
  width: 280px;
  height: auto;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--accent-2);
  font-weight: 500;
}
.device-phone details .detail-body { font-size: 14px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-actions button { margin-top: 0; padding: 9px 14px; font-size: 13px; }
.header-actions .header-link {
  display: inline-block;
  padding: 9px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

a.phone-link {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.phone-link:hover { color: var(--text); }
.header-actions .header-link:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  text-decoration: none;
}
.header-actions .header-link.admin-portal {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.header-actions .header-link.admin-portal:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.footer-note {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.04em;
}

/* ============================================================
   Absorbed inline styles  (previously style="…" in the HTML)
   ============================================================ */
/* landing: small field hint under the username input */
.field-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
/* landing: "Forgot password?" line under the password field */
.form-links { margin-top: 8px; font-size: 13px; }
/* extra separation before the "Request access" card / back-links */
.card--gap { margin-top: 24px; }
.form-foot { margin-top: 16px; }
/* spacing between stacked request-access disclosures + their forms */
.card details + details { margin-top: 12px; }
.card details > form { margin-top: 12px; }

/* dashboard: device-conditional visibility (moved out of inline <style>) */
.device-phone .device-desktop-info { display: none; }
.device-desktop .device-phone-only summary,
.device-tablet .device-phone-only summary { display: none; }
.device-desktop .device-phone-only .detail-body,
.device-tablet .device-phone-only .detail-body { display: block; }
.device-desktop .device-phone-only,
.device-tablet .device-phone-only { border: none; }

/* ============================================================
   PHASE 1 polish — takuser login + home.tak.xsd.us landing
   ============================================================ */
.site-header--center { justify-content: center; }
.brand--stack { flex-direction: column; align-items: center; text-align: center; }
.logo-lockup { width: auto; max-width: min(168px, 70vw); height: auto; }
.link-grid { display: grid; gap: 10px; margin-top: 12px; }
.detail-list { margin: 12px 0 0; padding: 0; }
.detail-list div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.detail-list div:last-child { border-bottom: none; }
.detail-list dt { margin: 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.detail-list dd { margin: 0; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; color: var(--code); }
.footer-note a { color: var(--accent-2); }

/* Phase 4 — dashboard layout */
.connection-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px 12px;
  margin: 0 0 16px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
}
.connection-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.connection-values code { color: var(--code); font-size: 12px; }
.connection-sep { color: var(--muted); }

/* ============================================================
   News row — Blog (primary, left-wide) + RSS feeds (utility sidebar)
   Blog is the content focus of this row; RSS is a scannable list.
   ============================================================ */
.news-layout {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px);
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
@media (max-width: 760px) {
  .news-layout { grid-template-columns: 1fr; }
  /* DOM order: blog then RSS — no reorder needed on mobile */
}
.placeholder-card h3 { margin: 0 0 8px; font-size: 15px; }
.placeholder-copy { margin: 0; font-size: 13px; line-height: 1.5; }

/* Blog pane reads as content; RSS sidebar matches row height (no sticky float) */
.news-main,
.news-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.news-main { padding-top: 18px; }
.news-sidebar {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0) 40px),
    var(--panel);
}

/* Section headings: blog = accent kicker bar; RSS = muted utility label */
.news-main h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.news-main h3::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent-2);
}
.news-sidebar h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-feed-list,
.news-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.news-feed-list,
.news-article-list { flex: 1 1 auto; }

.rss-feed-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rss-feed-group + .rss-feed-group {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle, rgba(44,56,72,0.5));
}
.rss-feed-group-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.rss-feed-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Blog empty state — centered in stretched column (handoff7) */
.news-main .news-article-list > .news-empty {
  padding: 28px 20px;
  text-align: center;
  line-height: 1.55;
  border: 1px dashed rgba(44, 56, 72, 0.85);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.006));
}
.news-main .news-article-list > .news-empty:only-child {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 128px;
}
.news-feed-item,
.news-article-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  font-size: 13px;
  line-height: 1.45;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-subtle, rgba(44,56,72,0.5));
}
.news-feed-item {
  margin: 0 -6px;
  padding: 4px 6px 9px;
  border-radius: 6px;
  transition: background-color 120ms ease;
}
.news-feed-item:hover { background: rgba(255,255,255,0.04); }
.rss-article-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.rss-article-item a {
  font-weight: 500;
  line-height: 1.35;
}
.rss-article-meta {
  font-size: 11px;
  line-height: 1.35;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.news-feed-item:last-child,
.news-article-item:last-child { border-bottom: 0; padding-bottom: 0; }
.news-feed-item a,
.news-article-item a {
  color: var(--text);
  text-decoration: none;
  transition: color 120ms ease;
  min-height: 0;
  display: inline;
}
.news-feed-item a:hover,
.news-article-item a:hover { color: var(--accent-2); text-decoration: none; }
.news-article-time,
.news-unread {
  font-size: 11px;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.news-unread {
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
  background: rgba(47, 129, 247, 0.12);
  border: 1px solid rgba(47, 129, 247, 0.30);
  border-radius: 999px;
  color: var(--accent-2);
  font-weight: 600;
}
.news-empty { font-size: 13px; line-height: 1.5; }
.news-more { margin-top: 4px; border: 0; padding: 0; }
.news-more-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-2);
}

.blog-post-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--border) 0%, var(--border) 78%, transparent) 1;
}
@media (prefers-reduced-motion: no-preference) {
  .blog-post-item {
    animation: blogItemIn 0.45s cubic-bezier(.16, 1, .3, 1) both;
  }
  .blog-post-item:nth-child(2) { animation-delay: 0.06s; }
  .blog-post-item:nth-child(3) { animation-delay: 0.12s; }
  .blog-post-item:nth-child(4) { animation-delay: 0.18s; }
}
@keyframes blogItemIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.blog-post-hero {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04),
    0 8px 22px rgba(0,0,0,0.38),
    inset 0 0 0 1px rgba(255,255,255,0.03);
  margin-bottom: 4px;
  transition: border-color 140ms ease, box-shadow 200ms cubic-bezier(.16,1,.3,1);
}
.blog-post-item:hover .blog-post-hero {
  border-color: rgba(47,129,247,0.38);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04),
    0 10px 26px rgba(0,0,0,0.44),
    0 0 0 1px rgba(47,129,247,0.22);
}
.blog-post-body .blog-post-hero-expanded {
  margin: 0 0 12px;
  max-height: 260px;
}
.blog-figure {
  margin: 14px 0;
  padding: 0;
  text-align: center;
}
.blog-inline-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.blog-post-item:last-of-type {
  border-bottom: none;
  border-image: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.blog-post-item--expanded {
  padding-bottom: 26px;
  margin-bottom: 26px;
}
.blog-post-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #f4f8fb;
}
.blog-post-meta {
  font-size: 12px;
  line-height: 1.4;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.blog-post-excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.blog-post-body {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  max-width: 68ch;
}
@media (prefers-reduced-motion: no-preference) {
  .blog-post-body:not(.hidden) { animation: blogBodyIn 0.32s ease both; }
}
@keyframes blogBodyIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.blog-post-body.hidden { display: none !important; }
.blog-post-body p { margin: 0 0 12px; }
.blog-post-body p:last-child { margin-bottom: 0; }
.blog-h {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.blog-post-body h4.blog-h {
  font-size: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle, rgba(44,56,72,0.5));
}
.blog-h:first-child { margin-top: 0; }
.blog-quote {
  margin: 0 0 12px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent-2);
  color: var(--muted);
  font-style: italic;
}
.blog-list {
  margin: 0 0 12px 18px;
  padding: 0;
}
.blog-list li { margin-bottom: 6px; }
.blog-list li::marker { color: var(--accent-2); }
.blog-hr {
  border: none;
  height: 1px;
  margin: 16px 0;
  background: linear-gradient(90deg, transparent, var(--border) 12%, var(--border) 88%, transparent);
}
.blog-inline-code,
.blog-code code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
}
.blog-inline-code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(63, 185, 80, 0.10);
  border: 1px solid rgba(63, 185, 80, 0.22);
  color: var(--code);
}
.blog-code {
  position: relative;
  margin: 0 0 14px;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 8px;
  background: #0b0f14;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.3);
}
.blog-code code { white-space: pre; color: var(--code); }
.blog-post-body a {
  color: var(--accent-2);
  text-decoration: none;
}
.blog-post-body a:hover { text-decoration: underline; }
.blog-post-body strong { font-weight: 600; color: var(--text); }
.blog-post-body em { color: var(--muted); font-style: italic; }
.blog-post-read-more {
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  cursor: pointer;
  min-height: 0;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.blog-post-read-more:hover {
  text-decoration: none;
  border-color: rgba(47,129,247,0.45);
  background: rgba(47,129,247,0.08);
}
.blog-post-read-more:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.blog-post-read-more[aria-expanded="true"] {
  color: var(--text);
  border-color: rgba(47,129,247,0.48);
  background: rgba(47,129,247,0.14);
}

.site-footer .footer-wiki {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--accent-2);
  text-decoration: none;
  font-size: 12px;
}
.site-footer .footer-wiki:hover { text-decoration: underline; }

.site-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}
.site-footer .footer-help { margin: 0 0 6px; }
.site-footer .footer-version { margin: 0; letter-spacing: 0.04em; }

.profile-page-card { margin-top: 8px; }
.profile-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.profile-page-title { margin: 0; font-size: 18px; }
.profile-page-hint { margin: 0 0 16px; font-size: 13px; }
.profile-form.hidden { display: none; }
.profile-form .form-field { margin-bottom: 12px; }
.profile-form label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--muted); }
.profile-form input,
.profile-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.readonly-field { margin: 0; padding: 10px 0; }

/* ---- Plan page (Phase 6B) ---- */
.header-actions .header-link.plan-nav-current {
  border-color: rgba(47, 129, 247, 0.55);
  color: var(--text);
  background: rgba(47, 129, 247, 0.12);
}
.plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
  padding: 16px 18px;
}
.plan-page-title { margin: 0 0 4px; font-size: 20px; }
.plan-page-hint { margin: 0; font-size: 13px; max-width: 52ch; }
.plan-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 1 1 280px;
  max-width: 100%;
}
.plan-search-wrap {
  flex: 1 1 160px;
  max-width: 220px;
  min-width: 0;
}
.plan-toolbar-btn-group {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}
.plan-toolbar-actions button { margin-top: 0; }
.plan-search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.plan-section { margin-bottom: 16px; }
/* .plan-section-title uses the shared .section-band-title treatment (below). */
.plan-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-empty {
  padding: 18px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}
.plan-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.plan-item-highlight {
  border-color: rgba(47, 129, 247, 0.65);
  box-shadow: 0 0 0 1px rgba(47, 129, 247, 0.35);
}
.plan-item-archived { opacity: 0.82; }
.plan-item-main {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  align-items: flex-start;
}
.plan-item-body { flex: 1; min-width: 0; }
.plan-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.plan-item-title { margin: 0; font-size: 15px; font-weight: 600; }
.plan-item-meta { margin: 0 0 8px; font-size: 12px; }
.plan-item-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text);
}
.plan-item-admin-response {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.08);
}
.plan-item-admin-response-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3fb950;
  margin-bottom: 6px;
}
.plan-item-admin-response-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text);
}
.plan-item-links {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}
.plan-item-links a { color: var(--accent-2); }

/* ---- Dashboard external links card ---- */
/* ============================================================
   SHARED — banded section header
   One treatment for any heading that groups prominent content
   inside a card (links, item cards, doc subsections). Consumed by
   .external-links-* and .plan-section-title here; .section-band*
   utility classes are available for new markup directly.
   ============================================================ */
.section-band-title,
.external-links-section-title,
.plan-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-strong, #f4f8fb);
}
.section-band-title::before,
.external-links-section-title::before,
.plan-section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent-2);
  flex-shrink: 0;
}
/* Band wrapper: a top hairline + spacing separates stacked groups. */
.section-band,
.external-links-section {
  padding-top: 18px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.section-band:first-child,
.external-links-section:first-child {
  margin-top: 0;
  padding-top: 2px;
  border-top: 0;
}
/* Hairline-separated rows. */
.row-list,
.external-links-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}
.row-list > *,
.external-links-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(44, 56, 72, 0.5));
}
.row-list > :first-child,
.external-links-item:first-child { padding-top: 0; }
.row-list > :last-child,
.external-links-item:last-child { padding-bottom: 0; border-bottom: 0; }

.external-links-card { scroll-margin-top: 24px; }
.external-links-head { margin-bottom: 12px; }
.external-links-head h3 { margin: 0 0 6px; font-size: 1.05rem; }
.external-links-hint { margin: 0; font-size: 13px; }
.external-links-hint a {
  color: var(--accent-2);
  display: inline;
  min-height: 0;
  vertical-align: baseline;
}
.external-links-sections { display: flex; flex-direction: column; gap: 4px; }
/* .external-links-section / -section-title / -list / -item now use the shared
   .section-band / .section-band-title / .row-list treatment defined above. */
.external-links-item-title {
  display: block;
  min-height: 0;
  color: var(--accent-2);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.external-links-item-title:hover { text-decoration: underline; }
.external-links-item-desc {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.plan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  text-transform: capitalize;
  color: var(--muted);
}
.plan-chip-status { border-color: rgba(47, 129, 247, 0.35); color: #9ecbff; }
.plan-chip-phase { border-color: rgba(63, 185, 80, 0.35); color: var(--code); }
.plan-chip-severity-high { border-color: rgba(248, 81, 73, 0.45); color: var(--danger); }
.plan-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 36px;
}
.plan-vote-disabled { opacity: 0.55; }
.plan-vote-btn {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.plan-vote-btn:hover:not(:disabled) {
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.plan-vote-btn.is-active {
  border-color: var(--accent-2);
  background: rgba(47, 129, 247, 0.15);
  color: var(--accent-2);
}
.plan-vote-btn:disabled { cursor: not-allowed; }
.plan-vote-score {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}
.plan-vote-frozen { font-size: 11px; min-width: 36px; text-align: center; }
.plan-archive { margin-bottom: 24px; }
.plan-archive > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}
.plan-archive-list { margin-top: 12px; }
.plan-search-results {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: 8px;
  background: rgba(210, 153, 34, 0.08);
}
.plan-search-results-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warn);
}
.plan-search-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.plan-search-view-btn { padding: 4px 10px; font-size: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 16, 0.72);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.16s cubic-bezier(0.2, 0, 0, 1);
}
.modal-panel.card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  text-transform: none;
  letter-spacing: -0.01em;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-panel { animation: none; }
}
.modal-form .form-field { margin-bottom: 12px; }
.modal-form .form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--muted);
}
.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
.modal-form textarea { resize: vertical; min-height: 96px; }
.form-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 520px) {
  .plan-toolbar-actions {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
  }
  .plan-search-wrap { max-width: none; flex: 1 1 auto; }
  .plan-toolbar-btn-group { display: flex; width: 100%; }
  .plan-toolbar-btn-group .btn-compact { flex: 1; min-width: 0; }
  .form-field-row { grid-template-columns: 1fr; }
}

/* ---- Basemaps page (Phase 7 field layers) ---- */
.header-actions .header-link.basemaps-nav-current {
  border-color: rgba(47, 129, 247, 0.55);
  color: var(--text);
  background: rgba(47, 129, 247, 0.12);
}
.basemaps-intro { margin-bottom: 16px; }
.basemaps-page-title { margin: 0 0 8px; font-size: 20px; }
.basemap-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.basemap-row { padding: 18px 20px; }
.basemap-title { margin: 0 0 6px; font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.basemap-summary { margin: 0; font-size: 14px; color: var(--text); }
.basemap-detail { margin: 12px 0 0; font-size: 13px; line-height: 1.55; }
.basemap-row-pending { opacity: 0.82; }
.chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.chip-ok { border-color: rgba(63, 185, 80, 0.45); color: #7ee787; background: rgba(63, 185, 80, 0.1); }
.chip-muted { color: var(--muted); }
.basemap-assets { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.basemap-asset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.basemap-asset-label { margin: 0 0 6px; font-size: 15px; }
.basemap-asset-detail { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.basemap-download-row { margin: 0 0 10px; }
.basemap-url-row { margin: 0; font-size: 12px; line-height: 1.5; word-break: break-all; }
.basemap-url-label { display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.basemap-url {
  display: block;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.basemap-qr-hint { margin: 8px 0 0; font-size: 12px; }
.basemap-steps { margin: 16px 0 0; padding-left: 1.2rem; font-size: 13px; line-height: 1.6; }
.basemap-empty { margin: 12px 0 0; font-size: 13px; }
@media (max-width: 760px) {
  .basemap-asset { grid-template-columns: 1fr; }
  .basemap-asset-qr { max-width: 280px; margin: 0 auto; }
}
