/* IBM Plex Sans Arabic + IBM Plex Mono, served from here (no third-party requests). Licence: fonts/OFL.txt */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(fonts/plex-arabic-600-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url(fonts/plex-arabic-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/plex-mono-500-latin.woff2) format("woff2"); }

:root {
  /* LAYOUT_WIDTH.md (nhmsv, Nasser 2026-10-26): content grows with the screen up to this, then centres */
  --content-max: 1920px;
  --bg: #f4f6f9; --card: #fff; --text: #0f172a; --nav-text: #3a4556; --muted: #5b6577; --subtle: #8a94a6; --line: #e3e8ef; --line-soft: #f8fafc; --field: #d6dce5;
  --accent: #6d28d9; --accent-hover: #5521a8; --accent-soft: #efe8fb; --accent-text: #fff; --count: #e0b84a; --danger: #b91c1c;
  --ok: #1f6e4c; --ok-bg: #e6f3ec; --err: #a3271a; --err-bg: #f9e3e0; --err-line: #c2412f;
  --warn: #8a4b00; --warn-bg: #fcefd9; --warn-line: #d98a1b; --info: #2747b8; --info-bg: #e8eefb; --trial: #5b3a99; --trial-bg: #f0ecf8;
  --shadow: none; --card-line: #e3e8ef;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d121a; --card: #151c27; --text: #e6ebf2; --nav-text: #b8c2d2; --muted: #a3aec0; --subtle: #8692a6; --line: #273243; --line-soft: #1b2431; --field: #33415a;
    --accent: color-mix(in srgb, #6d28d9 45%, #fff); --accent-hover: color-mix(in srgb, #6d28d9 30%, #fff); --accent-soft: color-mix(in srgb, #6d28d9 40%, #111722); --accent-text: #111722;
    --ok: #6fcf9a; --ok-bg: #17281f; --err: #f28b7d; --err-bg: #33191a; --err-line: #e0604f;
    --warn: #f0b45a; --warn-bg: #33270f; --warn-line: #d98a1b; --info: #8faeff; --info-bg: #18213a; --trial: #c3a8f0; --trial-bg: #26203a;
    --shadow: none; --card-line: #273243;
  }
}
:root[data-theme="dark"] {
    --bg: #0d121a; --card: #151c27; --text: #e6ebf2; --nav-text: #b8c2d2; --muted: #a3aec0; --subtle: #8692a6; --line: #273243; --line-soft: #1b2431; --field: #33415a;
    --accent: color-mix(in srgb, #6d28d9 45%, #fff); --accent-hover: color-mix(in srgb, #6d28d9 30%, #fff); --accent-soft: color-mix(in srgb, #6d28d9 40%, #111722); --accent-text: #111722;
    --ok: #6fcf9a; --ok-bg: #17281f; --err: #f28b7d; --err-bg: #33191a; --err-line: #e0604f;
    --warn: #f0b45a; --warn-bg: #33270f; --warn-line: #d98a1b; --info: #8faeff; --info-bg: #18213a; --trial: #c3a8f0; --trial-bg: #26203a;
    --shadow: none; --card-line: #273243;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 "Plex Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1 { font-size: 1.5rem; font-weight: 700; margin: .1em 0 .5em; line-height: 1.3; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 1.6em 0 .6em; }
h3 { font-size: 1rem; font-weight: 600; margin: .4em 0; }
.card h2:first-child, .card > h2:first-of-type { margin-top: 0; }
code, .code, textarea.cert, .codeinput, .otp { font-family: "Plex Mono", Consolas, "Cascadia Mono", monospace; }
.code { font-weight: 500; letter-spacing: .02em; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small, small { font-size: .85em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── shell (the admin pages): the same layout as admin.nhmsv.net, in this server's purple ──
   ≥900px: side menu 264 (folds to 76 with its button only); <900px: top mark + title, bottom tab bar, «المزيد» */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.shell.folded { grid-template-columns: 76px 1fr; }
.side { background: var(--card); border-inline-end: 1px solid var(--line); padding: 0 .75rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: .75rem; height: 64px; padding: 0 .4rem; border-bottom: 1px solid var(--line); margin-bottom: .75rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.brand b { display: block; font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.brand small { display: block; font-size: .75rem; color: var(--muted); }
.side nav { display: grid; gap: 2px; }
.side > * { flex: none; }
.navlink { position: relative; display: flex; align-items: center; gap: .75rem; min-height: 44px; color: var(--nav-text); padding: 0 .75rem; border-radius: 10px; font-weight: 500; font-size: .93rem; white-space: nowrap; }
.navlink:hover { background: var(--line-soft); color: var(--text); text-decoration: none; }
.navlink[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.navlink svg { width: 20px; height: 20px; flex: none; }
.navlink .label { overflow: hidden; text-overflow: ellipsis; }
.navsys { display: flex; align-items: center; gap: .5rem; margin: .6rem .25rem .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .4px; color: var(--muted); }
.navsys::before, .navsys::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.shell.folded .navsys span { display: none; }
.appver { margin: auto 0 0; padding-top: 1rem; text-align: center; font-size: .75rem; color: var(--muted); }
.appver code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .72rem; unicode-bidi: isolate; background: none; padding: 0; color: inherit; }
.shell.folded .appver { display: none; }
.mlist ~ .appver, form + .appver { margin-top: 1rem; }   /* «More»: right under sign-out */
.shell.folded .navsys { gap: 0; }
.shell.folded .navsys::after { display: none; }
.msys { display: flex; align-items: center; gap: .5rem; padding: .55rem 1rem .25rem; font-size: .72rem; font-weight: 700; letter-spacing: .4px; color: var(--muted); }
.msys::before, .msys::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.navcount { margin-inline-start: auto; background: var(--count); color: #1b1300; border-radius: 999px; padding: 0 .5rem; font-size: .75rem; font-weight: 700; }
/* a warning (e.g. simulated payments accepted) on «حالة النظام» */
.navdot { margin-inline-start: auto; width: 9px; height: 9px; border-radius: 50%; background: #c2410c; flex: none; }
.shell.folded .brand { justify-content: center; }
.shell.folded .brand span, .shell.folded .navlink .label { display: none; }
.shell.folded .navlink { justify-content: center; padding: 0; }
.shell.folded .navcount, .shell.folded .navdot { position: absolute; top: 6px; inset-inline-end: 8px; width: 9px; height: 9px; padding: 0; font-size: 0; background: #c2410c; border-radius: 50%; margin: 0; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; justify-content: space-between; min-height: 64px; padding: .5rem 1.75rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .t { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .end { display: flex; align-items: center; gap: .5rem; }
.topbar .mobile-mark { display: none; width: 30px; height: 30px; border-radius: 8px; flex: none; }
.topbar .mobile-mark img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.tbtn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 0; padding: .35rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: .82rem; line-height: 1.2; }
.tbtn:hover { background: var(--line-soft); color: var(--text); text-decoration: none; }
.avatar-sm { width: 24px; height: 24px; font-size: .7rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; }
.langform { margin: 0; display: inline-flex; }
button.btn-sm { min-height: 38px; padding: 0 .8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: .82rem; }
button.btn-sm:hover { background: var(--line-soft); }
.mrow button.mlang { min-height: 34px; padding: 0 .8rem; border-radius: 8px; border: 1px solid var(--line); font-size: .82rem; font-weight: 600; }
.loginlang { text-align: center; margin-top: 1rem; }
.iconbtn { width: 40px; height: 38px; min-height: 0; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn.out { color: var(--danger); }
.iconbtn:hover { background: var(--line-soft); border-color: var(--line); }
/* the appearance button: a moon while light, a sun while dark (also in «auto», from the device) */
.themebtn .ico-sun { display: none; }
:root[data-theme="dark"] .themebtn .ico-sun { display: block; }
:root[data-theme="dark"] .themebtn .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .themebtn .ico-sun { display: block; }
  :root:not([data-theme]) .themebtn .ico-moon { display: none; }
}
a.iconbtn:hover { text-decoration: none; color: var(--text); }
a.mlang { display: inline-flex; align-items: center; min-height: 34px; padding: 0 .8rem; border-radius: 8px; border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--text); }
a.mlang:hover { background: var(--line-soft); text-decoration: none; color: var(--text); }
.logout { margin: 0; }
/* the account area (docs/HEADER_ACCOUNT.md v2 in nhmsv/nhmsv): from the page's edge sign-out, account, theme, language
   (globe); it follows the page's direction; 36px high, 10px corners, 8px apart; a round avatar white on the brand colour */
.topbar .end { gap: 8px; }
/* the three icons 18×18 in px (never em), stroke 2, muted; sign-out as in the reference: the door at the page edge, the arrow inward */
.topbar .end .iconbtn { color: var(--muted); }
.topbar .end .iconbtn svg { width: 18px; height: 18px; flex: none; }
html[dir=ltr] .topbar .end .iconbtn.out svg { transform: scaleX(-1); }
.topbar .end .tbtn, .topbar .end button.btn-sm { height: 36px; min-height: 36px; padding-block: 0; border-radius: 10px; }
.topbar .end .iconbtn { width: 36px; height: 36px; border-radius: 10px; }
.topbar .end .iconbtn.out { color: var(--muted); }
.topbar .end .iconbtn.out:hover, .topbar .end .iconbtn.out:focus-visible { color: var(--danger); border-color: var(--danger); background: var(--card); }
.topbar .end .account { padding-inline: 4px 10px; }
.topbar .end .avatar-sm, .mlist .avatar-sm { width: 26px; height: 26px; border-radius: 50%; background: #6d28d9; color: #fff; font-size: .78rem; }
.account .who { unicode-bidi: isolate; }
/* PLATFORM_MODES.md in nhmsv/nhmsv: «وضع الاختبار» before the language while the platform is not live, and how this
   session signed in, inside the account card after the name (20px, corners 6, 11px; a coloured 8px dot under 400px) */
.hdr-mode { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.topbar .end .hdr-mode { height: 36px; padding: 0 12px; border-radius: 10px; }
.login-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.login-sso { background: var(--line); color: var(--muted); }
.login-local { background: var(--warn-bg); color: var(--warn); }
.login-emergency { background: var(--err-bg); color: var(--err); }
.login-line .login-badge { margin-inline-start: 6px; }
@media (max-width: 399px) {
  .account .who { display: none; } .topbar .end .account { padding-inline: 4px; }
  .account .login-badge { width: 8px; height: 8px; padding: 0; border-radius: 50%; }
  .account .login-badge .lb-text { display: none; }
  .account .login-sso { background: var(--muted); } .account .login-local { background: var(--warn-line); } .account .login-emergency { background: var(--err-line); }
}
.topsearch { display: flex; gap: 8px; margin: 0 0 18px; }
.topsearch input { flex: 1; min-width: 0; }
/* LAYOUT_WIDTH.md §1: beside the side menu the content starts right next to it (a fixed 32px gutter); past 1920px the far side stays empty */
.content main { width: 100%; max-width: var(--content-max); margin-inline: 0 auto; padding: 1.75rem 2rem; }
.bottombar { display: none; }
/* «المزيد» (phones) */
.mlist { background: var(--card); border: 1px solid var(--line); border-radius: 12px; list-style: none; margin: 0 0 12px; padding: 0; overflow: hidden; }
.mlist li + li { border-top: 1px solid var(--line); }
.mrow { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 56px; padding: 0 1rem; color: var(--text); font-size: .95rem; }
.mrow:hover { text-decoration: none; color: var(--text); background: var(--line-soft); }
.mrow .av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.mrow .av svg { width: 18px; height: 18px; }
.mrow .main { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.mrow .main small { color: var(--muted); font-size: .78rem; }
.mrow .chev { width: 18px; height: 18px; color: var(--subtle); flex: none; }
.mrow .chev svg { width: 18px; height: 18px; }
[dir="ltr"] .mrow .chev svg { transform: scaleX(-1); }   /* the chevron points to the end of the line */
.mrow .navdot { display: inline-block; margin-inline-start: 6px; vertical-align: middle; }
button.wide-out { width: 100%; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--danger); font-weight: 600; }
button.wide-out svg { width: 18px; height: 18px; }
@media (max-width: 899px) {
  .shell, .shell.folded { grid-template-columns: 1fr; }
  .side, .topbar .desk-only { display: none; }
  .topbar .mobile-mark { display: block; }
  .topbar { padding: .5rem 1rem; min-height: 56px; }
  .content main { padding: 1rem 1rem calc(68px + 1.25rem + env(safe-area-inset-bottom)); }
  .bottombar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset-inline: 0; bottom: 0; z-index: 20; min-height: 68px; padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); }
  .bottombar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 44px; color: var(--muted); font-size: .72rem; font-weight: 500; }
  .bottombar a:hover { text-decoration: none; }
  .bottombar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
  .bottombar svg { width: 23px; height: 23px; }
  .bottombar .navdot, .bottombar .navcount { position: absolute; top: 9px; inset-inline-start: calc(50% + 6px); width: 9px; height: 9px; padding: 0; font-size: 0; background: #c2410c; border-radius: 50%; margin: 0; }
}

/* public pages without the menu (login, /activate, /buy) */
main.narrow { max-width: 480px; margin: 0 auto; padding: 8vh 16px 40px; }

/* ── cards, forms, buttons ── */
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.highlight { border-color: var(--accent); }
.narrowcard { max-width: 460px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cols > .card { margin: 0; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .main { flex: 999 1 480px; min-width: 0; }
.split > .aside { flex: 1 1 300px; min-width: 0; }
.split > * > .card:last-child { margin-bottom: 0; }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--field); border-radius: 12px; background: var(--card); }
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
label { display: block; font-size: .88em; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
button { min-height: 42px; padding: 0 16px; border: 1px solid var(--field); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 500; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
a.button { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none; }
a.button:hover { background: var(--accent); color: var(--accent-text); }
button.danger { border-color: var(--err-line); color: var(--err); background: var(--card); }
button.danger:hover { background: var(--err-bg); }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); font-weight: 400; }
button.copied { background: var(--ok); border-color: var(--ok); color: var(--accent-text); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 12px; align-items: end; margin: 8px 0; }
.grid .wide { grid-column: 1 / -1; }
form.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 0 0 14px; }
form.inline label { flex: 1; min-width: 200px; }
form.inline label input[type=number] { width: 120px; display: inline-block; }
form[data-confirm] { margin-bottom: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.warn { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: 12px; }

/* ── states ── */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8em; font-weight: 600; background: var(--info-bg); color: var(--info); white-space: nowrap; max-width: 100%; }
dd .badge { white-space: normal; }
.st-active, .ls-active { background: var(--ok-bg); color: var(--ok); }
.st-trial { background: var(--trial-bg); color: var(--trial); }
.st-soon { background: var(--warn-bg); color: var(--warn); }
.st-expired, .st-trial_expired, .st-revoked, .st-transferred, .ls-revoked, .ls-transferred { background: var(--err-bg); color: var(--err); }

/* ── page header, numbers, tasks ── */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: 2px 0 0; }
.crumbs { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0 0 22px; }
.stat { background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.2; font-weight: 700; }
.stat span { color: var(--muted); font-size: .88em; }
.stat .label { display: block; margin-bottom: 4px; }
.tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 22px; }
.task { background: var(--card); border: 1px solid var(--card-line); border-top: 4px solid var(--warn-line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.task.err { border-top-color: var(--err-line); }
.task.ok { border-top-color: var(--accent); }
.task .kind { font-size: .78rem; font-weight: 700; color: var(--warn); }
.task.err .kind { color: var(--err); }
.task.ok .kind { color: var(--ok); }
.task b { font-size: 1rem; }
.task p { margin: 0; color: var(--muted); font-size: .92em; }
.task a.go { margin-top: auto; font-weight: 600; font-size: .92em; min-height: 36px; display: inline-flex; align-items: center; }
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.sectionhead h2 { margin: 0; }
.progress { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin: 6px 0 4px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.progress.soon > span { background: var(--warn-line); }

/* ── tables ── */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: .8em; color: var(--muted); font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--bg) 60%, transparent); }
td .detail { color: var(--muted); }
/* one line per cell (codes, dates); the table scrolls sideways on a phone. Free text still wraps. */
.tablewrap td { white-space: nowrap; }
.tablewrap td .detail { white-space: normal; display: inline-block; min-width: 240px; }
tr.ev-login_failed td { color: var(--err); }

/* ── device page ── */
.devhead h1 { margin: 0; font-size: 1.5rem; font-weight: 500; }
.copyrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
textarea.cert { font-size: .8em; word-break: break-all; margin-bottom: 8px; resize: vertical; }
.secret { font-size: 1.1em; padding: 6px 10px; background: var(--bg); border-radius: 8px; }
.otp { font-size: 1.4em; letter-spacing: .3em; text-align: center; }
.codeinput { font-size: 1.15em; letter-spacing: .05em; text-transform: uppercase; }
.steps li { margin-bottom: 10px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; }
.timeline .dot { display: flex; flex-direction: column; align-items: center; flex: none; }
.timeline .dot::before { content: ""; width: 10px; height: 10px; border-radius: 99px; background: var(--muted); margin-top: 7px; }
.timeline .dot::after { content: ""; flex: 1; width: 2px; background: var(--line-soft); }
.timeline li:last-child .dot::after { display: none; }
.timeline .ev { padding-bottom: 14px; min-width: 0; }
.timeline .ev b { display: block; font-weight: 600; font-size: .95em; }
.timeline .ev span { color: var(--muted); font-size: .85em; overflow-wrap: anywhere; }
.timeline .ev-activate .dot::before, .timeline .ev-make_permanent .dot::before, .timeline .ev-extend .dot::before { background: var(--accent); }
.timeline .ev-register .dot::before, .timeline .ev-reset_trial .dot::before { background: var(--trial); }
.timeline .ev-revoke .dot::before, .timeline .ev-transfer_out .dot::before { background: var(--err-line); }
.danger-zone { border-color: var(--err-bg); }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 10px; }
.pager { display: flex; gap: 16px; justify-content: center; margin: 14px 0; }
/* apps as the axis: the apps' cards, an app's head and tabs, its rows, and the side panel for adding or editing */
a.button.primary { background: var(--accent); color: var(--accent-text); }
a.button.primary:hover { background: var(--accent-hover); }
.pagehead .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.appgroup { margin-bottom: 8px; }
.appgrouphead { font-size: 1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.appgrouphead small { font-weight: 500; background: var(--line-soft); border-radius: 999px; padding: 1px 9px; font-size: .78em; }
a.button.small { min-height: 30px; padding: 0 10px; font-size: .8rem; border-radius: 10px; }
.catlist { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.catlist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.catname { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.catbtns, .catbtns form, .catform { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.catform { width: 100%; }
.catform input { flex: 1 1 140px; min-width: 0; }
.appcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.appcard { display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--card-line); border-radius: 16px; padding: 18px; color: var(--text); }
.appcard:hover { text-decoration: none; border-color: var(--accent); }
.apphead { display: flex; align-items: center; gap: 12px; }
.appname { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.appicon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85em; flex: none; }
.appicon.big { width: 56px; height: 56px; background: var(--accent); color: var(--accent-text); }
.appicon.has-img { background: none; overflow: hidden; }
.appicon.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.appstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.appstats > span { background: var(--line-soft); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; }
.appstats b { font-size: 1.3rem; }
.appstats small { color: var(--muted); font-size: .8em; }
.apptitle { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.apptitle h1 { margin: 0; }
.apptitle p { margin: 2px 0 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 2px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.listrow { display: grid; grid-template-columns: minmax(0, 2.4fr) 1.3fr 1fr 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 14px 18px; color: var(--text); }
.listrow:hover { text-decoration: none; border-color: var(--accent); }
.listrow .main { display: flex; flex-direction: column; min-width: 0; }
.listrow.dim { color: var(--muted); }
.listrow .price b { font-size: 1.2rem; }
@media (max-width: 700px) { .listrow { grid-template-columns: 1fr auto; } .listrow > span:nth-child(2), .listrow > span:nth-child(3) { display: none; } }
.offercard { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.offercard:hover { text-decoration: none; border-color: var(--accent); }
/* an offer's image (its brochure): in its card and in its form */
.offerimg { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
/* most brochures are portrait: in the card a thumbnail beside the text, never stretched; in the form the whole image */
.offercard:has(> .offerimg) { display: grid; grid-template-columns: 88px 1fr; column-gap: 14px; align-items: start; }
.offercard > .offerimg { grid-row: 1 / span 3; width: 88px; max-height: 132px; object-fit: contain; background: var(--line-soft); }
.offercard:has(> .offerimg) > :not(.offerimg) { grid-column: 2; }
.offerimgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; align-items: start; }
.offerimgs > small { grid-column: 1 / -1; }
.offerimgfield { display: grid; gap: 8px; justify-items: start; }
.offerimgfield > label:first-child { width: 100%; }
.offerimgfield .offerimg { width: auto; max-height: 200px; }
.offerhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.narrowform { max-width: 760px; }
.scrim { position: fixed; inset: 0; background: rgb(15 23 42 / .35); z-index: 40; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(540px, 100%); overflow-y: auto; background: var(--card); z-index: 41; padding: 22px 24px; box-sizing: border-box; box-shadow: 0 0 40px rgb(15 23 42 / .25); }
.modal { position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; background: var(--card); border-radius: 18px; padding: 24px; box-sizing: border-box; box-shadow: 0 20px 60px rgb(15 23 42 / .3); }
.modal .actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.modal .note { background: var(--line-soft); border-radius: 10px; padding: 10px 12px; margin: 0; }
.modal .note .code { white-space: nowrap; }
.drawerhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.drawerhead h2 { margin: 0; }
.drawer .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drawer .danger-zone { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.drawer .danger-zone h3 { margin: 0 0 6px; font-size: 1em; }
/* the status page's first row: one tile per thing to look at, its state as a dot */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 0 0 18px; }
.htile { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 16px 18px; color: var(--text); }
.htile:hover { text-decoration: none; border-color: var(--accent); }
.htile b { font-size: 1.35rem; line-height: 1.3; }
.htitle { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9em; }
.hdot { width: 10px; height: 10px; border-radius: 50%; background: var(--subtle); flex: none; }
.hdot.ok { background: #16a34a; }
.hdot.warn { background: #d97706; }
.hdot.bad { background: var(--danger); }
.cols > .card h3 { font-size: 1em; margin: 14px 0 6px; }
/* the log's filters: group chips, then one bar of fields that wraps */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--nav-text); font-size: .92em; }
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.chipcount { font-size: .85em; opacity: .75; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.filterbar label { display: flex; flex-direction: column; gap: 4px; font-size: .85em; color: var(--muted); flex: 0 1 160px; }
.filterbar label.grow { flex: 1 1 260px; }
.filterbar input, .filterbar select { color: var(--text); font-size: 1.1em; }
.filteractions { display: flex; gap: 12px; align-items: center; min-height: 42px; }
.result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
pre { background: var(--bg); padding: 8px; border-radius: 8px; overflow-x: auto; }

@media (max-width: 600px) {
  .devhead h1 { font-size: 1.2rem; }
  h1 { font-size: 1.3rem; }
}

/* checkbox inside a label */
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; min-height: 0; margin: 0; }

/* package form: included apps */
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0; }
legend { padding: 0 6px; font-size: .9em; }
fieldset label.check { display: inline-flex; margin-inline-end: 16px; }

/* /buy: plan choice */
fieldset.plans { display: grid; gap: 8px; padding: 10px; }
label.plan { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--field); border-radius: 12px; cursor: pointer; color: var(--text); }
label.plan:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.plan input { width: auto; min-height: 0; margin: 0; }
.plan-name { flex: 1; display: flex; flex-direction: column; }
.plan-price { font-size: 1.25em; white-space: nowrap; }
.plan-price s { font-size: .75em; font-weight: normal; }
.offer-note { margin: -4px 4px 0; color: var(--accent); font-weight: 600; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; }
.coupon-row button { flex: none; }
.price-summary { padding: 12px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.ok-note { color: var(--accent); margin: 0; }
details > label { margin-top: 8px; }
.sso-or { text-align: center; margin: 4px 0; }

/* app page (/admin/app-page): image thumbnails */
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.thumbs figure { margin: 0; display: grid; gap: 4px; justify-items: start; font-size: .8rem; color: var(--muted); }
.thumb { display: block; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; background: var(--field); }
.thumb.sq { width: 64px; height: 64px; }
.thumb.wide { width: 160px; height: 64px; }
.thumb.shot { width: 72px; height: 144px; }
.thumb.empty { background: repeating-linear-gradient(45deg, var(--field) 0 6px, transparent 6px 12px); }
button.small { min-height: 30px; padding: 0 10px; font-size: .8rem; }

/* public pages (/buy): the policies' links and the business line */
footer.legal { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; font-size: .82rem; color: var(--muted); }
footer.legal .legal-links { line-height: 1.9; }
footer.legal .legal-org { margin: 6px 0 0; }

/* small forms side by side in a table cell */
.inline-form { display: inline-block; margin: 0 0 0 4px; }
a.button.primary { background: var(--accent); color: var(--accent-text); }
/* the purchase code on the payment result page */
.purchase-code { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.code.big { font-size: 1.35rem; letter-spacing: .06em; }
/* bought on the website: the app's QR and the steps */
.get-app { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 14px 0; }
.get-app .qr svg { display: block; width: 180px; height: 180px; border-radius: 8px; }
.get-app ol { flex: 1 1 220px; margin: 0; padding-inline-start: 20px; line-height: 1.9; }

/* ── the platform switcher (docs/PLATFORM_SWITCHER.md in nhmsv/nhmsv; same look in every panel) ── */
.platforms { position: relative; }
.platforms > summary { list-style: none; cursor: pointer; }
.platforms > summary::-webkit-details-marker { display: none; }
.platforms[open] > summary.iconbtn { background: var(--accent-soft); color: var(--accent); }
.platforms-menu { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 30; width: 290px; padding: .4rem; max-height: 80vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); }
.platforms-group { font-size: .72rem; font-weight: 700; color: var(--subtle); padding: .55rem .6rem .25rem; text-transform: uppercase; letter-spacing: .3px; }
.platforms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.platforms-list a { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: .25rem .6rem; border-radius: 10px; color: var(--text); }
.platforms-list a:hover { background: var(--line-soft); text-decoration: none; }
.platforms-list a.current { background: var(--accent-soft); }
.platforms-list img { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.platforms-text { display: grid; line-height: 1.25; font-size: .88rem; font-weight: 600; }
.platforms-text small { font-size: .72rem; font-weight: 400; color: var(--muted); text-align: start; }
.platforms-head, .platforms-tiles { display: none; }

@media (max-width: 899px) {
  .topbar .t { flex: 1; flex-wrap: nowrap; min-width: 0; }
  .platforms { order: 9; margin-inline-start: auto; }
  .topbar:has(.platforms[open]) { z-index: 40; }
  .platforms-list { display: none; }
  .platforms-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
  .platforms-head strong { font-size: 1.05rem; }
  .platforms-close { width: 34px; height: 34px; min-height: 0; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer; background: var(--line-soft); border: 1px solid var(--line); color: var(--muted); }
  .platforms-close svg { width: 17px; height: 17px; }
  .platforms-group { padding: .7rem .25rem .4rem; }
  .platforms-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
  .platforms-tiles a { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .6rem .2rem .5rem; border: 1.5px solid transparent; border-radius: 12px; color: var(--text); font-size: .78rem; font-weight: 500; line-height: 1.3; text-align: center; }
  .platforms-tiles a:hover { background: var(--line-soft); text-decoration: none; }
  .platforms-tiles a.current { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
  .platforms-tiles img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
  .platforms[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 1; background: rgba(15, 23, 42, .12); cursor: default; }
  .platforms-menu { inset-inline-start: auto; inset-inline-end: 0; z-index: 2; width: 420px; max-width: calc(100vw - 2rem); padding: 1rem; border-radius: 16px; box-shadow: 0 12px 40px rgba(15, 23, 42, .18); }
}
@media (max-width: 599px) {
  .platforms[open] > summary::before { background: rgba(15, 23, 42, .42); }
  .platforms-menu { position: fixed; top: auto; bottom: 0; inset-inline: 0; width: auto; max-width: none; max-height: 85vh; padding: .5rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(15, 23, 42, .18); }
  .platforms-menu::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: #d5dbe3; margin: 0 auto .6rem; }
}
.mrow .navcount { margin-inline-start: .4rem; }

/* the home page: widgets and the activations chart in the main column, what to look at in a rail beside it */
.homehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.homehead h1 { margin: 0; }
.homehead p { margin: 2px 0 0; }
.homehead .topsearch { margin: 0; flex: 0 1 460px; }
/* ADMIN_PANEL_UNIFIED.md §2b: below 1600px «needs you» first, the content, then the widget rail under it (same 16px gaps) */
.home { display: flex; flex-direction: column; gap: 16px; }
.homemain { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.homerail { min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.shortcuts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shortcuts a { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: .92em; text-decoration: none; }
.shortcuts a:hover { background: var(--accent-soft); text-decoration: none; }
.home .stats, .home .card { margin: 0; }
.home .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat span.up { color: var(--ok); }
.widgethead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin: 0 0 12px; }
.widgethead h2, .homerail h2 { margin: 0; font-size: 1rem; }
.homerail .card > h2 { margin-bottom: 10px; }
.chips.small { margin: 0; gap: 6px; }
.chips.small .chip { padding: 2px 12px; font-size: .85em; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.bars.dense { gap: 2px; }
.bar { flex: 1 1 0; min-width: 0; height: 4px; border-radius: 4px; background: var(--line); }
.bar:not(.h0) { background: var(--accent); border-radius: 5px 5px 0 0; }
.bar.h1 { height: 10%; } .bar.h2 { height: 20%; } .bar.h3 { height: 30%; } .bar.h4 { height: 40%; } .bar.h5 { height: 50%; }
.bar.h6 { height: 60%; } .bar.h7 { height: 70%; } .bar.h8 { height: 80%; } .bar.h9 { height: 90%; } .bar.h10 { height: 100%; }
.barlegend { display: flex; justify-content: space-between; margin-top: 6px; }
.devlist { display: flex; flex-direction: column; }
.devrow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, .7fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.devrow:last-child { border-bottom: 0; }
.devrow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devrow .code { text-align: start; }
.attention { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.attention h2 { color: var(--warn); }
.attention.calm { background: var(--ok-bg); border-color: transparent; }
.attention.calm h2 { color: var(--ok); }
.attention p { margin: 0; font-size: .92em; }
.attitem { display: flex; flex-direction: column; gap: 2px; }
.attitem + .attitem { border-top: 1px solid var(--warn-line); padding-top: 10px; }
.attitem.is-err b { color: var(--err); }
.attitem a { font-weight: 600; font-size: .9em; }
.todaygrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.todaygrid b { display: block; font-size: 1.35rem; line-height: 1.3; }
.todaygrid span { color: var(--muted); font-size: .82em; }
.statuslist, .timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.statuslist li { display: flex; justify-content: space-between; gap: 10px; font-size: .92em; }
.dotted { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-align: end; }
.dotted::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); flex: none; }
.dotted.is-ok { color: var(--ok); } .dotted.is-ok::before { background: #16a34a; }
.dotted.is-warn { color: var(--warn); } .dotted.is-warn::before { background: #d97706; }
.dotted.is-bad { color: var(--err); } .dotted.is-bad::before { background: var(--danger); }
.timeline { border-inline-start: 2px solid var(--line); padding-inline-start: 12px; gap: 10px; font-size: .92em; }
.timeline li { display: flex; flex-direction: column; line-height: 1.45; }
@media (max-width: 899px) {
  .homehead .topsearch { flex-basis: 100%; }
  .bars { height: 110px; }
}
@media (max-width: 599px) {
  .devrow { grid-template-columns: minmax(0, 1fr) auto; }
  .devrow > :nth-child(2), .devrow > :nth-child(3), .devrow > :nth-child(5) { display: none; }
}
.get-app-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0 4px; }
/* an app's tabs, with its download and buy buttons at the end of the row */
.tabsrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabsrow .tabs { border-bottom: 0; margin-bottom: -1px; }
.tabactions { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; margin-inline-start: auto; }
.tabbtn { display: inline-flex; flex: none; white-space: nowrap; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .9em; text-decoration: none; }
a.tabbtn:hover { background: var(--accent); color: var(--accent-text); text-decoration: none; }
.tabbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tabbtn.off { background: var(--line-soft); color: var(--subtle); cursor: not-allowed; }
.tabbtn.off small { font-weight: 400; }
.fielderror { display: block; color: var(--err); font-size: .85em; font-weight: 600; margin-top: 4px; }
input[aria-invalid="true"] { border-color: var(--err-line); }

/* the home page on wide screens (≥1400px): four columns up to 1600px, three for the work and the rail */
.home .stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
@media (min-width: 900px) and (max-width: 1399px) {
  .homemain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .homemain > .w2, .homemain > .w3 { grid-column: 1 / -1; }
}
@media (min-width: 1400px) {
  .homemain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  .homemain > .w2 { grid-column: span 2; }
  .homemain > .w3 { grid-column: 1 / -1; }
}
/* from 1600px: two columns, the content beside the menu and a 360-420px widget rail on the far side; the home page alone drops the content max-width */
@media (min-width: 1600px) {
  .content main:has(> .home) { max-width: none; }
  .home { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 22vw, 420px); grid-template-rows: auto 1fr; align-items: start; }
  .homemain { grid-column: 1; grid-row: 1 / span 2; }
  .homeatt { grid-column: 2; grid-row: 1; }
  .homerail { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: stretch; }
}
.figures { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 12px; }
.figures b { display: block; font-size: 1.35rem; line-height: 1.3; }
.figures span { color: var(--muted); font-size: .82em; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 18px 14px; border-radius: 12px; background: var(--line-soft); color: var(--muted); font-size: .9em; min-height: 110px; }
.empty b { color: var(--nav-text); font-size: 1.05em; }
.meters, .ranklist, .minilist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.meterhead { display: flex; justify-content: space-between; gap: 10px; font-size: .92em; margin-bottom: 4px; }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.meter .fill { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); }
.meter .fill.h1 { width: 10%; } .meter .fill.h2 { width: 20%; } .meter .fill.h3 { width: 30%; } .meter .fill.h4 { width: 40%; } .meter .fill.h5 { width: 50%; }
.meter .fill.h6 { width: 60%; } .meter .fill.h7 { width: 70%; } .meter .fill.h8 { width: 80%; } .meter .fill.h9 { width: 90%; } .meter .fill.h10 { width: 100%; }
.ranklist li { display: flex; justify-content: space-between; gap: 10px; font-size: .92em; }
.minilist li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .92em; }
.minilist li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warntext { color: var(--warn); font-weight: 600; }
.orderrow { display: grid; grid-template-columns: 3.5em minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .8fr) auto minmax(0, .7fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .95em; }
.orderrow:last-child { border-bottom: 0; }
.orderrow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 599px) {
  .orderrow { grid-template-columns: 3em minmax(0, 1fr) auto; }
  .orderrow > :nth-child(3), .orderrow > :nth-child(4), .orderrow > :nth-child(6) { display: none; }
}

/* an app's page texts: one row per text, the Arabic on the right and the English on the left (stacked on a phone) */
.bilingual { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bilingual.head { padding-top: 0; border-bottom-width: 2px; font-size: .85em; font-weight: 700; color: var(--muted); }
.bilingual.head > [dir="ltr"] { text-align: left; }
.bilingual > input, .bilingual > textarea { width: 100%; }
.bl-label { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.bl-label small { font-size: .8em; }
.bl-fixed { padding: 9px 0; }
.bilingual.compact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 0; padding: 8px 0 0; min-width: 380px; }
.bilingual.compact > div { grid-column: 1 / -1; }
.pagebasics { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* a switch with its explanation under it, framed as one option (e.g. «إخفاء التحميل والشراء») */
label.check.option { align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
label.check.option input { margin-top: 3px; }
label.check.option > span { display: grid; gap: 2px; }
label.check.option b { font-weight: 600; }
.pagecolors { margin-top: 14px; }
.card > .actions { margin-top: 14px; }
@media (max-width: 899px) {
  .bilingual { grid-template-columns: 1fr; gap: 6px; }
  .bilingual.head > span:not(:first-child) { display: none; }
  .bilingual.compact { min-width: 0; }
}
/* an app's «الآراء» tab (app_feedback.php) */
.fblist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fbitem { margin: 0; }
.fbitem.is-new { border-inline-start: 4px solid var(--accent); }
.fbhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fbhead small { margin-inline-start: auto; }
.fbbody { margin: 10px 0 6px; white-space: normal; overflow-wrap: anywhere; }
.fbmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; }
.fbactions { display: flex; gap: 6px; flex-wrap: wrap; }
.fbactions .inline-form { margin: 0; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.stars .off { color: var(--line); }
.salestab > section + section { margin-top: 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.imgpicks { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.imgpick { margin: 0; display: grid; gap: 6px; justify-items: start; }
.imgpick label { position: relative; display: grid; gap: 2px; justify-items: center; text-align: center; cursor: pointer; font-size: .85rem; }
.imgpick label:focus-within .thumb { outline: 2px solid var(--accent, #6d28d9); outline-offset: 2px; }
.thumb.tile { width: 96px; height: 96px; }
.shotupload { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.shotupload input[type="file"] { max-width: 100%; }
.shotgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.shotgrid li { display: grid; gap: 6px; justify-items: start; align-content: start; }
.shotgrid form { margin: 0; }
.shotgrid select { font-size: .8rem; padding: 4px 6px; }
.shotbtns { display: flex; flex-wrap: wrap; gap: 4px; }
.shotbtns form { display: flex; gap: 4px; }
.thumb.shot { width: 96px; height: 192px; }
.bundlebox { display: grid; gap: 6px; margin-bottom: 14px; background: var(--accent-soft); }
.bundlebox p, .bundlebox form { margin: 0; }

/* app activity (home card and an app's activity tab): devices by their last silent check-in */
.seg { display: inline-block; }
.seg.today { background: #059669; } .seg.week { background: #34d399; } .seg.month { background: #a7f3d0; } .seg.idle { background: var(--field); }
.actbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); gap: 2px; }
.actbar .seg { height: 100%; }
.actbar .p1 { width: 5%; } .actbar .p2 { width: 10%; } .actbar .p3 { width: 15%; } .actbar .p4 { width: 20%; } .actbar .p5 { width: 25%; }
.actbar .p6 { width: 30%; } .actbar .p7 { width: 35%; } .actbar .p8 { width: 40%; } .actbar .p9 { width: 45%; } .actbar .p10 { width: 50%; }
.actbar .p11 { width: 55%; } .actbar .p12 { width: 60%; } .actbar .p13 { width: 65%; } .actbar .p14 { width: 70%; } .actbar .p15 { width: 75%; }
.actbar .p16 { width: 80%; } .actbar .p17 { width: 85%; } .actbar .p18 { width: 90%; } .actbar .p19 { width: 95%; } .actbar .p20 { width: 100%; }

.actlegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.actlegend li, .stats .label { display: inline-flex; align-items: center; gap: 6px; }
.actlegend .seg, .stats .label .seg { width: 10px; height: 10px; border-radius: 3px; }
.actlist { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.actlist a { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon name" "nums nums" "bar bar"; gap: 10px 12px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); height: 100%; }
.actlist a:hover { text-decoration: none; border-color: var(--accent); }
.actlist .appicon { grid-area: icon; width: 40px; height: 40px; }
.actlist .act-active .appicon { background: #d1fae5; color: #047857; }
.actlist .act-idle .appicon { background: var(--line-soft); color: var(--subtle); }
.actlist .act-idle a { background: var(--line-soft); }
.actname { grid-area: name; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.actname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actstate { display: inline-flex; align-items: center; gap: 6px; font-size: .82em; color: var(--muted); }
.actnums { grid-area: nums; display: flex; gap: 16px; font-size: .8em; color: var(--muted); }
.actnums b { font-size: 1.3rem; color: var(--text); margin-inline-end: 4px; }
.actlist .actbar { grid-area: bar; }
.actlist .act-idle .actnums b { color: var(--muted); }
.acttab { margin-top: 22px; }
.actdot { width: 9px; height: 9px; border-radius: 50%; background: var(--subtle); flex: none; }
.act-active .actdot { background: #059669; } .act-quiet .actdot { background: #d97706; }
.act-quiet .actstate { color: #b45309; } .act-active .actstate { color: #047857; }

/* ── the panel's login, design B (docs/LOGIN_PAGE.md in nhmsv/nhmsv): the platform's side, then the card ── */
body.guest { padding-inline-start: 0; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; align-content: start; }
.auth-side { background: linear-gradient(135deg, #4c1d95, #5b21b6 55%, #6d28d9); color: #fff; padding: max(28px, env(safe-area-inset-top)) 20px 76px; display: flex; flex-direction: column; gap: 10px; }
.auth-side img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 1px #ffffff26; }
.auth-side h1 { margin: 0; font: 700 24px/1.3 "Plex Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; }
.auth-side p { margin: 0; color: #ede9fe; }
.auth-pts { display: none; list-style: none; margin: 10px 0 0; padding: 0; flex-direction: column; gap: 12px; }
.auth-pts li { display: flex; gap: 10px; align-items: center; color: #f5f3ff; }
.auth-pts svg { flex: none; width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: #ffffff22; }
.auth-main { padding: 0 16px max(24px, env(safe-area-inset-bottom)); margin-top: -52px; }
.auth-card { max-width: 420px; margin: 0 auto; background: var(--card); border: 1px solid var(--card-line); border-radius: 20px; padding: 24px 20px; box-shadow: 0 12px 32px rgba(0, 0, 0, .08); display: flex; flex-direction: column; gap: 14px; }
.auth-card h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.auth-card .flash { margin: 0; }
.auth-card label { font-size: 14px; font-weight: 600; color: var(--text); }
.auth-card input { min-height: 48px; margin-top: 6px; }
.auth-card .pw input { margin-top: 0; }
.auth-card .pw { margin-top: 6px; }
.auth-card .auth-btn { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 700; }
.auth-card a.auth-btn:hover { text-decoration: none; }
.auth-btn svg { width: 20px; height: 20px; flex: none; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw { position: relative; display: block; }
/* the field itself is dir="ltr": its padding follows the page's side, where the button sits */
.pw input { padding-left: 84px; }
:root[dir="rtl"] .pw input { padding-left: 12px; padding-right: 84px; }
.pw-t { position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; padding: 8px 10px; min-height: 36px; }
.pw-t:hover { color: var(--accent); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
button.auth-lang { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; min-height: 36px; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.05fr 1fr; align-content: stretch; }
  .auth-side { padding: 56px; justify-content: center; }
  .auth-side h1 { font-size: 34px; }
  .auth-pts { display: flex; }
  .auth-main { margin: 0; padding: 32px; display: grid; place-items: center; }
  .auth-card { width: 100%; box-shadow: none; }
}
.auth-hint { font-size: 13px; margin-top: -4px; }
.auth-card .otp { font-size: 1.2em; }
.auth-link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.auth-link:hover { color: var(--accent); }
.auth-text { margin: 0; color: var(--muted); font-size: 14px; }
.auth-forgot { align-self: flex-start; font-size: 13px; }
/* «حذف» under an offer's or a code's form */
.dangerzone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dangerzone form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.offercard small.warn { padding: 4px 8px; border-radius: 8px; }

/* «Search the panel» (docs/ADMIN_SEARCH.md in nhmsv/nhmsv): the lens before the account group, on phones too; the dialog; the card it opens */
.topbar .ends { display: flex; align-items: center; gap: 8px; }
.topbar .searchbtn { width: 36px; height: 36px; border-radius: 10px; color: var(--muted); }
.topbar .searchbtn svg { width: 18px; height: 18px; flex: none; }
dialog.navsearch { width: min(600px, calc(100% - 32px)); max-height: min(72vh, 560px); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgb(15 23 42 / .3); overflow: hidden; }
dialog.navsearch[open] { display: flex; flex-direction: column; }
dialog.navsearch::backdrop { background: rgb(15 23 42 / .45); }
.nsfield { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.nsfield svg { flex: none; }
.nsfield input { flex: 1; min-width: 0; min-height: 0; border: 0; outline: 0; box-shadow: none; background: transparent; color: var(--text); font: inherit; font-size: 1rem; padding: 8px 0; }
.nsfield kbd { font: inherit; font-size: .72rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
#navsearch-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
#navsearch-list:empty { display: none; }
#navsearch-list [role="option"] { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
#navsearch-list [aria-selected="true"] { background: var(--accent-soft); }
.nsicon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--line-soft); color: var(--muted); }
#navsearch-list [aria-selected="true"] .nsicon { background: var(--card); color: var(--accent); }
.nsicon svg { width: 18px; height: 18px; }
.nstext { min-width: 0; }
.nstext b { display: block; font-weight: 600; }
.nstext small { display: block; color: var(--muted); font-size: .8rem; }
.nsempty { margin: 0; padding: 18px; text-align: center; color: var(--muted); }
@media (max-width: 899px) {
  dialog.navsearch { width: calc(100% - 16px); margin-top: 8px; max-height: calc(100% - 16px); }
  .nsfield kbd { display: none; }
}
main [id]:target { scroll-margin-top: 84px; animation: nstarget 2.4s ease-out; }
@keyframes nstarget { 0%, 60% { outline: 3px solid var(--accent); outline-offset: 3px; } 100% { outline: 3px solid transparent; outline-offset: 3px; } }
@media (prefers-reduced-motion: reduce) { main [id]:target { animation-timing-function: steps(1, end); } }
/* §5أ the history in an empty dialog; §5ب «Panel map»: its link at the foot of the side menu, and the page */
#navsearch-list [role="group"] { list-style: none; }
#navsearch-list [role="group"] > ul { list-style: none; margin: 0; padding: 0; }
.nshead { display: block; padding: 8px 10px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .3px; color: var(--muted); }
.nsclear { list-style: none; padding: 2px 10px 6px; }
.nsclear button { min-height: 0; padding: 2px 0; border: 0; background: none; color: var(--muted); font-size: .78rem; text-decoration: underline; cursor: pointer; }
.nsclear button:hover { color: var(--text); }
.maplink { display: flex; align-items: center; gap: .6rem; margin-top: auto; padding: .4rem .75rem; border-radius: 8px; color: var(--muted); font-size: .82rem; }
.maplink svg { width: 16px; height: 16px; flex: none; }
.maplink:hover { color: var(--text); background: var(--line-soft); text-decoration: none; }
.maplink[aria-current="page"] { color: var(--accent); }
.maplink + .appver { margin-top: .25rem; }
.shell.folded .maplink { justify-content: center; padding: .4rem 0; }
.shell.folded .maplink .label { display: none; }
.mapfilter { width: 100%; max-width: 420px; margin: 4px 0 16px; }
.panelmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.maplist, .maplist ul { list-style: none; margin: 0; padding: 0; }
.maplist > li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.mappage { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.mappage svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.maplist ul { margin-top: 4px; padding-inline-start: 26px; }
.maplist ul a { display: inline-block; padding: 3px 0; font-size: .9rem; }
/* phones and tablets (<900px): the search sits just inside the platform switcher, which keeps the bar's edge (ADMIN_SEARCH.md §5) */
.topbar .searchbtn.phone-only { display: none; }
@media (max-width: 899px) {
  .topbar .searchbtn.phone-only { display: inline-grid; order: 9; margin-inline-start: auto; }
  .topbar .searchbtn.phone-only ~ .platforms { margin-inline-start: 0; }
}

/* «الربط» (docs/INTEGRATIONS.md §1.2): the badge line, «How do I link it?», the platform-specific divider; tabs shown one at a time by app.js */
/* §1.2b the folded connection card: <section class="card integ-card"><details><summary> name, badge, key tail, last success / error, one fact */
.integ-count { margin: 0 0 14px; font-weight: 600; }
.integ-card { padding-top: 0; padding-bottom: 0; }
.integ-card > details > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 16px 0; cursor: pointer; list-style: none; }
.integ-card > details > summary::-webkit-details-marker { display: none; }
.integ-card > details > summary::before { content: "▸"; color: var(--muted); font-size: .9rem; }
html[dir="rtl"] .integ-card > details > summary::before { content: "◂"; }
.integ-card > details[open] > summary::before { content: "▾"; }
.integ-card > details > summary h2 { margin: 0; font-size: 1.05rem; }
.integ-card > details > summary .integ-meta { flex-basis: auto; }
.integ-card > details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.integ-card > details[open] { padding-bottom: 16px; }
@media (max-width: 600px) {
  /* on a phone the line wraps in two: the badge first */
  .integ-card > details > summary::before { order: -2; }
  .integ-card > details > summary .badge { order: -1; }
  .integ-card > details > summary .integ-meta { flex-basis: 100%; }
}
.integ-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; }
.integ-how { background: var(--line-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.integ-how summary { cursor: pointer; font-weight: 600; }
.integ-how ol { margin: 8px 0 0; padding-inline-start: 1.3rem; display: grid; gap: 4px; font-size: .92rem; }
.integ-sep { display: flex; align-items: center; gap: .5rem; margin-top: 8px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.integ-sep::before, .integ-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.copyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 0; }
.copyrow .code { overflow-wrap: anywhere; }
.tabpanel[hidden] { display: none; }

/* «بيع يدوي (حالات خاصة)» folded on the orders page: the title is the summary */
#new-order > details > summary { cursor: pointer; }
#new-order > details > summary h2 { display: inline; margin: 0; }
#new-order > details[open] > summary { margin-bottom: 12px; }

/* the home of license.nhmsv.net: the brand, then the activation card, then the links to the account, buying and the apps */
.homebrand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-size: 20px; }
.homebrand img { border-radius: 11px; }
.homelinks h2 { margin: 0 0 4px; font-size: 18px; }
.homelinks .muted { margin: 0 0 12px; }
.homelinks-row { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; }
.homelinks-row a { color: var(--accent); font-weight: 600; text-decoration: none; }
.homelinks-row a:hover { text-decoration: underline; }
.homelinks hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.homelinks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ADMIN_PANEL_UNIFIED.md §2c: every panel page has its own widget rail. Below 1600px it sits under the page as a grid of
   cards (16px apart); from 1600px it is a 360-420px column on the far side of the menu, and the page drops its max-width */
.withrail { display: flex; flex-direction: column; gap: 16px; }
.railmain { min-width: 0; }
.pagerail { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.pagerail .card { margin: 0; }
.pagerail .statuslist li > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1600px) {
  .content main:has(> .withrail) { max-width: none; }
  .withrail { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 22vw, 420px); align-items: start; }
  .pagerail { display: flex; flex-direction: column; align-items: stretch; }
}
