:root {
  color-scheme: light;
  font-size: 16px;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f4f5fb;
  --surface-overlay: rgba(247, 248, 252, 0.92);
  --background: #f7f7fb;
  --border: #d8dae5;
  --text-primary: #1b1b1f;
  --text-secondary: #3e3e44;
  --text-muted: #5f6275;
  --accent: #2563eb;
  --accent-hover: #1e40af;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  --danger: #d93025;
  --success: #388e3c;
  --badge-bg: rgba(37, 99, 235, 0.12);
  --badge-color: #2563eb;
  --badge-border: rgba(37, 99, 235, 0.2);
  --input-bg: #ffffff;
  --radius-large: 18px;
  --radius-medium: 14px;
  --radius-small: 10px;
  --shadow-soft: 0 20px 45px rgba(17, 24, 39, 0.08);
  --shadow-subtle: 0 12px 30px rgba(26, 34, 59, 0.08);
  --builder-sticky-offset: 132px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a1d;
  --surface-raised: #1f1f25;
  --surface-muted: #26262f;
  --surface-overlay: rgba(38, 38, 47, 0.9);
  --background: #121214;
  --border: #3e3e42;
  --text-primary: #e4e4e7;
  --text-secondary: #a3a3b1;
  --text-muted: #8d8d99;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.18);
  --danger: #ef4444;
  --success: #22c55e;
  --badge-bg: rgba(99, 102, 241, 0.18);
  --badge-color: #c7d2fe;
  --badge-border: rgba(99, 102, 241, 0.35);
  --input-bg: #23232c;
  --shadow-soft: 0 20px 45px rgba(0, 0, 0, 0.45);
  --shadow-subtle: 0 12px 30px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workspace-shell {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  border-bottom: 1px solid rgba(26, 34, 59, 0.1);
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  flex-wrap: wrap;
}

.workspace-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 260px;
}

.brand-logo {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.brand-logo svg {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.workspace-brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: 0.02em;
}

.workspace-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.workspace-pill {
  background: var(--badge-bg);
  color: var(--badge-color);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.workspace-divider {
  width: 1px;
  height: 28px;
  background: rgba(26, 34, 59, 0.12);
}

.workspace-select select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  background: var(--input-bg) url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" stroke="%2363636f" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M4 6l4 4 4-4"/%3E%3C/svg%3E') no-repeat right 0.55rem center;
  color: var(--text-primary);
  font-weight: 500;
}

.workspace-tabs {
  padding: 0 1.5rem 0.25rem;
  background: transparent;
}

.workspace-tabs .tabs {
  display: inline-flex;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: 0.3rem 0.35rem;
  border: 1px solid rgba(26, 34, 59, 0.08);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.workspace-tabs .tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.workspace-tabs .tab.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 6px 18px rgba(26, 34, 59, 0.12);
}

.workspace-tabs .tab:hover {
  color: var(--accent);
}

.app-layout {
  padding: 1.75rem 1.75rem 2.25rem;
  min-height: calc(100vh - 148px);
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid rgba(26, 34, 59, 0.08);
  margin-top: 4rem;
  box-shadow: 0 -12px 30px rgba(26, 34, 59, 0.08);
  transition: all 0.3s ease;
}

/* Static marketing pages */
.static-page-header {
  background: var(--surface);
  border-bottom: 1px solid rgba(26, 34, 59, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

.static-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand-link {
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text-primary);
}

.static-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.static-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.static-nav a[aria-current="page"],
.static-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.static-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.75rem 4rem;
  color: var(--text-primary);
}

.static-page .hero {
  max-width: 820px;
  margin-bottom: 3rem;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
}

.hero .lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
}

.content-grid article h2 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.content-grid article p {
  line-height: 1.7;
  color: var(--text-secondary);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist li::before {
  content: "✔";
  color: var(--accent);
  margin-right: 0.6rem;
}

.static-footer {
  max-width: 1100px;
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.static-footer a {
  color: var(--accent);
  text-decoration: none;
}

.static-footer a:hover {
  text-decoration: underline;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.help-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.help-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.help-card ol,
.help-card ul,
.help-card dl {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.help-card dl {
  padding-left: 0;
}

.help-card dt {
  font-weight: 600;
  margin-top: 0.75rem;
}

.help-card dt:first-of-type {
  margin-top: 0;
}

.help-card dd {
  margin-left: 0;
  margin-bottom: 0.5rem;
}

.help-card ul.checklist {
  padding-left: 0;
}

.help-card a {
  color: var(--accent);
  font-weight: 500;
}

.help-card a:hover {
  text-decoration: underline;
}

.workspace-tabs .tab:hover {
  color: var(--accent);
}

.workspace-actions .ghost-button {
  padding: 0.35rem 0.65rem;
}

.progress-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 34, 59, 0.12);
  background: var(--surface-muted);
  box-shadow: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.progress-indicator .ghost-button {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
}

.progress-bar-container {
  width: 120px;
  height: 5px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.progress-text {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-details {
  position: absolute;
  top: 70px;
  right: 1.5rem;
  width: 280px;
  background: var(--surface);
  border: 1px solid rgba(26, 34, 59, 0.1);
  border-radius: var(--radius-medium);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  padding: 1rem 1.25rem;
  z-index: 140;
}

.progress-details.hidden {
  display: none !important;
}

.progress-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.progress-check-item .check-icon {
  font-size: 1rem;
}

.progress-check-item.done {
  color: var(--success);
}

@media (max-width: 1280px) {
  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .workspace-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .workspace-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    justify-content: flex-end;
  }

  .preview-stack.with-insights {
    grid-template-columns: minmax(0, 1fr);
  }

  .ats-score-panel {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .workspace-tabs .tabs {
    width: 100%;
    justify-content: space-between;
  }

  .workspace-actions {
    gap: 0.35rem;
  }

  .builder-panel {
    padding: 0 1rem 1.5rem;
  }

  .workspace-tabs {
    padding: 0 1rem 0.5rem;
  }

  .workspace-header {
    padding: 0.6rem 1rem;
    gap: 0.6rem;
  }

  .app-layout {
    padding: 1.25rem 1rem 1.75rem;
  }

  .workspace-toolbar {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .static-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .static-nav {
    justify-content: space-between;
  }

  .static-page {
    padding: 2.5rem 1.25rem 3rem;
  }
}

.footer-compact {
  padding: 1.25rem 2.5rem;
}

.footer-expanded {
  padding: 2rem 2.5rem 1.5rem;
  border-top: 1px solid rgba(26, 34, 59, 0.08);
  animation: expandFooter 0.3s ease;
}

.footer-expanded.hidden {
  display: none;
}

@keyframes expandFooter {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-link:hover {
  text-decoration: underline;
  color: #3949ab;
}

.footer-small-print {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.5;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(26, 34, 59, 0.08);
}

.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid rgba(26, 34, 59, 0.08);
  z-index: 120;
}

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

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-actions .ghost-button {
  border: 1px solid rgba(26, 34, 59, 0.2);
}

@media (max-width: 900px) {
  .footer-compact {
    padding: 1rem 1.5rem;
  }
  
  .footer-expanded {
    padding: 1.5rem 1.5rem 1rem;
  }

  .cookie-banner {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* Template Selection Screen */
.template-selection-screen {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 0;
  position: relative;
  z-index: 10;
  background: var(--bg-primary);
}

.template-selection-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.template-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-large);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
}

.template-preview-mini {
  pointer-events: none;
  user-select: none;
}

.template-card:hover {
  border-color: var(--accent);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(63, 81, 181, 0.25);
}

.template-card.active {
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(63, 81, 181, 0.22);
  background: rgba(63, 81, 181, 0.08);
}

.template-card h3 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
}

.template-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Builder Panel with horizontal sections */
.builder-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0 1.25rem 1.75rem;
}

.workspace-toolbar {
  position: sticky;
  top: calc(var(--builder-sticky-offset));
  z-index: 90;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--surface);
  border-radius: var(--radius-large);
  border: 1px solid rgba(26, 34, 59, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  flex-wrap: wrap;
}

[data-theme="dark"] .workspace-toolbar {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.toolbar-divider {
  width: 1px;
  height: 34px;
  background: rgba(26, 34, 59, 0.14);
}

.section-nav {
  background: var(--surface-muted);
  border-radius: var(--radius-large);
  padding: 0.3rem 0.35rem;
  display: inline-flex;
  gap: 0.25rem;
  overflow-x: auto;
  border: 1px solid rgba(26, 34, 59, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.section-nav-btn {
  padding: 0.35rem 0.8rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.section-nav-btn:hover {
  background: rgba(63, 81, 181, 0.12);
  color: var(--accent);
}

.section-nav-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 28px rgba(63, 81, 181, 0.25);
}


.builder-content {
  display: grid;
  grid-template-columns: minmax(360px, var(--form-width, 480px)) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  position: relative;
  overflow-x: auto;
  width: 100%;
}

.builder-content.layout-vertical {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.builder-content.layout-focus-edit {
  grid-template-columns: minmax(420px, min(70vw, 820px)) minmax(300px, 1fr);
  gap: 1.25rem;
}

.builder-content.layout-focus-preview {
  grid-template-columns: minmax(0, 1fr);
}


.form-side {
  height: calc(100vh - var(--builder-sticky-offset) - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  position: sticky;
  top: calc(var(--builder-sticky-offset) + 24px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.builder-content.layout-focus-preview .form-side {
  display: none;
}

.builder-content.layout-vertical .form-side {
  height: auto;
  max-height: 60vh;
  position: relative;
  top: 0;
}

.builder-content.layout-focus-edit .form-side {
  padding-right: 2rem;
  max-width: 820px;
  align-self: start;
}

.builder-content.layout-focus-edit .preview-side {
  max-width: clamp(320px, 32vw, 520px);
  opacity: 0.85;
  align-self: start;
  position: sticky;
  top: 0;
}

.builder-content.layout-focus-preview .form-side {
  display: none;
}

.builder-content.layout-focus-preview .preview-side {
  grid-column: 1 / -1;
  max-width: none;
}

@media (max-width: 900px) {
  .builder-content {
    grid-template-columns: 1fr;
  }

  .form-side {
    position: relative;
    top: 0;
    height: auto;
  }

  .preview-stack.with-insights {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-toolbar {
    top: calc(var(--builder-sticky-offset));
    padding: 0.55rem 0.75rem;
    gap: 0.75rem;
  }
}


.preview-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.preview-actions {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preview-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.preview-stack .resume-preview {
  flex: 1 1 520px;
  min-width: min(520px, 100%);
  min-height: 680px;
}

.preview-stack.with-insights #ats-score-panel {
  flex: 0 0 320px;
  max-width: 320px;
  min-width: 260px;
}

.ats-score-panel {
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: 1.25rem;
  border: 1px solid rgba(26, 34, 59, 0.08);
  box-shadow: var(--shadow-subtle);
  max-height: calc(100vh - var(--builder-sticky-offset) - 48px);
  overflow-y: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ats-score-panel.collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  flex: 0 0 0 !important;
  max-width: 0;
  padding: 0;
  border-width: 0;
  box-shadow: none;
}

@media (max-width: 1440px) {
  .preview-stack .resume-preview {
    flex-basis: min(480px, 100%);
  }

  .preview-stack.with-insights #ats-score-panel {
    flex: 1 1 100%;
    max-width: none;
  }
}

#toggle-ats-panel.active {
  color: var(--accent);
  font-weight: 600;
}

#toggle-ats-panel.active::after {
  content: '●';
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--accent);
}

.resize-handle {
  position: absolute;
  left: calc(var(--form-width, 480px) + 0.75rem);
  top: 12px;
  bottom: 12px;
  width: 8px;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
  border-radius: 999px;
  transition: background 0.2s;
}

.resize-handle:hover,
.resize-handle.dragging {
  background: rgba(63, 81, 181, 0.2);
}

.builder-content.layout-vertical .resize-handle,
.builder-content.layout-focus-edit .resize-handle,
.builder-content.layout-focus-preview .resize-handle {
  display: none;
}

.layout-switcher {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--surface);
  border-radius: var(--radius-large);
  border: 1px solid rgba(26, 34, 59, 0.1);
}

.layout-btn {
  padding: 0.35rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: var(--radius-medium);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.layout-btn:hover {
  background: rgba(63, 81, 181, 0.08);
  color: var(--accent);
}

.layout-btn.active {
  background: var(--accent);
  color: #fff;
}


.preview-side .primary-button,
.preview-side .secondary-button,
.preview-side .ghost-button {
  min-width: 0;
}

.reorder-drawer {
  background: var(--surface);
  border-radius: var(--radius-large);
  border: 1px solid rgba(26, 34, 59, 0.1);
  box-shadow: var(--shadow-subtle);
  padding: 1.25rem;
}

.reorder-drawer.hidden {
  display: none;
}

.reorder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.reorder-header h4 {
  margin: 0;
  font-size: 1rem;
}

.reorder-header p {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.reorder-actions {
  display: inline-flex;
  gap: 0.5rem;
}

#toggle-reorder-panel.active {
  color: var(--accent);
}

.form-panel {
  background: transparent;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#resume-form {
  padding-right: 0.5rem;
}

#resume-form details {
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--surface-overlay);
}

#resume-form details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.section-controls button {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.section-controls button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.field-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
}

.field-controls button {
  padding: 0.15rem 0.35rem;
  font-size: 0.7rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.field-controls button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.label-with-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

label.no-label .label-with-controls {
  display: none;
}

label.no-label {
  margin-top: -0.5rem;
}

#resume-form details[open] summary {
  margin-bottom: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

input,
textarea,
select {
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  background: var(--input-bg);
  color: var(--text-primary);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 3rem;
}

.fields-grid {
  display: grid;
  gap: 1rem;
}

.fields-grid.two-column {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.fields-grid .wide {
  grid-column: 1 / -1;
}

.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dynamic-item {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-medium);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  box-shadow: 0 10px 24px rgba(36, 44, 68, 0.08);
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.item-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.section-hint,
.preview-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

button {
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.4rem;
  box-shadow: 0 4px 12px rgba(63, 81, 181, 0.25);
  border: none;
  font-weight: 600;
}

.primary-button:hover {
  background: #3949ab;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(63, 81, 181, 0.35);
}

.primary-button.outline {
  background: var(--surface-raised);
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: none;
}

.primary-button.outline:hover {
  background: rgba(63, 81, 181, 0.08);
}

.secondary-button {
  padding: 0.55rem 1.2rem;
  background: rgba(63, 81, 181, 0.1);
  color: var(--accent);
  box-shadow: none;
  border: 1px solid rgba(63, 81, 181, 0.2);
  font-weight: 600;
}

.secondary-button:hover {
  background: rgba(63, 81, 181, 0.18);
  border-color: rgba(63, 81, 181, 0.3);
}

.ghost-button {
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-weight: 500;
}

.ghost-button:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.25);
}

.remove-item {
  color: var(--danger);
  border-color: transparent;
}

.remove-item:hover {
  background: rgba(217, 48, 37, 0.12);
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.preview-toolbar {
  background: var(--surface);
  padding: 1.25rem 2rem;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  max-width: 8.5in;
  margin: 0 auto;
}

.template-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  width: 100%;
  padding: 0.5rem;
}

.template-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(247, 248, 252, 0.65);
  cursor: pointer;
  transition: border 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.template-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(34, 41, 71, 0.08);
}

.template-option input {
  display: none;
}

.template-option.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(63, 81, 181, 0.18);
}

.template-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(63, 81, 181, 0.14);
}

.preview-wrapper {
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
}

.resume-preview {
  background: #fff;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(27, 27, 31, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  padding: 2.5rem;
  min-height: 900px;
  overflow: auto;
  position: relative;
}

.preview-placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 4rem 2rem;
}

@media (max-width: 1280px) {
  .app-layout {
    grid-template-columns: minmax(340px, 400px) 1fr;
    padding: 2rem;
  }

  .form-panel {
    max-height: none;
    position: static;
  }
}

@media (max-width: 1024px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }

  .resume-preview {
    min-height: 0;
    height: auto;
  }
}

@media (max-width: 720px) {
  :root {
    font-size: 14px;
  }

  .app-header,
  .app-layout {
    padding: 1rem;
  }

  .app-header {
    padding: 1rem;
  }

  .header-title h1 {
    font-size: 1.5rem;
  }

  .value-badges {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .value-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-actions select,
  .header-actions button {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .tab {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .builder-sticky-controls {
    padding: 0.75rem 1rem;
  }

  .layout-switcher {
    gap: 0.35rem;
  }

  .layout-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-width: 44px;
    min-height: 44px;
  }

  .section-nav {
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .section-nav::-webkit-scrollbar {
    display: none;
  }

  .section-nav-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    white-space: nowrap;
    min-height: 44px;
  }

  .preview-toolbar {
    flex-direction: column;
    gap: 0.75rem;
  }

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

  .preview-controls button,
  .preview-controls select {
    width: 100%;
    min-height: 44px;
  }

  .jd-suggestions-panel {
    padding: 0.85rem;
  }

  .suggestion-chip {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    min-height: 44px;
  }

  .template-customization {
    padding: 0.85rem;
  }

  .color-preset {
    width: 44px;
    height: 44px;
  }

  .modal-container {
    max-width: 95vw;
    margin: 1rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .form-panel label {
    font-size: 0.9rem;
  }

  .form-panel input,
  .form-panel textarea,
  .form-panel select {
    font-size: 0.95rem;
    padding: 0.65rem;
    min-height: 44px;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    min-height: 44px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  .resume-preview {
    padding: 1.5rem;
  }
}

/* New Features Styles */

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 0;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Draft Manager */
.draft-manager {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-medium);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.draft-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.draft-selector select {
  flex: 1;
}

.draft-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Save Indicator */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.save-indicator.saving {
  background: rgba(255, 193, 7, 0.15);
  color: #f57c00;
}

.save-indicator.saved {
  background: rgba(76, 175, 80, 0.15);
  color: #388e3c;
}

.save-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ATS Score Panel */
.ats-score-panel {
  background: linear-gradient(135deg, rgba(63, 81, 181, 0.08), rgba(99, 102, 241, 0.05));
  padding: 1.5rem;
  border-radius: var(--radius-medium);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(63, 81, 181, 0.2);
}

.ats-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.ats-score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}

.ats-score-value.good {
  color: #4caf50;
}

.ats-score-value.warning {
  color: #ff9800;
}

.ats-score-value.poor {
  color: #f44336;
}

.ats-score-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.ats-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  transition: width 0.5s ease;
}

.ats-recommendations {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ats-recommendation {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-small);
  font-size: 0.9rem;
}

/* Compact ATS Score in Header */
.ats-score-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.ats-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ats-score-value-header {
  font-weight: 700;
  font-size: 1.125rem;
  min-width: 2.5rem;
  text-align: center;
}

.ats-score-value-header.good {
  color: #4caf50;
}

.ats-score-value-header.warning {
  color: #ff9800;
}

.ats-score-value-header.poor {
  color: #f44336;
}

.ats-score-mini-bar {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.ats-score-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  transition: width 0.5s ease;
}

.ats-recommendation-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.ats-recommendation.high .ats-recommendation-icon {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}

.ats-recommendation.medium .ats-recommendation-icon {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
}

.ats-recommendation.low .ats-recommendation-icon {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
}

/* JD Matcher Panel */
.jd-matcher-panel {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
}

.jd-input-area {
  margin-bottom: 1.5rem;
}

.jd-input-area textarea {
  width: 100%;
  min-height: 200px;
  margin-bottom: 1rem;
}

.jd-match-results {
  display: grid;
  gap: 1.5rem;
}

.match-score-card {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(129, 199, 132, 0.05));
  padding: 1.5rem;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.match-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.match-score-item {
  text-align: center;
}

.match-score-item-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.match-score-item-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.missing-keywords {
  background: rgba(255, 152, 0, 0.08);
  padding: 1rem;
  border-radius: var(--radius-small);
  border-left: 4px solid #ff9800;
}

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.keyword-chip {
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.keyword-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Writing Assistant */
.writing-assistant {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 320px;
  max-height: 500px;
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.writing-assistant.hidden {
  transform: translateY(calc(100% + 2rem));
}

.writing-assistant-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.writing-assistant-content {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.action-verb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.action-verb-btn {
  padding: 0.5rem;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-verb-btn:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.writing-tip {
  padding: 0.75rem;
  background: rgba(33, 150, 243, 0.08);
  border-left: 3px solid #2196f3;
  border-radius: var(--radius-small);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* Character Counter */
.char-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.char-counter.warning {
  color: #ff9800;
}

.char-counter.error {
  color: #f44336;
}

/* Validation Indicators */
.field-with-validation {
  position: relative;
}

.validation-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

.validation-icon.valid {
  color: #4caf50;
}

.validation-icon.invalid {
  color: #f44336;
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--surface);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-medium);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

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

.toast.success {
  border-left: 4px solid #4caf50;
}

.toast.error {
  border-left: 4px solid #f44336;
}

.toast.info {
  border-left: 4px solid #2196f3;
}

/* ATS Mode Toggle */
.ats-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ats-mode-toggle:hover {
  background: rgba(63, 81, 181, 0.15);
}

.ats-mode-toggle.active {
  background: var(--accent);
  color: white;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.toggle-switch.active {
  background: #4caf50;
}

.toggle-switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-switch.active .toggle-switch-handle {
  transform: translateX(20px);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.success {
  background: rgba(76, 175, 80, 0.15);
  color: #388e3c;
}

.badge.warning {
  background: rgba(255, 152, 0, 0.15);
  color: #f57c00;
}

.badge.info {
  background: rgba(33, 150, 243, 0.15);
  color: #1976d2;
}

.badge.ats-friendly {
  background: rgba(76, 175, 80, 0.15);
  color: #388e3c;
}

/* Welcome Screen */
.welcome-screen {
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Improved Template Selector */
.template-option {
  position: relative;
  min-height: 120px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-option:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(34, 41, 71, 0.15);
}

.template-option .badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.template-option .template-pill {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
}

.template-option .preview-hint {
  font-size: 0.85rem;
  line-height: 1.4;
}

/* JD Suggestions Panel */
.jd-suggestions-panel {
  background: linear-gradient(135deg, rgba(63, 81, 181, 0.05) 0%, rgba(33, 150, 243, 0.05) 100%);
  border: 1px solid rgba(63, 81, 181, 0.15);
  border-radius: var(--radius-large);
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(63, 81, 181, 0.08);
}

.jd-suggestions-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(63, 81, 181, 0.12);
}

.jd-suggestions-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.suggestion-group {
  background: var(--surface);
  border-radius: var(--radius-medium);
  padding: 0.85rem;
  border-left: 3px solid rgba(63, 81, 181, 0.3);
}

.suggestion-group.priority-high {
  border-left-color: #f57c00;
  background: rgba(255, 152, 0, 0.03);
}

.suggestion-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.priority-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 152, 0, 0.15);
  color: #f57c00;
  font-weight: 600;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid rgba(63, 81, 181, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-chip:hover {
  background: rgba(63, 81, 181, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(63, 81, 181, 0.15);
}

.chip-action {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Content Library */
.content-library {
  margin-top: 1.25rem;
  border: 1px solid rgba(26, 34, 59, 0.12);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

[data-theme="dark"] .content-library {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.content-library.collapsed .content-library-panel {
  display: none;
}

.content-library-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: none;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(37, 99, 235, 0.08));
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid rgba(26, 34, 59, 0.08);
  letter-spacing: 0.01em;
}

[data-theme="dark"] .content-library-toggle {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.content-library-toggle::after {
  content: '▾';
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.7;
}

.content-library.collapsed .content-library-toggle::after {
  content: '▸';
}

.content-library-panel {
  padding: 1rem 1.25rem 1.25rem;
}

.content-library-tabs {
  display: inline-flex;
  gap: 0.35rem;
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 0.25rem;
  border: 1px solid rgba(26, 34, 59, 0.08);
  margin-bottom: 1rem;
}

.content-library-tabs .tab {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.content-library-tabs .tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(63, 81, 181, 0.18);
}

.library-tab-content {
  border-radius: var(--radius-medium);
  background: var(--surface);
  border: 1px solid rgba(26, 34, 59, 0.08);
  padding: 1rem;
  max-height: 360px;
  overflow-y: auto;
}

[data-theme="dark"] .library-tab-content {
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.verb-category {
  margin-bottom: 1.1rem;
}

.verb-category h5 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.verb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip,
.verb-chips .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 34, 59, 0.12);
  background: rgba(63, 81, 181, 0.08);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover,
.verb-chips .chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(63, 81, 181, 0.3);
}

.bullet-templates {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-small);
  background: var(--surface);
  border: 1px solid rgba(26, 34, 59, 0.08);
}

[data-theme="dark"] .template-item {
  border-color: rgba(255, 255, 255, 0.05);
}

.template-item code {
  font-family: 'Inter', 'SFMono-Regular', ui-monospace, 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-small);
}

.template-item .ghost-button {
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Template Customization */
.template-customization {
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.color-picker-input {
  width: 50px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all 0.2s;
}

.color-picker-input:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.color-preset {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-preset:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

.color-preset.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.2);
}

.color-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.modal-visible {
  opacity: 1;
}

.modal-container {
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.modal-visible .modal-container {
  transform: scale(1);
}

.modal-small { width: 400px; }
.modal-medium { width: 500px; }
.modal-large { width: 700px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header-warning {
  background: rgba(255, 152, 0, 0.05);
  border-bottom-color: rgba(255, 152, 0, 0.2);
}

.modal-header-danger {
  background: rgba(217, 48, 37, 0.05);
  border-bottom-color: rgba(217, 48, 37, 0.2);
}

.modal-header-info {
  background: rgba(63, 81, 181, 0.05);
  border-bottom-color: rgba(63, 81, 181, 0.2);
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* ============================================
   Template Selector Styles
   ============================================ */

.template-selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 10000;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.template-selector-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.template-selector-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.template-selector-header .brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.template-selector-header .brand-logo h1 {
  font-size: 2rem;
  margin: 0;
}

.template-selector-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 0;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.template-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-large);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.template-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

.template-preview {
  aspect-ratio: 8.5 / 11;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-bottom: 2px solid var(--border);
  overflow: hidden;
}

.template-preview-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.template-preview-thumbnail {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.95);
}

.template-preview-thumbnail .mini-resume {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  height: 100%;
}

.preview-loading {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.template-preview-icon {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.template-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.template-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.template-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
  flex: 1;
}

.template-actions {
  display: flex;
  gap: 0.75rem;
}

.template-actions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.template-selector-footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.skip-btn {
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  transition: color 0.2s;
}

.skip-btn:hover {
  color: var(--text-primary);
}

/* Template Preview Modal */
.template-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

.template-preview-modal-content {
  background: var(--surface);
  border-radius: var(--radius-large);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.template-preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.template-preview-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.close-preview-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-preview-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.template-preview-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: var(--bg-secondary);
}

.resume-preview-container {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  max-width: 8.5in;
}

.template-preview-modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }
  
  .template-selector-container {
    padding: 1rem;
  }
  
  .template-preview-modal {
    padding: 1rem;
  }
  
  .template-preview-modal-content {
    max-height: 95vh;
  }
}

/* Performance: Reduce layout shift */
.template-card,
.template-preview {
  contain: layout style paint;
}

.template-selector-overlay {
  will-change: opacity;
  content-visibility: auto;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  padding: 2rem;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.modal-visible .modal-content {
  transform: scale(1);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.danger-button {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-medium);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.danger-button:hover {
  background: #c62828;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 48, 37, 0.3);
}

/* Form Validation */
.field-error {
  border-color: var(--danger) !important;
  background: rgba(217, 48, 37, 0.05);
}

.field-error-message {
  display: block;
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Onboarding Tour */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

.onboarding-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(0, 0, 0, 0.45) !important;
  border-radius: var(--radius-medium);
}

.onboarding-tooltip {
  position: fixed;
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  z-index: 10000;
  animation: slideIn 0.3s ease;
}

.onboarding-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.onboarding-tooltip-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.onboarding-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.onboarding-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.onboarding-tooltip-body {
  padding: 1.25rem 1.5rem;
}

.onboarding-tooltip-body p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-secondary);
}

.onboarding-tooltip-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.onboarding-progress {
  display: flex;
  gap: 0.4rem;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s;
}

.onboarding-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.onboarding-dot.completed {
  background: rgba(63, 81, 181, 0.4);
}

.onboarding-actions {
  display: flex;
  gap: 0.5rem;
}

.onboarding-callout {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: min(320px, calc(100% - 2rem));
  background: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(26, 34, 59, 0.12);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 120;
}

[data-theme="dark"] .onboarding-callout {
  border-color: rgba(255, 255, 255, 0.08);
}

.onboarding-callout-title {
  font-weight: 600;
  font-size: 1rem;
}

.onboarding-callout p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.onboarding-callout-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.onboarding-callout-actions .ghost-button {
  border: 1px solid rgba(26, 34, 59, 0.15);
}

@media (max-width: 600px) {
  .onboarding-callout {
    left: 1rem;
    right: 1rem;
    width: auto;
    bottom: 1rem;
  }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States & Skeleton Screens */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(63, 81, 181, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  text-align: center;
  min-width: 200px;
}

.loading-content .loading-spinner {
  width: 40px;
  height: 40px;
  border-width: 4px;
  margin-bottom: 1rem;
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-small);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-button {
  height: 2.5rem;
  width: 120px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Analytics Consent Banner */
.analytics-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: slideUp 0.3s ease-out;
}

.consent-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.consent-banner-text h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.consent-banner-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.consent-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

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

@media (max-width: 768px) {
  .consent-banner-content {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.5rem;
  }
  
  .consent-banner-actions {
    width: 100%;
  }
  
  .consent-banner-actions button {
    flex: 1;
  }
}

/* Section Reordering UI */
.section-reorder-ui {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.section-reorder-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reorder-section-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-raised);
  border: 2px solid var(--border);
  border-radius: var(--radius-small);
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.reorder-section-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.reorder-section-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: scale(0.98);
}

.reorder-section-item.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: dashed;
}

.reorder-drag-handle {
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: grab;
  line-height: 1;
}

.reorder-section-item:active .reorder-drag-handle {
  cursor: grabbing;
}

.reorder-section-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.reorder-section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
}
