/**
 * 100x Life Planning System - Layout Styles
 * Header, container, grid systems, and structural elements
 */

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Transparent so the body's topography texture shows through. The brand
     "navy" vars are near-black (#000/#131313), so the old gradient rendered as
     a flat black box. */
  background: transparent;
  padding: 2rem;
}

.login-container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg, 12px);
  padding: 3rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
  margin-bottom: 1.5rem;
}

.login-logo-img {
  height: 60px;
  width: auto;
}

.login-title {
  font-family: var(--font-heading);
  font-size: calc(1.75rem + var(--text-bump));
  color: var(--navy-primary);
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: calc(1rem + var(--text-bump));
  margin: 0 0 2rem 0;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-options .google-signin-btn {
  width: 100%;
  justify-content: center;
  padding: 0.875rem 1.25rem;
  font-size: calc(1rem + var(--text-bump));
}

.login-options .signin-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: calc(0.85rem + var(--text-bump));
  margin: 0.5rem 0;
}

.login-options .signin-divider::before,
.login-options .signin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light, #e5e5e5);
}

.login-options .email-signin-form {
  text-align: left;
}

.login-options .email-input-group {
  display: flex;
  gap: 0.5rem;
}

.login-options .email-signin-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light, #e5e5e5);
  border-radius: var(--radius-md, 6px);
  font-size: calc(1rem + var(--text-bump));
  background: var(--bg-primary);
  color: var(--text-dark);
}

.login-options .email-signin-input:focus {
  outline: none;
  border-color: var(--teal-accent);
  box-shadow: 0 0 0 3px rgba(74, 155, 181, 0.1);
}

.login-options .email-signin-btn {
  white-space: nowrap;
  padding: 0.75rem 1rem;
}

.login-options .email-signin-hint {
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.login-options .email-sent-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: rgba(74, 155, 181, 0.08);
  border-radius: var(--radius-md, 6px);
  text-align: center;
}

.login-options .email-sent-message i {
  font-size: calc(2.5rem + var(--text-bump));
  color: var(--teal-accent);
}

.login-options .email-sent-message p {
  margin: 0;
  font-weight: 500;
  color: var(--text-dark);
  font-size: calc(1rem + var(--text-bump));
}

.login-options .email-sent-address {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
}

.login-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(220, 53, 69, 0.1);
  border-radius: var(--radius-md, 6px);
  color: #dc3545;
  font-size: calc(0.9rem + var(--text-bump));
}

.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light, #e5e5e5);
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted);
}

.login-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--teal-accent);
}

.login-footer .separator {
  margin: 0 0.5rem;
}

/* Dark mode adjustments for login screen */
[data-theme="dark"] .login-container {
  background: var(--bg-primary);
}

[data-theme="dark"] .login-title {
  color: var(--text-dark);
}

[data-theme="dark"] .login-options .email-signin-input {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  color: #e8ecf4;
}

[data-theme="dark"] .login-options .email-sent-message {
  background: rgba(91, 184, 212, 0.15);
}

[data-theme="dark"] .login-options .email-sent-message p {
  color: #e8ecf4;
}

[data-theme="dark"] .login-footer {
  border-top-color: var(--border-medium);
}

/* Responsive login screen */
@media (max-width: 480px) {
  .login-container {
    padding: 2rem 1.5rem;
  }

  .login-title {
    font-size: calc(1.5rem + var(--text-bump));
  }

  .login-options .email-input-group {
    flex-direction: column;
  }

  .login-options .email-signin-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== HEADER ===== */
.header {
  background: #222222; /* 100x Forum dark gray, not theme-dependent */
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--teal-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  height: 36px;
  width: auto;
  border-radius: 0;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: calc(1.4rem + var(--text-bump));
  font-weight: 500;
  color: #ffffff; /* Always white, not theme-dependent */
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.header-actions .btn-ghost {
  color: #ffffff; /* Always white, not theme-dependent */
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
}

.header-actions .btn-ghost:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

/* ===== MODULE NAVIGATION ===== */
.module-nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.module-nav-inner {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.module-nav-inner::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.module-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: calc(0.75rem + var(--text-bump));
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-width: 70px;
  border-bottom: 3px solid transparent;
}

.module-nav-btn i {
  font-size: calc(1.25rem + var(--text-bump));
}

.module-nav-btn:hover {
  color: var(--text-dark);
  background: var(--bg-secondary);
}

.module-nav-btn.active {
  color: var(--teal-accent);
  border-bottom-color: var(--teal-accent);
  background: var(--teal-light);
}

/* Main content area */
#main-content {
  position: relative;
  z-index: 1;
}

/* Module containers */
.module-container {
  position: relative;
  min-height: calc(100vh - 200px);
}

/* Centered module headers (no back button) */
[class*="-header"].centered {
  justify-content: center;
  text-align: center;
}

[class*="-header"].centered [class*="-title"] {
  text-align: center;
}

/* Hide roadmap sections when other modules active */
.overview-container,
.interview-container,
.action-interview-container {
  /* These are the roadmap module containers */
}

/* Dark theme adjustments */
[data-theme="dark"] .module-nav {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .module-nav-btn:hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .module-nav-btn.active {
  background: rgba(74, 155, 181, 0.15);
}

/* Header - slightly darker in dark mode for contrast */
[data-theme="dark"] .header {
  background: #0f1a2e;
}

/* Footer text colors are already light, no dark mode override needed */

/* ===== MAIN CONTAINER ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-xl);
}

/* ===== OVERVIEW MODE ===== */
.overview-container {
  position: relative;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  overflow: hidden; /* Clip the SVG here instead of on container */
}

.hero-background .hero-path {
  width: 100%;
  height: 100%;
}

.hero-background .hero-x {
  position: absolute;
  right: 5%;
  top: 85px;
}

/* Floating particles background */
.floaters-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.floaters-container::before,
.floaters-container::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(74, 155, 181, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(74, 155, 181, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 130px 80px, rgba(26, 43, 74, 0.3), transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(1px 1px at 200px 50px, rgba(26, 43, 74, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 250px 150px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(2px 2px at 300px 90px, rgba(74, 155, 181, 0.3), transparent),
    radial-gradient(1px 1px at 350px 180px, rgba(26, 43, 74, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 400px 60px, rgba(74, 155, 181, 0.35), transparent),
    radial-gradient(2px 2px at 450px 130px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1px 1px at 500px 200px, rgba(26, 43, 74, 0.3), transparent),
    radial-gradient(2px 2px at 550px 40px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 600px 170px, rgba(74, 155, 181, 0.3), transparent);
  background-size: 650px 650px;
  animation: float 120s linear infinite;
}

.floaters-container::after {
  background-image:
    radial-gradient(1.5px 1.5px at 80px 100px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(2px 2px at 120px 180px, rgba(26, 43, 74, 0.3), transparent),
    radial-gradient(1px 1px at 180px 60px, rgba(74, 155, 181, 0.35), transparent),
    radial-gradient(2px 2px at 220px 140px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1.5px 1.5px at 280px 200px, rgba(26, 43, 74, 0.25), transparent),
    radial-gradient(1px 1px at 340px 80px, rgba(74, 155, 181, 0.3), transparent),
    radial-gradient(2px 2px at 380px 160px, rgba(74, 155, 181, 0.2), transparent),
    radial-gradient(1.5px 1.5px at 440px 40px, rgba(26, 43, 74, 0.35), transparent),
    radial-gradient(1px 1px at 500px 120px, rgba(74, 155, 181, 0.25), transparent),
    radial-gradient(2px 2px at 560px 190px, rgba(74, 155, 181, 0.3), transparent);
  background-size: 580px 580px;
  animation: float 100s linear infinite reverse;
  animation-delay: -30s;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0.6;
  }
  25% {
    opacity: 0.8;
  }
  50% {
    transform: translateY(-25%) translateX(-10%);
    opacity: 0.5;
  }
  75% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-50%) translateX(-20%);
    opacity: 0.6;
  }
}

.overview-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.overview-header h1 {
  font-family: var(--font-heading);
  font-size: calc(2.25rem + var(--text-bump));
  color: var(--navy-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.overview-header p {
  color: var(--text-secondary);
  font-size: calc(1.1rem + var(--text-bump));
}

.overview-header .progress-bar {
  margin: 1.5rem auto;
  max-width: 400px;
}

/* ===== AI SUGGESTION ===== */
.ai-suggestion {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--teal-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: var(--spacing-xl);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.ai-icon {
  width: 44px;
  height: 44px;
  background: var(--teal-light);
  color: var(--teal-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-suggestion-content {
  flex: 1;
}

.ai-suggestion-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--navy-primary);
}

.ai-suggestion-text {
  color: var(--text-secondary);
  font-size: calc(0.9rem + var(--text-bump));
}

.ai-suggestion .btn {
  flex-shrink: 0;
}

/* ===== ROADMAP GRID ===== */
.roadmap-grid {
  display: grid;
  gap: 1rem;
}

.section-label {
  font-family: var(--font-heading);
  font-size: calc(0.75rem + var(--text-bump));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.foundation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: var(--spacing-xl);
  padding: 15px; /* Allow space for glow effect */
  margin: -15px; /* Compensate for padding */
  margin-bottom: calc(var(--spacing-xl) - 15px);
}

/* ===== ACTION PLANNING GRID ===== */
.action-section {
  margin-top: var(--spacing-xl);
}

/* #actionGrid sits in the .roadmap-grid CSS grid; without min-width:0 it would
   expand its track to the action grid's intrinsic (wide) min-content and push
   the page. Letting it shrink lets the inner .action-grid cap + scroll. */
#actionGrid {
  min-width: 0;
}

.action-grid {
  display: grid;
  grid-template-columns: 180px repeat(5, 1fr);
  gap: 2px;
  background: var(--border-light);
  border-radius: var(--radius-lg);
  /* The grid is intrinsically wide (label column + ≥5 area columns); it is its
     OWN horizontal scroll container so it never overflows the page. Making the
     grid (not a wrapper) the scroll container is what lets the first column
     stick across the whole scroll. max-width caps the box to its container so
     the wide tracks scroll instead of expanding the page; min-width:0 lets it
     shrink below its intrinsic content width. On desktop it fits → no scrollbar. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

/* Keep the row-label column (and the corner) pinned while the area columns
   scroll horizontally. Inert on desktop, where the grid fits and never scrolls. */
.action-header--corner,
.action-row-label {
  position: sticky;
  left: 0;
  z-index: 5;
}

.action-header {
  background: var(--navy-primary);
  padding: 0.75rem;
  font-size: calc(0.8rem + var(--text-bump));
  font-weight: 600;
  text-align: center;
  color: var(--text-light);
  border-bottom: 2px solid var(--teal-accent);
}

.action-row-label {
  background: var(--navy-primary);
  color: var(--text-light);
  padding: 0.75rem;
  font-size: calc(0.75rem + var(--text-bump));
  font-weight: 500;
  display: flex;
  align-items: center;
}

.action-cell {
  background: var(--bg-primary);
  padding: 0.75rem;
  font-size: calc(0.75rem + var(--text-bump));
  color: var(--text-muted);
  min-height: 60px;
  transition: all var(--transition-fast);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}

.action-cell:hover {
  background: var(--bg-tertiary);
}

.action-cell-text {
  flex: 1 1 auto;
}

/* Two explicit per-cell actions: Plan with AI + Edit. */
.action-cell-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.action-cell-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.45rem;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: calc(0.68rem + var(--text-bump));
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.action-cell-btn i {
  font-size: 0.9em;
}

.action-cell-btn--ai {
  background: var(--teal-light, #e8f4f8);
  color: var(--teal-accent);
  border-color: rgba(74, 155, 181, 0.25);
}

.action-cell-btn--ai:hover,
.action-cell-btn--ai:focus-visible {
  background: var(--teal-accent);
  color: #fff;
  outline: none;
}

.action-cell-btn--edit {
  background: transparent;
  color: var(--text-secondary, #4a5568);
  border-color: var(--border-light, rgba(0, 0, 0, 0.12));
}

.action-cell-btn--edit:hover,
.action-cell-btn--edit:focus-visible {
  background: var(--bg-secondary, #f1f4f8);
  color: var(--text-dark, #1a2b4a);
  border-color: var(--text-muted, #718096);
  outline: none;
}

.action-cell.has-manual-edit::after {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold, #d4a55c);
  opacity: 0.7;
}

.action-cell.has-content {
  color: var(--text-dark);
}

.action-cell.active-cell {
  border: 2px solid var(--teal-accent);
  box-shadow: 0 0 10px rgba(74, 155, 181, 0.2);
}

/* ===== ACTION AREA COLUMN HEADER ===== */
.action-header--area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.35rem;
  text-align: left;
  cursor: grab;
  user-select: none;
  position: relative;
}

.action-header--area:active {
  cursor: grabbing;
}

.action-header-drag-handle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  opacity: 0.4;
  font-size: calc(1rem + var(--text-bump));
  line-height: 1;
  transition: opacity var(--transition-fast);
}

.action-header--area:hover .action-header-drag-handle {
  opacity: 0.85;
}

.action-header--dragging {
  opacity: 0.5;
}

.action-header--drag-over {
  outline: 2px dashed var(--teal-accent);
  outline-offset: -2px;
}

.action-header-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.action-header-name-btn {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  display: inline-block;
}

.action-header-name-btn:hover,
.action-header-name-btn:focus-visible {
  /* Keep the light header text legible — the global a:hover turns links navy,
     which vanishes against the dark header. */
  color: var(--text-light);
  text-decoration: underline;
  outline: none;
}

.action-header-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  opacity: 0.7;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.action-header-menu-btn:hover,
.action-header-menu-btn:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

/* +Add action area column header (empty slot) */
.action-header--add {
  background: var(--bg-secondary, #f8f9fa);
  color: var(--teal-accent);
  border-bottom: 2px dashed var(--teal-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.action-add-area-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: var(--teal-accent);
  font-weight: 600;
  font-size: calc(0.8rem + var(--text-bump));
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-add-area-btn:hover,
.action-add-area-btn:focus-visible {
  background: var(--teal-light, #e8f4f8);
  outline: none;
}

.action-add-area-btn i {
  font-size: calc(1rem + var(--text-bump));
}

.action-header--empty {
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border-light);
}

.action-header--corner {
  background: var(--navy-primary);
}

.action-cell--empty,
.action-cell--placeholder {
  background: var(--bg-primary, #fff);
  cursor: default;
  color: var(--text-muted);
  /* Inset dashed outline lives inside the cell so the grid's 2px gap stays clean */
  box-shadow: inset 0 0 0 1px transparent;
  outline: 1px dashed rgba(0, 0, 0, 0.15);
  outline-offset: -6px;
}

.action-cell--placeholder {
  min-height: 60px;
}

/* Popover menu for area rename/archive — absolutely positioned so it overlays
   the grid instead of taking flow space and growing the header. */
.action-area-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0.35rem;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 26, 46, 0.2);
  padding: 0.25rem;
  z-index: 1200;
  min-width: 160px;
  display: flex;
  flex-direction: column;
}

/* The class' display:flex outranks the UA [hidden] rule (same specificity,
   declared later), so restore hidden semantics explicitly. */
.action-area-menu[hidden] {
  display: none;
}

.action-area-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-dark, #1a2b4a);
  font-size: calc(0.875rem + var(--text-bump));
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.action-area-menu-item:hover,
.action-area-menu-item:focus-visible {
  background: var(--teal-light, #e8f4f8);
  outline: none;
}

/* Status bar below action grid */
.action-grid-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.25rem;
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-secondary, #4a5568);
}

.action-grid-status-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.action-grid-status-count--cap {
  color: var(--gold, #d4a55c);
  font-weight: 500;
}

.btn-link-archived {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--teal-accent);
  font-size: calc(0.85rem + var(--text-bump));
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
}

.btn-link-archived:hover,
.btn-link-archived:focus-visible {
  background: var(--teal-light, #e8f4f8);
  outline: none;
}

/* Archived areas modal contents */
.archived-areas-modal {
  max-width: 560px;
}

/* The shared .interview-modal-body carries no padding (interview panels supply
   their own); the archived list sits directly in it, so pad it here. */
.archived-areas-modal .interview-modal-body {
  padding: 0.5rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.archived-areas-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1rem;
  max-height: 60vh;
  overflow-y: auto;
}

.archived-area-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 6px;
}

.archived-area-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.archived-restore-blocked {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  color: var(--text-muted, #718096);
  font-size: calc(0.8rem + var(--text-bump));
  font-style: italic;
}

.archived-area-view {
  font-size: calc(0.85rem + var(--text-bump));
}

.archived-area-view > summary {
  cursor: pointer;
  color: var(--teal-accent);
  width: fit-content;
  list-style-position: inside;
}

.archived-area-view > summary:hover {
  text-decoration: underline;
}

.archived-area-plan {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  border-radius: 6px;
}

.archived-area-plan dt {
  font-weight: 600;
  color: var(--text-dark, #1a2b4a);
  margin-top: 0.5rem;
}

.archived-area-plan dt:first-child {
  margin-top: 0;
}

.archived-area-plan dd {
  margin: 0.15rem 0 0;
  color: var(--text-secondary, #4a5568);
  white-space: pre-wrap;
}

.archived-area-plan dd.is-empty {
  color: var(--text-muted, #718096);
  font-style: italic;
}

.archived-areas-cap-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  background: var(--teal-light, #e8f4f8);
  border-radius: 6px;
  color: var(--text-secondary, #4a5568);
  font-size: calc(0.85rem + var(--text-bump));
}

.archived-area-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.archived-area-name {
  font-weight: 600;
  color: var(--text-dark, #1a2b4a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archived-area-date {
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted, #718096);
}

.archived-areas-empty {
  color: var(--text-muted, #718096);
  font-style: italic;
  margin: 1rem 0;
}

.archived-areas-note {
  margin: 0.5rem 0 0;
  color: var(--text-muted, #718096);
  font-size: calc(0.85rem + var(--text-bump));
}

/* ===== INTERVIEW MODE ===== */
.interview-container {
  display: none;
  max-width: 800px;
  margin: 0 auto;
}

.interview-container.active {
  display: block;
}

.interview-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: var(--spacing-xl);
}

.back-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  color: var(--navy-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: calc(1.25rem + var(--text-bump));
}

.back-btn:hover {
  border-color: var(--navy-primary);
  background: var(--bg-tertiary);
}

.interview-title {
  flex: 1;
}

.interview-title h2 {
  font-family: var(--font-heading);
  font-size: calc(1.5rem + var(--text-bump));
  color: var(--navy-primary);
  font-weight: 600;
}

.interview-title p {
  color: var(--text-secondary);
  font-size: calc(0.9rem + var(--text-bump));
}

.interview-actions {
  display: flex;
  gap: 1rem;
  margin-top: var(--spacing-lg);
  justify-content: flex-end;
}

/* ===== ACTION INTERVIEW MODE ===== */
.action-interview-container {
  display: none;
  max-width: 900px;
  margin: 0 auto;
}

.action-interview-container.active {
  display: block;
}

.action-context {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--navy-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.action-context-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.action-context-icon {
  width: 36px;
  height: 36px;
  background: var(--navy-primary);
  color: var(--text-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-context-title {
  font-family: var(--font-heading);
  font-size: calc(1rem + var(--text-bump));
  color: var(--navy-primary);
  font-weight: 600;
}

.action-context-content {
  color: var(--text-secondary);
  font-size: calc(0.9rem + var(--text-bump));
  line-height: 1.5;
  padding-left: 2.75rem;
}

.action-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.action-nav-btn {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: calc(0.75rem + var(--text-bump));
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-nav-btn:hover {
  border-color: var(--navy-primary);
  color: var(--navy-primary);
}

.action-nav-btn.active {
  background: var(--navy-primary);
  border-color: var(--navy-primary);
  color: var(--text-light);
}

.action-nav-btn.completed {
  border-color: var(--teal-accent);
  color: var(--teal-accent);
}

/* ===== MODE TOGGLE ===== */
.mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-toggle-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: calc(0.85rem + var(--text-bump));
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-toggle-btn:hover {
  border-color: var(--navy-primary);
}

.mode-toggle-btn.active {
  background: var(--navy-primary);
  border-color: var(--navy-primary);
  color: var(--text-light);
}

/* AI Mode Toggle */
.ai-mode-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.ai-mode-label {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 140px;
  height: 36px;
  background: var(--bg-tertiary);
  border-radius: 18px;
  padding: 3px;
  cursor: pointer;
  border: 1px solid var(--border-light);
}

.toggle-switch-inner {
  display: flex;
  height: 100%;
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(0.75rem + var(--text-bump));
  font-weight: 500;
  color: var(--text-muted);
  z-index: 1;
  transition: color var(--transition-fast);
  gap: 0.25rem;
}

.toggle-option.active {
  color: var(--text-light);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--navy-primary);
  border-radius: 15px;
  transition: transform var(--transition-fast);
}

.toggle-switch.ai-off .toggle-slider {
  transform: translateX(100%);
}

.toggle-switch.ai-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toggle-switch.ai-disabled .toggle-option:first-child {
  opacity: 0.5;
}

.ai-mode-description {
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted);
  font-style: italic;
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}

.toggle-group {
  display: flex;
  background: var(--navy-medium);
  border-radius: var(--radius-md);
  padding: 4px;
}

.toggle-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.toggle-btn:hover {
  color: var(--text-light);
}

.toggle-btn.active {
  background: var(--teal-accent);
  color: var(--text-light);
}

/* App shell: full-height flex column so the footer's `margin-top: auto` pins it
   to the bottom of the viewport on short pages instead of trailing the content. */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== FOOTER ===== */
.app-footer {
  background: #0f1a2e; /* Always dark navy, not theme-dependent */
  padding: 1.25rem 2rem;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: calc(0.85rem + var(--text-bump));
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: calc(0.85rem + var(--text-bump));
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--teal-accent);
}

.footer-links .separator {
  color: rgba(255, 255, 255, 0.3);
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
  /* Header */
  .header {
    padding: 0.75rem 1rem;
  }

  .logo-text {
    font-size: calc(1.1rem + var(--text-bump));
  }

  .logo-icon {
    height: 32px;
    width: auto;
  }

  .header-actions {
    gap: 0.5rem;
  }

  /* Hide button text on mobile, show icons only */
  .header-actions .btn-ghost {
    padding: 0.5rem;
    border: none;
    gap: 0;
  }

  .header-actions .btn-ghost span,
  .header-actions .btn-ghost:not(:has(i))::after {
    display: none;
  }

  /* Target the text nodes after icons */
  .header-actions .btn-ghost {
    font-size: 0;
  }

  .header-actions .btn-ghost i {
    font-size: calc(1.25rem + var(--text-bump));
  }

  /* Module nav scroll indicator */
  .module-nav {
    position: sticky;
  }

  .module-nav::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--bg-primary) 80%);
    pointer-events: none;
    z-index: 1;
  }

  .module-nav-inner {
    padding: 0 0.75rem;
    gap: 0.4rem; /* breathing room between the horizontally-scrolling tabs */
  }

  .module-nav-btn {
    padding: var(--spacing-sm) 0.85rem;
    min-width: 76px;
    font-size: calc(0.7rem + var(--text-bump));
  }

  .module-nav-btn i {
    font-size: calc(1.15rem + var(--text-bump));
  }

  /* Main container - reduced padding */
  .container {
    padding: 0.75rem;
  }

  /* The foundation grid's negative-margin glow gutter overflows narrow screens;
     drop the horizontal bleed on mobile (keeps the vertical spacing). */
  .foundation-grid {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  /* Hero section */
  .hero-title {
    font-size: calc(1.75rem + var(--text-bump));
  }

  .hero-subtitle {
    font-size: calc(1rem + var(--text-bump));
  }

  /* Progress text */
  .progress-summary {
    font-size: calc(0.9rem + var(--text-bump));
  }

  /* AI Suggestion box */
  .ai-suggestion {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .ai-suggestion .btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer */
  .app-footer {
    padding: 1rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.5rem 0.75rem;
  }

  .logo-text {
    font-size: calc(1rem + var(--text-bump));
  }

  .logo-icon {
    height: 28px;
    width: auto;
  }

  .logo {
    gap: 0.5rem;
  }

  .header-actions .btn-ghost i {
    font-size: calc(1.1rem + var(--text-bump));
  }

  .hero-title {
    font-size: calc(1.5rem + var(--text-bump));
  }
}

/* AI Mode Toggle - Mobile */
@media (max-width: 768px) {
  .ai-mode-toggle {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .ai-mode-label {
    display: none;
  }

  .toggle-switch {
    width: 100%;
    height: 40px;
  }

  .toggle-option {
    font-size: calc(0.85rem + var(--text-bump));
  }

  .ai-mode-description {
    text-align: center;
    font-size: calc(0.75rem + var(--text-bump));
  }

  /* Interview action buttons */
  .interview-actions {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .interview-actions .btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: calc(0.85rem + var(--text-bump));
    justify-content: center;
    white-space: nowrap;
  }

  /* Guided nav buttons */
  .guided-nav {
    gap: 0.5rem;
  }

  .guided-nav .btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: calc(0.85rem + var(--text-bump));
    justify-content: center;
    white-space: nowrap;
  }

  /* Show short text, hide long text on mobile */
  .btn-text-long {
    display: none;
  }

  .btn-text-short {
    display: inline;
  }
}
