:root {
    --bg: #f5f5f7;
    --card-bg: #ffffff;
    --accent: #111111;
    --accent-soft: #222222;
    --accent-muted: #d4d4d8;
    --border-subtle: #e4e4e7;
    --text-main: #111827;
    --text-subtle: #6b7280;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.12);
    --transition-fast: 160ms ease-out;
    --transition-med: 220ms ease-out;
  }
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  html,
  body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter",
      sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at top left, #e5e7eb, #f9fafb 55%);
  }
  
  /* App layout */
  
  .app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  /* Header */
  
  .app-header {
    width: 100%;
    padding: 24px 28px;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  
  .brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
  }
  
  .brand-dot {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    border-radius: 999px;
    flex-shrink: 0; /* important */
  }

  
  .brand-name {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 18px;
    color: #374151;
  }

  .brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
  
    text-decoration: none;
    color: inherit;   /* keeps text color */
    cursor: pointer;
  }
  
  
  /* Main */
  
  .app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px 24px;
  }
  
  /* Quiz / result cards */
  
  .card {
    width: 100%;
    max-width: 720px;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 28px 20px 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
  }
  
  @media (min-width: 768px) {
    .card {
      padding: 32px 32px 28px;
    }
  }
  
  /* Steps */
  
  .step {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition-med), transform var(--transition-med);
  }
  
  .step-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
  
  .step-title {
    font-size: 26px;
    line-height: 1.2;
    margin: 0 0 10px;
  }
  
  .step-subtitle {
    margin: 0 0 20px;
    font-size: 15px;
    color: var(--text-subtle);
  }
  
  .field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4b5563;
  }
  
  /* Inputs */
  
  .input-text,
  .input-select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    font-size: 15px;
    outline: none;
    background: #f9fafb;
    transition: border-color var(--transition-fast),
      box-shadow var(--transition-fast), background var(--transition-fast),
      transform var(--transition-fast);
  }
  
  .input-text::placeholder {
    color: #9ca3af;
  }
  
  .input-text:focus,
  .input-select:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
  }
  
  .input-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #4b5563 50%),
      linear-gradient(135deg, #4b5563 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% - 2px),
      calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
  }
  
  /* Honeypot (hidden) */
  
  .hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
  }
  
  /* Range slider */
  
  .slider-row {
    margin-top: 4px;
    margin-bottom: 12px;
  }
  
  .input-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    outline: none;
  }
  
  .input-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #111827;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.15);
    transition: transform var(--transition-fast),
      box-shadow var(--transition-fast);
  }
  
  .input-range::-webkit-slider-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(15, 23, 42, 0.18);
  }
  
  .input-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #111827;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.15);
  }
  
  .slider-value {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-subtle);
  }
  
  /* Buttons */
  
  .btn-primary,
  .btn-ghost {
    border: none;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    cursor: pointer;
    transition: transform var(--transition-fast),
      box-shadow var(--transition-fast), background var(--transition-fast),
      color var(--transition-fast), opacity var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  
  .btn-primary {
    background: var(--accent-soft);
    color: #ffffff;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.22);
  }
  
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 32px rgba(15, 23, 42, 0.26);
  }
  
  .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
  }
  
  .btn-ghost {
    background: transparent;
    color: #4b5563;
    border: 1px solid var(--border-subtle);
  }
  
  .btn-ghost:hover {
    background: #f3f4f6;
  }
  
  .nav-row {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }
  
  /* Progress (below card) */
  
  .progress-wrapper {
    width: 100%;
    max-width: 720px;
    margin-bottom: 20px;
  }
  
  .progress-label {
    font-size: 13px;
    color: var(--text-subtle);
    margin-bottom: 6px;
  }
  
  .progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
  }
  
  .progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #22c55e);
    transition: width var(--transition-med);
  }
  
  /* Result card */
  
  .card-result {
    animation: fadeInUp var(--transition-med);
  }
  
  .hidden {
    display: none;
  }
  
  .result-header {
    text-align: left;
    margin-bottom: 10px;
  }
  
  .result-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
    margin: 0 0 4px;
  }
  
  .result-score {
    font-size: 44px;
    font-weight: 700;
    margin: 0;
  }
  
  .result-tag {
    font-size: 14px;
    font-weight: 500;
    margin: 2px 0 0;
  }
  
  /* Tag colors (soft, non-panic) */
  .tag-high {
    color: #16a34a; /* green */
  }
  .tag-mid {
    color: #0ea5e9; /* blue */
  }
  .tag-low {
    color: #f97316; /* warm orange */
  }
  .tag-very-low {
    color: #fb7185; /* soft rose */
  }
  
  /* Calming nudge */
  
  .result-nudge {
    font-size: 13px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 10px 0 14px;
  }
  
  /* Summary & lists */
  
  .result-summary {
    margin: 4px 0 20px;
    font-size: 15px;
    color: var(--text-subtle);
  }
  
  .result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 20px;
  }
  
  @media (min-width: 768px) {
    .result-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  
  .result-block h3 {
    margin: 0 0 8px;
    font-size: 15px;
  }
  
  .result-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 14px;
    color: var(--text-subtle);
  }
  
  .result-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
  }
  
  .result-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: #6366f1;
  }
  
  .result-meta {
    font-size: 13px;
    color: var(--text-subtle);
    margin-bottom: 16px;
  }
  
  .share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
  }
  
  .tiny-text {
    font-size: 11px;
    color: #9ca3af;
  }
  
  /* Ads */
  
  .ad-slot {
    width: 100%;
    max-width: 720px;
    margin: 0 auto 24px auto;
    padding: 12px;
    border-radius: 16px;
    border: 1px dashed #e5e7eb;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
  }
  
  /* Footer */
  
  .app-footer {
    width: 100%;
    padding: 10px 16px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(249, 250, 251, 0.9);
    backdrop-filter: blur(6px);
  }
  
  .footer-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    justify-content: space-between;
  }
  
  .footer-brand {
    font-size: 12px;
    color: var(--text-subtle);
  }
  
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
  }
  
  .footer-links a {
    color: #6b7280;
    text-decoration: none;
  }
  
  .footer-links a:hover {
    text-decoration: underline;
  }
  
  .footer-made {
    font-size: 12px;
    color: #9ca3af;
  }
  
  @media (min-width: 640px) {
    .footer-inner {
      flex-direction: row;
      align-items: center;
    }
  }
  
  /* Animations */
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Utility */
  
  .input-error {
    border-color: #f97373 !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
  }
  