/* Settings (V3) — «الإعدادات».
   One calm column: a small shop header, then accordion sections (components.css .acc). Teal for normal things, amber
   only for Pro and for "needs your attention" notes — never blue. No entrance animation (the page is kept alive). */

.settings-v3 { max-width: 720px; padding-bottom: 32px; accent-color: var(--brand); }
/* clip (not hidden) keeps the rounded corners without making the section a scroll box, so the Save bar can stick */
.settings-v3 .acc { overflow: clip; scroll-margin-top: calc(var(--topbar-h) + var(--safe-t) + 10px); }
.settings-v3 .acc-summary { flex: 0 0 auto; max-width: 42%; }
.settings-v3 .acc-summary .icon { vertical-align: -2px; }

/* ---------- header ---------- */
.set-head { display: flex; align-items: center; gap: 12px; padding: 4px 2px 16px; }
.set-head .grow { display: flex; flex-direction: column; gap: 1px; }
.set-head-name { font-size: var(--fs-lg); font-weight: 800; line-height: 1.35; }
.set-head-sub { font-size: var(--fs-sm); color: var(--text-3); }
.set-plan { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; min-height: 40px; padding: 0 4px; border-radius: 12px; color: var(--text-3); text-decoration: none; }
.set-plan:hover { text-decoration: none; background: var(--surface-2); }
.set-plan .plan-pill { font-size: 12px; padding: 2px 10px; }
.set-pro-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 800; }

/* ---------- shared inside sections ---------- */
.set-body { display: flex; flex-direction: column; gap: 16px; }
.set-group { display: flex; flex-direction: column; gap: 8px; }
.set-group > .field-label { gap: 6px; }
.set-row { display: flex; align-items: center; gap: 12px; }
.set-row .grow { display: flex; flex-direction: column; gap: 2px; }
.set-row-title { font-weight: 700; line-height: 1.45; }
.set-hint { font-size: var(--fs-xs); line-height: 1.55; color: var(--text-3); }
.set-link { font-weight: 700; unicode-bidi: isolate; word-break: break-all; }
.set-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-v3 .segmented .seg { white-space: normal; line-height: 1.25; text-align: center; }

/* Pro lock: what Pro adds + one button (no dead switches) */
.set-lock { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.set-lock-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-strong); }
.set-lock .grow { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.set-lock p { font-size: var(--fs-sm); line-height: 1.65; }

/* ---------- shop ---------- */
.set-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 560px) { .set-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; } }
.set-logo { display: flex; align-items: center; gap: 14px; }
.set-logo .grow { display: flex; flex-direction: column; gap: 6px; }
.set-logo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.set-save { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 2; display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px; margin: 0 -10px -6px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-md); }
@media (min-width: 721px) { .set-save { bottom: 12px; } }

/* ---------- language & look ---------- */
.theme-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.theme-tile { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 16px; border: 1.5px solid var(--border-strong); background: var(--surface); text-align: start; transition: border-color var(--dur), box-shadow var(--dur); }
.theme-tile:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border-strong)); }
.theme-tile.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.theme-tile-name { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.theme-tile-name .icon { color: var(--text-3); }
.theme-tile.selected .theme-tile-name .icon { color: var(--brand); }
.theme-tile-check { margin-inline-start: auto; }
.theme-tile-sub { font-size: var(--fs-xs); line-height: 1.4; color: var(--text-3); }
/* A tiny picture of each theme. The swatches are the light / dark values of tokens.css (--bg, --surface, --border,
   --brand), fixed here on purpose so each preview shows its own theme whatever theme is on now. */
.theme-tile-light { --pv-bg: #E1E8E5; --pv-card: #FCFDFD; --pv-line: #D1DBD7; --pv-brand: #0F766E; }
.theme-tile-dark { --pv-bg: #121D20; --pv-card: #1A282B; --pv-line: #2B3D41; --pv-brand: #2DD4BF; }
.theme-pv { position: relative; display: flex; flex-direction: column; gap: 6px; height: 72px; padding: 8px; border-radius: 10px; overflow: hidden; background: var(--pv-bg); border: 1px solid var(--pv-line); }
.theme-pv::after { content: ''; position: absolute; top: 0; inset-inline-end: 12px; width: 8px; height: 13px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.theme-pv-card { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 8px; border-radius: 6px; background: var(--pv-card); }
.theme-pv-card i { display: block; width: 72%; height: 4px; border-radius: 2px; background: var(--pv-line); }
.theme-pv-card i + i { width: 46%; }
.theme-pv-btn { width: 54%; height: 10px; border-radius: 4px; background: var(--pv-brand); }
.theme-auto { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.theme-auto .grow { display: flex; flex-direction: column; gap: 2px; }
.theme-auto-icon { display: inline-flex; color: var(--text-3); }

/* ---------- currency & days to pay ---------- */
.set-due { display: flex; align-items: center; gap: 10px; }
.set-due-input { width: 96px; text-align: center; font-size: var(--fs-lg); font-weight: 800; }
.set-due-unit { font-weight: 700; color: var(--text-2); }

/* ---------- reminder ---------- */
.set-tpl { min-height: 150px; line-height: 1.7; }
.set-ph { gap: 6px; }
.set-ph-code { font-size: 11px; font-weight: 600; color: var(--text-3); unicode-bidi: isolate; }
.set-bubble { position: relative; padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); line-height: 1.7; color: var(--text); }
[dir='rtl'] .set-bubble { border-radius: 16px 16px 4px 16px; }

/* ---------- notifications ---------- */
.set-push { padding: 12px; border-radius: 14px; background: var(--surface-2); }
.set-push-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto; background: var(--surface-3); color: var(--text-3); }
.set-push-icon.on { background: var(--brand-soft); color: var(--brand-strong); }
.set-time { cursor: pointer; }
.set-time-input { width: auto; min-width: 120px; flex: 0 0 auto; }

/* ---------- this device ---------- */
.set-status { display: flex; flex-direction: column; }
.set-status li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.set-status li + li { border-top: 1px dashed var(--border); }
.set-status li .grow { display: flex; flex-direction: column; gap: 2px; }
.set-status-icon { display: inline-flex; margin-top: 1px; color: var(--text-3); }
.set-status .is-ok .set-status-icon { color: var(--ok); }
.set-status .is-warn .set-status-icon { color: var(--accent-strong); }
.set-ios { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.set-ios-steps { display: flex; flex-direction: column; gap: 8px; }
.set-ios-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); line-height: 1.55; }
.set-ios-steps li > .num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; background: var(--brand-soft); color: var(--brand-strong); font-size: var(--fs-xs); font-weight: 800; }
.set-ios-share { display: inline-block; vertical-align: -3px; color: var(--brand); }
.set-install-menu { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); }
.set-install-menu .icon { margin-top: 2px; color: var(--text-3); }

/* ---------- my data ---------- */
.set-files { gap: 10px; }
.set-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: background var(--dur); }
.set-file:hover { text-decoration: none; background: var(--surface-2); }
.set-file .grow { display: flex; flex-direction: column; gap: 2px; }
.set-file-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; background: var(--brand-softer); color: var(--brand); }
.set-file-go { color: var(--text-3); }

/* ---------- account ---------- */
.set-login { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.set-login .grow { display: flex; flex-direction: column; gap: 2px; }
.set-login-icon { display: inline-flex; margin-top: 2px; color: var(--text-3); }
.set-login-phone { display: block; font-size: var(--fs-lg); font-weight: 800; letter-spacing: .02em; text-align: start; }
[dir='rtl'] .set-login-phone { text-align: right; }
.set-body > .btn-block + .btn-block { margin-top: -6px; }
.set-logout { color: var(--text-2); margin-top: 2px; }

/* ---------- about ---------- */
.set-about { display: flex; flex-direction: column; margin: 0; }
.set-about > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.set-about > div + div { border-top: 1px dashed var(--border); }
.set-about dt { color: var(--text-2); }
.set-about dd { margin: 0; font-weight: 700; }

/* ---------- notifications (V4): free line + Pro rows shown locked ---------- */
.set-alerts-free { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--brand-softer); border: 1px solid color-mix(in srgb, var(--brand) 16%, transparent); }
.set-alerts-free .grow { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.set-alerts-free .set-row-title { font-size: var(--fs-sm); line-height: 1.6; }
.set-alerts-free-icon { display: inline-flex; margin-top: 2px; color: var(--brand); }
.set-locked { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); }
.set-locked-row .set-row-title { color: var(--text-2); }
.set-locked-row .set-pro-tag { flex: 0 0 auto; align-self: flex-start; margin-top: 2px; }
.set-push { flex-wrap: wrap; }
.set-push > .grow { flex: 1 1 140px; min-width: 0; }

/* ---------- V5: lighter — one-line section heads, the offline note, guide / invite rows ---------- */
.settings-v3 { padding-top: var(--sp-2); padding-bottom: var(--sp-7); }
.settings-v3 .acc-head { min-height: var(--row-min); padding: var(--sp-3) var(--sp-4); }
.settings-v3 .acc-body { padding: var(--sp-4); }
.settings-v3 .set-body { gap: var(--sp-5); }
.set-offline { line-height: 1.7; }
.set-offline > .icon { color: var(--brand); }
.set-links { display: flex; flex-direction: column; gap: 10px; margin-top: var(--section-gap); }
.set-link-row { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--row-min); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--card-shadow); color: var(--text); text-decoration: none; transition: background var(--dur); }
.set-link-row:hover { background: var(--surface-2); text-decoration: none; }
.set-link-row .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.set-link-title { font-weight: 800; font-size: var(--fs-md); }
.set-link-sub { font-size: var(--fs-xs); color: var(--text-3); }
.set-link-go { color: var(--text-3); flex: 0 0 auto; }
