/* ================================================================
   GORA AI – Launch Workspace  v0.4.0
   ================================================================ */

:root {
  --bg:         #f5f7f8;
  --panel:      #ffffff;
  --ink:        #162025;
  --muted:      #61717a;
  --line:       #d9e0e3;
  --teal:       #0f766e;
  --teal-soft:  #d9f0ed;
  --blue:       #295f98;
  --blue-soft:  #dce9f7;
  --amber:      #b36b16;
  --amber-soft: #f7ead8;
  --red:        #ad3434;
  --green:      #2f7d4f;
  --shadow:     0 18px 45px rgba(24, 38, 45, 0.11);
}

*  { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 280px), var(--bg);
  color: var(--ink);
}

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

/* ═══════════════════════════════════════
   AUTH VISIBILITY
═══════════════════════════════════════ */

.workspace-app        { display: none; }
.profile-setup-screen { display: none; }
/* profile-panel is now a fixed side panel — see .profile-side-panel */

body.is-authenticated .login-screen      { display: none; }
body.is-authenticated .workspace-app     { display: block; }
body.is-authenticated .profile-setup-screen { display: none; }

body.is-profile-setup .login-screen      { display: none; }
body.is-profile-setup .workspace-app     { display: none; }
body.is-profile-setup .profile-setup-screen { display: grid; }

/* ═══════════════════════════════════════
   AUTH SCREEN
═══════════════════════════════════════ */

.login-screen {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 460px);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  min-height: 100vh;
  padding: clamp(24px, 6vw, 72px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(41, 95, 152, 0.12), transparent 48%),
    #f7fafb;
}

.login-brand { max-width: 680px; }

.login-brand h1 {
  margin: 8px 0 16px;
  font-size: clamp(56px, 9vw, 104px);
  line-height: 0.9;
  letter-spacing: 0;
}

.login-brand p:not(.eyebrow) {
  max-width: 600px;
  margin: 0;
  color: #3f5059;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.35;
}

.login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.login-proof span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
}

/* Auth card container */
.login-card {
  display: grid;
  gap: 0;
  border: 1px solid rgba(217, 224, 227, 0.95);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Auth tabs ───────────────────────────────────── */

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  padding: 14px;
  border: none;
  background: #f7fafb;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.auth-tab:first-child { border-right: 1px solid var(--line); border-radius: 10px 0 0 0; }
.auth-tab:last-child  { border-radius: 0 10px 0 0; }

.auth-tab.active {
  background: #fff;
  color: var(--teal);
  position: relative;
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--teal);
}

/* ── OAuth buttons ───────────────────────────────── */

.oauth-section {
  display: grid;
  gap: 9px;
  padding: clamp(18px, 3vw, 24px) clamp(18px, 3vw, 28px) 0;
}

.oauth-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}

.oauth-btn:hover { border-color: #b0bfc6; box-shadow: 0 2px 8px rgba(24,38,45,0.07); }
.oauth-btn:active { background: #f7fafb; }

.oauth-btn svg { flex-shrink: 0; }

.oauth-btn.apple  { background: #000; color: #fff; border-color: #000; }
.oauth-btn.apple:hover { background: #111; }

/* ── Divider ─────────────────────────────────────── */

.oauth-divider {
  position: relative;
  display: flex;
  align-items: center;
  margin: 18px clamp(18px, 3vw, 28px) 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth-divider span {
  padding: 0 12px;
  white-space: nowrap;
}

/* ── Email form ──────────────────────────────────── */

.login-form {
  display: grid;
  gap: 10px;
  padding: clamp(14px, 2vw, 18px) clamp(18px, 3vw, 28px) 0;
}

.login-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 12px;
  margin-top: 4px;
  transition: border-color 120ms, outline 120ms;
}

.login-form input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.signup-fields {
  display: grid;
  gap: 4px;
}

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

.signup-fields label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.signup-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 12px;
  margin-top: 4px;
}

.signup-fields input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.login-message {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}

.login-button {
  min-height: 44px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  transition: background 120ms;
}

.login-button:hover   { background: #0d6660; }
.login-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Demo button + note */
.ghost-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.full-width {
  justify-content: center;
  width: 100%;
  margin: 0 clamp(18px, 3vw, 28px);
  width: calc(100% - clamp(36px, 6vw, 56px));
  margin-top: 12px;
}

.login-note {
  margin: 10px clamp(18px, 3vw, 28px) clamp(18px, 3vw, 24px);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Pricing CTA on login brand panel */
.login-pricing-cta {
  display: block;
  margin-top: 20px;
  text-decoration: none;
  color: inherit;
}
.login-pricing-cta-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  transition: background 180ms, border-color 180ms;
}
.login-pricing-cta:hover .login-pricing-cta-inner {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}
.login-pricing-badge {
  background: var(--amber);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.login-pricing-arrow { margin-left: auto; opacity: 0.7; }

/* Pricing note at bottom of login card */
.login-pricing-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 12px clamp(18px, 3vw, 28px) 16px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.login-pricing-note a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}
.login-pricing-note a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════
   PROFILE SETUP SCREEN
═══════════════════════════════════════ */

.profile-setup-screen {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 480px);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  min-height: 100vh;
  padding: clamp(24px, 6vw, 72px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(41, 95, 152, 0.12), transparent 48%),
    #f7fafb;
}

.profile-setup-brand { max-width: 680px; }
.profile-setup-brand h1 {
  margin: 8px 0 16px;
  font-size: clamp(40px, 7vw, 80px);
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.profile-setup-brand p:not(.eyebrow) {
  max-width: 520px; margin: 0; color: #3f5059;
  font-size: clamp(16px, 1.8vw, 20px); line-height: 1.4;
}

.profile-setup-card {
  background: #fff;
  border: 1px solid rgba(217,224,227,0.95);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 36px);
  overflow: hidden;
}

.profile-setup-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.psp-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line); flex-shrink: 0;
  transition: background 200ms;
}
.psp-dot.active { background: var(--teal); }

.psp-line {
  flex: 1; height: 2px;
  background: var(--line);
}

.profile-step-heading {
  margin: 0 0 18px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
}

.profile-step { display: grid; gap: 12px; }
.profile-step label {
  display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: var(--ink);
}

.profile-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.profile-setup-actions {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
}

.profile-skip {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13px; text-decoration: underline;
  padding: 4px 0; text-align: center;
}
.profile-skip:hover { color: var(--ink); }

.plan-select-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.plan-select { display: grid; gap: 10px; margin-bottom: 6px; }

.plan-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.plan-option:hover { border-color: var(--teal); }
.plan-option.selected,
.plan-option:has(input:checked) {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.06);
}
.plan-option input[type="radio"] { margin: 0; accent-color: var(--teal); }
.plan-option-main { display: flex; flex-direction: column; gap: 2px; }
.plan-option-name { font-weight: 800; font-size: 14px; color: var(--ink); }
.plan-option-desc { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.plan-option-price { font-weight: 800; font-size: 15px; color: var(--ink); white-space: nowrap; }
.plan-option-price small { font-weight: 600; font-size: 11px; color: var(--muted); }

/* ═══════════════════════════════════════
   PROFILE NAV BUTTON (topbar)
═══════════════════════════════════════ */

.profile-nav-btn {
  display: flex; align-items: center; gap: 0;
  background: none; border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50%; padding: 2px;
  cursor: pointer;
  transition: border-color 140ms, background 140ms;
}
.profile-nav-btn:hover { border-color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.06); }

.profile-initials-badge {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1); color: #fff;
  font-size: 10px; font-weight: 900; letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   PROFILE PANEL (workspace)
═══════════════════════════════════════ */

.profile-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding-top: 4px;
}

.profile-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}

.profile-card h3 {
  margin: 0 0 14px; font-size: 14px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}

.profile-field-row {
  display: grid; gap: 4px; margin-bottom: 12px;
}
.profile-field-row:last-child { margin-bottom: 0; }
.profile-field-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.profile-field-value { font-size: 14px; color: var(--ink); font-weight: 600; }
.profile-field-value.muted { color: var(--muted); font-weight: 400; }

.profile-edit-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: border-color 120ms, color 120ms;
  margin-top: 12px;
}
.profile-edit-btn:hover { border-color: var(--teal); color: var(--teal); }

.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; letter-spacing: 0.02em;
  margin-bottom: 14px; flex-shrink: 0;
}

.profile-name-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-name-row h4 { margin: 0; font-size: 16px; font-weight: 800; }
.profile-name-row p  { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.profile-team-list { display: grid; gap: 8px; margin-bottom: 12px; }
.profile-team-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
}
.profile-team-member-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; flex-shrink: 0;
}
.profile-team-member-info { flex: 1; min-width: 0; }
.profile-team-member-name { font-size: 13px; font-weight: 700; }
.profile-team-member-role { font-size: 12px; color: var(--muted); }
.profile-team-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 2px 4px;
  border-radius: 4px; line-height: 1;
}
.profile-team-remove:hover { color: var(--red); background: var(--amber-soft); }

.profile-add-member-form {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end;
  margin-top: 10px;
}
.profile-add-member-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; }

/* ═══════════════════════════════════════
   WORKSPACE TOPBAR
═══════════════════════════════════════ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 clamp(14px, 3vw, 40px);
  background: linear-gradient(135deg, #0d3349 0%, #0e4d60 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Brand mark */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.topbar-brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #fff; letter-spacing: -1px;
  flex-shrink: 0;
}

.topbar-brand-name {
  font-size: 14px; font-weight: 800; color: #fff; letter-spacing: 0.1px;
}
.topbar-brand-name em { color: rgba(255,255,255,0.4); font-style: normal; font-weight: 400; }

/* Actions cluster */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-badge {
  background: rgba(255,255,255,0.1) !important;
  color: rgba(255,255,255,0.65) !important;
  border: none !important;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px; font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-out-button {
  height: 30px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 140ms;
}
.sign-out-button:hover { color: rgba(255, 255, 255, 0.85); }

.pricing-nav-link {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 11px;
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  font-size: 11.5px; font-weight: 800;
  text-decoration: none;
  transition: background 160ms, border-color 160ms;
  white-space: nowrap;
}
.pricing-nav-link:hover { background: rgba(251,191,36,0.2); border-color: rgba(251,191,36,0.8); }

.support-nav-link {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px; font-weight: 800;
  text-decoration: none;
  transition: background 160ms, border-color 160ms, color 160ms;
  white-space: nowrap;
}
.support-nav-link:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.92); }

/* ═══════════════════════════════════════
   STEP NAVIGATOR (inside dark topbar)
═══════════════════════════════════════ */

.step-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  min-height: unset;
  height: 100%;
}

.step-connector {
  width: 32px;
  flex-shrink: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 6px;
  border-radius: 1px;
  transition: background 300ms;
}

.step-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 150ms;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  border-radius: 6px;
}
.step-nav-btn:hover { background: rgba(255, 255, 255, 0.06); }

.step-circle {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 250ms;
}

.step-num {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
  transition: opacity 200ms;
}

.step-check-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  color: #fff;
  transition: opacity 200ms;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  transition: color 150ms;
}

/* Active step */
.step-nav-btn.active .step-circle { background: #0ea5e9; }
.step-nav-btn.active .step-num    { color: #fff; }
.step-nav-btn.active .step-label  { color: #fff; font-weight: 700; }

/* Done step */
.step-nav-btn.done .step-circle      { background: #059669; }
.step-nav-btn.done .step-num         { opacity: 0; }
.step-nav-btn.done .step-check-icon  { opacity: 1; }
.step-nav-btn.done .step-label       { color: rgba(255, 255, 255, 0.6); }
.step-nav-btn.done + .step-connector { background: rgba(5, 150, 105, 0.5); }

/* Step 4 optional — amber accent */
.step-nav-btn--optional .step-circle { border: 1.5px dashed rgba(255,255,255,0.2); background: transparent; }
.step-nav-btn--optional .step-num    { color: rgba(255,255,255,0.35); }
.step-nav-btn--optional.active .step-circle { background: #d97706; border-color: #d97706; }
.step-nav-btn--optional.active .step-label  { color: #fbbf24; }
.step-nav-btn--optional.done .step-circle   { background: #d97706; border-color: #d97706; }

/* ═══════════════════════════════════════
   WORKSPACE PAGES (STEP FLOW)
═══════════════════════════════════════ */

.workspace-pages {
  /* Each step-page is shown/hidden; no grid needed */
}

.step-page {
  display: none;
  padding: clamp(16px, 3vw, 32px) clamp(18px, 4vw, 48px);
  gap: 18px;
  flex-direction: column;
  animation: stepPageIn 220ms ease;
}

.step-page.active {
  display: flex;
  flex-direction: column;
}

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

.step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.step-btn-next,
.step-btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
  font-family: inherit;
}

.step-btn-next {
  background: var(--teal);
  color: #fff;
  border: 2px solid var(--teal);
}
.step-btn-next:hover { background: #065f56; border-color: #065f56; }

.step-btn-prev {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
}
.step-btn-prev:hover { border-color: var(--teal); color: var(--teal); }

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid rgba(217, 224, 227, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.section-heading h2 {
  margin: 2px 0 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

/* ═══════════════════════════════════════
   PRODUCT INTAKE PANEL
═══════════════════════════════════════ */

.field-label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 10px 11px;
}

.search-input:focus, select:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

/* Search row — full width above two-column layout */
.catalog-search-row {
  margin: -4px 0 0;
}

.catalog-search-row .search-input {
  background: #f7fafb;
}

/* Two-column layout */
.catalog-layout {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--line);
  margin: 14px -18px -18px;
}

/* Left sidebar */
.catalog-sidebar {
  width: 192px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  max-height: 620px;
}

.sidebar-section { padding-bottom: 14px; }

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 7px;
}

.sidebar-divider {
  height: 1px;
  background: var(--line);
  margin: 0 0 14px;
}

/* Category filters — vertical list inside sidebar */
.catalog-sidebar .filter-tabs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
}

.catalog-sidebar .filter-tab {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 110ms, color 110ms;
}
.catalog-sidebar .filter-tab:hover  { background: var(--teal-soft); color: var(--teal); }
.catalog-sidebar .filter-tab.active { background: var(--teal-soft); color: var(--teal); font-weight: 700; }

.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 10px; font-weight: 700;
  margin-left: 5px; vertical-align: middle;
  line-height: 1; transition: background 110ms, color 110ms;
}
.catalog-sidebar .filter-tab.active .filter-count {
  background: rgba(15, 118, 110, 0.18);
  color: var(--teal);
}

/* Add product button (in section heading) */
.add-product-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 120ms;
}
.add-product-button:hover { background: var(--teal-soft); }

/* Product grid — right column */
.product-catalog {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 18px;
  padding: 16px 18px;
  max-height: 620px;
  overflow: auto;
}

.product-group {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 17px;
}

.product-group::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 99px;
  background: #2aa8c8;
}

.product-group h3  { margin: 0; color: #1989b0; font-size: 21px; }
.product-subgroup  { display: grid; gap: 10px; }
.product-subgroup h4 { margin: 0; font-size: 17px; }

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

.product-option {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0;
  text-align: left;
  box-shadow: 0 12px 28px rgba(24, 38, 45, 0.08);
  cursor: pointer;
  transition: box-shadow 150ms, border-color 150ms;
}

.product-option:hover  { box-shadow: 0 16px 36px rgba(24, 38, 45, 0.14); }
.product-option.active { border-color: var(--teal); outline: 3px solid rgba(15, 118, 110, 0.18); }

.product-visual { display: block; width: 100%; aspect-ratio: 1.9 / 1; background: #fff; }

.product-tile-caption {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 16px 12px 12px;
  background: linear-gradient(180deg, #065e7c 0%, #07557d 60%);
  color: #fff;
  position: relative;
}

.product-tile-caption::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0; right: 0;
  height: 20px;
  background: linear-gradient(to bottom, transparent, #065e7c);
  pointer-events: none;
}

.product-tile-caption strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; }
.product-tile-caption span   { color: rgba(255, 255, 255, 0.72); font-size: 12px; font-weight: 400; line-height: 1.4; }

.attribute-grid {
  display: grid;
  gap: 10px;
  padding-top: 0;
  border-top: none;
}

.attribute-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.check-row { grid-template-columns: 15px 1fr; align-items: start; color: var(--ink) !important; font-weight: 600 !important; font-size: 12px; }
.check-row input { width: 13px; height: 13px; margin: 2px 0 0; accent-color: var(--teal); }

/* ═══════════════════════════════════════
   MAP PANEL – D3 World Map
═══════════════════════════════════════ */

.map-canvas {
  position: relative;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #a9cdce;
}

/* D3-rendered SVG paths */
.map-sphere   { fill: #a9cdce; }
.map-graticule { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 0.5; }

.country { transition: opacity 180ms ease; }
.country-unknown { pointer-events: none; }

/* Tooltip */
.map-tooltip {
  display: none;
  position: absolute;
  z-index: 10;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 6px;
  background: rgba(22,32,37,0.88);
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

/* Loading message */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 700;
}

/* Legend */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(217, 224, 227, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
}

.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i    { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
/* framework legend swatches set via JS inline style */
.map-legend .unknown { background: #c8dde2; }

/* Region process card */
.region-process { display: grid; gap: 10px; margin-top: 14px; }

.process-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.process-card h3 { margin: 0 0 6px; font-size: 16px; }
.process-card p  { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.process-steps {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.process-steps li {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.process-steps span {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

/* Market cards */
.market-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }

.market-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms;
}

.market-card:hover          { border-color: #b0bfc6; }
.market-card.active         { border-color: var(--teal); background: linear-gradient(90deg, rgba(15,118,110,0.08), #fff); }
.market-card.region-highlight { border-color: var(--teal); opacity: 1; }
.market-card h3             { margin: 0 0 7px; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.market-region-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  background: var(--teal-soft); color: var(--teal);
  border-radius: 4px; padding: 2px 5px; white-space: nowrap;
}

.market-card dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 7px;
  margin: 0;
  font-size: 13px;
}

.market-card dt { color: var(--muted); font-weight: 800; }
.market-card dd { margin: 0; }

/* ═══════════════════════════════════════
   DOSSIER LAYOUT — SIDE NAV + CONTENT
═══════════════════════════════════════ */

.dossier-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
}

.dossier-sidenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  background: #f7fafb;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.sidenav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 120ms, color 120ms;
  white-space: nowrap;
  overflow: hidden;
}
.sidenav-btn svg { flex-shrink: 0; opacity: 0.65; transition: opacity 120ms; }
.sidenav-btn:hover { background: rgba(15,118,110,0.06); color: var(--ink); }
.sidenav-btn:hover svg { opacity: 1; }

.sidenav-btn.active {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
}
.sidenav-btn.active svg { opacity: 1; color: var(--teal); }

.sidenav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.sidenav-badge {
  font-size: 10px;
  font-weight: 800;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  flex-shrink: 0;
  display: none;
}
.sidenav-badge:not(:empty) { display: inline-block; }

.dossier-main {
  padding: 20px;
  min-width: 0;
  overflow: auto;
}

.dossier-main .tab-content        { display: none; }
.dossier-main .tab-content.active { display: block; }

/* ═══════════════════════════════════════
   OPTIONAL TOOLS CTA BANNER
═══════════════════════════════════════ */

.optional-tools-cta {
  margin-top: 4px;
  border: 1px dashed var(--amber);
  border-radius: 10px;
  background: var(--amber-soft);
  padding: 16px 20px;
}

.optional-cta-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.optional-cta-icon { color: var(--amber); flex-shrink: 0; }

.optional-cta-text { flex: 1; min-width: 200px; }
.optional-cta-heading {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.optional-cta-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.optional-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 2px solid var(--amber);
  border-radius: 7px;
  background: #fff;
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms;
  flex-shrink: 0;
}
.optional-cta-btn:hover { background: var(--amber-soft); }

/* ═══════════════════════════════════════
   OPTIONAL TOOLS AREA
═══════════════════════════════════════ */

.optional-area {
  border-top: 2px solid var(--amber);
  background: var(--panel);
  padding: clamp(18px, 3vw, 36px) clamp(18px, 4vw, 48px);
  animation: stepPageIn 220ms ease;
}

.optional-area-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.optional-area-header h2 {
  font-size: clamp(18px, 2.5vw, 26px);
  margin: 4px 0 8px;
}

.optional-area-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 600px;
}

.optional-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
}

.opt-tab-btn {
  flex-shrink: 0;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: color 150ms, border-color 150ms;
}
.opt-tab-btn:hover { color: var(--ink); }
.opt-tab-btn.active { color: var(--amber); border-bottom-color: var(--amber); }

.opt-tab-content       { display: none; }
.opt-tab-content.active { display: block; }

/* ═══════════════════════════════════════
   PROFILE SIDE PANEL
═══════════════════════════════════════ */

.profile-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(8,18,22,0.14);
  z-index: 200;
  overflow-y: auto;
  animation: slideInRight 220ms cubic-bezier(0.2, 0, 0.2, 1);
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.profile-side-inner { padding: 24px; }

.profile-side-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* ═══════════════════════════════════════
   DOSSIER WORKSPACE PANEL
═══════════════════════════════════════ */

.export-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms;
}

.export-button:hover { background: var(--teal-soft); }

.workspace-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.workspace-tabs::-webkit-scrollbar { display: none; }

.tab-button {
  flex-shrink: 0;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms, border-color 150ms;
}

.tab-button:hover { color: var(--ink); }

.tab-button.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 800;
}

.tab-content       { display: none; }
.tab-content.active { display: block; }

.readiness {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  margin-bottom: 12px;
}

.score-label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
#readinessScore { font-size: 28px; line-height: 1; }

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ecef;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transition: width 200ms ease;
}

.requirements-list,
.template-library,
.rationale-panel { display: grid; gap: 10px; }

.requirement-item,
.template-item,
.rationale-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.requirement-item { display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.requirement-item input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--teal); }

.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.tag {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
}

.tag.high   { background: #f6dddd; color: var(--red); }
.tag.medium { background: var(--amber-soft); color: var(--amber); }

.template-item { display: grid; gap: 7px; }

.template-item h3,
.requirement-item h3,
.rationale-item h3 { margin: 0; font-size: 16px; }

.template-item p,
.requirement-item p,
.rationale-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; font-weight: 400; }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.link-row a,
.small-button { display: inline-flex; align-items: center; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); padding: 7px 9px; text-decoration: none; font-size: 13px; font-weight: 800; cursor: pointer; }

.small-button { width: fit-content; }

/* Cost estimate inline display */
.cost-estimate {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 6px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  line-height: 1.4;
  border: 1px solid transparent;
}
.cost-estimate.cost-paid {
  background: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
}
.cost-estimate.cost-free {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.cost-estimate.cost-low {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--muted);
}
.cost-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.cost-icon { font-size: 12px; flex-shrink: 0; }
.cost-value { font-weight: 800; }
.cost-note { opacity: 0.8; }
.cost-footer {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.cost-freshness-badge {
  font-size: 11px; font-weight: 700;
}
.cost-freshness-fresh  { color: #6b7280; }
.cost-freshness-aging  { color: #b45309; }
.cost-freshness-stale  { color: #dc2626; }
.cost-estimate.cost-aging { border-color: #fcd34d; }
.cost-estimate.cost-stale { border-color: #fca5a5; background: #fff5f5; }
.cost-verify-link {
  font-size: 11px; font-weight: 700; color: var(--teal);
  text-decoration: none;
}
.cost-verify-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════
   DRAWERS
═══════════════════════════════════════ */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(8, 18, 22, 0.38);
}

.drawer.open { display: block; }

.drawer-inner {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  margin: 14px 14px 14px auto;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.drawer-inner h2   { margin: 8px 0 14px; }
.drawer-inner ol   { padding-left: 22px; }
.drawer-inner li   { margin-bottom: 8px; }

/* ─── Product drawer — structured right panel ─── */

.product-drawer-inner {
  width: min(480px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  margin: 14px 14px 14px auto;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.product-drawer-header h2 { margin: 4px 0 0; font-size: 18px; }

.product-drawer-body {
  flex: 1;
  overflow-y: auto;
}

.product-drawer-section { padding: 16px 20px; }

.product-drawer-section-label {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px;
}

.product-drawer-divider { height: 1px; background: var(--line); margin: 0 20px; }

.product-drawer-fields { display: grid; gap: 12px; }

.product-field {
  display: grid; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.product-field input,
.product-field select,
.product-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px;
  background: #f7fafb; color: var(--ink);
  padding: 9px 11px; font-size: 13px; font-family: inherit; font-weight: 400;
  transition: border-color 140ms;
}
.product-field input:focus,
.product-field select:focus,
.product-field textarea:focus { border-color: var(--teal); outline: 3px solid rgba(15,118,110,0.13); }
.product-field textarea { resize: none; line-height: 1.45; }
.product-field-optional { font-weight: 400; color: var(--muted); font-size: 12px; }

.product-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.product-market-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.market-chip {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: border-color 110ms, background 110ms, color 110ms;
}
.market-chip:hover { border-color: var(--teal); color: var(--teal); }
.market-chip.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }

.product-attr-checks { display: grid; gap: 9px; }
.product-check {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  cursor: pointer; line-height: 1.35;
}
.product-check input { width: 15px; height: 15px; margin-top: 1px; accent-color: var(--teal); flex-shrink: 0; }

.product-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.product-drawer-note {
  font-size: 11.5px; color: var(--muted); line-height: 1.4;
  margin: 0 0 12px;
}
.product-drawer-footer-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* ═══════════════════════════════════════
   ASSISTANT
═══════════════════════════════════════ */

.assistant-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 18;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.45);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 28px rgba(15, 118, 110, 0.55);
}

.assistant-launcher::before {
  content: '✦';
  font-size: 11px;
  opacity: 0.75;
}

.assistant-launcher span { font-size: 13px; font-weight: 800; letter-spacing: 0.01em; }

.assistant-panel {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 19;
  display: none;
  width: min(460px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 132px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.assistant-panel.open {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
}

.assistant-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.assistant-header h2 { margin: 3px 0 0; font-size: 22px; }

.assistant-context { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 16px 0; }
.assistant-context span { border-radius: 999px; background: var(--teal-soft); color: var(--teal); padding: 5px 8px; font-size: 12px; font-weight: 700; }

.assistant-modes { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 16px; }
.assistant-modes button { min-height: 32px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }

.assistant-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 220px;
  overflow: auto;
  padding: 4px 16px 14px;
  background: linear-gradient(180deg, #fff, #f7fafb);
}

.assistant-message {
  display: grid;
  gap: 7px;
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.assistant-message.user     { justify-self: end; border-color: rgba(15,118,110,0.34); background: var(--teal-soft); }
.assistant-message strong   { font-size: 13px; }
.assistant-message p        { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.assistant-message ul       { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.assistant-message li       { margin-bottom: 4px; }
.assistant-message .link-row { margin-top: 2px; }

.assistant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.assistant-form label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-weight: 700; }

.assistant-form textarea {
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 10px;
}

.assistant-form textarea:focus { border-color: var(--teal); outline: 3px solid rgba(15,118,110,0.14); }
.assistant-note { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ═══════════════════════════════════════
   FOOTER NOTE
═══════════════════════════════════════ */

.demo-note {
  margin: 0 clamp(18px, 4vw, 48px) 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.78);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

/* ═══════════════════════════════════════
   EXPORT GROUP
═══════════════════════════════════════ */

.export-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.export-template-src {
  border-color: var(--amber);
  color: var(--amber);
}
.export-template-src:hover {
  background: var(--amber-soft);
}

.export-pdf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms;
}

.export-pdf:hover { background: var(--blue-soft); }

/* ═══════════════════════════════════════
   COMPARE BUTTON & COMPARISON PANEL
═══════════════════════════════════════ */

.compare-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms;
}

.compare-button:hover { background: var(--teal-soft); }

.comparison-panel {
  display: none;
  margin-bottom: 16px;
}

.comparison-panel.visible { display: block; }

.cmp-product-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cmp-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cmp-table th {
  padding: 9px 12px;
  background: #f0f4f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.cmp-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.cmp-table tr:last-child td { border-bottom: none; }
.cmp-table tr:hover td { background: #f7fafb; }
.cmp-table tr.active-market td { background: var(--teal-soft); }

.cmp-cell-name {
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.cmp-detail {
  color: var(--muted);
  font-size: 12px;
}

.cmp-label {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.cmp-complexity-low    { background: #d9f0ed; color: var(--teal); }
.cmp-complexity-medium { background: var(--amber-soft); color: var(--amber); }
.cmp-complexity-high   { background: #f6dddd; color: var(--red); }

.cmp-select-btn {
  min-height: 30px;
  border: 1px solid var(--teal);
  border-radius: 5px;
  background: #fff;
  color: var(--teal);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms;
}

.cmp-select-btn:hover { background: var(--teal-soft); }

/* ═══════════════════════════════════════
   TIMELINE / GANTT
═══════════════════════════════════════ */

.timeline-content { display: grid; gap: 14px; }

.tl-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.tl-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.tl-range {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.tl-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.tl-leg-item i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tl-cat-admin   { background: #94a3b8; }
.tl-cat-testing { background: #60a5fa; }
.tl-cat-review  { background: #f59e0b; }
.tl-cat-wait    { background: #34d399; }
.tl-cat-local   { background: #a78bfa; }

.tl-chart {
  display: grid;
  gap: 5px;
  overflow: hidden;
}

.tl-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.tl-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-track {
  position: relative;
  height: 22px;
  border-radius: 4px;
  background: #edf2f4;
}

.tl-bar {
  position: absolute;
  top: 3px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.88;
  transition: opacity 120ms;
}

.tl-bar:hover { opacity: 1; }

.tl-bar[data-cat="admin"]   { background: #94a3b8; }
.tl-bar[data-cat="testing"] { background: #60a5fa; }
.tl-bar[data-cat="review"]  { background: #f59e0b; }
.tl-bar[data-cat="wait"]    { background: #34d399; }
.tl-bar[data-cat="local"]   { background: #a78bfa; }

.tl-axis {
  display: grid;
  margin-top: 6px;
  padding-left: 140px;
}

.tl-axis-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tl-months {
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  text-align: right;
}

.tl-disclaimer {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tl-note {
  padding: 10px 12px;
  border: 1px solid var(--amber-soft);
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

/* ═══════════════════════════════════════
   TEAM WORKSPACE
═══════════════════════════════════════ */

.team-content { display: grid; gap: 14px; }

.team-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.team-notes-col,
.team-activity-col {
  display: grid;
  gap: 10px;
}

.team-section-heading {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}

.team-notes-list { display: grid; gap: 8px; }

.team-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 11px;
}

.team-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.team-item-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.team-item-body { display: grid; gap: 5px; }

.team-note-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team-note-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 8px;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 120ms, outline 120ms;
}

.team-note-input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

/* Activity log */

.activity-list { display: grid; gap: 7px; }

.activity-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  flex-shrink: 0;
}

.activity-body {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
}

.activity-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* CSV export link */
.team-export-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

/* ═══════════════════════════════════════
   SOURCE FRESHNESS BADGES
═══════════════════════════════════════ */

.freshness-badge {
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.freshness-badge.fresh  { background: #d9f0ed; color: var(--teal); }
.freshness-badge.aging  { background: var(--amber-soft); color: var(--amber); }
.freshness-badge.stale  { background: #f6dddd; color: var(--red); }

/* ═══════════════════════════════════════
   AI CONFIG PANEL
═══════════════════════════════════════ */

.assistant-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  padding: 4px 7px;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.small-btn:hover { background: #f0f4f6; color: var(--ink); }

.ai-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
}

.ai-mode-badge.live {
  border-color: rgba(15, 118, 110, 0.4);
  background: var(--teal-soft);
  color: var(--teal);
}

.ai-live-tag {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.ai-config-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: #f7fafb;
  padding: 12px 16px;
  grid-column: 1 / -1;
}

.ai-config-panel.open { display: block; }

.ai-config-body { display: grid; gap: 8px; }

.ai-config-body label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-config-body input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
  font-family: ui-monospace, "Cascadia Mono", "Fira Mono", monospace;
  transition: border-color 120ms, outline 120ms;
}

.ai-config-body input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.ai-config-note {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
  line-height: 1.45;
}

.ai-config-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ai-config-status {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
}

/* ═══════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════ */

.empty-msg {
  padding: 22px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   DIGITAL SIGNATURE
═══════════════════════════════════════ */

.sig-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 18, 22, 0.6);
  backdrop-filter: blur(4px);
  animation: sigModalIn 180ms ease-out;
}

@keyframes sigModalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sig-modal[hidden] { display: none; }

.sig-modal-inner {
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(8, 18, 22, 0.22);
  padding: 24px;
  animation: sigPanelIn 220ms cubic-bezier(0.2, 0, 0.2, 1);
}

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

.sig-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sig-modal-header h2 { margin: 4px 0 0; font-size: 20px; }

.sig-section-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Saved signature preview */
.saved-sig-section { display: grid; gap: 14px; }

.saved-sig-display {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  padding: 14px 18px;
}

.saved-sig-display img { display: block; max-height: 60px; max-width: 220px; }
.saved-sig-display p   { margin: 0; font-size: 13px; color: var(--muted); }

/* Canvas draw pad */
.sig-draw-section { display: grid; gap: 14px; }

.sig-canvas-wrap {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fafcfc;
  cursor: crosshair;
  overflow: hidden;
  transition: border-color 150ms;
}

.sig-canvas-wrap:hover { border-color: var(--teal); }

.sig-canvas {
  display: block;
  width: 100%;
  height: 160px;
  touch-action: none;
}

.sig-canvas-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: #c8dde2;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  pointer-events: none;
  user-select: none;
}

.sig-name-field { display: grid; gap: 6px; }

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

/* Signed badge on template cards */
.sig-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: #d9f0ed;
  color: var(--teal);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Template item header (title + badge row) */
.template-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.template-item-header h3 { margin: 0; font-size: 16px; flex: 1; }

.sig-applied-info {
  margin: 4px 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
}

/* Signature block in template drawer */
.sig-drawer-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0 16px;
}

.sig-drawer-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
}

.sig-applied-block {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(15,118,110,0.06), #fff);
}

.sig-applied-block img { max-height: 48px; max-width: 180px; display: block; }
.sig-applied-block p   { margin: 0; font-size: 13px; color: var(--teal); font-weight: 600; }

.sig-sign-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.sig-sign-prompt p { margin: 0; color: var(--muted); font-size: 13px; }

/* ═══════════════════════════════════════
   DOCUMENT REPOSITORY
═══════════════════════════════════════ */

.repository-content { display: grid; gap: 16px; }

.repo-section { display: grid; gap: 10px; }

.repo-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repo-section-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.repo-list { display: grid; gap: 8px; }

.repo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 130ms, box-shadow 130ms;
}

.repo-item:hover { border-color: #b0bfc6; box-shadow: 0 2px 8px rgba(24,38,45,0.06); }

.repo-item-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 16px;
  flex-shrink: 0;
}

.repo-item-icon.uploaded { background: var(--teal-soft); color: var(--teal); }

.repo-item-body { flex: 1; min-width: 0; }

.repo-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-item-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.repo-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.repo-download-btn,
.repo-delete-btn {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms;
}

.repo-download-btn { color: var(--blue); border-color: rgba(41,95,152,0.3); }
.repo-download-btn:hover { background: var(--blue-soft); }
.repo-delete-btn   { color: var(--red);  border-color: rgba(173,52,52,0.25); }
.repo-delete-btn:hover { background: #f6dddd; }

.repo-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms, background 140ms;
}

.repo-upload-zone:hover,
.repo-upload-zone.drag-over {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.repo-upload-zone input[type="file"] { display: none; }
.repo-upload-zone p { margin: 0; color: var(--muted); font-size: 13px; }
.repo-upload-zone strong { color: var(--teal); font-weight: 700; }

/* ═══════════════════════════════════════
   TEMPLATE SOURCE MODAL
═══════════════════════════════════════ */

.tmpl-source-modal {
  display: none;
  position: fixed; inset: 0; z-index: 1100;
  align-items: center; justify-content: center;
  background: rgba(15,32,37,0.55);
  backdrop-filter: blur(4px);
}
.tmpl-source-modal.is-open {
  display: flex;
  animation: sigModalIn 180ms ease;
}
.tmpl-source-content {
  position: relative;
  background: var(--panel);
  border-radius: 14px;
  padding: 32px;
  width: min(560px, calc(100vw - 32px));
  box-shadow: 0 24px 64px rgba(22,32,37,0.18);
}
.tmpl-source-content h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.tmpl-source-subtitle { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.tmpl-source-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--muted);
  padding: 4px 8px; border-radius: 6px;
}
.tmpl-source-close:hover { background: var(--bg); color: var(--ink); }
.tmpl-source-options {
  display: grid; gap: 10px;
}
.tmpl-source-option {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  gap: 0 12px;
  align-items: start;
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.tmpl-source-option:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.tmpl-source-icon {
  grid-row: 1 / 3;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--panel);
}
.tmpl-source-option strong {
  font-size: 14px; font-weight: 800; color: var(--ink);
  display: block; margin-bottom: 2px;
}
.tmpl-source-option span:not(.tmpl-source-icon) {
  font-size: 12px; color: var(--muted);
}

/* ═══════════════════════════════════════
   MOTION & ANIMATION
═══════════════════════════════════════ */

/* Readiness bar — smoother ease */
.meter span {
  transition: width 650ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab content fade-in */
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
  animation: tabFadeIn 180ms ease-out;
}

/* Comparison panel slide-down */
@keyframes panelSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#comparisonPanel:not([hidden]) {
  animation: panelSlideDown 240ms cubic-bezier(0.2, 0, 0.2, 1);
}

/* Drawer slide-in from right */
@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.drawer.open .drawer-inner {
  animation: drawerIn 240ms cubic-bezier(0.2, 0, 0, 1);
}

/* Map country selection pulse */
@keyframes countryPulse {
  0%   { filter: brightness(1.6) drop-shadow(0 0 5px rgba(255,255,255,0.7)); }
  100% { filter: brightness(1)   drop-shadow(0 0 0   transparent); }
}

.country.pulse {
  animation: countryPulse 380ms ease-out forwards;
}

/* Assistant panel open */
@keyframes assistantSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.assistant-panel.open {
  animation: assistantSlideUp 200ms ease-out;
}

/* Market card hover lift */
.market-card {
  transition: border-color 140ms, background 140ms, transform 140ms, box-shadow 140ms;
}

.market-card:hover:not(.active) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(24,38,45,0.1);
}

/* Product option hover lift */
.product-option {
  transition: box-shadow 150ms, border-color 150ms, transform 150ms;
}

.product-option:hover {
  transform: translateY(-2px);
}

/* OAuth button press */
.oauth-btn {
  transition: background 120ms, border-color 120ms, box-shadow 120ms, transform 80ms;
}

.oauth-btn:active {
  transform: scale(0.975);
}

/* Login button press */
.login-button {
  transition: background 120ms, transform 80ms;
}

.login-button:active {
  transform: scale(0.975);
}

/* Export / ghost / compare buttons */
.export-button, .export-pdf, .compare-button, .ghost-button {
  transition: background 120ms, color 120ms, border-color 120ms, transform 80ms;
}

.export-button:active, .export-pdf:active, .compare-button:active {
  transform: scale(0.975);
}

/* ═══════════════════════════════════════
   OPTIONAL TABS (OEM / PRIVATE LABEL)
═══════════════════════════════════════ */

.tab-button-optional {
  color: var(--amber);
  border-left: 1px solid var(--line);
  margin-left: 4px;
  padding-left: 18px;
}
.tab-button-optional:hover { color: var(--ink); }
.tab-button-optional.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.opt-section-intro {
  margin-bottom: 28px;
}
.opt-badge {
  display: inline-block;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 10px;
}
.opt-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
}
.opt-section-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 740px;
}
.opt-section-desc strong { color: var(--ink); font-weight: 700; }

.opt-sub-heading {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.opt-key-areas {
  margin-bottom: 32px;
}
.opt-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.opt-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 16px;
  background: var(--bg);
  transition: border-color 150ms, box-shadow 150ms;
}
.opt-card:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(15,118,110,0.08);
}
.opt-card-icon {
  font-size: 22px;
  margin-bottom: 8px;
}
.opt-card h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}
.opt-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.opt-jurisdiction-table-wrap {
  margin-bottom: 32px;
  overflow-x: auto;
}
.opt-jurisdiction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.opt-jurisdiction-table th {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.opt-jurisdiction-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
  color: var(--ink);
  line-height: 1.55;
}
.opt-jurisdiction-table tr:nth-child(even) td { background: #f8fafb; }
.opt-jurisdiction-table td:first-child { white-space: nowrap; }

.opt-templates-section {
  margin-bottom: 24px;
}
.opt-templates-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.opt-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.opt-template-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 150ms, box-shadow 150ms;
}
.opt-template-card:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 12px rgba(15,118,110,0.08);
}
.opt-template-header {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--teal);
}
.opt-template-header svg { flex-shrink: 0; margin-top: 1px; }
.opt-template-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.4;
}
.opt-template-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  flex: 1;
}
.opt-template-btn {
  align-self: flex-start;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 120ms;
}
.opt-template-btn:hover { background: var(--teal-soft); }

/* ═══════════════════════════════════════
   MODE SWITCH BUTTON (topbar)
═══════════════════════════════════════ */

.mode-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.75);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms;
  white-space: nowrap;
}
.mode-switch-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ═══════════════════════════════════════
   MODE SELECTION MODAL
═══════════════════════════════════════ */

.mode-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 18, 22, 0.65);
  backdrop-filter: blur(6px);
}
.mode-modal[hidden] { display: none; }

@keyframes modeModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.mode-modal-inner {
  background: var(--panel);
  border-radius: 20px;
  box-shadow: 0 32px 96px rgba(8, 18, 22, 0.28);
  padding: clamp(28px, 5vw, 52px) clamp(24px, 5vw, 56px) clamp(32px, 5vw, 56px);
  max-width: 820px;
  width: 100%;
  animation: modeModalIn 280ms cubic-bezier(0.2, 0, 0.2, 1);
}

.mode-modal-brand {
  text-align: center;
  margin-bottom: 32px;
}
.mode-modal-brand h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  margin: 6px 0 8px;
  color: var(--ink);
}
.mode-modal-brand p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mode-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 28px 24px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms, box-shadow 180ms, transform 140ms, background 180ms;
}
.mode-option:hover {
  border-color: var(--teal);
  box-shadow: 0 6px 28px rgba(15, 118, 110, 0.14);
  transform: translateY(-3px);
  background: #fff;
}
.mode-option--portfolio:hover {
  border-color: var(--amber);
  box-shadow: 0 6px 28px rgba(179, 107, 22, 0.14);
}

.mode-option-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--teal-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
  margin-bottom: 4px;
}
.mode-option-icon--amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.mode-option strong {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}
.mode-option p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.mode-option-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  margin-top: 6px;
}
.mode-option-cta--amber { color: var(--amber); }

/* ═══════════════════════════════════════
   PORTFOLIO VIEW
═══════════════════════════════════════ */

/* Hide portfolio view by default; show only in portfolio mode */
.portfolio-view {
  display: none;
  padding: clamp(20px, 3vw, 36px) clamp(18px, 4vw, 48px) 48px;
}
.workspace-app[data-mode="portfolio"] .portfolio-view { display: block; }

/* Hide wizard elements in portfolio mode */
.workspace-app[data-mode="portfolio"] .step-nav,
.workspace-app[data-mode="portfolio"] .workspace-pages { display: none !important; }

.portfolio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.portfolio-header h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  margin: 4px 0 0;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* ─ Programme card ─────────────────────── */
.prog-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 150ms, box-shadow 150ms, transform 140ms;
  role: listitem;
}
.prog-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.1);
  transform: translateY(-2px);
}

.prog-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.prog-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.prog-card-titles { flex: 1; min-width: 0; }
.prog-card-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 3px;
  line-height: 1.3;
}
.prog-card-project {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prog-card-markets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.prog-market-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.prog-progress-wrap { display: grid; gap: 5px; }
.prog-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.prog-progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.prog-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 400ms ease;
}

.prog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.prog-status {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.prog-status--planning    { background: #f3f4f6; color: #6b7280; }
.prog-status--in-progress { background: var(--teal-soft); color: var(--teal); }
.prog-status--submitted   { background: var(--blue-soft); color: var(--blue); }
.prog-status--approved    { background: #dcfce7; color: #15803d; }
.prog-status--rejected    { background: #fee2e2; color: var(--red); }

.prog-open-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  background: none;
  border: 1.5px solid var(--teal);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 120ms;
  white-space: nowrap;
}
.prog-open-btn:hover { background: var(--teal-soft); }

/* Portfolio empty state */
.portfolio-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.portfolio-empty h3 { font-size: 18px; font-weight: 800; margin: 0; }
.portfolio-empty p { color: var(--muted); margin: 0; font-size: 14px; }
.portfolio-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--amber-soft);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════
   ADD PROGRAMME MODAL
═══════════════════════════════════════ */

.add-prog-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 18, 22, 0.6);
  backdrop-filter: blur(4px);
}
.add-prog-modal[hidden] { display: none; }

.add-prog-modal-inner {
  position: relative;
  background: var(--panel);
  border-radius: 16px;
  padding: 36px 36px 28px;
  width: min(520px, 100%);
  box-shadow: 0 24px 72px rgba(8, 18, 22, 0.24);
  animation: modeModalIn 240ms cubic-bezier(0.2, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.add-prog-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 16px;
  padding: 4px 8px;
}
.add-prog-modal-inner h2 { margin: 4px 0 20px; font-size: 18px; font-weight: 800; }

.add-prog-form {
  display: grid;
  gap: 14px;
}
.add-prog-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.add-prog-markets-field { display: grid; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); }

.add-prog-market-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.market-chip-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.market-chip-label:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}
.market-chip-label input { width: 0; height: 0; opacity: 0; position: absolute; }

.add-prog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */

@media (max-width: 1180px) {
  .dossier-layout { grid-template-columns: 180px 1fr; }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; align-items: start; padding: 22px; }
  .login-brand h1 { font-size: 54px; }
  .login-card { margin: 0 4px; }
  .oauth-section { padding-left: 16px; padding-right: 16px; }
  .oauth-divider { margin-left: 16px; margin-right: 16px; }
  .login-form { padding-left: 16px; padding-right: 16px; }
  .login-note { margin-left: 16px; margin-right: 16px; }
  .ghost-button.full-width { margin-left: 16px; margin-right: 16px; width: calc(100% - 32px); }
}

@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar-brand-name { display: none; }
  .pricing-nav-link { display: none; }
  .support-nav-link { display: none; }
  .step-label { display: none; }
  .dossier-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .dossier-sidenav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); padding: 8px; }
  .sidenav-btn { padding: 7px 10px; font-size: 12px; }
  .optional-area-header { flex-direction: column; }
  .catalog-layout { flex-direction: column; margin: 14px -18px -18px; }
  .catalog-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); max-height: none; flex-direction: row; flex-wrap: wrap; }
  .catalog-sidebar .filter-tabs { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .catalog-sidebar .filter-tab { width: auto; }
  .product-tile-grid { grid-template-columns: 1fr; }
  .map-canvas { min-height: 260px; }
  .market-card dl { grid-template-columns: 1fr; }
  .readiness { grid-template-columns: 1fr; }
  .assistant-launcher { right: 12px; bottom: 16px; height: 42px; padding: 0 16px; font-size: 12px; }
  .assistant-panel { right: 12px; bottom: 72px; max-height: calc(100vh - 96px); }
  .assistant-form { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; }
  /* v0.4.0 responsive */
  .team-split { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 90px 1fr; }
  .tl-label { font-size: 11px; }
  .export-group { flex-direction: column; align-items: flex-start; }
  .compare-button, .export-pdf { width: 100%; justify-content: center; }
  .opt-cards-grid { grid-template-columns: 1fr; }
  .opt-templates-grid { grid-template-columns: 1fr; }
  .mode-options { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-header { flex-direction: column; align-items: flex-start; }
  .add-prog-modal-inner { padding: 24px 20px 20px; }
}

/* ═══════════════════════════════════════
   TIMELINE — DATE PICKER ROW
═══════════════════════════════════════ */

.tl-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.tl-date-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.tl-date-input {
  height: 34px;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel);
  transition: border-color 140ms;
  cursor: pointer;
}

.tl-date-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15,118,110,0.12);
}

.tl-target-note {
  display: block;
  font-size: 12.5px;
  color: var(--teal);
  font-weight: 600;
  margin-top: 6px;
}

.tl-target-note.muted {
  color: var(--muted);
  font-weight: 400;
}

/* ═══════════════════════════════════════
   GAP ANALYSIS TAB
═══════════════════════════════════════ */

.gap-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.gap-header h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 2px;
}

.gap-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.gap-section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Multi-market table */
.gap-market-table-wrap { overflow-x: auto; }

.gap-mkt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gap-mkt-table th {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gap-mkt-row td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: middle;
}

.gap-mkt-name { font-weight: 700; color: var(--ink); }
.gap-mkt-pathway { color: var(--muted); font-size: 12px; }
.gap-mkt-count { font-weight: 700; white-space: nowrap; }
.gap-mkt-pct { font-weight: 800; color: var(--teal); text-align: right; }

.gap-mkt-bar-cell { min-width: 120px; }
.gap-mkt-bar {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.gap-mkt-bar > div {
  height: 100%;
  border-radius: 999px;
  transition: width 500ms cubic-bezier(0.4,0,0.2,1);
}

/* Per-category breakdown */
.gap-cats { display: flex; flex-direction: column; gap: 10px; }

.gap-cat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--panel);
  transition: border-color 140ms;
}

.gap-cat--done   { border-color: rgba(15,118,110,0.3); background: #f0fdf9; }
.gap-cat--partial { border-color: rgba(179,107,22,0.25); }
.gap-cat--open   { border-color: var(--line); }

.gap-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.gap-cat-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.gap-cat-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.gap-meter {
  height: 5px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.gap-meter-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
  transition: width 500ms cubic-bezier(0.4,0,0.2,1);
}

.gap-open-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gap-open-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink);
  padding: 4px 0;
  border-top: 1px solid rgba(217,224,227,0.5);
}

.gap-open-item--high { color: var(--red); font-weight: 600; }

.gap-priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  margin-top: 4px;
}

.gap-all-done {
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--teal);
}

/* ═══════════════════════════════════════
   COOKIE CONSENT BANNER
═══════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #162025;
  color: #e8edf0;
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 8px 32px rgba(10,20,25,0.35);
  width: min(680px, calc(100vw - 32px));
  font-size: 13px;
  line-height: 1.5;
  animation: tabFadeIn 280ms ease-out;
}

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

.cookie-text { margin: 0; flex: 1; min-width: 200px; }
.cookie-text a { color: #5eead4; text-underline-offset: 2px; }
.cookie-text a:hover { color: #fff; }

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-actions .step-btn-next.small-btn {
  height: 34px;
  padding: 0 16px;
  font-size: 12px;
}

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE ADDITIONS (v0.5)
═══════════════════════════════════════ */

@media (max-width: 520px) {
  /* Topbar — very small screens */
  .topbar { padding: 0 10px; gap: 4px; }
  .step-connector { display: none; }
  .step-circle { width: 26px; height: 26px; font-size: 11px; }
  .topbar-actions { gap: 6px; }
  .sign-out-button { display: none; }

  /* Login */
  .login-screen { padding: 16px; }
  .login-brand h1 { font-size: 42px; }
  .login-proof { flex-wrap: wrap; gap: 6px; }

  /* Product catalog */
  .catalog-search-row { padding: 0; }
  .product-catalog { grid-template-columns: 1fr; padding: 12px; }

  /* Dossier sidenav — icon only on tiny screens */
  .sidenav-label { display: none; }
  .sidenav-btn { padding: 8px; min-width: 36px; justify-content: center; }

  /* Market cards */
  .market-grid { grid-template-columns: 1fr; }
  .market-card { padding: 14px; }

  /* Map */
  .map-canvas { min-height: 220px; }

  /* Drawer full-width */
  .product-drawer-inner {
    width: 100vw;
    margin: 0;
    border-radius: 16px 16px 0 0;
    height: calc(100vh - 40px);
    position: fixed;
    bottom: 0;
    left: 0;
  }

  /* Step footer */
  .step-footer { flex-direction: column; gap: 10px; }
  .step-btn-prev, .step-btn-next { width: 100%; justify-content: center; }

  /* Gap analysis table — hide less important cols */
  .gap-mkt-pathway { display: none; }
  .gap-mkt-bar-cell { display: none; }

  /* Cookie banner */
  .cookie-banner { bottom: 10px; padding: 12px 14px; flex-direction: column; align-items: flex-start; }
  .cookie-actions { width: 100%; justify-content: flex-end; }
}

/* ═══════════════════════════════════════
   SANDBOX / SALES-DEMO MODE
═══════════════════════════════════════ */

.sandbox-badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px; margin-left: 6px;
  border: 1.5px solid rgba(94, 234, 212, 0.5);
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.12);
  color: #5eead4;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.03em; text-transform: uppercase;
  white-space: nowrap;
}
.sandbox-badge[hidden] { display: none; }

.sandbox-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 2100;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #162025;
  color: #e8edf0;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 8px 32px rgba(10,20,25,0.35);
  width: min(560px, calc(100vw - 32px));
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.sandbox-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.sandbox-toast-link { color: #5eead4; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sandbox-toast-link:hover { color: #fff; }

@media (max-width: 520px) {
  .sandbox-badge { display: none; }
  .sandbox-toast { bottom: 10px; flex-direction: column; align-items: flex-start; }
}
