:root{color-scheme:light;--bg:#f5f4f9;--surface:#fff;--surface2:#f1eff9;--text:#20223e;--muted:#62667b;--line:#deddeb;--primary:#6435bd;--primary-soft:#f0e9fc;--on-primary:#fff;--teal:#087e77;--danger:#b42347;--shadow:0 6px 26px #2c1d5210;--radius:20px;--font:15px;--warm:#fff9ef}
:root[data-theme=night]{color-scheme:dark;--bg:#101528;--surface:#192139;--surface2:#222c48;--text:#f3f2fc;--muted:#b8bfd5;--line:#3b4661;--primary:#b69aff;--primary-soft:#34284e;--on-primary:#17102b;--teal:#6ed8cb;--danger:#ff9db4;--shadow:0 6px 26px #0002;--warm:#211f2e}
:root[data-font=large]{--font:17px}:root[data-font=xlarge]{--font:19px}
:root[data-comfort=on]{--bg:#f7f1e5;--surface:#fffbf3;--surface2:#f2eadc;--primary-soft:#efe6f3}
:root[data-comfort=on][data-theme=night]{--bg:#191923;--surface:#24232e;--surface2:#302e3d;--primary-soft:#3c3046}
:root[data-contrast=on]{--text:#080e22;--muted:#273348;--line:#6f7487;--primary:#48208e}
:root[data-contrast=on][data-theme=night]{--text:#fff;--muted:#eee;--line:#aeb9cd;--primary:#d0b9ff}
*{box-sizing:border-box}html{font-size:var(--font);scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:Tahoma,Arial,sans-serif;direction:rtl;line-height:1.75}button,input,select,textarea{font:inherit}button,a,input,select,textarea,summary{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}button,input,select,textarea{max-width:100%}button{line-height:1.6}input,select,textarea{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:12px;padding:.75rem;min-width:0}input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{width:100%}input[readonly]{background:var(--surface2);color:var(--muted)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:.9}textarea{resize:vertical}label{display:grid;gap:.45rem}fieldset{padding:0;border:0;margin:0;min-width:0}legend{margin-bottom:.65rem}h1,h2,h3,h4,p{overflow-wrap:anywhere}h1{font-size:1.5rem;line-height:1.5}h2{font-size:1.3rem;line-height:1.6}h3{font-size:1.1rem}p{margin:.4rem 0 1rem}small{font-size:.8rem}a{color:var(--primary)}[hidden]{display:none!important}:focus-visible{outline:3px solid var(--teal);outline-offset:4px}h1:focus{outline:0}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.visually-hidden:focus-visible+label{outline:3px solid var(--teal)}
.side{position:fixed;right:0;inset-block:0;width:260px;background:var(--surface);padding:1.5rem 1rem;border-left:1px solid var(--line);display:flex;flex-direction:column;gap:1.2rem;overflow:auto;z-index:20}.brand{display:flex;gap:.7rem;align-items:center}.brand-logo{width:48px;height:48px;object-fit:contain;border-radius:14px;background:white;flex:none}.brand b{font-size:1rem}.brand small{display:block;font-size:.6rem;letter-spacing:1px;color:var(--muted)}.brand em{font-style:normal;color:var(--primary)}.profile{display:flex;align-items:center;gap:.7rem;text-align:right;width:100%;background:var(--surface2);border:1px solid var(--line);border-radius:16px;padding:.8rem;color:var(--text)}.profile>span:last-child{min-width:0;overflow-wrap:anywhere}.profile b{font-size:.9rem}.profile small{display:block;color:var(--muted);font-size:.7rem}.avatar{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:var(--primary-soft);color:var(--primary);font-weight:bold;flex:none;overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}.avatar img[data-preset=pezhvak]{object-position:center 45%;transform:scale(1.65);transform-origin:50% 46%}.avatar-large{width:92px;height:92px;font-size:1.8rem;border:3px solid var(--surface);box-shadow:0 0 0 1px var(--line)}nav{display:grid;gap:.25rem}nav button{background:none;border:0;color:var(--muted);text-align:right;padding:.7rem;border-radius:12px;font-size:.84rem;white-space:normal}nav button.active,nav button:hover{color:var(--primary);background:var(--primary-soft)}nav button.active{font-weight:bold;box-shadow:inset -3px 0 var(--primary)}.plan{margin-top:auto;padding:1rem;border-radius:14px;background:var(--primary-soft);color:var(--primary);font-size:.85rem}.plan small{display:block;color:var(--muted)}.foot{display:block;text-align:center;color:var(--muted)}main{margin-right:260px;padding:1.7rem 2.2rem;max-width:1700px;min-width:0}.app-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.6rem;flex-wrap:wrap}.header-title{min-width:0}.app-header h1{margin:.25rem 0}.app-header small{color:var(--muted)}.header-actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}.connection{color:var(--muted);font-size:.75rem}.connection::before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--muted);margin-left:6px}.connection[data-status=online]::before{background:#139a7e}.connection[data-status=offline]::before{background:#de4965}.icon-button,.logout-btn{border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:12px;padding:.55rem .85rem;min-height:44px}.icon-button{font-size:1.35rem;min-width:44px}.logout-btn{font-size:.85rem}.page{display:none}.page.show{display:block}.primary,.secondary,.text-button,.form>button,.chat button{border:0;border-radius:12px;padding:.75rem 1.2rem;font-weight:bold;min-height:44px}.primary,.form>button,.chat button{background:var(--primary);color:var(--on-primary)}.secondary{background:var(--surface2);color:var(--text);border:1px solid var(--line)}.text-button{background:none;color:var(--primary);padding:.5rem .3rem;font-size:.86rem}.danger{color:var(--danger)}.eyebrow{color:var(--primary);font-size:.8rem;font-weight:bold}.card,.stats article,.network,.empty{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.3rem;box-shadow:var(--shadow);min-width:0}.card h2,.card h3{margin-top:0}.dashboard-cards{display:grid;gap:1.1rem}.hero{display:flex;gap:1.5rem;align-items:center;justify-content:space-between;padding:1.8rem;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow)}.hero>div{min-width:0}.hero h2{font-size:1.55rem;margin:.7rem 0}.hero p{color:var(--muted);max-width:44rem}.hero-mascot{width:160px;height:200px;border-radius:18px;object-fit:cover;flex:none}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem}.stats b{display:block;font-size:1.75rem;margin:.6rem 0}.stats small{display:block;color:var(--muted)}.section-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:.6rem 0 1rem}.section-head h2{margin:0}.section-head p,.muted{color:var(--muted)}.cols{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.row{display:flex;justify-content:space-between;gap:.8rem;flex-wrap:wrap;padding:.85rem 0;border-bottom:1px solid var(--line)}.row span{font-size:.75rem;color:var(--muted);background:var(--surface2);border-radius:8px;padding:.1rem .6rem}.quick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.quick button{background:var(--primary-soft);color:var(--primary);border:1px solid var(--line);border-radius:14px;padding:1.1rem;min-height:70px}.quick b{display:block}.notice{background:var(--surface2);color:var(--muted);border:1px solid var(--line);padding:1rem;border-radius:14px;margin-top:1rem;font-size:.86rem;line-height:2}.notice.error{color:var(--danger)}.notice button{margin:.5rem}.network-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.network p,.network small{color:var(--muted)}.empty{text-align:center;padding:3rem 1rem;color:var(--muted)}.empty h2{color:var(--text)}.chat{max-width:900px;margin:auto}.log{min-height:300px;max-height:55vh;overflow:auto;overflow-wrap:anywhere}.ai,.user{padding:.9rem;border-radius:14px;max-width:90%;white-space:pre-wrap}.ai{background:var(--primary-soft)}.user{background:var(--surface2);margin-right:auto;border:1px solid var(--line)}.chat form{display:flex;gap:.5rem;margin-top:1rem}.chat form input{flex:1;min-width:0}.form{display:grid;gap:1rem;max-width:850px}.form label{font-size:.95rem}footer{text-align:center;color:var(--muted);padding:2rem .5rem;font-size:.75rem}.agency-summary,.connection-card{background:var(--surface2);border:1px solid var(--line);border-radius:14px;padding:1rem;margin-bottom:1rem;color:var(--text)}.client-layout{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(300px,1.5fr);gap:1rem}.table-head{display:flex;justify-content:space-between;gap:.8rem;align-items:center;margin-bottom:1rem;flex-wrap:wrap}.table-head input{max-width:220px}.client-list,.growth-list{display:grid;gap:.65rem}.client-item{width:100%;text-align:right;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:12px;padding:1rem}.client-item:hover,.client-item.selected{border-color:var(--teal);background:var(--surface2)}.client-item b,.client-item small{display:block}.client-item small{color:var(--muted)}.client-details-head,.brand-row{display:flex;gap:1rem;justify-content:space-between;align-items:center;flex-wrap:wrap}.brand-row{border-top:1px solid var(--line);padding:.8rem 0}.growth-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.growth-item{border:1px solid var(--line);border-radius:12px;padding:1rem;display:flex;flex-direction:column;gap:.4rem;min-width:0}.growth-item a{overflow-wrap:anywhere}.growth-item small{color:var(--muted)}.growth-item select{max-width:240px}dialog{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:18px;padding:1.5rem;width:min(460px,calc(100% - 28px))}dialog::backdrop{background:#101828aa}dialog form{display:grid;gap:1rem}.dialog-actions{display:flex;justify-content:flex-end;gap:.5rem}
/* Personalization: one shared theme across every page, including dialogs. */
#settings{max-width:1000px;margin-inline:auto}.settings-intro{display:flex;align-items:center;gap:1.5rem;justify-content:space-between;padding:1.6rem 1.7rem;background:var(--primary-soft);border:1px solid var(--line);border-radius:24px;margin-bottom:1.2rem}.settings-intro h2{font-size:1.65rem;margin:.4rem 0}.settings-intro p{color:var(--muted);font-size:.92rem}.settings-intro img{object-fit:cover;border-radius:18px;flex:none}.sync-label{display:inline-block;color:var(--primary);font-size:.75rem}.settings-group{background:var(--surface);border:1px solid var(--line);border-radius:18px;margin-bottom:.8rem;overflow:clip}.settings-group summary{display:flex;align-items:center;gap:1rem;padding:1.1rem 1.3rem;cursor:pointer;list-style:none;min-height:76px}.settings-group summary::-webkit-details-marker{display:none}.settings-group summary::after{content:'＋';color:var(--muted);margin-right:auto;font-size:1.3rem}.settings-group[open] summary::after{content:'−'}.settings-group[open] summary{border-bottom:1px solid var(--line)}.settings-group summary>span:nth-child(2){min-width:0}.settings-group summary b{display:block;font-size:.98rem}.settings-group summary small{display:block;color:var(--muted);font-size:.78rem;margin-top:.15rem}.group-icon{background:var(--primary-soft);color:var(--primary);width:40px;height:40px;border-radius:12px;display:grid;place-items:center;font-size:1.3rem;flex:none}.settings-body{display:grid;gap:1.1rem;padding:1.4rem}.settings-body>label,.field-grid>label,.password-form>label{font-size:.9rem}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.field-hint{display:block;color:var(--muted);font-size:.78rem;line-height:1.9;margin:0}.profile-editor{display:flex;gap:1.3rem;align-items:center;flex-wrap:wrap}.profile-editor>div{min-width:0;flex:1}.upload-label{cursor:pointer;display:inline-block;font-size:.82rem;margin-bottom:.4rem}.avatar-choices{display:flex;gap:.7rem;flex-wrap:wrap;margin-top:.5rem}.avatar-choices button{font-size:.78rem}.theme-options{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.theme-options legend{font-size:.9rem}.theme-choice{position:relative;border:1px solid var(--line);border-radius:14px;padding:.8rem;grid-template-columns:auto 1fr;align-items:center;gap:.6rem;cursor:pointer}.theme-choice input{grid-column:1;grid-row:1;accent-color:var(--primary);width:18px;height:18px}.theme-choice b{font-size:.85rem;grid-column:2;grid-row:1}.theme-sample{grid-column:1 / -1;display:grid;place-items:center;height:65px;border-radius:10px;font-size:1.7rem}.day-sample{background:#f6f4fb;color:#7857b4;border:1px solid #ddd5ed}.night-sample{background:#18213a;color:#c1a5ff;border:1px solid #45536d}.theme-choice:has(input:checked){border:2px solid var(--primary);padding:calc(.8rem - 1px);background:var(--primary-soft)}.reading-preview{padding:1.2rem;background:var(--surface2);border-radius:12px}.reading-preview p{font-size:.9rem;color:var(--muted);margin:.3rem 0 0}.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.65rem 0;border-bottom:1px solid var(--line)}.toggle-row:last-child{border:0}.toggle-row b{font-size:.9rem}.toggle-row small{display:block;color:var(--muted);font-size:.78rem;margin:.2rem 0}.toggle-row input{appearance:none;width:46px;height:26px;background:var(--line);border:1px solid var(--muted);border-radius:20px;padding:3px;flex:none;cursor:pointer}.toggle-row input:before{content:'';display:block;width:18px;height:18px;border-radius:50%;background:var(--surface);transform:translateX(0);box-shadow:0 1px 3px #0004;transition:transform .15s}.toggle-row input:checked{background:var(--primary);border-color:var(--primary)}.toggle-row input:checked:before{transform:translateX(-18px);background:var(--on-primary)}.card-order{display:grid;gap:.6rem}.order-item{display:flex;align-items:center;gap:.7rem;border:1px solid var(--line);border-radius:12px;padding:.65rem .8rem;background:var(--surface2);flex-wrap:wrap}.order-item label{display:flex;gap:.6rem;align-items:center;flex:1;min-width:140px;font-size:.85rem}.order-item input{width:19px;height:19px;accent-color:var(--primary)}.order-buttons{display:flex;gap:.4rem}.order-buttons button{border:1px solid var(--line);background:var(--surface);color:var(--text);width:42px;min-height:42px;border-radius:9px}.companion-note{border-right:3px solid var(--primary);padding-right:1rem}.companion-note p{font-size:.87rem;color:var(--muted);margin:.4rem 0}.settings-savebar{display:flex;align-items:center;justify-content:space-between;gap:1rem;position:sticky;bottom:12px;background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 5px 30px #21133320;padding:1rem 1.2rem;z-index:10;margin:1rem 0}.settings-savebar b{display:block;font-size:.85rem}.settings-savebar small{display:block;color:var(--muted);font-size:.73rem}.save-actions{display:flex;gap:.6rem;flex:none}.save-actions button{font-size:.83rem;padding:.7rem 1rem}.settings-savebar[data-state=error]{border-color:var(--danger)}.settings-savebar[data-state=dirty]{border-color:var(--primary)}.password-form{display:grid;gap:1rem}.password-form>button{justify-self:start}.button-row{display:flex;gap:.7rem;flex-wrap:wrap;align-items:center}.button-row .upload-label{margin:0}.guide-list{margin:0;padding-right:1.3rem;font-size:.88rem;color:var(--muted)}.guide-list li{margin-bottom:.7rem}.toast{position:fixed;bottom:20px;left:20px;max-width:min(460px,calc(100vw - 40px));background:var(--text);color:var(--surface);padding:1rem 1.2rem;border-radius:14px;box-shadow:0 5px 25px #0003;font-size:.9rem;z-index:100;overflow-wrap:anywhere}.toast[data-error=true]{background:var(--danger);color:var(--bg)}
.auth-wrap{margin:0;max-width:none;min-height:100vh;display:grid;place-items:center;padding:1.5rem}.auth-card{width:min(100%,460px);background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:2rem;box-shadow:var(--shadow)}.auth-card h1{margin-top:1.5rem}.auth-sub,.security-note{color:var(--muted);font-size:.85rem}.auth-card form,.auth-card #registerFields{display:grid;gap:1rem}.auth-card form>button{background:var(--primary);color:var(--on-primary);border:0;padding:.8rem;border-radius:12px}.switch{display:block;margin:1rem auto;background:none;border:0;color:var(--primary)}.security-note{display:block;text-align:center}#error{color:var(--danger)}
@media(max-width:1150px){.side{width:225px}main{margin-right:225px;padding:1.4rem}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.client-layout{grid-template-columns:1fr}}
@media(max-width:760px){.side{position:sticky;width:100%;height:auto;max-height:none;padding:.6rem .85rem;gap:.6rem;border:0;border-bottom:1px solid var(--line)}.side .brand{gap:.5rem}.brand-logo{width:38px;height:38px}.side .brand b{font-size:.9rem}.side .brand small{font-size:.5rem}.side .profile,.side .plan,.side .foot{display:none}nav{display:flex;overflow:auto;gap:.3rem;padding-bottom:.15rem}nav button{white-space:nowrap;flex:none;font-size:.78rem;padding:.5rem .7rem;min-height:40px}main{margin:0;padding:1rem;max-width:100%}.app-header{margin-bottom:1rem;gap:.6rem}.app-header h1{font-size:1.3rem}.header-actions{gap:.4rem}.connection{font-size:.68rem}.hero{padding:1.1rem;gap:.8rem}.hero h2{font-size:1.25rem}.hero-mascot{width:105px;height:132px}.hero p{font-size:.85rem}.hero button{font-size:.83rem}.settings-intro{padding:1.1rem;gap:.8rem}.settings-intro h2{font-size:1.35rem}.settings-intro img{width:84px;height:105px}.settings-intro p{font-size:.83rem}.settings-group summary{padding:.9rem;gap:.7rem}.settings-body{padding:1rem;gap:1rem}.settings-group summary small{font-size:.73rem}.group-icon{width:34px;height:34px}.settings-savebar{padding:.85rem;flex-wrap:wrap;bottom:8px;gap:.65rem}.save-actions{width:100%}.save-actions button{flex:1}.field-grid,.growth-grid,.cols{grid-template-columns:1fr}.network-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-editor{gap:1rem}.settings-intro>div{min-width:0}.sync-label{font-size:.7rem}}
@media(max-width:420px){.header-title{width:100%}.header-actions{width:100%;justify-content:flex-end}.connection{margin-left:auto}.hero{flex-wrap:wrap}.hero>div{flex:1;min-width:170px}.hero-mascot{width:88px;height:110px}.settings-intro{align-items:flex-start}.settings-intro img{width:65px;height:82px}.theme-choice{grid-template-columns:22px 1fr;gap:.35rem;padding:.6rem}.theme-choice b{font-size:.78rem}.theme-choice:has(input:checked){padding:calc(.6rem - 1px)}.avatar-large{width:72px;height:72px}.network-cards{grid-template-columns:1fr}.stats article{padding:.85rem}.theme-options{gap:.65rem}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}
:root[data-motion=on]{scroll-behavior:auto}:root[data-motion=on] *,:root[data-motion=on] *::before,:root[data-motion=on] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}

.profile-editor:has(#profilePhoto:focus-visible) .upload-label,.button-row:has(#importSettings:focus-visible) .upload-label{outline:3px solid var(--teal);outline-offset:4px}
/* Full-data backups: device file and account cloud are separate destinations. */
#backupCreateFields,#backupPreviewForm{display:grid;gap:1rem}#backupCreateFields>button,#backupPreviewForm>button{justify-self:start}.backup-destinations{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}.backup-destinations label{display:flex;gap:.7rem;align-items:flex-start;padding:1rem;background:var(--surface2);border:1px solid var(--line);border-radius:14px;cursor:pointer}.backup-destinations input,.backup-confirm input{width:20px;height:20px;accent-color:var(--primary);flex:none}.backup-destinations small{display:block;color:var(--muted);font-size:.75rem}.backup-list{display:grid;gap:.7rem}.backup-list article{padding:1rem;border:1px solid var(--line);border-radius:14px;display:grid;gap:.6rem}.backup-list article>small{color:var(--muted)}.backup-list .button-row button{font-size:.8rem}.restore-area{display:grid;gap:1rem;padding-top:1rem;border-top:1px solid var(--line)}.restore-area h3{margin:0}.restore-preview{border:1px solid var(--primary);border-radius:14px;padding:1rem;display:grid;gap:.7rem}.backup-confirm{display:flex;align-items:center;gap:.6rem}.backup-table-wrap{overflow:auto}.backup-table-wrap table{width:100%;border-collapse:collapse;font-size:.8rem;min-width:270px}.backup-table-wrap th,.backup-table-wrap td{padding:.6rem;border-bottom:1px solid var(--line);text-align:right}.backup-table-wrap th{color:var(--muted)}#deviceBackupLink{text-decoration:none}#backupActionStatus[data-error=true],#restoreStatus[data-error=true]{color:var(--danger)}.restore-area:has(#restoreBackupFile:focus-visible)>.upload-label{outline:3px solid var(--teal);outline-offset:4px}@media(max-width:520px){.backup-destinations{grid-template-columns:1fr}.backup-destinations b{font-size:.9rem}}
