/* Arctis UI. Colors are placeholders until the brand palette is applied: change only the variables below. */
:root {
  /* Arctis brand: Deep Navy #0B1D2A, Ice Silver #DCE3E9, Glacier White #F8FAFB, Frost Blue #7FAAC8 */
  --bg: #F8FAFB; --panel: #ffffff; --ink: #0B1D2A; --muted: #5A7083; --line: #D8E2EA;
  --brand: #0B1D2A; --brand-ink: #F8FAFB; --accent: #7FAAC8; --link: #2F6A90;
  --mark: #0B1D2A; --word: #0B1D2A;
  --ok: #177a4d; --ok-bg: #dff3e8; --bad: #b3261e; --bad-bg: #fbe3e1; --warn: #8a5a00; --warn-bg: #fdf0d2; --info-bg: #E6EFF6;
  --shadow: 0 1px 2px rgba(11, 29, 42, .06), 0 6px 18px rgba(11, 29, 42, .07);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1D2A; --panel: #112636; --ink: #F8FAFB; --muted: #9FB3C2; --line: #23404F;
    --brand: #7FAAC8; --brand-ink: #0B1D2A; --accent: #7FAAC8; --link: #9CC0DA;
    --mark: #DCE3E9; --word: #DCE3E9;
    --ok: #5fd39b; --ok-bg: #12382a; --bad: #ff8f86; --bad-bg: #3d1a18; --warn: #f1c35b; --warn-bg: #3a2d0c; --info-bg: #17344A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { margin: 0 0 .8rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .88rem; }
.center { justify-content: center; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 1.2rem; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brandmark { display: inline-block; flex: none; width: 30px; height: 30px; background: var(--mark); -webkit-mask: url(/brand/mark.svg) center / contain no-repeat; mask: url(/brand/mark.svg) center / contain no-repeat; }
.brandword { display: inline-block; flex: none; height: 17px; aspect-ratio: 4.85; background: var(--word); -webkit-mask: url(/brand/word.svg) center / contain no-repeat; mask: url(/brand/word.svg) center / contain no-repeat; }
body[dir=rtl] .brandword, [dir=rtl] .brandword { -webkit-mask-position: right center; mask-position: right center; }
.brandsub { font-weight: 500; color: var(--muted); font-size: .85rem; border: 1px solid var(--line); border-radius: 999px; padding: 0 .55rem; }
.topright { margin-inline-start: auto; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.who { color: var(--muted); font-size: .9rem; }
.tabs { display: flex; gap: .2rem; overflow-x: auto; max-width: 100%; }
.tab { border: 0; background: none; color: var(--muted); font: inherit; padding: .45rem .8rem; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tab:hover { background: var(--bg); color: var(--ink); }
.tab.active { background: var(--info-bg); color: var(--ink); font-weight: 600; }
.container { max-width: 1200px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* controls */
.btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 9px; padding: .5rem .95rem; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { border-color: var(--bad); }
.btn.small { padding: .25rem .6rem; font-size: .85rem; }
.btn.wide { width: 100%; padding: .65rem; }
.btn.link { border: 0; background: none; color: var(--link); padding: .4rem; }
.btnrow { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btnrow.tight { gap: .3rem; flex-wrap: nowrap; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: .5rem .7rem; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox] { width: auto; }
select { width: auto; }
.form select { width: 100%; }
.search { width: 220px; }
.langsel { padding: .3rem .5rem; }
.form { display: grid; gap: .8rem; }
.field { display: grid; gap: .25rem; }
.field > span { font-size: .85rem; color: var(--muted); }
.field small { color: var(--muted); }
.field.check { display: flex; align-items: center; gap: .5rem; }
.field.check > span { font-size: .95rem; color: var(--ink); }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 9px; padding: .55rem .8rem; font-size: .92rem; }
.codeinput { letter-spacing: .15em; font-size: 1.2rem; text-align: center; font-family: ui-monospace, Consolas, monospace; }

/* auth */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(1200px 500px at 50% -10%, var(--info-bg), transparent), var(--bg); }
.authcard { width: 100%; max-width: 410px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 1.6rem; }
.authcard { position: relative; }
.authhead { display: grid; justify-items: center; gap: .55rem; margin: .4rem 0 1.4rem; text-align: center; }
.authhead .brandmark { width: 76px; height: 76px; }
.authhead .brandword { height: 24px; }
.authhead .tagline { font-family: "Trajan Pro", "Caladea", Georgia, "Times New Roman", serif; letter-spacing: .22em; font-size: .62rem; color: var(--muted); text-transform: uppercase; }
.authhead .brandsub { border: 1px solid var(--line); font-size: .78rem; }
.authcard > .langsel { position: absolute; inset-block-start: .8rem; inset-inline-end: .8rem; }
.authcard h2 { margin: 0 0 .4rem; font-size: 1.25rem; }
.authcard .form { margin-top: 1rem; }
.qrbox { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: .5rem; justify-self: center; }
.qrbox img { display: block; }
.secretline { display: block; text-align: center; word-break: break-all; background: var(--bg); border-radius: 8px; padding: .5rem; letter-spacing: .08em; direction: ltr; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; direction: ltr; }
.codes code { background: var(--bg); border-radius: 8px; padding: .4rem .6rem; text-align: center; font-size: 1rem; letter-spacing: .06em; }

/* portal */
.sitegroup h2 { margin-top: 1.8rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: .9rem; }
.tile { display: flex; align-items: center; gap: .9rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.tileicon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--info-bg); }
.tileicon .brandmark { width: 26px; height: 26px; background: var(--accent); }
.tilebody { flex: 1; min-width: 0; }
.tilename { font-weight: 600; overflow-wrap: anywhere; }
.tilenote { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }

/* tables / badges / stats */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: start; padding: .55rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--info-bg) 35%, transparent); }
.ua { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: var(--muted); }
.badge { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .78rem; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.brand { background: var(--info-bg); color: var(--link); border-color: transparent; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.statnum { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.statlbl { color: var(--muted); font-size: .85rem; }
.stat.warn .statnum { color: var(--warn); }

/* dialogs and toasts */
dialog.modal { border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem; width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(5, 15, 25, .55); }
dialog.modal .btnrow { justify-content: flex-end; margin-top: 1.1rem; }
.secretbox { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; text-align: center; direction: ltr; }
#toasts { position: fixed; inset-block-end: 1rem; inset-inline-end: 1rem; display: grid; gap: .5rem; z-index: 50; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 10px; padding: .65rem .9rem; box-shadow: var(--shadow); }
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 720px) {
  .topbar { padding: .5rem .8rem; }
  .container { padding: 1rem .8rem 2.5rem; }
  .search { width: 100%; }
  .tiles { grid-template-columns: 1fr; }
}

/* status, modes, footer */
.tilestatus { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #8a99a6; }
.dot.online { background: #2fb36d; }
.dot.offline { background: #e0483e; }
.dot.unknown { background: #8a99a6; }
.modebadge { margin-inline-start: 4px; }
.modeline { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.modesel { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line, #3a4b59); background: transparent; color: inherit; max-width: 100%; }
.foot { text-align: center; margin: 24px 0 8px; font-size: 13px; }
.foot a { color: inherit; opacity: .7; }
.dot.warn { background: #e8a73a; }
.terms { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.55; } .terms h2 { font-size: 17px; margin-top: 22px; } .langbar { text-align: end; font-size: 14px; }
.tile .btn { flex: none; }
.tilestatus .badge { white-space: normal; }
.tilestatus .since { width: 100%; }
