/* Account visual revision; existing settings handlers retained. Auth changes documented in the review record. */
:is(#account-modal,#body-profile-modal,#styling-mode-modal){padding:0;background:var(--paper);border:1px solid var(--line);border-radius:28px;overflow:hidden;max-height:calc(100dvh - 24px)}
:is(#account-modal,#body-profile-modal,#styling-mode-modal)[open]{animation:account-sheet-in .24s cubic-bezier(.2,.7,.2,1)}
:is(#account-modal,#body-profile-modal,#styling-mode-modal)::backdrop{background:#0005;backdrop-filter:blur(3px)}
#account-modal .account-dialog{width:100%;padding:26px 22px 22px;max-height:calc(100dvh - 26px);background:var(--paper)}
#account-modal .auth-brand{margin-bottom:18px;gap:10px}#account-modal .auth-logo{filter:grayscale(1);border-radius:12px}#account-modal .auth-wordmark{font-size:15px;letter-spacing:2px}
#account-modal .auth-title{font-size:26px;line-height:1.55;font-weight:700;margin-bottom:6px}#account-modal .auth-subtitle{font-size:13px;line-height:1.8;margin-bottom:22px;color:var(--muted)}
#account-modal .brand-field{margin-bottom:16px;font-size:12px}#account-modal .brand-field>span{font-size:12px;color:var(--muted);font-weight:500}
#account-modal input{min-height:50px;border-radius:15px;background:var(--white);font-size:16px;border-color:var(--line)}
#account-modal .auth-submit{min-height:50px;border-radius:16px;font-size:15px;box-shadow:none}
#account-modal .auth-close{width:38px;height:38px;min-height:38px;border:1px solid var(--line);background:var(--white);color:var(--ink);border-radius:50%;box-shadow:none}
#account-modal .auth-switch{font-size:13px;line-height:1.8}#account-modal .legal-links{font-size:11px;line-height:1.9;margin-top:18px}
#account-modal .auth-message:not(:empty){border-radius:14px;padding:12px;font-size:13px;line-height:1.7}
#account-modal .settings-group{border:1px solid var(--line);border-radius:20px;box-shadow:none;margin-bottom:12px;background:var(--white)}
#account-modal .settings-row{min-height:58px;padding:16px;transition:background .16s,transform .16s}
#account-modal .settings-row-main strong{font-size:14px;font-weight:600}#account-modal .settings-row-main small{font-size:11px;line-height:1.7}
#account-modal .settings-row:is(button,a):hover{background:var(--accent-soft)}#account-modal .settings-row:is(button,a):active{transform:scale(.985);background:var(--accent-soft)}
#account-modal .settings-avatar{width:48px;height:56px;border-radius:45% 45% 16px 16px;background:var(--accent-soft);color:var(--ink);border:1px solid var(--line);font-size:22px}
#account-modal .settings-email{direction:ltr;text-align:start;unicode-bidi:plaintext;font-size:14px;overflow-wrap:anywhere}
#account-modal .settings-private{font-size:10px}#account-modal .settings-chevron{color:var(--muted)}
#account-modal .account-danger[open] .settings-danger-body{animation:account-detail-in .18s ease-out}
#account-modal .account-danger[open] summary{background:var(--accent-soft)}
#account-modal .settings-danger-actions button{border-radius:14px;min-height:46px;font-size:13px}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])){padding-top:calc(16px + var(--safe-top,0px));background:var(--paper)}
#account-modal:has(#account-session-panel:not([hidden])){background:var(--paper)}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])) .auth-title{font-size:28px;margin:0 0 22px;padding-inline-end:50px;text-align:start}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])) .auth-close{top:var(--safe-top,0px);z-index:3}
:is(#body-profile-form,#styling-mode-form){display:flex;flex-direction:column;padding:0;max-height:calc(100dvh - 26px);overflow:hidden}
:is(#body-profile-form,#styling-mode-form) .modal-heading{padding:20px;margin:0;flex:none;border-bottom:1px solid var(--line);align-items:center}
:is(#body-profile-form,#styling-mode-form) .modal-heading h2{font-size:22px;line-height:1.5}
:is(#body-profile-form,#styling-mode-form) .eyebrow{font-size:11px;color:var(--muted)}
:is(#body-profile-form,#styling-mode-form) .close-button{width:38px;height:38px;min-height:38px;flex:none;border:1px solid var(--line);border-radius:50%;background:var(--white);font-size:23px}
.account-form-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 20px}
.account-form-body>p{font-size:12px;line-height:1.8;color:var(--muted);margin-top:0}
#body-profile-modal .profile-privacy-note{padding:12px;border-radius:14px;border:1px solid var(--line);background:var(--white);font-size:11px;line-height:1.85}
.account-form-body :is(input,select,textarea){font-size:16px;background:var(--white);border-radius:14px;min-height:48px;border:1px solid var(--line)}
.account-form-body .form-row{gap:12px}#body-profile-modal .metadata-details{padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--white)}
#body-profile-modal .metadata-details summary{font-size:13px;cursor:pointer}#body-profile-modal .metadata-details[open]{animation:account-detail-in .18s ease-out}
#open-styling-mode{border-radius:16px;min-height:48px;background:var(--accent-soft);color:var(--ink);border-color:var(--line)}
:is(#body-profile-form,#styling-mode-form) .modal-actions{flex:none;margin:0;padding:14px 20px max(14px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--paper);gap:10px}
:is(#body-profile-form,#styling-mode-form) .modal-actions button{border-radius:16px;min-height:48px;font-size:14px;flex:1}
#styling-mode-form .styling-mode-options{gap:12px;margin:18px 0}#styling-mode-form .styling-mode-options label{border:1px solid var(--line);background:var(--white);border-radius:20px;min-height:90px;display:flex;align-items:center;justify-content:center;gap:10px;padding:16px;font-size:17px;transition:transform .16s,background .16s,border-color .16s}
#styling-mode-form .styling-mode-options label:has(:checked),#styling-mode-form .styling-hijab-options label:has(:checked){background:var(--accent-soft);border-color:var(--accent);color:var(--ink)}
#styling-mode-form .styling-mode-options input,#styling-mode-form .styling-hijab-options input{width:18px;height:18px;min-height:18px;accent-color:var(--accent)}
#styling-mode-form .styling-hijab-options label{border-radius:14px;border:1px solid var(--line);background:var(--white);padding:10px 6px;font-size:12px}
#styling-mode-form .styling-body-row{margin-top:18px}
:is(#account-modal,#body-profile-modal,#styling-mode-modal) :is(button,input,select,textarea,summary):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
:is(#account-modal,#body-profile-modal,#styling-mode-modal) button:not(.gsi-material-button){transition:transform .16s,background .16s}
:is(#account-modal,#body-profile-modal,#styling-mode-modal) button:not(.gsi-material-button):active{transform:scale(.98)}
@keyframes account-sheet-in{from{opacity:0;transform:translateY(12px) scale(.99)}to{opacity:1;transform:none}}
@keyframes account-detail-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:none}}
@media(max-width:640px){#account-modal:has(#account-session-panel:not([hidden])){max-height:100dvh;border-radius:0;border:0}#account-modal:has(#account-session-panel:not([hidden])) .account-dialog{max-height:100dvh;padding-bottom:calc(28px + var(--safe-bottom,0px))}}
@media(max-width:360px){#account-modal .account-dialog{padding-inline:16px}.account-form-body{padding:16px}:is(#body-profile-form,#styling-mode-form) .modal-heading{padding:16px}:is(#body-profile-form,#styling-mode-form) .modal-heading h2{font-size:19px}}
@media(prefers-reduced-motion:reduce){:is(#account-modal,#body-profile-modal,#styling-mode-modal)[open],#account-modal .account-danger[open] .settings-danger-body,#body-profile-modal .metadata-details[open]{animation:none}:is(#account-modal,#body-profile-modal,#styling-mode-modal) :is(button,label){transition:none;transform:none!important}}
/* Account / entry alignment, 2026-10-21. Existing controller and form IDs retained. */
#account-email-fields{border:0;margin:12px 0 0;padding:0;min-width:0}
#account-email-fields[hidden]{display:none!important}
#account-modal .provider-apple,#account-modal .email-disclosure,#account-modal .auth-guest{width:100%;min-height:48px;border-radius:16px;font:inherit;font-size:14px;font-weight:600;line-height:1.5;cursor:pointer}
#account-modal .provider-apple{background:var(--ink);color:var(--paper);border:1px solid var(--ink);margin-bottom:10px}
#account-modal .gsi-material-button{width:100%;max-width:none;height:48px;border-radius:16px}
#account-modal .gsi-material-button-content-wrapper{justify-content:center;gap:12px}
#account-modal .email-disclosure{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border:1px solid var(--line);background:var(--white);color:var(--ink)}
#account-modal .email-disclosure[aria-expanded="true"]>span:last-child{transform:rotate(180deg)}
#account-modal .auth-guest{background:var(--accent-soft);color:var(--ink);border:1px solid var(--line);margin:4px 0 8px}
#account-modal .auth-divider{margin:14px 0}
#account-modal .auth-close{display:grid;place-items:center;padding:0;line-height:1;font:26px/1 system-ui;top:16px;inset-inline-end:16px;inset-inline-start:auto}
#account-modal .auth-brand{padding-inline-end:40px;margin-bottom:14px}
#account-modal .auth-subtitle{margin-bottom:18px}
#account-modal .auth-switch{margin:12px 0}
#account-modal .legal-links{margin-top:12px}
#account-modal #account-email{direction:ltr;text-align:start}
#account-modal .account-dialog{overflow-y:auto;overscroll-behavior:contain}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])) .auth-close{top:12px}
html[dir="ltr"] #account-open-styling .settings-chevron{transform:rotate(180deg)}
#styling-mode-form .styling-mode-options,#styling-mode-form .styling-hijab-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#styling-mode-form :is(.styling-mode-options,.styling-hijab-options) label:has(.account-choice-portrait){position:relative;display:flex;flex-direction:column;border-radius:44% 44% 18px 18px;padding:0;overflow:hidden;gap:0;min-width:0;background:var(--white)}
#styling-mode-form .account-choice-portrait{display:block;width:100%;height:190px;object-fit:contain;object-position:bottom;background:#f5f5f1}
#styling-mode-form :is(.styling-mode-options,.styling-hijab-options) label:has(.account-choice-portrait)>input{position:absolute;opacity:0;width:1px;height:1px}
#styling-mode-form :is(.styling-mode-options,.styling-hijab-options) label:has(.account-choice-portrait)>span{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
#styling-mode-form :is(.styling-mode-options,.styling-hijab-options) label:has(.account-choice-portrait):has(:checked){outline:2px solid var(--ink);outline-offset:2px}
#styling-mode-form :is(.styling-mode-options,.styling-hijab-options) label:has(.account-choice-portrait):has(:checked)::after{content:'✓';position:absolute;bottom:8px;inset-inline-start:8px;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#41464d;color:#fff;font:16px/1 system-ui}
#styling-mode-form label:has(.account-choice-portrait):focus-within{outline:3px solid var(--ink);outline-offset:3px}
#styling-mode-form .styling-hijab-options label:last-child{grid-column:1/-1;min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px}
#styling-mode-form .styling-body-row{gap:12px}
@media(max-width:360px){#styling-mode-form .account-choice-portrait{height:155px}#account-modal .auth-title{font-size:23px}}
@media(prefers-reduced-motion:no-preference){#account-email-fields:not([hidden]){animation:account-detail-in .18s ease-out}}

/* Personal fit polish: retain paired measurements at mobile breakpoints. */
#body-profile-form .account-form-body{display:flex;flex-direction:column;gap:14px;padding:16px 20px}
#body-profile-form .account-form-body>*,#body-profile-form .form-row>label{margin:0;min-width:0}
#body-profile-form .form-row{gap:12px}
#body-profile-form .profile-basic-measurements{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end}
#body-profile-form .profile-basic-measurements>label{display:block}
#body-profile-form .profile-basic-measurements input{margin-top:6px}
#body-profile-form :is(input,select,textarea){display:block;width:100%;max-width:100%;box-sizing:border-box;border:1px solid var(--line);background:var(--white);color:var(--ink);font:inherit;font-size:16px;line-height:1.4;padding:10px 12px;border-radius:14px;min-height:46px;margin-top:6px}
#body-profile-form select{appearance:none;padding-inline-end:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b7d80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:left 12px center}
html[dir="ltr"] #body-profile-form select{background-position:right 12px center}
#body-profile-form input[type="number"]{direction:ltr;text-align:start;appearance:textfield;-moz-appearance:textfield}
#body-profile-form input[type="number"]::-webkit-inner-spin-button,#body-profile-form input[type="number"]::-webkit-outer-spin-button{appearance:none;margin:0}
#body-profile-form .profile-privacy-note{font-size:11px;line-height:1.75;padding:10px 12px}
#body-profile-form #open-styling-mode{min-height:44px;padding:10px 12px;font-size:13px;line-height:1.5}
#body-profile-form .metadata-details{padding:12px}
#body-profile-form .metadata-details summary{min-height:24px;line-height:24px}
#body-profile-form .metadata-details .form-row,#body-profile-form .metadata-details .brand-field{margin-top:12px}
#body-profile-form .modal-heading{padding:16px 20px}
#body-profile-form .modal-heading h2{font-size:20px}
#body-profile-form .modal-actions{padding:12px 20px max(12px,env(safe-area-inset-bottom))}
#body-profile-form .close-button{display:grid;place-items:center;padding:0;line-height:1}
@media(max-width:360px){#body-profile-form .account-form-body,#body-profile-form .modal-heading{padding-inline:16px}#body-profile-form .modal-heading h2{font-size:18px}#body-profile-form .profile-basic-measurements{gap:10px}#body-profile-form .profile-basic-measurements>label>span{font-size:11px}}
#body-profile-form .modal-heading{gap:14px}
#body-profile-form .modal-heading>div{flex:1;min-width:0}
/* Grouped account overview — reference approved 21 Oct. */
#account-modal .account-identity{padding:4px 14px 14px;background:linear-gradient(130deg,#41464d,#343938 65%,#4d493e);color:#fff;border:0;border-radius:24px;margin-bottom:14px}
#account-modal .account-identity .settings-profile-row{padding:16px 0 12px;min-height:80px}
#account-modal .account-identity .settings-avatar{border-radius:50%;width:52px;height:52px;background:#bdac82;color:#262a2d;border:1px solid #ffffff30}
#account-modal .account-identity .settings-private{color:#e3e2de}
#account-modal .account-identity #sync-account-now{width:100%;min-height:58px;border:1px solid #ffffff24;border-radius:16px;padding:10px 12px;background:#ffffff10;color:#fff}
#account-modal .account-identity #sync-account-now small,#account-modal .account-identity .settings-chevron{color:#e3e2de}
#account-modal .account-plan-teaser{display:flex;align-items:center;justify-content:space-between;width:100%;gap:12px;text-align:start;border:1px solid var(--line);border-radius:18px;background:var(--accent-soft);color:var(--ink);padding:14px 16px;min-height:70px;font:inherit}
#account-modal .account-plan-teaser strong{display:block;font-size:15px}#account-modal .account-plan-teaser small{display:block;font-size:12px;color:var(--muted);margin-top:4px}#account-modal .account-plan-teaser>span:last-child{font-size:13px;font-weight:600}
#account-modal .account-section-label{font-size:12px;color:var(--muted);font-weight:500;margin:18px 4px 8px}
#account-modal #account-session-panel>.settings-group{margin-bottom:0}
#account-modal #account-session-panel .settings-row{min-height:54px;padding:13px 16px}
#account-modal #account-session-panel .settings-row-main small{font-size:11px;line-height:1.6}
#account-modal #weather-optin-group{margin-top:12px;border-color:#b96b5b50}
#account-modal #weather-optin-group strong{color:#b66c59}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])) .auth-title{font-size:23px;margin-bottom:16px}
#account-modal #logout-account{justify-content:center;background:none;border-top:1px solid var(--line);margin-top:8px}
:is(#account-data-modal,#account-plans-modal){padding:0;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:24px;max-width:440px;width:calc(100% - 32px);max-height:calc(100dvh - 24px)}
:is(#account-data-modal,#account-plans-modal)::backdrop{background:#0006;backdrop-filter:blur(3px)}
.account-data-sheet{padding:20px;overflow:auto;max-height:calc(100dvh - 26px)}
.account-data-sheet header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.account-data-sheet h2{font-size:21px;margin:0}.account-data-sheet .close-button{position:static;display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--white);color:var(--ink);font:24px/1 system-ui;flex:none}
.account-data-sheet input{width:100%;min-height:48px;font-size:16px;border:1px solid var(--line);border-radius:14px;background:var(--white);color:var(--ink);margin-top:8px}
.account-data-sheet .settings-danger-body{display:block;padding:0}.account-data-sheet .settings-danger-actions{display:grid;gap:10px;margin-top:16px}.account-data-sheet .settings-danger-actions button{min-height:46px;border-radius:14px}.account-data-sheet p{font-size:13px;line-height:1.8}
.account-plan-periods{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.account-plan-periods span{padding:18px 6px;background:var(--white);border:1px solid var(--line);border-radius:14px;text-align:center;font-size:14px}
#account-modal .account-identity .settings-email{color:#fff}
#account-modal #account-session-panel{gap:10px}
#account-modal .account-section-label{margin:8px 4px -4px}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])){position:relative}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])) .auth-close{position:absolute;top:12px;margin:0}
#account-modal .account-dialog:has(#account-session-panel:not([hidden])) .auth-title{text-align:center;padding-inline:42px}
#account-modal .account-identity .settings-row{border-top:0}
#account-modal #account-open-styling .settings-chevron{transform:none}
html[dir="ltr"] #account-modal #account-open-styling .settings-chevron{transform:none}
#account-modal .account-identity .settings-row::after{display:none}
#account-data-message:empty{display:none}
#account-data-message:not(:empty){padding:10px 12px;border:1px solid var(--line);background:var(--accent-soft);border-radius:12px}
/* Guest and subscriber use the same account sections and controls. */
#account-modal :is(#account-guest-card,#account-signed-identity,#account-signout-group,#open-account-data,#open-account-plans)[hidden]{display:none!important}
#account-modal .account-guest-card{display:flex;flex-direction:column;align-items:center;text-align:center;padding:18px 18px 12px;border:1px solid var(--line);border-radius:24px;background:var(--white);gap:10px}
#account-modal .guest-avatar{display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:var(--accent-soft);color:var(--accent)}
#account-modal .guest-avatar svg{width:28px;height:28px}
#account-modal .account-guest-card>strong{font-size:18px}
#account-modal .account-guest-card p{margin:0;font-size:12px;line-height:1.8;color:var(--muted);max-width:280px}
#account-modal #account-guest-create{width:100%;min-height:46px;margin-top:4px;border-radius:14px}
#account-modal #account-guest-signin{min-height:40px;font-size:13px}
#account-modal #account-subscription:not([hidden]){border-color:var(--line);background:var(--white);border-radius:18px;margin:0}
#account-modal #account-subscription .account-sub-status.is-paid{background:var(--accent-soft);color:var(--ink);border:1px solid var(--line);padding:5px 10px;border-radius:20px;font-size:12px;white-space:nowrap}
#account-modal #account-manage{color:var(--ink);font-weight:600;min-height:46px}
#account-modal #account-modal-message:not(:empty){position:sticky;top:0;z-index:2;background:var(--white);border:1px solid var(--line);padding:10px 12px;border-radius:12px;font-size:12px;box-shadow:0 3px 14px #0001}
@media(prefers-reduced-motion:no-preference){#account-modal .account-session-panel{animation:account-detail-in .18s ease-out}}

/* The plans sheet (subscription quotas, 2026-10-21): three cards, monthly the hero.
   RTL puts the first card right — the approved order monthly/annual/weekly. */
#account-plans-modal .account-plan-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
@media (max-width:520px){#account-plans-modal .account-plan-cards{grid-template-columns:1fr}}
#account-plans-modal .plan-card{display:flex;flex-direction:column;gap:8px;padding:14px 12px;background:var(--white);border:1px solid var(--line);border-radius:16px}
#account-plans-modal .plan-card.is-hero{border-color:var(--ink);box-shadow:0 1px 0 var(--line)}
#account-plans-modal .plan-card-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
#account-plans-modal .plan-card-head strong{font-size:15px}
#account-plans-modal .plan-tag,#account-plans-modal .plan-badge{font-size:11px;padding:2px 8px;border-radius:999px;border:1px solid var(--line);color:var(--muted);white-space:nowrap}
#account-plans-modal .plan-badge{background:var(--accent-soft);color:var(--ink)}
#account-plans-modal .plan-price{margin:0;font-size:14px;font-weight:600}
#account-plans-modal .plan-note{margin:0;font-size:12px;color:var(--muted);line-height:1.6;flex:1}
#account-plans-modal .plan-buy{width:100%;min-height:40px}
#account-plans-modal .account-plan-links{margin:4px 0 0;font-size:12px;color:var(--muted);text-align:center}
#account-plans-modal .account-plan-links a{color:inherit}

/* The usage counters: a quiet list under the subscription group. */
#account-usage .account-usage-list{list-style:none;margin:0;padding:4px 16px 12px;display:grid;gap:8px}
#account-usage .account-usage-list li{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px}
#account-usage .account-usage-list li span{color:var(--muted)}
#account-usage .account-usage-list li strong{font-weight:600;white-space:nowrap;font-feature-settings:"tnum"}

/* «استخدام بياناتي للتحسين والتدريب» (سياسة الخصوصية، البند 5). */
#account-data-modal .improve-data-group{margin:0 0 14px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--white)}
#account-data-modal .improve-toggle{display:flex;align-items:flex-start;gap:10px;cursor:pointer}
#account-data-modal .improve-toggle input{width:18px;height:18px;margin-top:2px;accent-color:var(--accent)}
#account-data-modal .improve-copy strong{display:block;font-size:14px}
#account-data-modal .improve-copy small{display:block;font-size:12px;color:var(--muted);margin-top:4px;line-height:1.7}
