  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
 
  :root {
    --bg:            #f0f4fb;
    --surface:       #ffffff;
    --surface-alt:   #f7f9fd;
    --border:        rgba(30, 60, 110, 0.10);
    --border-strong: rgba(30, 60, 110, 0.18);
    --text:          #0e1c2e;
    --text-muted:    #6b7c93;
    --text-faint:    #a0aebf;
    --accent:        #2563eb;
    --accent-light:  #dbeafe;
    --accent-glow:   rgba(37, 99, 235, 0.15);
    --success:       #059669;
    --success-light: #d1fae5;
    --danger:        #dc2626;
    --danger-light:  #fee2e2;
    --warning:       #d97706;
    --warning-light: #fef3c7;
 
    --radius-sm:  10px;
    --radius-md:  16px;
    --radius-lg:  24px;
    --radius-xl:  32px;
 
    --shadow-card: 0 1px 2px rgba(14,28,46,0.04), 0 4px 16px rgba(14,28,46,0.06), 0 12px 40px rgba(14,28,46,0.04);
    --shadow-input: 0 1px 3px rgba(14,28,46,0.06) inset;
    --shadow-focus: 0 0 0 4px var(--accent-glow);
 
    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
 
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  }
 
  html { scroll-behavior: smooth; }
 
  body {
    font-family: var(--font-body);
    font-size: 15px;
    background-color: var(--bg);
    background-image:
      radial-gradient(ellipse 900px 600px at 85% -5%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
      radial-gradient(ellipse 600px 400px at 10% 90%, rgba(16, 185, 129, 0.05) 0%, transparent 55%);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
  }
 
  /* ── Page wrapper ───────────────────────────────────── */
  .settings-page {
    padding: 2.5rem 2rem 4rem;
    animation: fadeUp 0.5s ease both;
  }
 
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
 
  .settings-shell { max-width: 1160px; margin: 0 auto; }
 
  /* ── Hero ───────────────────────────────────────────── */
  .settings-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
 
  .eyebrow {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .eyebrow::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    flex-shrink: 0;
  }
 
  .settings-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: var(--text);
  }
 
  .hero-copy {
    color: var(--text-muted);
    max-width: 560px;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
  }
 
  .hero-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--success-light);
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 100px;
    border: 1px solid rgba(5, 150, 105, 0.2);
    white-space: nowrap;
  }
  .hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    animation: pulse-dot 2s ease infinite;
  }
  @keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,0.5); }
    50% { box-shadow: 0 0 0 5px rgba(5,150,105,0); }
  }
 
  /* ── Layout grid ────────────────────────────────────── */
  .settings-grid {
    display: grid;
    grid-template-columns: 272px 1fr;
    gap: 1.5rem;
    align-items: start;
  }
 
  /* ── Cards base ─────────────────────────────────────── */
  .profile-card,
  .settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
  }
 
  /* ── Profile card ───────────────────────────────────── */
  .profile-card {
    padding: 1.75rem;
    position: sticky;
    top: 24px;
    overflow: hidden;
  }
  .profile-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 200px 160px at 50% -30%, var(--accent-light), transparent);
    pointer-events: none;
    opacity: 0.6;
  }
 
  .avatar-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    margin-bottom: 1.2rem;
  }
  .avatar-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
  }
  .avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px dashed rgba(37, 99, 235, 0.25);
    animation: spin-ring 20s linear infinite;
  }
  @keyframes spin-ring { to { transform: rotate(360deg); } }
 
  .avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 2;
    transition: transform var(--transition), background var(--transition);
  }
  .avatar-edit:hover { transform: scale(1.15); background: #1d4ed8; }
  .avatar-edit svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
 
  .profile-card h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
  }
  .profile-card > p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
  }
 
  .profile-divider {
    height: 1px;
    background: var(--border);
    margin: 0 -1.75rem 1.5rem;
  }
 
  .profile-meta { display: grid; gap: 0.6rem; }
 
  .profile-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    transition: border-color var(--transition), background var(--transition);
  }
  .profile-meta-item:hover {
    border-color: var(--border-strong);
    background: #f2f5fb;
  }
 
  .meta-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--accent-light);
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .meta-icon svg { width: 14px; height: 14px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
 
  .meta-content dt {
    font-size: 0.72rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 1px;
  }
  .meta-content dd {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
  }
 
  /* ── Settings card ──────────────────────────────────── */
  .settings-card { overflow: hidden; }
 
  .card-header {
    padding: 1.75rem 1.75rem 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }
 
  .card-kicker {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.35rem;
  }
 
  .card-header h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.025em;
  }
  .card-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-weight: 300;
  }
 
  /* ── Tabs ───────────────────────────────────────────── */
  .card-tabs {
    display: flex;
    gap: 2px;
    padding: 0 1.75rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .card-tabs::-webkit-scrollbar { display: none; }
 
  .tab-btn {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
  }
  .tab-btn:hover { color: var(--text); }
  .tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
  }
 
  /* ── Form ───────────────────────────────────────────── */
  .settings-form {
    padding: 1.75rem;
    display: grid;
    gap: 1.25rem;
  }
 
  .form-section {
    display: grid;
    gap: 1rem;
  }
  .form-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
  }
 
  .form-grid {
    display: grid;
    gap: 1rem;
  }
  .form-grid.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 
  /* ── Field ──────────────────────────────────────────── */
  .field { display: grid; gap: 0.4rem; }
 
  .field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .field label .badge-required {
    font-size: 0.65rem;
    color: var(--accent);
    background: var(--accent-light);
    border-radius: 100px;
    padding: 1px 6px;
    font-weight: 700;
  }
 
  .input-wrap { position: relative; }
 
  .field input,
  .field select,
  .field textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    font-family: var(--font-body);
    font-size: 0.93rem;
    background: var(--surface-alt);
    color: var(--text);
    outline: none;
    box-shadow: var(--shadow-input);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    -webkit-appearance: none;
    appearance: none;
  }
  .field input:hover:not(:disabled),
  .field select:hover:not(:disabled) {
    border-color: rgba(37, 99, 235, 0.3);
    background: #f9fafd;
  }
  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
    background: var(--surface);
  }
  .field input:disabled {
    background: #f5f7fb;
    color: var(--text-faint);
    cursor: not-allowed;
    border-style: dashed;
  }
  .field textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
 
  .input-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    pointer-events: none;
  }
  .input-icon svg { width: 14px; height: 14px; stroke: var(--text-faint); fill: none; stroke-width: 2; }
 
  /* ── Toggle / checkbox ──────────────────────────────── */
  .toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    user-select: none;
  }
  .toggle-field:hover { border-color: var(--border-strong); background: #f2f5fb; }
 
  .toggle-info { display: grid; gap: 2px; }
  .toggle-title { font-size: 0.9rem; font-weight: 600; }
  .toggle-desc  { font-size: 0.8rem; color: var(--text-muted); font-weight: 300; }
 
  .toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
  }
  .toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
  .toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 100px;
    background: #dde3ed;
    transition: background var(--transition);
    cursor: pointer;
  }
  .toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform var(--transition);
  }
  .toggle input:checked + .toggle-track { background: var(--accent); }
  .toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }
 
  /* ── Alert ──────────────────────────────────────────── */
  .settings-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    font-size: 0.88rem;
    line-height: 1.55;
    animation: slideIn 0.3s ease both;
  }
  @keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .settings-alert.success { background: var(--success-light); color: #065f46; border-color: rgba(5,150,105,0.25); }
  .settings-alert.error   { background: var(--danger-light);  color: #991b1b; border-color: rgba(220,38,38,0.25); }
  .settings-alert.info    { background: var(--accent-light);  color: #1e40af; border-color: rgba(37,99,235,0.25); }
  .settings-alert.warning { background: var(--warning-light); color: #92400e; border-color: rgba(217,119,6,0.25); }
 
  .alert-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
  .alert-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
 
  .alert-text strong { font-weight: 700; display: block; margin-bottom: 1px; }
 
  /* ── Form actions ───────────────────────────────────── */
  .form-divider { height: 1px; background: var(--border); margin: 0 -1.75rem; }
 
  .form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
  }
  .form-actions-right { display: flex; gap: 0.6rem; }
 
  /* ── Buttons ────────────────────────────────────────── */
  .btn {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.3rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
  }
  .btn:active { transform: scale(0.975); }
 
  .btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3), 0 1px 2px rgba(37,99,235,0.2);
  }
  .btn.primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 16px rgba(37,99,235,0.35), 0 1px 3px rgba(37,99,235,0.25);
    transform: translateY(-1px);
  }
  .btn.ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
  }
  .btn.ghost:hover { background: var(--surface-alt); color: var(--text); }
 
  .btn.danger-ghost {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(220,38,38,0.25);
  }
  .btn.danger-ghost:hover { background: var(--danger-light); }
 
  .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
 
  /* ── Responsive ─────────────────────────────────────── */
  @media (max-width: 960px) {
    .settings-page { padding: 1.5rem 1rem 3rem; }
    .settings-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .profile-card { position: static; }
    .settings-hero { flex-direction: column; align-items: flex-start; }
    .card-tabs { margin: 0 0; }
  }