/* ============================================================
   Astra Origins — Account Settings · page styles (new design)
   Shared shell lives in cosmos.css. Loaded globally in master so
   pane swaps stay styled.
   ============================================================ */

.t-tn.is-on { background: oklch(from var(--accent) l c h / 0.18); color: var(--accent); }
.s-head { padding-bottom: 14px; margin-bottom: 14px; }

/* ── Two-column layout: account nav + panels ──────────── */
.s-layout { display: grid; grid-template-columns: 248px 1fr; gap: 18px; align-items: start; }

/* ── Account nav rail ─────────────────────────────────── */
.s-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.s-nav-group { font-size: 9px; color: var(--ink-3); letter-spacing: 0.16em; font-weight: 800; padding: 4px 10px 8px; }
.s-nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: left; border: 1px solid transparent; cursor: pointer; background: none; transition: background 0.15s, color 0.15s; }
.s-nav-item .bi { font-size: 15px; width: 18px; text-align: center; color: var(--ink-3); }
.s-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.s-nav-item.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.s-nav-item.is-on .bi { color: var(--accent); }
.s-nav-danger { color: oklch(0.55 0.2 25); }
.s-nav-danger .bi { color: oklch(0.55 0.2 25); }
.s-nav-danger.is-on { background: oklch(0.55 0.2 25 / 0.1); color: oklch(0.5 0.2 25); border-color: oklch(0.55 0.2 25 / 0.3); }

.s-secure { margin-top: 14px; padding: 12px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.s-secure-h { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; color: var(--ink-2); display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.s-secure-h .bi { color: oklch(0.6 0.15 145); }
.s-secure p { font-size: 11px; line-height: 1.55; color: var(--ink-3); margin: 0; }

/* ── Panels ───────────────────────────────────────────── */
.s-panel { display: none; }
.s-panel.is-on { display: block; animation: s-fade 0.2s ease; }
@keyframes s-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.s-panel-head { margin-bottom: 14px; }
.s-panel-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.s-panel-title { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; margin: 0; display: flex; align-items: center; gap: 9px; }
.s-panel-title .bi { color: var(--accent); }
.s-panel-sub { font-size: 12px; color: var(--ink-3); margin: 4px 0 0; line-height: 1.5; }

.s-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }

/* ── Fields ───────────────────────────────────────────── */
.s-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.s-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.s-label { font-size: 11px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 6px; }
.s-soon { font-size: 8px; font-weight: 800; letter-spacing: 0.1em; color: var(--ink-3); background: var(--surface-3); padding: 1px 6px; border-radius: 999px; }
.s-input { width: 100%; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; outline: none; transition: border-color 0.15s, background 0.15s; }
.s-input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.12); }
.s-input-locked { background: var(--surface-3); color: var(--ink-3); cursor: not-allowed; }
.s-input[disabled] { opacity: 0.6; cursor: not-allowed; }
.s-select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2398a0b3'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 14px; padding-right: 36px; cursor: pointer; }
.s-textarea { border-radius: 16px; resize: vertical; line-height: 1.55; min-height: 76px; }
.s-hint { font-size: 10px; color: var(--ink-3); letter-spacing: 0.02em; }
.s-dob { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.s-err { font-size: 10px; color: oklch(0.55 0.22 25); font-weight: 600; }
.s-err:empty { display: none; }

/* prefixed input (username) */
.s-prefix { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding-left: 16px; }
.s-prefix:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.12); }
.s-prefix-at { color: var(--ink-3); font-size: 13px; }
.s-input-prefixed { background: none; border: none; box-shadow: none; padding-left: 4px; }
.s-input-prefixed:focus { background: none; box-shadow: none; }

/* password */
.s-pass { position: relative; display: block; }
.s-pass .s-input { padding-right: 44px; }
.s-pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); background: none; border: none; cursor: pointer; }
.s-pass-toggle:hover { background: var(--surface-3); color: var(--ink); }
.s-meter { display: block; height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.s-meter > span { display: block; height: 100%; width: 0; border-radius: 999px; background: oklch(0.6 0.2 25); transition: width 0.25s, background 0.25s; }

/* username suggestions */
.s-suggest { display: flex; flex-direction: column; gap: 8px; }
.s-suggest-h { font-size: 9px; font-weight: 800; letter-spacing: 0.14em; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.s-suggest-h .bi { color: var(--accent); }
.s-suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.s-suggest-chip { font: inherit; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s; }
.s-suggest-chip:hover { background: var(--accent); color: white; }
.s-suggest-chip .bi { font-size: 11px; }
.s-suggest-empty { font-size: 11px; color: var(--ink-3); }

/* checkboxes (badge, ad terms) */
.s-check { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.s-check input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.s-app-intro { font-size: 12px; color: var(--ink-2); margin: 0 0 4px; line-height: 1.5; }

/* feedback banner */
.s-feedback { font-size: 12px; font-weight: 600; padding: 10px 13px; border-radius: 10px; line-height: 1.45; }
.s-feedback.is-ok { background: oklch(0.6 0.15 145 / 0.12); color: oklch(0.4 0.12 145); }
.s-feedback.is-err { background: oklch(0.6 0.18 25 / 0.12); color: oklch(0.5 0.2 25); }

/* ── Buttons ──────────────────────────────────────────── */
.s-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.s-btn { font: inherit; font-size: 13px; font-weight: 700; padding: 11px 22px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; text-decoration: none; }
.s-btn:disabled { opacity: 0.6; cursor: default; }
.s-btn-sm { padding: 8px 14px; font-size: 12px; }
.s-btn-primary { background: var(--accent); color: white; }
.s-btn-primary:hover { background: oklch(from var(--accent) calc(l - 0.05) c h); color: white; }
.s-btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--accent-line); }
.s-btn-secondary:hover { background: var(--accent-soft); }
.s-btn-ghost { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.s-btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.s-btn-warn { background: oklch(0.75 0.15 70); color: oklch(0.2 0.05 70); }
.s-btn-warn:hover { background: oklch(0.7 0.15 70); }
.s-btn-danger { background: oklch(0.55 0.22 25); color: white; }
.s-btn-danger:hover { background: oklch(0.5 0.22 25); color: white; }

/* ── Rows (security / privacy) ────────────────────────── */
.s-rows { gap: 0; padding: 6px; }
.s-row { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 13px 12px; border-radius: 10px; border-bottom: 1px solid var(--line); background: none; border-left: none; border-right: none; border-top: none; cursor: pointer; }
.s-row:last-child { border-bottom: none; }
.s-row:hover { background: var(--surface-2); }
.s-row-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); font-size: 16px; flex-shrink: 0; }
.s-row-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; text-align: left; }
.s-row-t { font-size: 13px; font-weight: 700; }
.s-row-d { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-row > .bi { color: var(--ink-3); }

/* collapsible notification category group (native <details>) */
.s-notif-group { border-bottom: 1px solid var(--line); }
.s-notif-group:last-child { border-bottom: none; }
.s-notif-group-head { display: flex; align-items: center; gap: 13px; padding: 13px 12px; cursor: pointer; border-radius: 10px; list-style: none; user-select: none; }
.s-notif-group-head::-webkit-details-marker { display: none; }
.s-notif-group-head::marker { content: ''; }
.s-notif-group-head:hover { background: var(--surface-2); }
.s-notif-group-chev { margin-left: auto; color: var(--ink-3); transition: transform 0.2s ease; flex-shrink: 0; }
.s-notif-group[open] .s-notif-group-chev { transform: rotate(180deg); }
.s-notif-group-body { padding: 2px 0 6px 20px; }
.s-notif-group-body .s-row:last-child { border-bottom: none; }

/* toggle switch */
.s-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.s-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.s-switch-track { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line); border-radius: 999px; transition: background 0.2s; }
.s-switch-track::before { content: ""; position: absolute; left: 3px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px oklch(0 0 0 / 0.25); transition: transform 0.2s; }
.s-switch input:checked + .s-switch-track { background: var(--accent); border-color: var(--accent); }
.s-switch input:checked + .s-switch-track::before { transform: translateX(18px); }

/* ── Verification badge ───────────────────────────────── */
.s-badge-cur { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.s-badge-cur-l { display: flex; flex-direction: column; gap: 6px; }
.s-badge-now { display: flex; }
.s-badge-note { font-size: 11px; color: var(--ink-3); }
.s-badge-reason { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.s-badge-reason-l { font-weight: 700; color: var(--ink-2); }
.s-badge-chip { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: white; background: oklch(0.55 0.18 250); padding: 5px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }

/* sub-cards (badge rules / consent) */
.s-subcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.s-subcard-h { font-size: 12px; font-weight: 800; color: var(--ink); letter-spacing: 0.01em; }
.s-rules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.s-rules li { font-size: 12px; color: var(--ink-2); line-height: 1.5; display: flex; align-items: flex-start; gap: 8px; }
.s-rules li .bi { color: oklch(0.6 0.15 145); margin-top: 1px; flex-shrink: 0; }
.s-consent-note { margin: 4px 0 0; line-height: 1.55; }
.s-note-link { color: inherit; font-weight: 800; text-decoration: underline; }
.s-app { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.s-app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.s-app-t { font-size: 13px; font-weight: 700; }
.s-app-d { font-size: 9px; color: var(--ink-3); letter-spacing: 0.08em; margin-top: 3px; }
.s-app-status { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; color: white; background: oklch(0.6 0.16 145); padding: 4px 10px; border-radius: 999px; }
.s-app-grid { gap: 12px; }
.s-app-v { font-size: 13px; font-weight: 600; margin-top: 3px; color: var(--ink); }

/* notes */
.s-note { display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.s-note .bi { margin-top: 1px; flex-shrink: 0; }
.s-note-ok { background: oklch(0.6 0.15 145 / 0.12); color: oklch(0.4 0.12 145); }
.s-note-info { background: oklch(0.6 0.14 230 / 0.12); color: oklch(0.42 0.13 235); }
.s-note-warn { background: oklch(0.7 0.16 50 / 0.14); color: oklch(0.45 0.16 45); }

/* ── Ads ──────────────────────────────────────────────── */
.s-ads { display: flex; flex-direction: column; gap: 12px; }
/* Media preview inside the create/edit modal */
.s-ad-mediaprev { position: relative; margin-top: 4px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.s-ad-mediaprev[hidden] { display: none; }
.s-ad-mediaprev-el { display: block; width: 100%; max-height: 260px; object-fit: contain; background: oklch(0.12 0.02 265); }
.s-ad-mediaprev-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border: none; border-radius: 50%; background: oklch(0.12 0.02 265 / 0.7); color: #fff; font-size: 13px; cursor: pointer; backdrop-filter: blur(4px); transition: background 0.15s, transform 0.15s; }
.s-ad-mediaprev-x:hover { background: oklch(0.55 0.22 25); transform: scale(1.06); }

/* Ad preview modal */
.s-adp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.s-adp-title { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.s-adp-media { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: oklch(0.12 0.02 265); }
.s-adp-media.is-empty { background: var(--surface-2); display: grid; place-items: center; min-height: 160px; color: var(--ink-3); font-size: 34px; }
.s-adp-media-el { display: block; width: 100%; max-height: 420px; object-fit: contain; background: oklch(0.12 0.02 265); }
.s-adp-details { display: flex; flex-direction: column; gap: 14px; }
.s-adp-link { font-size: 13px; color: var(--accent); text-decoration: none; word-break: break-all; }
.s-adp-link:hover { text-decoration: underline; }
.s-adp-v { font-size: 13px; font-weight: 600; color: var(--ink); }

.s-ads-loader { display: grid; place-items: center; padding: 14px 0; }
.s-ads-loader[hidden] { display: none; }
.s-ads-sentinel { display: block; height: 1px; }
.s-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: s-spin 0.8s linear infinite; }
@keyframes s-spin { to { transform: rotate(360deg); } }
.s-ad { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.s-ad-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.s-ad-name { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.s-ad-state { font-size: 8px; font-weight: 800; letter-spacing: 0.1em; padding: 3px 9px; border-radius: 999px; }
.s-ad-approved { background: oklch(0.55 0.04 250); color: white; }
.s-ad-pending { background: oklch(0.78 0.15 80); color: oklch(0.28 0.08 70); }
.s-ad-rejected { background: oklch(0.58 0.22 25); color: white; }
.s-ad-acts { display: flex; gap: 5px; flex-wrap: wrap; }
.s-ad-btn { font-size: 11px; font-weight: 700; padding: 6px 11px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px; color: white; border: none; cursor: pointer; }
.s-ad-preview { background: oklch(0.65 0.14 200); }
.s-ad-edit { background: oklch(0.55 0.18 255); }
.s-ad-deact { background: oklch(0.78 0.15 80); color: oklch(0.28 0.08 70); }
.s-ad-del { background: oklch(0.58 0.22 25); }
.s-ad-btn:disabled { opacity: 0.5; cursor: default; }
.s-ad-meta { font-size: 9px; color: var(--ink-3); letter-spacing: 0.08em; margin: 11px 0; display: flex; align-items: center; gap: 6px; }
.s-ad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.s-ad-v { font-size: 13px; font-weight: 700; margin-top: 3px; }
.s-ad-foot { font-size: 9px; color: var(--ink-3); letter-spacing: 0.08em; margin-top: 10px; }
.s-ad-inactive { color: oklch(0.55 0.2 25); font-weight: 800; }
.s-ad-active { color: oklch(0.5 0.16 145); font-weight: 800; }

/* empty state */
.s-empty, .s-guard { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; }
.s-empty-orb, .s-guard-orb { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); font-size: 24px; }
.s-empty-head, .s-guard-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.s-empty-sub, .s-guard-sub { font-size: 13px; color: var(--ink-3); margin: 0; max-width: 420px; }
.s-guard { margin-top: 6px; }

/* file box (ad media) */
.s-filebox { display: block; cursor: pointer; }
.s-filebox-inner { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; transition: border-color 0.15s, background 0.15s; }
.s-filebox:hover .s-filebox-inner { border-color: var(--accent-line); background: var(--accent-soft); }
.s-filebox-inner .bi { font-size: 22px; color: var(--accent); }
.s-filebox.has-file .s-filebox-inner { border-style: solid; border-color: var(--accent-line); color: var(--ink); }

/* ── Danger zone ──────────────────────────────────────── */
.s-card-danger { border-color: oklch(0.6 0.18 25 / 0.4); }
.s-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.s-danger-t { font-size: 14px; font-weight: 700; }
.s-danger-strong { color: oklch(0.55 0.22 25); }
.s-danger-d { font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; max-width: 52ch; }
.s-danger-sep { height: 1px; background: var(--line); margin: 2px 0; }

/* ── Modal ────────────────────────────────────────────── */
.s-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; }
.s-modal[hidden] { display: none; }
.s-modal-backdrop { position: absolute; inset: 0; background: oklch(0.1 0.02 260 / 0.55); backdrop-filter: blur(3px); }
.s-modal-box { position: relative; width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px oklch(0 0 0 / 0.28); animation: s-fade 0.2s ease; scrollbar-width: thin; scrollbar-color: var(--accent-line) transparent; }
/* Custom scrollbar — modal (WebKit/Chromium) */
.s-modal-box::-webkit-scrollbar { width: 10px; }
.s-modal-box::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.s-modal-box::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid var(--surface); border-radius: 999px; }
.s-modal-box::-webkit-scrollbar-thumb:hover { background: var(--accent-line); }
.s-modal-lg { max-width: 620px; }
.s-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.s-modal-title { font-size: 16px; font-weight: 800; margin: 0; }
.s-modal-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: none; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.s-modal-x:hover { background: var(--surface-3); color: var(--ink); }
.s-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.s-confirm-text { font-size: 13px; color: var(--ink-2); margin: 0; line-height: 1.55; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1000px) {
  .s-layout { grid-template-columns: 1fr; }
  .s-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .s-nav-group, .s-secure { display: none; }
  .s-nav-item { flex: 0 0 auto; padding: 8px 12px; }
  .s-nav-item span { display: none; }
  .s-nav-item .bi { font-size: 17px; }
}
@media (max-width: 640px) {
  .s-grid2 { grid-template-columns: 1fr; }
  .s-ad-grid { grid-template-columns: 1fr; }
  .s-danger-row { flex-direction: column; align-items: flex-start; }
}
