/* Page: account.html — Account Settings */

    /* ═══ PAGE SHELL ═══ */
    .db-page { max-width: 1320px; margin: 0 auto; padding: var(--s8); }

    /* ── PAGE HEADER — now in borrower-shared.css ── */
    .acct-header__actions { display: flex; gap: var(--s3); align-items: center; }

    /* ═══ LAYOUT ═══ */
    .acct-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--s6); align-items: start; }

    /* ── LEFT NAV ── */
    .acct-nav {
      background: var(--white); border: 1px solid var(--border);
      border-radius: var(--r-2xl); overflow: hidden;
      position: sticky; top:-15px;
    }
    .acct-nav__head {
      padding: var(--s5) var(--s5) var(--s4);
      border-bottom: 1px solid var(--border);
    }

    /* Avatar block */
    .acct-avatar-block { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s5); }
    .acct-avatar {
      width: 72px; height: 72px; border-radius: 50%;
      background: linear-gradient(135deg, var(--blue) 0%, #1D4ED8 100%);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.4rem; font-weight: 800; color: white;
      position: relative; cursor: pointer;
      transition: transform var(--t-base);
      
    }
    .acct-avatar:hover { transform: scale(1.04); }
    .acct-avatar__edit {
      position: absolute; bottom: -2px; right: -2px;
      width: 22px; height: 22px; border-radius: 50%;
      background: var(--blue); border: 2px solid var(--white);
      display: flex; align-items: center; justify-content: center;
    }
    .acct-avatar__name { font-size: var(--t-md); font-weight: 800; color: var(--ink); text-align: center; line-height: 1.2; }
    .acct-avatar__email { font-size: var(--t-xs); color: var(--text-m); text-align: center; }
    .acct-avatar__verified { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: var(--ok); margin-top: var(--s1); }

    /* Nav items */
    .acct-nav__items { padding: var(--s2) 0;     max-height: 380px;
    overflow-y: scroll; }
    .acct-nav-item {
      display: flex; align-items: center; gap: var(--s3);
      padding: var(--s3) var(--s5); cursor: pointer;
      transition: all var(--t-fast); border-left: 3px solid transparent;
      text-decoration: none;
    }
    .acct-nav-item:hover { background: var(--off); border-left-color: var(--border-hi); }
    .acct-nav-item.active { background: var(--blue-pale); border-left-color: var(--blue); }
    .acct-nav-item__icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
    .acct-nav-item__label { font-size: var(--t-sm); font-weight: 600; color: var(--ink); flex: 1; }
    .acct-nav-item.active .acct-nav-item__label { color: var(--blue); }
    .acct-nav-item__badge { font-size: 9px; font-weight: 800; background: var(--blue); color: white; padding: 1px 5px; border-radius: var(--r-pill); }
    .acct-nav-item__badge.red { background: #EF4444; }

    .acct-nav__sep { height: 1px; background: var(--border); margin: var(--s2) 0; }

    /* Danger zone nav item */
    .acct-nav-item.danger .acct-nav-item__label { color: #EF4444; }
    .acct-nav-item.danger:hover { background: rgba(239,68,68,.05); border-left-color: #EF4444; }

    /* ── RIGHT CONTENT PANELS ── */
    .acct-sections { display: flex; flex-direction: column; gap: var(--s5); }

    /* Section */
    .acct-section {
      background: var(--white); border: 1px solid var(--border);
      border-radius: var(--r-2xl); overflow: hidden;
      scroll-margin-top: calc(var(--nav-h) + var(--s6));
    }
    .acct-section__head {
      padding: var(--s5) var(--s6);
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: var(--s4);
    }
    .acct-section__head-icon {
      width: 38px; height: 38px; border-radius: var(--r-lg);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.1rem; flex-shrink: 0;
    }
    .acct-section__head-icon.blue   { background: var(--blue-pale); }
    .acct-section__head-icon.green  { background: rgba(5,150,105,.08); }
    .acct-section__head-icon.amber  { background: rgba(245,158,11,.08); }
    .acct-section__head-icon.purple { background: rgba(124,58,237,.08); }
    .acct-section__head-icon.red    { background: rgba(239,68,68,.08); }
    .acct-section__head-icon.grey   { background: var(--off); }
    .acct-section__head-text { flex: 1; }
    .acct-section__title { font-family: var(--font-d); font-size: var(--t-xl); font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
    .acct-section__sub { font-size: var(--t-xs); color: var(--text-m); margin-top: 2px; }
    .acct-section__body { padding: var(--s6); }

    /* ── FORM FIELDS ── */
    .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
    .field-grid.three { grid-template-columns: 1fr 1fr 1fr; }
    .field-grid.full  { grid-template-columns: 1fr; }

    .form-field { display: flex; flex-direction: column; gap: var(--s2); }
    .form-field--span2 { grid-column: span 2; }
    .form-label {
      font-size: var(--t-xs); font-weight: 700;
      text-transform: uppercase; letter-spacing: .08em;
      color: var(--text-m); display: flex; align-items: center; gap: var(--s2);
    }
    .form-label__required { color: #EF4444; }
    .form-label__verified { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: var(--ok); text-transform: none; letter-spacing: 0; }

    .form-input {
      border: 1.5px solid var(--border); border-radius: var(--r-lg);
      padding: var(--s3) var(--s4); font-size: var(--t-sm);
      color: var(--ink); outline: none; background: var(--white);
      transition: border-color var(--t-fast), box-shadow var(--t-fast);
    }
    .form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
    .form-input:disabled { background: var(--off); color: var(--text-m); cursor: not-allowed; }
    .form-input.has-value { border-color: var(--ok); }

    .form-select {
      border: 1.5px solid var(--border); border-radius: var(--r-lg);
      padding: var(--s3) var(--s4); font-size: var(--t-sm);
      color: var(--ink); outline: none; background: var(--white);
      transition: border-color var(--t-fast), box-shadow var(--t-fast);
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 14px center;
      padding-right: 36px; cursor: pointer;
    }
    .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }

    .form-hint { font-size: 11px; color: var(--text-m); line-height: 1.5; }
    .form-hint.ok { color: var(--ok); }
    .form-hint.warn { color: var(--amber); }

    .form-divider { border: none; border-top: 1px solid var(--border); margin: var(--s5) 0; }

    /* Inline field with action */
    .form-input-group { position: relative; }
    .form-input-group .form-input { padding-right: 90px; }
    .form-input-group__action {
      position: absolute; right: var(--s3); top: 50%; transform: translateY(-50%);
    }

    /* ── TOGGLE / SWITCH ROW ── */
    .toggle-row {
      display: flex; align-items: flex-start; justify-content: space-between;
      gap: var(--s5); padding: var(--s4) 0;
      border-bottom: 1px solid var(--border);
    }
    .toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
    .toggle-row:first-child { padding-top: 0; }
    .toggle-row__info { flex: 1; }
    .toggle-row__title { font-size: var(--t-sm); font-weight: 700; color: var(--ink); margin-bottom: 3px; }
    .toggle-row__sub { font-size: var(--t-xs); color: var(--text-m); line-height: 1.5; }
    .toggle-row__tag { display: inline-block; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: var(--r-pill); margin-left: var(--s2); }
    .toggle-row__tag.recommended { background: rgba(5,150,105,.1); color: var(--ok); }
    .toggle-row__tag.required    { background: rgba(239,68,68,.1); color: #EF4444; }

    /* Switch component */
    .sw {
      width: 44px; height: 26px; border-radius: 13px;
      background: var(--border-hi); position: relative;
      cursor: pointer; transition: background var(--t-base);
      flex-shrink: 0; border: none; outline: none;
    }
    .sw.on { background: var(--blue); }
    .sw.green.on { background: var(--ok); }
    .sw::after {
      content: ''; position: absolute; top: 3px; left: 3px;
      width: 20px; height: 20px; border-radius: 50%;
      background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2);
      transition: transform var(--t-base);
    }
    .sw.on::after { transform: translateX(18px); }

    /* ── CHANNEL CARD ── */
    .channel-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--s4); margin-bottom: var(--s5); }
    .channel-card {
      border: 1.5px solid var(--border); border-radius: var(--r-xl);
      padding: var(--s4); text-align: center;
      transition: all var(--t-base); cursor: pointer; background: var(--white);
    }
    .channel-card:hover { border-color: var(--blue); box-shadow: var(--sh-sm); }
    .channel-card.on { border-color: var(--blue); background: var(--blue-pale); }
    .channel-card__icon { font-size: 1.8rem; margin-bottom: var(--s2); }
    .channel-card__name { font-size: var(--t-sm); font-weight: 700; color: var(--ink); margin-bottom: var(--s1); }
    .channel-card__status { font-size: 10px; font-weight: 700; }
    .channel-card.on  .channel-card__status { color: var(--blue); }
    .channel-card.off .channel-card__status { color: var(--text-m); }
    .channel-card__dot {
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--border-hi); display: inline-block; margin-right: 4px;
    }
    .channel-card.on .channel-card__dot { background: var(--blue); }

    /* ── NOTIFICATION FREQUENCY ── */
    .freq-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--s3); }
    .freq-option {
      border: 1.5px solid var(--border); border-radius: var(--r-lg);
      padding: var(--s4); cursor: pointer; transition: all var(--t-fast); background: var(--white);
    }
    .freq-option:hover { border-color: var(--blue); background: var(--blue-pale); }
    .freq-option.active { border-color: var(--blue); background: var(--blue-pale); }
    .freq-option__icon { font-size: 1.4rem; margin-bottom: var(--s2); }
    .freq-option__label { font-size: var(--t-sm); font-weight: 700; color: var(--ink); margin-bottom: 3px; }
    .freq-option.active .freq-option__label { color: var(--blue); }
    .freq-option__sub { font-size: var(--t-xs); color: var(--text-m); line-height: 1.4; }

    /* ── SECURITY ITEMS ── */
    .security-item {
      display: flex; align-items: center; gap: var(--s4);
      padding: var(--s4) 0; border-bottom: 1px solid var(--border);
    }
    .security-item:last-child { border-bottom: none; padding-bottom: 0; }
    .security-item:first-child { padding-top: 0; }
    .security-item__icon {
      width: 40px; height: 40px; border-radius: var(--r-lg);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.1rem; flex-shrink: 0; background: var(--off); border: 1px solid var(--border);
    }
    .security-item__info { flex: 1; }
    .security-item__title { font-size: var(--t-sm); font-weight: 700; color: var(--ink); margin-bottom: 2px; }
    .security-item__sub { font-size: var(--t-xs); color: var(--text-m); line-height: 1.5; }
    .security-item__status { flex-shrink: 0; }

    /* ── CONNECTED SERVICES ── */
    .connected-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
    .connected-card {
      border: 1.5px solid var(--border); border-radius: var(--r-xl);
      padding: var(--s4); display: flex; align-items: center; gap: var(--s4);
      transition: all var(--t-base);
    }
    .connected-card.active { border-color: var(--ok); background: rgba(5,150,105,.03); }
    .connected-card__logo {
      width: 42px; height: 42px; border-radius: var(--r-md);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.4rem; flex-shrink: 0; background: var(--off); border: 1px solid var(--border);
    }
    .connected-card__info { flex: 1; min-width: 0; }
    .connected-card__name { font-size: var(--t-sm); font-weight: 700; color: var(--ink); }
    .connected-card__status { font-size: var(--t-xs); font-weight: 600; margin-top: 2px; }
    .connected-card.active  .connected-card__status { color: var(--ok); }
    .connected-card.inactive .connected-card__status { color: var(--text-m); }

    /* ── PRIVACY PREFERENCE ROWS ── */
    .privacy-row {
      display: flex; align-items: flex-start; gap: var(--s4);
      padding: var(--s4); border: 1.5px solid var(--border);
      border-radius: var(--r-lg); margin-bottom: var(--s3);
      transition: border-color var(--t-fast);
    }
    .privacy-row:last-child { margin-bottom: 0; }
    .privacy-row:hover { border-color: var(--blue-light); }
    .privacy-row__icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
    .privacy-row__content { flex: 1; }
    .privacy-row__title { font-size: var(--t-sm); font-weight: 700; color: var(--ink); margin-bottom: 3px; }
    .privacy-row__desc { font-size: var(--t-xs); color: var(--text-m); line-height: 1.6; }

    /* ── DANGER ZONE ── */
    .danger-section { border-color: rgba(239,68,68,.3) !important; }
    .danger-section .acct-section__head { background: rgba(239,68,68,.03); border-bottom-color: rgba(239,68,68,.15); }
    .danger-item {
      display: flex; align-items: center; gap: var(--s4);
      padding: var(--s4); border: 1.5px solid rgba(239,68,68,.2);
      border-radius: var(--r-lg); margin-bottom: var(--s3);
      background: rgba(239,68,68,.02);
    }
    .danger-item:last-child { margin-bottom: 0; }
    .danger-item__icon { font-size: 1.3rem; flex-shrink: 0; }
    .danger-item__info { flex: 1; }
    .danger-item__title { font-size: var(--t-sm); font-weight: 700; color: #DC2626; margin-bottom: 3px; }
    .danger-item__sub { font-size: var(--t-xs); color: var(--text-m); line-height: 1.5; }

    /* ── SESSION LIST ── */
    .session-item {
      display: flex; align-items: center; gap: var(--s4);
      padding: var(--s4) 0; border-bottom: 1px solid var(--border);
    }
    .session-item:last-child { border-bottom: none; padding-bottom: 0; }
    .session-item:first-child { padding-top: 0; }
    .session-item__icon {
      width: 38px; height: 38px; border-radius: var(--r-md);
      background: var(--off); border: 1px solid var(--border);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.1rem; flex-shrink: 0;
    }
    .session-item__info { flex: 1; }
    .session-item__device { font-size: var(--t-sm); font-weight: 700; color: var(--ink); margin-bottom: 2px; display: flex; align-items: center; gap: var(--s2); }
    .session-item__meta { font-size: var(--t-xs); color: var(--text-m); }
    .session-current { font-size: 9px; font-weight: 800; color: var(--ok); background: rgba(5,150,105,.1); padding: 1px 6px; border-radius: var(--r-pill); }

    /* ── UNSAVED BANNER ── */
    .unsaved-banner {
      position: fixed; bottom: var(--s6); left: 50%; transform: translateX(-50%) translateY(100px);
      background: var(--ink); border-radius: var(--r-2xl); padding: var(--s3) var(--s4);
      display: flex; align-items: center; gap: var(--s4);
      box-shadow: 0 8px 32px rgba(0,0,0,.25); z-index: 100;
      transition: transform .4s cubic-bezier(.34,1.56,.64,1);
      min-width: 340px;
    }
    .unsaved-banner.show { transform: translateX(-50%) translateY(0); }
    .unsaved-banner__text { flex: 1; font-size: var(--t-sm); font-weight: 600; color: white; }
    .unsaved-banner__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex-shrink: 0; animation: pulse 2s infinite; }
    @keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

    /* ── PLAN CARD ── */
    .plan-card {
      background: linear-gradient(135deg, var(--blue) 0%, #1D4ED8 100%);
      border-radius: var(--r-xl); padding: var(--s5) var(--s6);
      display: flex; align-items: center; gap: var(--s5); margin-bottom: var(--s6);
      position: relative; overflow: hidden;
    }
    .plan-card::before {
      content: ''; position: absolute; inset: 0;
      background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
      background-size: 20px 20px;
    }
    .plan-card__icon { font-size: 2rem; flex-shrink: 0; position: relative; z-index: 1; }
    .plan-card__info { flex: 1; position: relative; z-index: 1; }
    .plan-card__label { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.7); margin-bottom: var(--s1); }
    .plan-card__name { font-family: var(--font-d); font-size: var(--t-2xl); font-weight: 700; color: white; letter-spacing: -0.02em; }
    .plan-card__desc { font-size: var(--t-sm); color: rgba(255,255,255,.8); margin-top: var(--s1); }
    .plan-card__cta { position: relative; z-index: 1; flex-shrink: 0; }

    /* ── RESPONSIVE ── */
    @media(max-width:1100px) { .acct-layout { grid-template-columns: 1fr; } .acct-nav { position: static; } }
    @media(max-width:768px)  {
      .db-page { padding: var(--s5) var(--s4); }
      .field-grid { grid-template-columns: 1fr; }
      .field-grid.three { grid-template-columns: 1fr; }
      .channel-cards { grid-template-columns: 1fr 1fr; }
      .freq-grid { grid-template-columns: 1fr; }
      .connected-grid { grid-template-columns: 1fr; }
      .field-grid .form-field--span2 { grid-column: span 1; }
      .acct-nav__items { display: flex; flex-wrap: wrap; padding: var(--s3); }
      .acct-nav-item { border-left: none; border-bottom: 2px solid transparent; border-radius: var(--r-lg); padding: var(--s2) var(--s3); }
      .acct-nav-item.active { border-bottom-color: var(--blue); }
    }
    @media(max-width:480px) { .channel-cards { grid-template-columns: 1fr 1fr; } .unsaved-banner { min-width: calc(100vw - 32px); } }
