/* AMS theme1: sun/moon button + light-theme base. Dark stays the default and is untouched: every light rule is under html[data-theme="light"]. */
:root { --ams-accent-ink: #f59e0b; }
html[data-theme="light"] { color-scheme: light; --ams-accent-ink: #b45309; }
.ams-theme-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 36px; height: 36px; margin-inline: .2rem; padding: 0; border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, .22); background: transparent; color: #cbd5e1; cursor: pointer;
  font: inherit; line-height: 1; transition: color .15s, border-color .15s, background-color .15s;
}
.ams-theme-btn:hover { color: #fbbf24; border-color: #f59e0b; }
.ams-theme-btn:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
.ams-theme-btn svg { display: block; pointer-events: none; }
.ams-theme-btn .ams-th-moon { display: none; }
html[data-theme="light"] .ams-theme-btn .ams-th-sun { display: none; }
html[data-theme="light"] .ams-theme-btn .ams-th-moon { display: block; }
html[data-theme="light"] .ams-theme-btn { color: #334155; border-color: rgba(15, 23, 42, .16); }
html[data-theme="light"] .ams-theme-btn:hover { color: #b45309; border-color: #d97706; background: rgba(245, 158, 11, .08); }
.nav-trailing .ams-theme-btn { width: 34px; height: 34px; margin-inline: 0 .35rem; }
.amsbar-links .ams-theme-btn { width: 32px; height: 32px; }
html.ams-theme-anim, html.ams-theme-anim * { transition: background-color .25s ease, color .25s ease, border-color .25s ease !important; }
@media (prefers-reduced-motion: reduce) { html.ams-theme-anim, html.ams-theme-anim * { transition: none !important; } }

/* docs: the live site bar inside #ams-sb resets its children (bar_embed.php "all:revert"), so the button rules repeat with the bar scope */
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn .ams-th-sun{ display: none; }
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn .ams-th-moon{ display: block; }
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn{ color: #334155; border-color: rgba(15, 23, 42, .16); }
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn:hover{ color: #b45309; border-color: #d97706; background: rgba(245, 158, 11, .08); }
#ams-sb .nav-trailing .ams-theme-btn.ams-theme-btn{ width: 34px; height: 34px; margin-inline: 0 .35rem; }
#ams-sb .amsbar-links .ams-theme-btn.ams-theme-btn{ width: 32px; height: 32px; }
#ams-sb .ams-theme-btn.ams-theme-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; box-sizing: border-box;
  width: 36px; height: 36px; margin-inline: .2rem; padding: 0; border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, .22); background: transparent; color: #cbd5e1; cursor: pointer; font: inherit; line-height: 1;
}
#ams-sb .ams-theme-btn.ams-theme-btn:hover { color: #fbbf24; border-color: #f59e0b; }
#ams-sb .ams-theme-btn.ams-theme-btn svg { display: block; pointer-events: none; }
#ams-sb .ams-theme-btn.ams-theme-btn svg.ams-th-moon { display: none; }
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn svg.ams-th-sun { display: none; }
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn svg.ams-th-moon { display: block; }
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn{ color: #334155; border-color: rgba(15, 23, 42, .16); }
html[data-theme="light"] #ams-sb .ams-theme-btn.ams-theme-btn:hover{ color: #b45309; border-color: #d97706; background: rgba(245, 158, 11, .08); }
#ams-sb .nav-trailing .ams-theme-btn.ams-theme-btn{ width: 34px; height: 34px; margin-inline: 0 .35rem; }

/* light overrides for the inline <style> blocks printed by the PHP pages */
html[data-theme="light"] .acct-ico{color:#3c4757}
html[data-theme="light"] .acct-ico:hover{color:#141414;background:rgba(15,23,42,0.066)}
html[data-theme="light"] .nav-links a.acct-login{border:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] .acct-dd>summary{color:#273142}
html[data-theme="light"] .acct-dd>summary:hover,html[data-theme="light"] .acct-dd[open]>summary{background:rgba(15,23,42,0.066);color:#141414}
html[data-theme="light"] .acct-av{background:#ffffff}
html[data-theme="light"] .acct-menu{background:#ffffff;border:1px solid var(--border,rgba(15,23,42,0.225));box-shadow:0 12px 28px rgba(15,23,42,0.158)}
html[data-theme="light"] .acct-menu a{color:#273142 !important}
html[data-theme="light"] .acct-menu a:hover{background:rgba(15,23,42,0.077);color:#141414 !important}
html[data-theme="light"] .acct-menu hr{border-top:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] .nav-mobile .acct-m-head{border-top:1px solid var(--border,rgba(15,23,42,0.225));color:#141414}
html[data-theme="light"] .nav-mobile .acct-m-hr{border-top:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] .acct-out button{color:#273142}
html[data-theme="light"] .acct-out button:hover{background:rgba(15,23,42,0.077);color:#141414}
html[data-theme="light"] .bell-h{border-bottom:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] .bell-read{color:var(--ams-accent-ink)}
html[data-theme="light"] .bell-list a.unread{background:rgba(45,212,191,0.08)}
html[data-theme="light"] .bell-list .bt small{color:#5b6779}
html[data-theme="light"] .bell-empty{color:#5b6779}
html[data-theme="light"] .acct-menu a.bell-all{border-top:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] .bell-list .bt b em{color:#5b6779}
html[data-theme="light"] .bell-list .bt .pv{color:#3c4757}
html[data-theme="light"] .bell-list a.unread .pv{color:#141414}
html[data-theme="light"] .fr-row+.fr-row{border-top:1px solid rgba(15,23,42,0.108)}
html[data-theme="light"] .fr-b button{border:1px solid var(--border,rgba(15,23,42,0.225));color:#273142}
html[data-theme="light"] .fr-done{color:#5b6779}
html[data-theme="light"] .logo-page{color:#0b1220 !important}
html[data-theme="light"] .logo-page:hover,html[data-theme="light"] .logo-page[aria-current]{background:rgba(15,23,42,0.066);color:#0b1220 !important}
html[data-theme="light"] .site-nav .logo:focus-visible{outline:2px solid var(--amber-500,#f59e0a)}
html[data-theme="light"] .tb-sbtn{color:#3c4757}
html[data-theme="light"] .tb-sbtn:hover,html[data-theme="light"] .tb-search.is-open .tb-sbtn{color:#141414;background:rgba(15,23,42,0.066)}
html[data-theme="light"] .tb-sbtn:focus-visible,html[data-theme="light"] .tb-sx:focus-visible{outline:2px solid var(--amber-500,#f59e0a)}
html[data-theme="light"] .tb-sf input{border:1px solid rgba(15,23,42,0.3);background:#e8edf7;color:#141414}
html[data-theme="light"] .tb-sf input:focus{border-color:var(--amber-500,#f59e0a);box-shadow:0 0 0 3px rgba(245,158,11,0.2)}
html[data-theme="light"] .tb-sf input::placeholder{color:#51627a}
html[data-theme="light"] .tb-sx{color:#273444}
html[data-theme="light"] .tb-sx:hover{color:#141414;background:rgba(15,23,42,0.066)}
@media (max-width:767.98px){html[data-theme="light"] .tb-search.is-open .tb-sf{background:#f3f5f9}}
@media (min-width:768px){html[data-theme="light"] .tb-search.is-open .tb-sf{background:#f3f5f9;box-shadow:0 8px 24px rgba(15,23,42,0.122)}}
html[data-theme="light"] .nav-mobile>.acct-m-login{color:var(--ams-accent-ink) !important}
html[data-theme="light"] .f2-mc-t{background:#293747}
html[data-theme="light"] .f2-mc-t:focus-visible{outline:3px solid #f59e0a}
html[data-theme="light"] .f2-mc-more{background:rgba(15,23,42,0.55);color:#141414}
html[data-theme="light"] .mi-it.over{outline:3px solid #f59e0a}
html[data-theme="light"] .mi-b{background:rgba(232,237,247,0.72);color:#141414}
html[data-theme="light"] .mi-b:focus-visible{outline:2px solid #f59e0a}
html[data-theme="light"] .mi-n{background:rgba(232,237,247,0.72);color:#141414}
html[data-theme="light"] .mi-cnt{color:#6b7c94}
html[data-theme="light"] .ph-t{background:var(--surface-2,#ebeef5)}
html[data-theme="light"] .ph-t:focus-visible{outline:3px solid var(--accent,#f59e0a)}
html[data-theme="light"] .lg-card{background:var(--surface,#eaeef6);border:1px solid var(--border,rgba(15,23,42,0.18));box-shadow:0 20px 50px rgba(15,23,42,0.122)}
html[data-theme="light"] .lg-field input{border:1px solid var(--border,rgba(15,23,42,0.27));background:rgba(15,23,42,0.044)}
html[data-theme="light"] .lg-field input:focus{outline:2px solid var(--accent,#f59e0a)}
html[data-theme="light"] .lg-btn.ghost{border:1px solid var(--border,rgba(15,23,42,0.27))}
html[data-theme="light"] .lg-alt a{color:var(--ams-accent-ink)}
html[data-theme="light"] .lg-alert{background:rgba(237,44,44,0.12);color:#bc0606;border:1px solid rgba(235,20,20,0.35)}
html[data-theme="light"] .lg-check input{accent-color:var(--ams-accent-ink)}
html[data-theme="light"] .lg-forgot{color:var(--ams-accent-ink)}
html[data-theme="light"] .as-sel{background:var(--surface,#eaeef6)}
html[data-theme="light"] .as-bad{color:#b90909}
html[data-theme="light"] .as-post{background:var(--surface,#eaeef6)}
html[data-theme="light"] .as-post .as-pt:hover{color:var(--ams-accent-ink)}
html[data-theme="light"] .as-post .as-pm a:hover{color:var(--ams-accent-ink)}
html[data-theme="light"] .fb-card{background:var(--surface,#1a1a1a);border:1px solid var(--border,#577aa8);box-shadow:0 10px 30px rgba(15,23,42,0.06)}
html[data-theme="light"] .fb-field input,html[data-theme="light"] .fb-field textarea{border:1px solid var(--border,#253241);background:rgba(15,23,42,0.044)}
html[data-theme="light"] .fb-field input:focus,html[data-theme="light"] .fb-field textarea:focus{outline:2px solid var(--accent,#f59e0a)}
html[data-theme="light"] .fb-alert.ok{border:1px solid #1fe087}
html[data-theme="light"] .fb-alert.err{background:#2f0404;border:1px solid #fa0505}
html[data-theme="light"] #ams-sb .acct-ico{color:#3c4757}
html[data-theme="light"] #ams-sb .acct-ico:hover{color:#141414;background:rgba(15,23,42,0.066)}
html[data-theme="light"] #ams-sb .nav-links a.acct-login{border:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] #ams-sb .acct-dd>summary{color:#273142}
html[data-theme="light"] #ams-sb .acct-dd>summary:hover,html[data-theme="light"] #ams-sb .acct-dd[open]>summary{background:rgba(15,23,42,0.066);color:#141414}
html[data-theme="light"] #ams-sb .acct-av{background:#ffffff}
html[data-theme="light"] #ams-sb .acct-menu{background:#ffffff;border:1px solid var(--border,rgba(15,23,42,0.225));box-shadow:0 12px 28px rgba(15,23,42,0.158)}
html[data-theme="light"] #ams-sb .acct-menu a{color:#273142 !important}
html[data-theme="light"] #ams-sb .acct-menu a:hover{background:rgba(15,23,42,0.077);color:#141414 !important}
html[data-theme="light"] #ams-sb .acct-menu hr{border-top:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] #ams-sb .nav-mobile .acct-m-head{border-top:1px solid var(--border,rgba(15,23,42,0.225));color:#141414}
html[data-theme="light"] #ams-sb .nav-mobile .acct-m-hr{border-top:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] #ams-sb .acct-out button{color:#273142}
html[data-theme="light"] #ams-sb .acct-out button:hover{background:rgba(15,23,42,0.077);color:#141414}
html[data-theme="light"] #ams-sb .bell-h{border-bottom:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] #ams-sb .bell-read{color:var(--ams-accent-ink)}
html[data-theme="light"] #ams-sb .bell-list a.unread{background:rgba(45,212,191,0.08)}
html[data-theme="light"] #ams-sb .bell-list .bt small{color:#5b6779}
html[data-theme="light"] #ams-sb .bell-empty{color:#5b6779}
html[data-theme="light"] #ams-sb .acct-menu a.bell-all{border-top:1px solid var(--border,rgba(15,23,42,0.225))}
html[data-theme="light"] #ams-sb .bell-list .bt b em{color:#5b6779}
html[data-theme="light"] #ams-sb .bell-list .bt .pv{color:#3c4757}
html[data-theme="light"] #ams-sb .bell-list a.unread .pv{color:#141414}
html[data-theme="light"] #ams-sb .fr-row+.fr-row{border-top:1px solid rgba(15,23,42,0.108)}
html[data-theme="light"] #ams-sb .fr-b button{border:1px solid var(--border,rgba(15,23,42,0.225));color:#273142}
html[data-theme="light"] #ams-sb .fr-done{color:#5b6779}
html[data-theme="light"] #ams-sb .logo-page{color:#0b1220 !important}
html[data-theme="light"] #ams-sb .logo-page:hover,html[data-theme="light"] #ams-sb .logo-page[aria-current]{background:rgba(15,23,42,0.066);color:#0b1220 !important}
html[data-theme="light"] #ams-sb .site-nav .logo:focus-visible{outline:2px solid var(--amber-500,#f59e0a)}
html[data-theme="light"] #ams-sb .tb-sbtn{color:#3c4757}
html[data-theme="light"] #ams-sb .tb-sbtn:hover,html[data-theme="light"] #ams-sb .tb-search.is-open .tb-sbtn{color:#141414;background:rgba(15,23,42,0.066)}
html[data-theme="light"] #ams-sb .tb-sbtn:focus-visible,html[data-theme="light"] #ams-sb .tb-sx:focus-visible{outline:2px solid var(--amber-500,#f59e0a)}
html[data-theme="light"] #ams-sb .tb-sf input{border:1px solid rgba(15,23,42,0.3);background:#e8edf7;color:#141414}
html[data-theme="light"] #ams-sb .tb-sf input:focus{border-color:var(--amber-500,#f59e0a);box-shadow:0 0 0 3px rgba(245,158,11,0.2)}
html[data-theme="light"] #ams-sb .tb-sf input::placeholder{color:#51627a}
html[data-theme="light"] #ams-sb .tb-sx{color:#273444}
html[data-theme="light"] #ams-sb .tb-sx:hover{color:#141414;background:rgba(15,23,42,0.066)}
@media (max-width:767.98px){html[data-theme="light"] #ams-sb .tb-search.is-open .tb-sf{background:#f3f5f9}}
@media (min-width:768px){html[data-theme="light"] #ams-sb .tb-search.is-open .tb-sf{background:#f3f5f9;box-shadow:0 8px 24px rgba(15,23,42,0.122)}}
html[data-theme="light"] #ams-sb .nav-mobile>.acct-m-login{color:var(--ams-accent-ink) !important}
html[data-theme="light"] .uf-t th,html[data-theme="light"] .uf-t td{border-bottom:1px solid var(--line,#2c313a)}
@media (max-width:767px){html[data-theme="light"] .acct-mbar .acct-ico{color:#273142}}
html[data-theme="light"] a.acct-m-head:hover{background:rgba(15,23,42,0.044)}
html[data-theme="light"] .uf-ib:hover{background:rgba(37,99,235,0.08);color:var(--ams-accent-ink)}
html[data-theme="light"] .uf-ib:focus-visible{outline:2px solid var(--accent,#1558ea)}
html[data-theme="light"] .uf-ib.danger:hover{background:rgba(220,38,38,0.08);color:#a71b1b}
html[data-theme="light"] .uf-ib.primary{color:#141414}
html[data-theme="light"] .uf-ib.primary:hover{color:#141414}
html[data-theme="light"] .uf-hint-i{color:#c76d05}
@media (max-width:600px){html[data-theme="light"] .uf-t tr{border-bottom:1px solid var(--line,#2c313a)}}
html[data-theme="light"] .uf-bar{background:var(--line,#21252b)}
html[data-theme="light"] .uf-t th,html[data-theme="light"] .uf-t td{border-bottom:1px solid var(--line,#2c313a)}
html[data-theme="light"] .uf-msg.err{background:#2f0404}
html[data-theme="light"] .uf-sub{border-bottom:1px solid var(--line,#2c313a)}
html[data-theme="light"] .uf-sub a.on{border-bottom-color:var(--accent,#1558ea)}
html[data-theme="light"] .uf-toast{background:#eaeef6;color:#141414}
html[data-theme="light"] .uf-flt button{border:1px solid var(--line,#253241)}
html[data-theme="light"] .uf-flt button:hover{border-color:var(--accent,#1558ea)}
html[data-theme="light"] .uf-flt button:focus-visible{outline:2px solid var(--accent,#1558ea)}
html[data-theme="light"] .uf-flt button[aria-pressed="true"]{border:2px solid var(--accent,#f59e0a);background:rgba(245,158,11,0.14);box-shadow:0 0 0 2px rgba(245,158,11,0.25)}
html[data-theme="light"] .uf-flt small{background:#ffffff;color:#141414}
html[data-theme="light"] .uf-srt{border-inline-start:1px solid var(--line,#253241)}
html[data-theme="light"] .mp-sub{color:var(--text-muted,#51627a)}
html[data-theme="light"] .mp-own .ph-cap{color:#141414;background:linear-gradient(transparent,rgba(0,0,0,0.315))}
html[data-theme="light"] .pf-tabs a.is-active{color:var(--ams-accent-ink)}
html[data-theme="light"] .du-tools input{border:1px solid var(--border,#253241)}
html[data-theme="light"] .du-btn{border:1px solid var(--border,#253241)}
html[data-theme="light"] .du-btn:hover{border-color:#47566b}
html[data-theme="light"] .du-btn.danger{border-color:#fa0505;background:#2f0404}
html[data-theme="light"] .du-card{background:var(--surface,#1a1a1a);border:1px solid var(--border,#577aa8);box-shadow:0 10px 30px rgba(15,23,42,0.06)}
html[data-theme="light"] .du-table th,html[data-theme="light"] .du-table td{border-bottom:1px solid var(--border,#577aa8)}
html[data-theme="light"] .du-alert.ok{border:1px solid #1fe087}
html[data-theme="light"] .du-alert.err{background:#2f0404;border:1px solid #fa0505}
html[data-theme="light"] .du-pager a,html[data-theme="light"] .du-pager span{border:1px solid var(--border,#577aa8)}
html[data-theme="light"] .du-pager .cur{border-color:#f59e0a;color:#111111}
@media (max-width:720px){html[data-theme="light"] .du-table tr{border-bottom:1px solid var(--border,#577aa8)}}
html[data-theme="light"] .du-tools input{border:1px solid var(--border,#253241)}
html[data-theme="light"] .du-btn{border:1px solid var(--border,#253241)}
html[data-theme="light"] .du-btn:hover{border-color:#47566b}
html[data-theme="light"] .du-btn.danger{border-color:#fa0505;background:#2f0404}
html[data-theme="light"] .du-card{background:var(--surface,#1a1a1a);border:1px solid var(--border,#577aa8);box-shadow:0 10px 30px rgba(15,23,42,0.06)}
html[data-theme="light"] .du-table th,html[data-theme="light"] .du-table td{border-bottom:1px solid var(--border,#577aa8)}
html[data-theme="light"] .du-alert.ok{border:1px solid #1fe087}
html[data-theme="light"] .du-alert.err{background:#2f0404;border:1px solid #fa0505}
html[data-theme="light"] .du-pager a,html[data-theme="light"] .du-pager span{border:1px solid var(--border,#577aa8)}
html[data-theme="light"] .du-pager .cur{border-color:#f59e0a;color:#111111}
@media (max-width:720px){html[data-theme="light"] .du-table tr{border-bottom:1px solid var(--border,#577aa8)}}
@media (max-width:767px){html[data-theme="light"] #ams-sb .acct-mbar .acct-ico{color:#273142}}
html[data-theme="light"] #ams-sb a.acct-m-head:hover{background:rgba(15,23,42,0.044)}

/* Desktop bar: theme button + language menu grouped at the physical right edge (in Arabic too) */
.tb-end,#ams-sb .tb-end.tb-end{display:none;flex-direction:row;align-items:center;gap:.35rem;flex:0 0 auto}
.tb-end .lang-dd,#ams-sb .tb-end.tb-end .lang-dd{display:inline-flex}
[dir="rtl"] .tb-end,#ams-sb[dir="rtl"] .tb-end.tb-end{flex-direction:row-reverse}
@media (min-width:768px){.tb-end,#ams-sb .tb-end.tb-end{display:flex}}
.site-nav .nav-links>a,#ams-sb .site-nav .nav-links>a{white-space:nowrap}

/* darkfiles1: Files page (My Files / profile Files tab) action icons in the default dark theme.
   The inline sheet printed by incF/ams_ufiles.php sets .uf-ib{color:var(--ink,#334155)} and
   --ink is never defined, so the fallback #334155 (slate-700) is used. That colour is correct
   in light theme, but on the dark navy background the enabled pencil, link, lock and delete
   controls look greyed-out / disabled. Download stays light only because .nf a{color:inherit}
   in ams-feed.css / ams-legacy.css is more specific than .uf-ib and inherits --text (#f1f5f9).
   These rules apply only when the page is not in light theme and skip .uf-ib.primary (filled
   amber buttons). Existing html[data-theme="light"] .uf-ib rules above are unchanged.
   Disabled is theme-neutral: [disabled], .is-disabled, [aria-disabled="true"]. */
html:not([data-theme="light"]) .uf-ib:not(.primary){color:var(--text,#f1f5f9)}
html:not([data-theme="light"]) .uf-ib:not(.primary):not([disabled]):not(.is-disabled):not([aria-disabled="true"]):hover,
html:not([data-theme="light"]) .uf-ib:not(.primary):not([disabled]):not(.is-disabled):not([aria-disabled="true"]):focus-visible{background:rgba(255,255,255,.12);color:#fff}
html:not([data-theme="light"]) .uf-ib:not(.primary):not([disabled]):not(.is-disabled):not([aria-disabled="true"]):focus-visible{outline:2px solid var(--accent,#f59e0b);outline-offset:2px}
html:not([data-theme="light"]) .uf-ib.danger:not([disabled]):not(.is-disabled):not([aria-disabled="true"]):hover,
html:not([data-theme="light"]) .uf-ib.danger:not([disabled]):not(.is-disabled):not([aria-disabled="true"]):focus-visible{background:rgba(239,68,68,.22);color:#f87171}
.uf-ib[disabled],.uf-ib.is-disabled,.uf-ib[aria-disabled="true"]{opacity:.38;cursor:not-allowed;pointer-events:none;background:transparent}
