@layer components {
  .metric-tile {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
  }

  .metric-val {
    display: block;
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
  }

  .metric-label { font-size: 0.85rem; color: var(--muted); }

  .bento-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 26px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
  }

  .bento-copy h3 { margin: 0 0 6px; font-size: 1.24rem; letter-spacing: -0.02em; }
  .bento-copy p { margin: 0; color: var(--muted); font-size: 0.94rem; }

  .pipeline-visual { display: flex; align-items: center; }

  .pipe-node {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .pipe-node.is-accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .pipe-wire { position: relative; flex: 1; height: 2px; background: var(--glass-border); overflow: hidden; min-width: 24px; }

  .chip-cloud,
  .hw-strip,
  .theme-split { display: flex; flex-wrap: wrap; gap: 8px; }

  .chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
  }

  .chip.is-ok { color: var(--ok); border-color: rgba(31, 138, 76, 0.28); }
  .chip.is-accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

  .theme-split > span {
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
  }

  .split-dark { background: #141211; color: #f6f1e9; }
  .split-cream { background: #f7f3ec; color: #181615; }
  .split-tag { background: var(--accent-soft); color: var(--accent); }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .compare-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 0.9rem; }
  .compare-table th,
  .compare-table td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--glass-border); }
  .compare-table thead th { font-size: 0.84rem; font-weight: 700; background: var(--surface-2); }
  .compare-table thead th:first-child,
  .compare-table tbody th[scope="row"] { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--glass-border); }
  .compare-table thead th:first-child { background: var(--surface-2); z-index: 3; }
  .compare-table tbody th[scope="row"] { background: var(--surface); font-weight: 600; }
  .compare-table tbody tr:last-child th,
  .compare-table tbody tr:last-child td { border-bottom: 0; }
  .compare-table .col-highlight { background: var(--accent-soft); font-weight: 600; }

  .status-cell { display: inline-flex; align-items: center; gap: 8px; }
  .status-cell::before { content: ""; width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
  .status-cell.is-yes::before { background: var(--ok); }
  .status-cell.is-mid::before { background: var(--accent); }
  .status-cell.is-no::before { background: var(--danger); opacity: 0.7; }

  .roi-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 18px; align-items: stretch; }

  .roi-inputs,
  .roi-results {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 26px;
    box-shadow: var(--shadow-md);
  }

  .roi-inputs { display: grid; gap: 18px; }
  .preset-row { display: flex; flex-wrap: wrap; gap: 8px; }

  .preset-btn {
    flex: 1 1 auto;
    min-height: 36px;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--surface-2);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 110ms var(--ease-out);
  }

  .preset-btn:active { transform: scale(0.97); }
  .preset-btn.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

  .slider-group { display: grid; gap: 7px; }
  .slider-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; gap: 8px; }
  .slider-label label { font-weight: 600; }
  .slider-label output { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
  input[type="range"] { width: 100%; min-height: 32px; touch-action: pan-y; accent-color: var(--accent); cursor: pointer; }

  .toggle-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    font-size: 0.86rem;
    color: var(--muted);
    cursor: pointer;
  }

  .toggle-check input { accent-color: var(--accent); }

  .roi-results { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
  .roi-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--muted); }
  .roi-badge { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 0.75rem; }
  .roi-primary-metric small { display: block; font-size: 0.84rem; color: var(--muted); margin-bottom: 4px; }
  .roi-primary-metric strong { display: block; font-size: clamp(1.9rem, 3.6vw, 2.8rem); letter-spacing: -0.03em; line-height: 1.05; color: var(--accent); font-variant-numeric: tabular-nums; }
  .roi-sub-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .roi-sub-metrics > div { background: var(--surface-2); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 13px; }
  .roi-sub-metrics small { display: block; font-size: 0.76rem; color: var(--muted); margin-bottom: 4px; }
  .roi-sub-metrics strong { font-size: 1.02rem; font-variant-numeric: tabular-nums; }

  .billing-segmented { margin-top: 8px; }
  .pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  .price-card { position: relative; background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); padding: 26px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-md); }
  .price-card.is-popular { border-color: var(--accent); box-shadow: var(--shadow-lg); }
  .popular-tag { position: absolute; top: -11px; right: 22px; padding: 3px 11px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.74rem; font-weight: 700; }
  .price-head h3 { margin: 0 0 4px; font-size: 1.18rem; }
  .price-head p { margin: 0; font-size: 0.86rem; color: var(--muted); }
  .price-amount { display: flex; align-items: baseline; gap: 6px; }
  .price-amount strong { font-size: 1.9rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .price-amount span { font-size: 0.84rem; color: var(--muted); }
  .price-features { list-style: none; margin: 0 0 auto; padding: 0; display: grid; gap: 9px; font-size: 0.88rem; color: var(--muted); }
  .price-features li { position: relative; padding-left: 18px; }
  .price-features li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 999px; background: var(--accent); }
  .guarantee-line { margin: 22px 0 0; text-align: center; font-size: 0.86rem; color: var(--muted); }

  .faq-container { max-width: 780px; }
  .faq-list { display: grid; gap: 10px; }
  .faq-item { background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); overflow: hidden; }
  .faq-trigger { width: 100%; min-height: 52px; background: transparent; border: 0; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; font-size: 0.96rem; font-weight: 600; cursor: pointer; }
  .faq-icon { width: 16px; height: 16px; position: relative; flex-shrink: 0; }
  .faq-icon::before,
  .faq-icon::after { content: ""; position: absolute; top: 50%; left: 50%; width: 11px; height: 1.8px; background: var(--accent); transform: translate(-50%, -50%); transition: transform 200ms var(--ease-out); }
  .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
  .faq-trigger[aria-expanded="true"] .faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
  .faq-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 240ms var(--ease-out); }
  .faq-trigger[aria-expanded="true"] + .faq-body { grid-template-rows: 1fr; }
  .faq-body > div { overflow: hidden; }
  .faq-body p { margin: 0; padding: 0 20px 17px; color: var(--muted); font-size: 0.9rem; }

  .final-cta-section { padding-top: 24px; }
  .final-cta-card { background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); padding: 40px 28px; text-align: center; box-shadow: var(--shadow-lg); }
  .final-cta-card h2 { margin: 0 auto 22px; max-width: 24ch; font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -0.028em; }
  .final-cta-card .hero-cta-row { justify-content: center; margin-bottom: 0; }
  .footer-badge { font-size: 0.78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--glass-border); color: var(--muted); }

  .floating-theme-btn {
    position: fixed;
    right: 24px;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 150;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), background-color 180ms var(--ease-out);
  }

  .floating-theme-btn:active { transform: scale(0.95); }

  .floating-theme-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
  }

  .modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.58); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; }
  .modal-backdrop[hidden] { display: none; }
  .modal-card { width: min(520px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow-lg); animation: modal-in 200ms var(--ease-out); }
  .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
  .modal-head h2 { margin: 0; font-size: 1.24rem; letter-spacing: -0.02em; }
  .modal-close { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
  .consult-form { display: grid; gap: 13px; }
  .form-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .form-row { display: grid; gap: 6px; }
  .form-row label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
  .form-row input,
  .form-row select { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: var(--surface-2); }
  .consult-preview { background: var(--surface-2); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 12px; }
  .consult-preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.82rem; }
  .copy-toast { color: var(--ok); font-weight: 600; }
  .consult-preview pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.82rem; color: var(--muted); }
  .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

  @media (hover: hover) and (pointer: fine) {
    .floating-theme-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
  }
}
