/* ==========================================================================
   ONBOARDING MODAL — first-run experience
   ========================================================================== */

   .onb-modal {
    --onb-bg: #ffffff;
    --onb-surface-2: #f8fafc;
    --onb-border: #e5e7eb;
    --onb-border-soft: #f1f5f9;
    --onb-text-1: #0f172a;
    --onb-text-2: #475569;
    --onb-text-3: #94a3b8;
    --onb-brand: #22c55e;
    --onb-brand-dark: #16a34a;
    --onb-brand-soft: #f0fdf4;
    --onb-accent: #2563eb;
    --onb-shadow: 0 24px 60px -16px rgba(15, 23, 42, 0.4);
  
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--onb-text-1);
    -webkit-font-smoothing: antialiased;
  }
  
  .onb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: onb-fade 0.25s ease both;
  }
  
  .onb-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    background: var(--onb-bg);
    border-radius: 20px;
    box-shadow: var(--onb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: onb-rise 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  
  @keyframes onb-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes onb-rise {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  
  /* ---------- Progress bar ---------- */
  .onb-progress {
    height: 4px;
    background: var(--onb-border-soft);
    flex-shrink: 0;
  }
  
  .onb-progress-bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--onb-brand), var(--onb-brand-dark));
    border-radius: 0 4px 4px 0;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  /* ---------- Form / steps ---------- */
  .onb-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  
  .onb-step {
    display: none;
    padding: 32px 32px 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }
  
  .onb-step.is-active {
    display: block;
    animation: onb-step-in 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  
  @keyframes onb-step-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  
  .onb-step-head { margin-bottom: 24px; }
  
  .onb-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--onb-brand-dark);
    background: var(--onb-brand-soft);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
  }
  
  .onb-step-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
  }
  
  .onb-step-head p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--onb-text-2);
    line-height: 1.5;
  }
  
  /* ---------- Fields ---------- */
  .onb-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  
  .onb-field-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
  }
  
  .onb-field-row-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  
  .onb-field-row-row3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .onb-field-row label,
  .onb-field-row > label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--onb-text-1);
  }
  
  .onb-hint {
    font-size: 11.5px;
    color: var(--onb-text-3);
  }
  
  .onb-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--onb-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--onb-text-1);
    background: #ffffff;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
  }
  
  .onb-input:focus {
    outline: none;
    border-color: var(--onb-brand);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  }
  
  .onb-input--area {
    resize: vertical;
    min-height: 76px;
    line-height: 1.5;
  }
  
  .onb-input-prefix {
    position: relative;
    display: flex;
    align-items: center;
  }
  .onb-input-prefix > span {
    position: absolute;
    left: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--onb-text-3);
    pointer-events: none;
  }
  .onb-input-prefix .onb-input {
    padding-left: 26px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  
  /* ---------- Chips (radio pills) ---------- */
  .onb-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .onb-chip {
    position: relative;
    cursor: pointer;
    user-select: none;
  }
  
  .onb-chip-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  
  .onb-chip > span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--onb-border);
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: var(--onb-text-2);
    transition: all 0.15s ease;
  }
  
  .onb-chip:hover > span { border-color: #cbd5e1; color: var(--onb-text-1); }
  
  .onb-chip-input:checked + span {
    background: var(--onb-brand-soft);
    border-color: var(--onb-brand);
    color: var(--onb-brand-dark);
    box-shadow: 0 0 0 1px var(--onb-brand);
  }
  
  .onb-chip-input:focus-visible + span {
    outline: 2px solid var(--onb-accent);
    outline-offset: 2px;
  }
  
  /* ---------- Switch ---------- */
  .onb-switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--onb-border-soft);
    background: var(--onb-surface-2);
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .onb-switch-row:hover { border-color: var(--onb-border); }
  
  .onb-switch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  
  .onb-switch {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: background 0.2s ease;
  }
  .onb-switch::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
  }
  .onb-switch-input:checked + .onb-switch { background: var(--onb-brand); }
  .onb-switch-input:checked + .onb-switch::after { transform: translateX(16px); }
  .onb-switch-input:focus-visible + .onb-switch {
    outline: 2px solid var(--onb-accent);
    outline-offset: 2px;
  }
  
  .onb-switch-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .onb-switch-label strong { font-size: 13px; font-weight: 700; color: var(--onb-text-1); }
  .onb-switch-label em { font-style: normal; font-size: 11.5px; color: var(--onb-text-3); }
  
  /* ---------- Finish screen ---------- */
  .onb-step--finish {
    padding: 24px 32px 24px;
    display: none;
  }
  .onb-step--finish.is-active { display: flex; align-items: center; }
  
  .onb-finish {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 24px 0 8px;
    width: 100%;
  }
  
  .onb-finish-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--onb-brand-soft);
    color: var(--onb-brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    animation: onb-check-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  .onb-finish-icon svg { width: 30px; height: 30px; }
  
  @keyframes onb-check-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
  }
  
  .onb-finish h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
  }
  
  .onb-finish p {
    margin: 0;
    font-size: 14px;
    color: var(--onb-text-2);
    max-width: 400px;
    line-height: 1.5;
  }
  
  .onb-finish-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 18px;
  }
  
  /* ---------- Buttons ---------- */
  .onb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    font-family: inherit;
    text-decoration: none;
  }
  .onb-btn:focus-visible {
    outline: 2px solid var(--onb-accent);
    outline-offset: 2px;
  }
  .onb-btn:active { transform: translateY(1px); }
  
  .onb-btn--primary {
    background: var(--onb-brand);
    color: #ffffff;
    box-shadow: 0 4px 14px -4px rgba(34, 197, 94, 0.5);
  }
  .onb-btn--primary:hover {
    background: var(--onb-brand-dark);
    color: #ffffff;
    box-shadow: 0 6px 18px -4px rgba(34, 197, 94, 0.6);
  }
  
  .onb-btn--ghost {
    background: #ffffff;
    color: var(--onb-text-2);
    border-color: var(--onb-border);
  }
  .onb-btn--ghost:hover {
    background: var(--onb-surface-2);
    color: var(--onb-text-1);
    border-color: #cbd5e1;
  }
  
  .onb-btn--skip { font-weight: 500; }
  
  /* ---------- Footer ---------- */
  .onb-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px 16px;
    border-top: 1px solid var(--onb-border-soft);
    background: var(--onb-surface-2);
    flex-shrink: 0;
  }
  
  .onb-footer-spacer { flex: 1; }
  
  /* ---------- Responsive ---------- */
  @media (max-width: 520px) {
    .onb-modal { padding: 12px; }
    .onb-panel { max-height: calc(100vh - 24px); border-radius: 16px; }
    .onb-step { padding: 24px 20px 8px; }
    .onb-field-row-row2,
    .onb-field-row-row3 { grid-template-columns: 1fr; }
    .onb-step-head h2 { font-size: 19px; }
    .onb-finish-icon { width: 54px; height: 54px; }
    .onb-finish-icon svg { width: 26px; height: 26px; }
    .onb-finish h2 { font-size: 19px; }
    .onb-footer { padding: 12px 16px 14px; }
    .onb-btn { padding: 11px 16px; font-size: 13.5px; }
  }
  
  /* ---------- Reduced motion ---------- */
  @media (prefers-reduced-motion: reduce) {
    .onb-modal *,
    .onb-modal *::before,
    .onb-modal *::after {
      animation: none !important;
      transition: none !important;
    }
  }
  