/* Brage Hosting portal - theme based on heimdal.website/customer */
:root {
  --bg: #e3f0fb;
  --bar: #1d4f80;
  --bar-text: #e3f0fb;
  --bar-btn: #2b6197;
  --bar-btn-hover: #336ca3;
  --card: #ffffff;
  --card-tint: #f3f8fd;
  --border: #c5dbef;
  --text: #17293b;
  --muted: #5b7086;
  --primary: #2370b5;
  --primary-hover: #1b5c96;
  --hover-tint: #d3e6f8;
  --error-bg: #fde8e8;
  --error: #a32020;
  --ok-bg: #e2f4e6;
  --ok: #1e6b34;
  --warn-bg: #fdf3d7;
  --warn: #8a5a00;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.page { display: block; }
main { width: 100%; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Blue top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 54px;
  padding: env(safe-area-inset-top, 0) 16px 0;
  background: var(--bar); color: var(--bar-text);
}
.bar-left { margin-right: auto; display: flex; flex-direction: column; line-height: 1.35; padding: 4px 0; color: inherit; text-decoration: none; min-width: 0; }
.bar-left:hover { color: inherit; }
.brand { font-size: 16px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { font-size: 13px; letter-spacing: .02em; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.langs { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid #3b6fa3; }
.langs a { padding: 5px 9px; font-size: 13px; font-weight: 600; color: var(--bar-text); text-decoration: none; opacity: .75; }
.langs a.on { background: var(--bar-btn); opacity: 1; }
.langs a:hover { opacity: 1; color: #fff; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 34px; border-radius: 8px; color: #fff; background: var(--bar-btn);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.cart-btn:hover { background: var(--bar-btn-hover); color: #fff; }
.cart-btn .ni { width: 18px; height: 18px; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: #f2c12e; color: #17293b; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
/* ---------- Menu button (three lines, top left) ---------- */
.menu-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 36px; padding: 0;
  background: var(--bar-btn); border: 0; border-radius: 8px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.menu-btn:hover { background: var(--bar-btn-hover); }
.menu-btn .bars { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.menu-btn .bars span { display: block; height: 2px; background: #fff; border-radius: 1px; }
.nav-open .menu-btn { background: #24578a; box-shadow: inset 0 1px 3px rgba(0,0,0,.2); }

/* ---------- Dark side menu ---------- */
:root { --nav-w: 250px; --nav-bg: #0f2a45; --nav-bg-2: #0b2238; --nav-text: #c9dcef; --nav-muted: #7f9cba; --nav-hover: #173a5c; --nav-active: #1d4f80; --nav-accent: #5aa2e6; }
.sidenav {
  position: fixed; top: 54px; bottom: 0; left: 0; z-index: 30;
  width: var(--nav-w); display: flex; flex-direction: column;
  background: var(--nav-bg); color: var(--nav-text);
  overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.sidenav nav { flex: 1; padding: 10px 10px 16px; }
.nav-h { margin: 16px 12px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-muted); }
.nav-sep { height: 1px; margin: 14px 12px; background: rgba(255,255,255,.08); }
.sidenav a, .sidenav button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; margin: 1px 0; border: 0;
  color: var(--nav-text); background: none; text-decoration: none; text-align: left;
  font: inherit; font-size: .97rem; cursor: pointer;
}
.sidenav a:hover, .sidenav button:hover { color: #fff; }
.sidenav a:hover .ni, .sidenav button:hover .ni { opacity: 1; }
.sidenav a.on { color: #fff; font-weight: 700; }
.sidenav a.on .ni { color: var(--nav-accent); }
.sidenav a:focus-visible, .sidenav button:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: -2px; border-radius: 6px; }
.sidenav .ni { width: 19px; height: 19px; flex: none; opacity: .85; }
.sidenav a.on .ni { opacity: 1; }
.sidenav .nav-langs { display: flex; gap: 6px; margin: 18px 12px 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidenav .nav-langs a {
  flex: none; width: auto; justify-content: center; padding: 6px 14px; margin: 0; font-size: .88rem; font-weight: 700; letter-spacing: .04em;
  color: var(--nav-text); border: 1px solid rgba(255,255,255,.14); border-radius: 8px;
}
.sidenav .nav-langs a:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.sidenav .nav-langs a.on { color: #fff; background: var(--nav-active); border-color: var(--nav-active); }
.nav-user { padding: 12px 10px 14px; background: var(--nav-bg-2); border-top: 1px solid rgba(255,255,255,.06); }
.nav-who { display: flex; flex-direction: column; padding: 2px 12px 8px; line-height: 1.35; min-width: 0; }
.nav-who strong { color: #fff; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-who span { color: var(--nav-muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user form { margin: 0; }
.shade { position: fixed; inset: 54px 0 0 0; z-index: 25; background: rgba(8, 22, 36, .55); }

/* Laptop / desktop: menu always visible, no button */
@media (min-width: 900px) {
  .menu-btn { display: none; }
  .page { margin-left: var(--nav-w); }
  .shade { display: none !important; }
}
/* Phone / tablet: menu slides in from the left */
@media (max-width: 899px) {
  .sidenav { transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .nav-open .sidenav { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; box-shadow: 8px 0 24px rgba(0,0,0,.25); }
  body.nav-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none; } }

/* ---------- Content ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px 0; }
.wrap.wide { max-width: 1200px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin-bottom: 16px;
}
.card.narrow { max-width: 420px; margin: 0 auto 16px; }
.card.tint { background: var(--card-tint); }
h1 { font-size: 1.5rem; margin: 0 0 12px; color: var(--bar); }
h2 { font-size: 1.1rem; margin: 16px 0 8px; color: var(--bar); }
h2.first, .card > h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; margin: 14px 0 6px; }
.muted { color: var(--muted); font-size: .9em; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 8px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }

.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.head-row h1 { margin: 0; }

/* ---------- Forms ---------- */
label { display: block; margin: 0 0 16px; font-weight: 600; font-size: .95rem; }
label .help { display: block; font-weight: 400; margin-top: 4px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 11px 12px; font: inherit; font-weight: 400;
  color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: 8px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: auto; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--primary); }
label.check { display: flex; align-items: flex-start; gap: 4px; font-weight: 400; }
label.check input { margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-block; padding: 11px 22px;
  font: inherit; font-weight: 600; color: #fff; text-decoration: none; text-align: center;
  background: var(--primary); border: 1px solid var(--primary); border-radius: 8px; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: #fff; color: var(--primary); }
.btn-ghost:hover { background: var(--bg); color: var(--primary); }
.btn-small { padding: 7px 14px; font-size: .9rem; }
.btn-danger { background: #b42a2a; border-color: #b42a2a; }
.btn-danger:hover { background: #962020; }
.btn-ok { background: #2e8b3e; border-color: #2e8b3e; }
.btn-ok:hover { background: #237032; }
.btn-block { display: block; width: 100%; }
.btn.disabled { opacity: .4; pointer-events: none; }

.error { background: var(--error-bg); color: var(--error); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.notice { background: var(--ok-bg); color: var(--ok); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.info { background: #e1edf9; color: var(--bar); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

/* Status boxes (from heimdal) */
.sec { display: inline-block; padding: 2px 10px; border-radius: 6px; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.sec-ok   { background: #dff3e4; color: #1e6b34; border: 1px solid #9fd3ad; }
.sec-bad  { background: #fde8e8; color: #a32020; border: 1px solid #eeb0b0; }
.sec-warn { background: #fdf3d7; color: #8a5a00; border: 1px solid #ecd28a; }
.sec-grey { background: #eceff3; color: #4a5866; border: 1px solid #c9d1da; }
.sec-info { background: #e1edf9; color: #1d4f80; border: 1px solid #a9c6e6; }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  font-size: .75rem; font-weight: 600; color: var(--primary);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
}

/* Tabs / chips */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tab {
  padding: 6px 14px; border-radius: 8px; font-size: .92rem; font-weight: 600; text-decoration: none;
  color: var(--bar); background: #fff; border: 1px solid var(--border);
}
.tab:hover { background: var(--hover-tint); color: var(--bar); }
.tab.active { background: var(--bar); color: #fff; border-color: var(--bar); }

/* Key / value lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .95rem; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list td { padding: 11px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #f6faff; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.list tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
table.list a.rowlink { font-weight: 600; text-decoration: none; }
.empty { padding: 24px 0; text-align: center; color: var(--muted); }

/* Responsive tables: stack on phones */
@media (max-width: 640px) {
  table.list.stack thead { display: none; }
  table.list.stack, table.list.stack tbody, table.list.stack tfoot { display: block; width: 100%; }
  table.list.stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.list.stack tbody tr:last-child { border-bottom: 0; }
  table.list.stack tbody tr:hover td { background: none; }
  table.list.stack td { display: block; padding: 4px 2px; border: 0; text-align: right; overflow: hidden; overflow-wrap: anywhere; }
  table.list.stack td::before { content: attr(data-l); float: left; margin-right: 14px; color: var(--muted); font-weight: 600; text-align: left; }
  table.list.stack td:not([data-l])::before { content: none; }
  table.list.stack td input:not([type="checkbox"]) { display: inline-block; width: 55%; max-width: 200px; margin: 0; padding: 8px 10px; }
  table.list.stack tfoot td { border-top: 0; }
  table.list.stack tfoot tr { border-top: 2px solid var(--border); border-bottom: 0; }
}

/* ---------- Shop ---------- */
.hero { text-align: left; padding: 8px 0 4px; }
.hero h1 { font-size: 1.9rem; margin-bottom: 6px; }
.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 16px 0; }
.pkg { display: flex; flex-direction: column; margin: 0; }
.pkg h2 { margin: 0 0 4px; font-size: 1.2rem; }
.pkg .type { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.price { font-size: 1.9rem; font-weight: 800; color: var(--bar); line-height: 1.1; margin: 12px 0 2px; }
.price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.features { list-style: none; padding: 0; margin: 14px 0 18px; flex: 1; }
.features li { padding: 5px 0 5px 26px; position: relative; border-top: 1px solid #eaf2fa; }
.features li::before {
  content: ""; position: absolute; left: 4px; top: 11px; width: 12px; height: 7px;
  border-left: 2px solid #2e8b3e; border-bottom: 2px solid #2e8b3e; transform: rotate(-45deg);
}

.search-row { display: flex; gap: 10px; }
.search-row input { margin: 0; flex: 1; }
.search-row .btn { flex: none; }
@media (max-width: 480px) { .search-row { flex-direction: column; } }

.domain-results { list-style: none; margin: 14px 0 0; padding: 0; }
.domain-results li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.domain-results .dn { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.domain-results .dr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.domain-results form { margin: 0; }

.choice { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; margin: 0 0 10px; cursor: pointer; font-weight: 400; background: #fff; }
.choice:hover { background: #f6faff; }
.choice:has(input:checked) { border-color: var(--primary); background: #eef6fd; box-shadow: 0 0 0 1px var(--primary); }
.choice strong { display: inline; }
.choice .sub { display: none; margin: 12px 0 0 26px; }
.choice:has(input:checked) .sub { display: block; }
.choice .sub input { margin-top: 0; }

.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: step; flex-wrap: wrap; }
.steps li { counter-increment: step; font-size: .88rem; color: var(--muted); font-weight: 600; }
.steps li::before { content: counter(step); display: inline-flex; width: 22px; height: 22px; margin-right: 6px; align-items: center; justify-content: center; border-radius: 50%; background: #fff; border: 1px solid var(--border); font-size: .78rem; }
.steps li + li::after { content: none; }
.steps li.on { color: var(--bar); }
.steps li.on::before { background: var(--bar); color: #fff; border-color: var(--bar); }
.steps li:not(:last-child)::after { content: "›"; margin-left: 8px; color: var(--border); }

.totals { margin-left: auto; max-width: 340px; }
.totals .kv { grid-template-columns: 1fr max-content; }
.totals .kv dd { text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 1.15rem; color: var(--bar); }

/* Dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: var(--text); }
a.tile:hover { background: #f6faff; color: var(--text); }
.tile .n { display: block; font-size: 1.8rem; font-weight: 800; color: var(--bar); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { font-size: .88rem; color: var(--muted); font-weight: 600; }
.tile.alert .n { color: #b42a2a; }

/* Tickets */
.msgs { list-style: none; padding: 0; margin: 0; }
.msg { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.msg.staff { background: var(--card-tint); border-color: #a9c6e6; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.msg-head strong { color: var(--bar); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Invoice */
.invoice-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.invoice-head address { font-style: normal; line-height: 1.5; }
.paid-stamp { font-size: 1.4rem; }

/* Full-screen confirmation / wait (from heimdal) */
.confirm {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(23, 41, 59, .6);
}
.confirm-box {
  width: 100%; max-width: 420px;
  background: var(--card); border-radius: 14px; padding: 28px 24px;
  text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
.confirm-box p { font-size: 1.1rem; margin: 0 0 24px; }
#wait .confirm-box p { margin: 0; }   /* Please wait box: no empty space under the text (no buttons here) */
.confirm-actions { display: flex; gap: 12px; justify-content: center; }
.confirm-actions .btn { min-width: 110px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 4px solid #d6e4f2; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.login-lost { margin: 14px 0 0; text-align: center; font-size: .92rem; }

/* Footer */
.foot { flex: none; color: var(--muted); font-size: .85rem; text-align: center; }
.foot .wrap { padding: 0 16px 28px; }
.foot a { color: var(--muted); }
.test-badge { margin-top: 8px; }

@media (max-width: 480px) {
  .card { padding: 20px 16px; }
  .clock { display: none; }
  .brand { font-size: 15px; }
  .brand-co { display: none; }
  .topbar { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .bar-right { gap: 6px; }
  .langs a { padding: 5px 7px; }
  .steps li:not(.on) { font-size: 0; }
  .steps li:not(.on)::before { font-size: .78rem; margin-right: 0; }
  .steps li:not(:last-child)::after { font-size: .88rem; margin: 0 4px 0 6px; }
  .steps { flex-wrap: nowrap; gap: 2px; }
  .hero h1 { font-size: 1.5rem; }
}

/* Print (invoices) */
@media print {
  body { background: #fff; }
  .topbar, .sidenav, .shade, .foot, .no-print, .flash { display: none !important; }
  .page { margin: 0 !important; min-height: 0; }
  .card { border: 0; padding: 0; }
  .wrap { padding: 0; max-width: none; }
}

/* Utilities */
.grow { flex: 1; }
.mt16 { margin-top: 16px; }
.choice .sub { display: none; }
.choice:has(input:checked) .sub { display: block; }
.choice .sub input + input { margin-top: 8px; }
details summary { cursor: pointer; color: var(--primary); padding: 6px 0; }
details[open] summary { margin-bottom: 8px; }
input.narrow-input { max-width: 90px; }
code { background: var(--bg); padding: 1px 6px; border-radius: 4px; font-size: .9em; overflow-wrap: anywhere; }
.actions form { margin: 0; }
.actions select { width: auto; }

/* Access switches (Admin > Server Config) - from heimdal */
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 6px 0 4px; }
.access-label { font-weight: 700; font-size: 1rem; }
.switch-form { display: inline-flex; align-items: center; gap: 12px; margin: 0; }
.switch {
  position: relative; flex: none; width: 46px; height: 26px; padding: 0;
  border: 0; border-radius: 13px; background: #b9c4cf; cursor: pointer;
  transition: background .2s;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s;
}
.switch.on { background: #4caf50; }
.switch.on .knob { left: 23px; }
.switch:focus-visible { outline: 2px solid var(--bar); outline-offset: 2px; }
.switch-text { font-size: .9rem; }
.kv dd { min-width: 0; }
.kv dd .sec { white-space: normal; }
@media (max-width: 480px) {
  .kv:not(.totals .kv) { grid-template-columns: 1fr; gap: 0; }
  .kv:not(.totals .kv) dt { margin-top: 8px; }
}

/* Logged-in user in the top bar: [icon name] [logout] */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px; height: 36px; padding: 0 12px 0 10px;
  color: #fff; text-decoration: none; font-size: .95rem; font-weight: 600;
  background: var(--bar-btn); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.user-chip:hover, .user-chip:focus { color: #fff; text-decoration: none; }
.user-chip .ni { width: 18px; height: 18px; flex: none; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 36px; padding: 0;
  color: #fff; background: var(--bar-btn); border: 0; border-radius: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.icon-btn:hover { background: var(--bar-btn-hover); }
.icon-btn .ni { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .user-chip { width: 38px; padding: 0; justify-content: center; }
  .user-name { display: none; }
}

/* Profile: one-field password row */
.pw-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pw-row .pw-field { flex: 1 1 260px; margin: 0; }
.pw-row .btn { margin-top: 27px; }
@media (max-width: 480px) { .pw-row .btn { margin-top: 0; width: 100%; } }

/* Profile: customer details, one line each with Edit behind */
.detail-list { list-style: none; margin: 0; padding: 0; }
.detail { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); min-height: 46px; }
.detail:first-child { border-top: 0; }
.d-label { flex: 0 0 120px; font-weight: 700; color: var(--muted); }
.d-value { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.d-edit { flex: none; margin-left: auto; }
.d-locked { font-size: .85rem; padding: 0 6px; }
.d-form { flex: 1 1 280px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.d-form input, .d-form select { flex: 1 1 160px; width: auto; margin: 0; padding: 8px 10px; }
.d-form .d-postcode { flex: 0 1 100px; }
.d-actions { display: inline-flex; gap: 8px; }
.d-error { flex-basis: 100%; color: var(--error); font-size: .9rem; }
.detail.editing { background: #f6faff; margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 8px; }
@media (max-width: 480px) {
  .detail { gap: 6px 10px; flex-wrap: nowrap; }
  .detail.editing { flex-wrap: wrap; }
  .d-label { flex: 0 0 78px; font-size: .9rem; }
  .d-value { flex: 1 1 auto; font-size: .95rem; }
  .d-form { flex-basis: 100%; }
  .d-edit.btn { padding: 6px 10px; }
}

/* Compact form (Opprett konto) */
form.compact label { margin-bottom: 10px; font-size: .9rem; }
form.compact input, form.compact select { margin-top: 3px; height: 32px; padding: 4px 9px; font-size: .93rem; line-height: 1.3; border-radius: 6px; }
form.compact .help { font-size: .8rem; margin-top: 2px; }
form.compact .grid2 { gap: 0 12px; }
form.compact .btn { margin-top: 6px; }

/* Opprett konto: wider box on desktop */
.card.narrow.register-card { max-width: 860px; }

/* Small, even gap between the last box and the footer */
main > :nth-last-child(1 of :not(.confirm)) { margin-bottom: 18px; }

/* Desktop: user icon + name directly on the blue top bar (no box), still a link to Min profil */
@media (min-width: 481px) {
  .user-chip { background: none; box-shadow: none; padding: 0 6px; }
  .user-chip:hover, .user-chip:focus { background: none; color: #fff; text-decoration: none; }
}

/* Logout right under the language selector */
.sidenav .nav-logout { margin: 8px 0 0; }

/* Greyed-out Endre (Kundenr / Navn cannot be changed by the customer) */
.btn.btn-locked, .btn.btn-locked:hover { background: #eceff3; border-color: #c9d1da; color: #8a97a5; cursor: not-allowed; }

/* Endre passord button (top left of Kundedetaljer) + pop-up */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.card-head h2 { margin: 0; }
dialog.dlg { width: min(420px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.25); color: var(--text); }
dialog.dlg::backdrop { background: rgba(23, 41, 59, .6); }
dialog.dlg form { padding: 24px; margin: 0; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* Checkout: payment method choice */
fieldset.paymethods { border: 0; padding: 0; margin: 8px 0 16px; }
fieldset.paymethods legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.paymethod { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 400; }
.paymethod:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--card-tint); }
.paymethod input { margin-top: 4px; flex: none; width: auto; }
.paymethod span { display: flex; flex-direction: column; gap: 2px; }
.paymethod small { color: var(--muted); }
.access-row + .access-row { border-top: 1px solid var(--border); }
.access-row { padding: 10px 0; flex-wrap: nowrap; }
/* Payment Setup: "Aktiv" checkbox in the box header */
.check-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; cursor: pointer; white-space: nowrap; }
.check-switch input { width: 18px; height: 18px; margin: 0; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; flex: none; }
.card-head > form, .card-head .head-actions .btn { margin: 0; }
/* Payment Setup: lower status badges (Mangler / Satt opp) */
.kv-slim .sec { padding: 0 8px; font-size: .78rem; line-height: 1.5; vertical-align: middle; }
textarea.terms-text { min-height: 0; height: 68px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Admin > Domener: add TLD on one line */
.add-tld { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.add-tld h3 { margin: 0 0 8px; font-size: 1rem; }
.add-tld-row { display: grid; grid-template-columns: 90px 1fr 1fr 1fr auto; gap: 8px; align-items: center; }
.add-tld-row input { margin: 0; }
@media (max-width: 600px) { .add-tld-row { grid-template-columns: 1fr 1fr; } .add-tld-row .btn { grid-column: 1 / -1; } }
/* Order page: Supportavtale add-on + admin field */
.choice.addon { margin-top: 14px; }
.addon-price { color: var(--primary); font-weight: 700; margin-left: 4px; }
.addon-admin { display: grid; grid-template-columns: max-content 240px; justify-content: start; gap: 6px 28px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.addon-admin label { margin: 0; }
@media (max-width: 600px) { .addon-admin { grid-template-columns: 1fr; } }
.choice.addon .sub { display: block; margin: 4px 0 0 26px; }
.addon-note { display: block; margin: 2px 0 0 26px; } .addon-admin input { margin: 0; }
@media (max-width: 600px) { br.br-desk { display: none; } }
.btn.btn-remove { padding-top: 3px; padding-bottom: 3px; line-height: 1.3; }
.dns-notice { margin-bottom: 16px; }
/* Text shown only on desktop / only on mobile */
.only-mob { display: none; }
@media (max-width: 600px) { .only-desk { display: none; } .only-mob { display: inline; } }
@media (max-width: 600px) { .hide-mob { display: none !important; } }
@media (max-width: 600px) { table.list.stack td.nolabel-mob::before { content: none; } }
/* Customer front page, mobile: "Webhotell • domain.com  [Aktiv]" on one line */
td.mob-line { display: none; }
@media (max-width: 600px) {
  table.list.stack td.mob-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 6px 2px; }
  td.mob-line .ml-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  td.mob-line .ml-sep { color: var(--muted); margin: 0 8px; }
  td.mob-line .sec { flex: none; }
  table.list.stack tr:has(td.mob-line) { padding: 4px 0; }
}
table.list th.col-grow { width: 100%; } table.list td.hide-mob { white-space: nowrap; } table.list td.hide-mob:first-child { white-space: normal; }
table.list .col-status { padding-right: 72px; }
/* Mine tjenester: click a product to open its details pop-up */
tr.svc-row { cursor: pointer; }
tr.svc-row:hover td { background: #f6faff; }
tr.svc-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
dialog.dlg-svc { width: min(480px, calc(100vw - 32px)); }
dialog.dlg-svc .dlg-body { padding: 22px 24px; }
dialog.dlg-svc h3 { font-size: 1rem; margin: 16px 0 6px; }
dialog.dlg-svc ul.feat { margin: 0 0 8px; padding-left: 20px; }
dialog.dlg-svc ul.feat li { margin: 2px 0; }
dialog.dlg-svc .dlg-actions { justify-content: flex-start; align-items: center; margin-top: 18px; }   /* Lukk + Avbestill same height (no stretch) */
@media (max-width: 480px) { dialog.dlg-svc dl.kv.kv-slim { grid-template-columns: max-content 1fr; gap: 6px 14px; } dialog.dlg-svc dl.kv.kv-slim dt { margin-top: 0; } }
dialog.dlg-svc { background: var(--card-tint); border: 1px solid var(--border); }
dialog.dlg-svc .svc-note { margin: 14px 0 0; }
td .ml-sep { color: var(--muted); margin: 0 8px; }
.choice.addon-has { cursor: default; } .choice.addon-has:hover { background: #fff; }
.addon-inc { display: block; margin-top: 4px; }
@media (max-width: 600px) { .hero { padding-bottom: 14px; text-align: left; } .hero h1 { margin-bottom: 0; } }
@media (max-width: 600px) { .pkg h2 { font-size: 1.45rem; } }
/* three-way access choice: Av / Kun Norge / Alle land */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg form { margin: 0; display: flex; }
.seg-btn { border: 0; border-left: 1px solid var(--border); background: #fff; color: var(--text, #333); padding: 6px 14px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.seg form:first-child .seg-btn { border-left: 0; }
.seg-btn:hover:not(:disabled) { background: #f2f6fa; }
.seg-btn:disabled { cursor: default; opacity: 1; }
.seg-btn.on.seg-off { background: #fdecec; color: #a12a2a; }
.seg-btn.on.seg-norway { background: #dff3e4; color: #1e6b34; }
.seg-btn.on.seg-open { background: #e6f0fa; color: #1d4f80; }
.seg-btn { white-space: nowrap; }
@media (max-width: 600px) { .seg-btn { padding: 6px 10px; font-size: .85rem; } }
@media (max-width: 600px) { .seg { display: flex; width: 100%; } .seg form { flex: 1; } .seg-btn { width: 100%; } }
@media (max-width: 600px) { .access-row:has(.seg) { flex-wrap: wrap; } }
.num-small { width: 72px; margin: 0; text-align: center; }
@media (max-width: 600px) { .h2-big { font-size: 1.3rem; } }
.hero h1.picked-domain { margin-bottom: 4px; }
.hero.hero-picked { padding-bottom: 0; } .hero.hero-picked .lead { margin-bottom: 4px; }
.order-done .order-help { margin-top: 22px; }
.card:has(> .empty-slim) { padding-top: 14px; padding-bottom: 14px; } .empty.empty-slim { padding: 0; margin: 0; }
#ny textarea { min-height: 0; height: 130px; }
.invoice-pdf { float: right; margin: 0 0 8px 12px; } .card:has(> .invoice-pdf) { position: relative; }
td.inv-actions { white-space: nowrap; } td.inv-actions .btn + .btn { margin-left: 6px; }
td.inv-line .ml-name { display: flex; flex-direction: column; gap: 1px; color: inherit; text-decoration: none; white-space: normal; }
td.inv-line .ml-name .muted { font-size: .85rem; }
td.inv-line .btn { flex: none; }
.order-done { position: relative; }
.box-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 1.6rem; line-height: 1; color: var(--muted); text-decoration: none; }
.box-close:hover { background: #eef3f8; color: var(--bar); }
.order-done h1 { padding-right: 34px; }
.order-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; max-width: 620px; }
.order-btns form { margin: 0; display: flex; }
.order-btns .btn { width: 100%; white-space: nowrap; }
@media (max-width: 600px) { .order-btns { grid-template-columns: 1fr; } }
#actForm input[name="message"] { padding: 5px 10px; font-size: .9rem; }
textarea[name="admin_note"] { min-height: 0; height: auto; padding: 5px 10px; font-size: .9rem; line-height: normal; }
#actForm input[name="message"] { line-height: normal; }
textarea[name="admin_note"] { height: 56px; }
/* Strips under the blue top bar: test mode + global message (all pages) */
.topstrips { position: sticky; top: 54px; z-index: 35; }
.testbar { background: #fff4d6; color: #7a5200; border-bottom: 1px solid #f0d58a; text-align: left; padding: 4px 16px; font-size: 15px; font-weight: 700; line-height: 24px; letter-spacing: .02em; }
@media (min-width: 900px) { .testbar { padding-left: 24px; } }
.msg-input { margin-top: 0; padding: 5px 10px; font-size: .9rem; line-height: normal; }
.access-note { display: block; font-size: .85rem; font-weight: 400; margin-top: 2px; }
/* Admin > Email Setup */
.tpl-list { list-style: none; margin: 0; padding: 0; }
.tpl-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.tpl-list li:first-child { border-top: 0; }
.tpl-name { font-weight: 600; }
.tpl-name .sec { margin-left: 6px; font-size: .75rem; padding: 0 6px; }
h1.tpl-title { margin: 0; font-size: 1.4rem; }
textarea.tpl-body { min-height: 340px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.5; }
.tpl-vars code { margin-right: 4px; }
.choice .sub .grid2 { margin-top: 4px; }

/* Email template on/off tick */
.tpl-list li { justify-content: flex-start; }
.tpl-list li .tpl-name { flex: 1; }
.tpl-tick { margin: 0; display: flex; }
.tick { width: 22px; height: 22px; border: 2px solid var(--border-strong, #9fb3c6); border-radius: 5px; background: #fff; cursor: pointer; padding: 0; position: relative; flex: none; }
.tick.on { background: var(--bar); border-color: var(--bar); }
.tick.on::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.tick:focus-visible { outline: 2px solid var(--bar); outline-offset: 2px; }
.tpl-off .tpl-name { color: var(--muted, #7a8996); }

/* Admin customer: send email on one line */
.mail-send { display: flex; gap: 8px; align-items: center; margin: 16px 0 0; }
.mail-send select { flex: 1; min-width: 0; margin: 0; }
.mail-send { margin: 22px 0; }
.mail-send + hr.sep { margin: 0 0 22px; }
.cust-btns { margin-top: 0; margin-bottom: 6px; }
.mail-send select { background-color: #eef6fd; border-color: #9cc3e6; color: var(--bar); font-weight: 600; }
.mail-send select:hover { background-color: var(--hover-tint); }

/* Admin customer: Email History */
.mail-hist h3 { font-size: .95rem; margin: 0 0 6px; color: var(--bar); }
.mail-hist .muted { margin: 0 0 22px; }
.mail-hist ul { list-style: none; margin: 0 0 22px; padding: 0; }
.mail-hist li { border-top: 1px solid var(--border); }
.mail-hist li:first-child { border-top: 0; }
.mail-hist button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 4px; background: none; border: 0; text-align: left; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; border-radius: 6px; }
.mail-hist button:hover { background: var(--card-tint); }
.mail-hist button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.mh-date { color: var(--muted); white-space: nowrap; font-size: .85rem; }
.mh-subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--primary); }
dialog.dlg-mail { width: min(620px, calc(100vw - 32px)); }
dialog.dlg-mail .dlg-body { padding: 22px 24px; }
pre.mail-body { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: .92rem; background: var(--card-tint); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin: 0 0 16px; max-height: 60vh; overflow: auto; }
.mail-hist { contain: inline-size; }   /* long subjects are cut with … instead of widening the card */
textarea.cm-body { min-height: 220px; }
.inv-bank { display: block; margin-top: 10px; font-weight: 700; }
@media (min-width: 900px) { .card.narrow.order-done { max-width: 680px; padding: 36px 40px; } }

/* Cron-oppsett */
.cron-list { list-style: none; margin: 0; padding: 0; }
.cron-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.cron-list li:first-child { border-top: 0; }
.cron-name { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 0; cursor: pointer; }
.cron-name input { width: 20px; height: 20px; accent-color: var(--bar); margin: 0; }
.cron-days { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; color: var(--muted); }
.cron-days input { width: 70px; margin: 0; padding: 6px 8px; text-align: center; }
.cron-days { flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.cron-days span { font-size: .78rem; font-weight: 400; }

.cron-list li { flex-wrap: nowrap; }
.cron-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cron-help { margin: 0 0 0 30px; font-size: .78rem; color: var(--muted); font-weight: 400; }
input.cron-days { flex: none; width: 70px; margin: 0 0 0 auto; padding: 6px 8px; text-align: center; }
.cron-name input { flex: none; }
input.cron-date { width: 80px; }

/* Nyhetsbrev */
textarea.nl-body { min-height: 120px; height: 120px; }
details.nl-en { margin: 4px 0 12px; }
details.nl-en summary { cursor: pointer; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.nl-list { list-style: none; margin: 0; padding: 0; }
.nl-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.nl-list li:first-child { border-top: 0; }
.nl-subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nl-count { white-space: nowrap; font-size: .85rem; }
.nl-dlg { position: relative; }
.nl-dlg h2 { padding-right: 36px; }
.nl-dlg .box-close { background: none; border: 0; cursor: pointer; }
.nl-dlg h3 { font-size: .95rem; margin: 14px 0 8px; }
@media (max-width: 600px) { .nl-count { display: none; } .nl-list .mh-date { font-size: .78rem; } }
/* Profile (Kunde Detaljer) on desktop: smaller text + matching buttons */
@media (min-width: 900px) {
  .detail { min-height: 38px; padding: 4px 0; }
  .detail .d-label, .detail .d-value { font-size: .9rem; }
  .detail .d-label { flex-basis: 110px; }
  .detail .btn-small { font-size: .78rem; padding: 4px 12px; }
  .detail .d-form input, .detail .d-form select { font-size: .9rem; padding: 6px 9px; }
}

/* Pager: Forrige (left) · 1/X (centre) · Neste (right) */
.pager-wide { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 14px; }
.pager-wide > :first-child { justify-self: start; }
.pager-wide > :last-child { justify-self: end; }
.pager-n { font-weight: 700; color: var(--muted); font-size: .9rem; }
.pager-wide .is-off { opacity: .4; pointer-events: none; }
/* Support case view + Kundeservice (admin + customer): smaller text and boxes */
@media (min-width: 0) {
  .ticket-view { font-size: .9rem; }
  .ticket-view h1 { font-size: 1.25rem; }
  .ticket-view .msg { padding: 9px 12px; margin-bottom: 8px; border-radius: 8px; }
  .ticket-view .msg-head { font-size: .78rem; margin-bottom: 4px; }
  .ticket-view .msg-body { font-size: .9rem; }
  .ticket-view label { font-size: .88rem; }
  .ticket-view textarea { font-size: .9rem; padding: 7px 10px; min-height: 0; height: 96px; }
  .ticket-view select { font-size: .85rem; padding: 5px 8px; width: auto; }
  .ticket-view .btn:not(.btn-small) { font-size: .85rem; padding: 7px 16px; }
  .ticket-view .btn-small { font-size: .8rem; padding: 5px 12px; }
}
@media (min-width: 0) {
  .ticket-view input:not([type=checkbox]):not([type=radio]) { font-size: .9rem; padding: 7px 10px; }
  .ticket-view h2 { font-size: 1.05rem; }
  .ticket-view table.list { font-size: .88rem; }
}
#ny form .field:last-child { margin-bottom: 0; }
@media (min-width: 900px) { .ticket-view#ny textarea { line-height: 1.5; height: calc(3 * 1.5em + 16px); } }   /* room for 3 lines */

/* Kundeservice, mobile: one line per case */
@media (max-width: 600px) {
  table.list.stack td.tk-line { justify-content: flex-start; gap: 8px; font-size: .85rem; }
  td.tk-line .tk-date { flex: none; color: var(--muted); font-size: .78rem; }
  td.tk-line .tk-subj { flex: 1; font-weight: 600; text-decoration: none; }
  td.tk-line .sec { font-size: .75rem; padding: 4px 9px; line-height: 1.2; }
  td.tk-line .tk-open { flex: none; padding: 4px 10px; font-size: .75rem; line-height: 1.2; }
}
.tk-btns { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; }
.tk-btns .btn { white-space: nowrap; }
textarea.reply-body { min-height: 0; height: 180px; font-size: .92rem; }
/* Svar pop-up: light blue like the rest of the theme, white writing area */
dialog#replyDlg { background: #eef6fd; border: 1px solid #9cc3e6; }
dialog#replyDlg h2 { color: var(--bar); }
dialog#replyDlg textarea { background: #eef6fd; border-color: #9cc3e6; }
dialog#replyDlg { margin: 70px auto auto; max-height: calc(100vh - 90px); }
.reply-actions { justify-content: flex-start; }
#replyDlg .reply-actions { margin-top: 16px; }
@media (min-width: 900px) { dialog#replyDlg { width: min(820px, calc(100vw - 300px)); } }
@media (min-width: 900px) { dialog#replyDlg { inset: 0 0 0 var(--nav-w); width: min(820px, calc(100vw - var(--nav-w) - 48px)); } }
@media (min-width: 900px) { dialog#replyDlg { margin: auto; } }   /* desktop: centred (both ways) in the area right of the menu */

/* New reply from customer service: slow yellow glowing bell in the top bar */
.bell { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px;
        background: #ffd84d; color: #5a4300; margin-right: 8px; animation: bellglow 2.4s ease-in-out infinite; flex: none; }
.bell svg { width: 20px; height: 20px; fill: currentColor; }
.bell:hover { background: #ffe680; }
.bell:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes bellglow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 216, 77, .35); }
  50%      { box-shadow: 0 0 14px 5px rgba(255, 216, 77, .85); }
}
@media (prefers-reduced-motion: reduce) { .bell { animation: none; box-shadow: 0 0 10px 3px rgba(255, 216, 77, .7); } }
#newTicketDlg select { margin-bottom: 14px; } #newTicketDlg .reply-actions { margin-top: 16px; }
@media (min-width: 900px) { dialog#newTicketDlg { inset: 0 0 0 var(--nav-w); margin: auto; width: min(820px, calc(100vw - var(--nav-w) - 48px)); } }   /* centred in the area right of the menu */

/* Admin orders, mobile: one line per order */
@media (max-width: 600px) {
  table.list.stack td.ord-line { justify-content: flex-start; gap: 8px; font-size: .88rem; }
  td.ord-line .ord-no { flex: none; font-weight: 700; text-decoration: none; }
  td.ord-line .ord-name { flex: 1; color: var(--text); text-decoration: none; }
  td.ord-line .ord-amt { flex: none; white-space: nowrap; font-size: .82rem; }
  td.ord-line .sec { font-size: .72rem; padding: 3px 6px; min-width: 6.4em; text-align: center; }   /* same width on every status, so the kr amounts line up */
  td.ord-line .ord-amt { min-width: 6.5em; text-align: right; }
}

/* Admin Oversikt, mobile: only the 3 newest orders, no Forrige/Neste - "Alle" button opens Bestillinger */
.only-mob-l { display: none; }
@media (max-width: 600px) {
  .only-desk-l { display: none; }
  .only-mob-l { display: inline-flex; }
  .dash-orders table.list tbody tr:nth-child(n+4) { display: none; }
  .dash-orders .pager-wide { display: none; }
}

/* Admin tickets, mobile: one line per ticket - date, subject · customer, status */
@media (max-width: 600px) {
  table.list.stack td.atk-line { justify-content: flex-start; gap: 8px; font-size: .85rem; }
  td.atk-line .atk-date { flex: none; color: var(--muted); font-size: .78rem; }
  td.atk-line .atk-subj { flex: 1; font-weight: 600; color: var(--text); text-decoration: none; }
  td.atk-line .atk-who { font-weight: 400; color: var(--muted); }
  td.atk-line .sec { flex: none; font-size: .72rem; padding: 3px 6px; min-width: 6.4em; text-align: center; }
}

/* Admin services, mobile: one line per service - type icon, domain, price, status */
@media (max-width: 600px) {
  table.list.stack td.asv-line { justify-content: flex-start; gap: 8px; font-size: .85rem; }
  td.asv-line .asv-name { flex: 1; font-weight: 600; color: var(--text); text-decoration: none; }
  td.asv-line .asv-name { display: flex; align-items: center; gap: 6px; }
  td.asv-line .asv-ico { flex: none; display: inline-flex; color: var(--muted); }
  td.asv-line .asv-ico svg { width: 15px; height: 15px; }
  td.asv-line .asv-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  td.asv-line .asv-amt { flex: none; white-space: nowrap; font-size: .82rem; min-width: 6.5em; text-align: right; }
  td.asv-line .sec { flex: none; font-size: .72rem; padding: 3px 6px; min-width: 6.4em; text-align: center; }
}

/* Admin customers, mobile: one line per customer - "Nils Haram (16)", sorted A-Z */
@media (max-width: 600px) {
  table.list.stack td.acu-line { justify-content: flex-start; gap: 8px; font-size: .85rem; }
  td.acu-line .acu-name { flex: 1; font-weight: 600; color: var(--text); text-decoration: none; }
  td.acu-line .acu-n { font-weight: 400; color: var(--muted); }
}

/* Admin customer page, mobile: Kundedetaljer / Konto / Tjenester / Fakturaer / Saker fold open/closed, all closed by default */
@media (max-width: 600px) {
  section.fold:not(.is-open) > :not(.fold-h):not(dialog) { display: none !important; }
  .grid2 > section.fold-first { order: -1; }   /* Konto above Kundedetaljer on mobile */
  section.card.fold { padding-top: 12px; padding-bottom: 12px; }   /* low boxes: less space above/below the heading */
  section.card.fold.is-open { padding-bottom: 20px; }
  section.fold > .fold-h { padding: 4px 0; cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; user-select: none; }
  section.fold.is-open > .fold-h { margin-bottom: 14px; }
  section.fold > .fold-h::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-3px, -3px); transition: transform .15s; }
  section.fold.is-open > .fold-h::after { transform: rotate(-135deg) translate(-3px, -3px); }
}

/* Admin customer page, mobile: each service as its own little box - name as a tinted header line, then striped lines */
@media (max-width: 600px) {
  table.list.stack.svc-stack tr { padding: 0; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  table.list.stack.svc-stack tbody tr:last-child { border-bottom: 1px solid var(--border); margin-bottom: 0; }
  table.list.stack.svc-stack td { padding: 7px 12px; }
  table.list.stack.svc-stack td { background: var(--card-tint); }   /* same light blue on every line under the name */
  table.list.stack.svc-stack td:first-child { background: var(--hover-tint); text-align: left; }
  table.list.stack.svc-stack td:first-child::before { content: none; }
  table.list.stack.svc-stack td:first-child .muted { font-size: .85rem; }
  table.list.stack.svc-stack td:first-child br { display: none; }
  table.list.stack.svc-stack td:first-child .muted::before { content: " · "; }
}

/* Admin customer page, mobile: lower input boxes inside the Kunde Detaljer fold box */
@media (max-width: 600px) {
  section.fold-details input:not([type="checkbox"]):not([type="radio"]), section.fold-details select { padding: 6px 10px; margin-top: 3px; font-size: .92rem; }
  section.fold-details label, section.fold-details .field { margin-bottom: 10px; }
}

/* Admin invoice, mobile: separator line between "Sett betalt" and "Send påminnelse" */
hr.act-sep { display: none; }
@media (max-width: 600px) { .actions > hr.act-sep { display: block; flex-basis: 100%; width: 100%; margin: 6px 0; } }

/* Admin service page, mobile: lower input boxes */
@media (max-width: 600px) {
  section.svc-edit input:not([type="checkbox"]):not([type="radio"]), section.svc-edit select { padding: 6px 10px; margin-top: 3px; }   /* lower boxes, same text size */
  section.svc-edit textarea { padding: 6px 10px; margin-top: 3px; min-height: 60px; }
  section.svc-edit label { margin-bottom: 10px; }
}

/* Admin service page: customer name / epost / order on separate lines on mobile only */
@media (min-width: 601px) { .svc-cust-m { display: none; } }
@media (max-width: 600px) { .svc-cust-m { line-height: 1.6; } }

/* Admin ticket reply popup, mobile: air between the reply box and "Lukk saken etter svaret" */
@media (max-width: 600px) { #replyDlg label.check { margin-top: 12px; } }

/* Admin "+ New" case popup, mobile: at the top of the screen, message box half height */
@media (max-width: 600px) {
  dialog#newTicketDlg { margin: 70px auto auto; max-height: calc(100vh - 90px); }
  #newTicketDlg textarea.reply-body { height: 90px; }
  #newTicketDlg input:not([type="checkbox"]), #newTicketDlg select { padding: 6px 10px; margin-top: 3px; }   /* lower boxes */
  #newTicketDlg textarea.reply-body { padding: 6px 10px; margin-top: 3px; }
  #newTicketDlg label, #newTicketDlg .field, #newTicketDlg select { margin-bottom: 10px; }
}

/* Mobile: every popup gets the same light blue look as the Svar popup */
@media (max-width: 600px) {
  dialog.dlg { background: #eef6fd; border: 1px solid #9cc3e6; }
  dialog.dlg h2 { color: var(--bar); }
  dialog.dlg input:not([type="checkbox"]):not([type="radio"]), dialog.dlg select, dialog.dlg textarea { background: #eef6fd; border-color: #9cc3e6; }
}

/* Admin Pakker, mobile: one line per package - name, price, Synlig/Skjult, Endre */
@media (max-width: 600px) {
  table.list.stack td.pkg-line { justify-content: flex-start; gap: 8px; font-size: .85rem; }
  td.pkg-line .pkg-name { flex: 1; font-weight: 600; color: var(--text); text-decoration: none; }
  td.pkg-line .pkg-amt { flex: none; white-space: nowrap; font-size: .82rem; text-align: right; }
  td.pkg-line .pkg-amt .muted { font-size: .75rem; }
  td.pkg-line .sec { flex: none; font-size: .72rem; padding: 3px 6px; min-width: 4.6em; text-align: center; }
  td.pkg-line .pkg-edit { flex: none; padding: 4px 10px; font-size: .75rem; line-height: 1.2; }
}

/* Admin Domener, mobile: each TLD as a small box (".no" header, light blue lines), lower and narrower price boxes */
@media (max-width: 600px) {
  table.list.stack.tld-stack td { display: flex; align-items: center; justify-content: space-between; padding: 5px 12px; }
  table.list.stack.tld-stack td::before { float: none; margin: 0; }
  table.tld-stack td:first-child { font-size: 1.05rem; }
  table.list.stack.tld-stack td input:not([type="checkbox"]) { width: 110px; max-width: 110px; padding: 5px 10px; text-align: right; background: #fff; }
  table.tld-stack td input[type="checkbox"] { width: 18px; height: 18px; margin: 3px 0; }
}

/* Admin Domener, mobile: each TLD box opens/closes when ".no" etc. is tapped - all closed by default */
@media (max-width: 600px) {
  table.list.stack.tld-stack tr:not(.is-open) td:not(:first-child) { display: none; }
  table.list.stack.tld-stack td:first-child { cursor: pointer; user-select: none; padding-top: 9px; padding-bottom: 9px; }
  table.list.stack.tld-stack td:first-child::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--bar); border-bottom: 2px solid var(--bar); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
  table.list.stack.tld-stack tr.is-open td:first-child::after { transform: rotate(-135deg) translate(-2px, -2px); }
}
.tld-price { display: none; }
@media (max-width: 600px) {
  table.tld-stack tr:not(.is-open) .tld-price { display: inline; font-weight: 400; color: var(--muted); }   /* closed: ".no (149)" - renewal price */
}

/* Betalingsoppsett, mobile: smaller Lagre / Slett buttons */
@media (max-width: 600px) {
  section.pay-setup .btn { padding: 8px 13px; font-size: .8rem; line-height: 1.2; }
  section.pay-setup .head-actions { display: flex; align-items: center; }   /* Aktiv tick box centred on the button line */
  section.pay-setup .head-actions .check-switch { display: inline-flex; align-items: center; margin: 0; }
  section.pay-setup .head-actions .check-switch input { margin: 0 6px 0 0; }
}

/* Betalingsoppsett: Kontonummer with a Låst/Ulåst button on the same line */
.bank-row { display: flex; align-items: stretch; gap: 8px; margin-top: 6px; }   /* Låst button as tall as the number box */
.bank-row input { margin-top: 0; flex: 1; min-width: 0; }
.bank-row input.is-locked { background: var(--card-tint); color: var(--muted); cursor: not-allowed; }
.bank-row .bank-lock { flex: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bank-row .bank-lock svg { width: 14px; height: 14px; }
.btn-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #e8c766; }
@media (max-width: 600px) { section.svc-edit .bank-row input:not([type="checkbox"]):not([type="radio"]) { margin-top: 0; } }   /* no extra top margin, so the Låst button is exactly as tall as the box */

/* Epostoppsett, mobile: lower boxes - server choices, template lines and Endre buttons */
@media (max-width: 600px) {
  section.svc-edit .choice { padding: 8px 12px; margin-bottom: 8px; }
  section.svc-edit .tpl-list li { padding-top: 5px; padding-bottom: 5px; }
  section.svc-edit .tpl-list .tpl-name { font-size: .9rem; }
  section.svc-edit .tpl-list .btn { padding: 5px 12px; font-size: .78rem; line-height: 1.2; }
}

/* Cron-oppsett, mobile: lower day/date boxes and tighter lines */
@media (max-width: 600px) {
  section.svc-edit .cron-list li { padding: 8px 0; }
  section.svc-edit input.cron-days:not([type="checkbox"]) { padding: 3px 8px; margin-top: 0; width: 64px; font-size: .9rem; }
  section.svc-edit .cron-help { margin-top: 0; margin-bottom: 0; }
  section.svc-edit label.cron-name { margin-bottom: 0; }   /* no gap between the name and the grey help line */
  section.svc-edit .cron-left { gap: 1px; }
}

/* Tjenestevilkår (mobile + desktop): each box opens/closes when its heading is tapped - all closed by default */
section.terms-fold { padding-top: 7px; padding-bottom: 7px; }
.terms-fold .card-head { margin-bottom: 0; }
.terms-fold .card-head:not(.is-open) .btn, .terms-fold .card-head:not(.is-open) ~ textarea { display: none; }
.terms-fold .card-head.is-open { margin-bottom: 12px; }
.terms-fold .fold-h { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; margin: 0; cursor: pointer; user-select: none; }
.terms-fold .fold-h::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-3px, -3px); transition: transform .15s; }
.terms-fold .card-head.is-open .fold-h::after { transform: rotate(-135deg) translate(-3px, -3px); }
@media (max-width: 600px) {   /* Tjenestevilkår, mobile: lower closed boxes */
  section.terms-fold { padding-top: 7px; padding-bottom: 7px; }
  .terms-fold .fold-h { padding: 2px 0; }
  textarea.terms-text { height: 136px; }   /* 2x taller text box on mobile */
}
@media (min-width: 601px) { textarea.terms-text { height: 204px; } }   /* Tjenestevilkår, desktop: 3x taller text box */

/* Admin Domener, desktop: lower input boxes and rows; checkboxes and TLD centred on the line */
@media (min-width: 601px) {
  table.tld-stack td { padding-top: 5px; padding-bottom: 5px; vertical-align: middle; }
  table.tld-stack td input:not([type="checkbox"]) { padding: 5px 10px; }
  .add-tld-row input { padding: 6px 10px; }
  .add-tld-row .btn { padding-top: 6px; padding-bottom: 6px; }
}

/* Nyhetsbrev, desktop: lower choice boxes and subject box */
@media (min-width: 601px) {
  section.nl-form .choice { padding: 8px 14px; margin-bottom: 8px; }
  section.nl-form input:not([type="checkbox"]):not([type="radio"]) { padding: 6px 10px; margin-top: 4px; }
  section.nl-form label { margin-bottom: 12px; }
}

/* Epostoppsett, desktop: lower boxes - server choices, SMTP fields, template lines and Endre buttons */
@media (min-width: 601px) {
  #tpl.svc-edit .tpl-list li { padding-top: 4px; padding-bottom: 4px; }
  #tpl.svc-edit .tpl-list .btn { padding: 4px 12px; font-size: .8rem; line-height: 1.2; }
  section.svc-edit .choice { padding: 8px 14px; margin-bottom: 8px; }
  section.svc-edit .choice .sub input:not([type="checkbox"]):not([type="radio"]), section.svc-edit .choice .sub select { padding: 6px 10px; }
}

/* Epostmal (edit template), desktop: low Lagre / Tilbakestill / Tilbake buttons */
@media (min-width: 601px) { .tpl-actions .btn { padding: 7px 14px; font-size: .86rem; line-height: 1.2; } }

/* Cron-oppsett: Backup box */
.cron-list li.bk-days-row { flex-wrap: wrap; }
.bk-days { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.bk-day { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 4px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; font-weight: 600; cursor: pointer; background: #fff; }
.bk-day:has(input:checked) { background: #eef6fd; border-color: var(--primary); }
.bk-day input { width: 16px; height: 16px; margin: 0; accent-color: var(--bar); }
.cron-help.bk-help { margin-left: 0; }
.cron-name.bk-plain { font-weight: 700; }
.bk-last { margin: 0 0 10px; }
.bk-note { margin: 0 0 10px; }
.bk-actions { margin-top: 4px; }
@media (max-width: 600px) {
  .cron-list li.bk-days-row .cron-left { width: 100%; }
  .bk-days { margin-left: 0; width: 100%; }
  .bk-day { padding: 4px 7px; font-size: .8rem; }
}
@media (max-width: 600px) {   /* Backup head on phones: heading on its own line, the three buttons under it */
  .bk-card .card-head { flex-wrap: wrap; gap: 10px; }
  .bk-card .card-head .head-actions { width: 100%; justify-content: flex-start; gap: 6px; }
  .bk-card .card-head .head-actions .btn { padding: 7px 11px; font-size: .8rem; }
}

/* Cron-oppsett, desktop only: lower number/date boxes, day boxes and lines */
@media (min-width: 601px) {
  section.svc-edit .cron-list li { padding: 7px 0; }
  section.svc-edit input.cron-days:not([type="checkbox"]) { padding: 3px 8px; margin-top: 0; }
  .bk-day { padding: 2px 8px; }
}
@media (min-width: 601px) { .cron-card .card-head .btn { padding: 4px 12px; line-height: 1.2; } }   /* Cron-oppsett, desktop: lower Lagre / Start backup / Gjenopprett */
.bk-card .cron-list li:last-child { padding-bottom: 2px; }   /* Backup: less air under "Månedlig backup den 30." */
.bk-card hr.sep { margin-top: 8px; }

/* Backup progress pop-up */
dialog.bk-prog { position: fixed; inset: 0; margin: auto !important; height: fit-content; width: min(440px, calc(100vw - 32px)); padding: 20px 22px 22px; }
@media (min-width: 900px) { dialog.bk-prog { inset: 0 0 0 var(--nav-w); } }
.dlg-x { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; background: none; font-size: 1.7rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; }
.dlg-x:hover { background: var(--hover-tint); color: var(--text); }
.bk-prog progress { width: 100%; height: 18px; margin-top: 8px; appearance: none; border: 0; border-radius: 9px; overflow: hidden; background: #e3ebf3; }
.bk-prog progress::-webkit-progress-bar { background: #e3ebf3; border-radius: 9px; }
.bk-prog progress::-webkit-progress-value { background: var(--primary); border-radius: 9px; transition: width .3s; }
.bk-prog progress::-moz-progress-bar { background: var(--primary); border-radius: 9px; }
.bk-prog-pct { margin: 8px 0 0; font-weight: 700; text-align: center; }
.bk-prog-msg { margin: 4px 0 0; text-align: center; color: var(--muted); }
.bk-prog.is-done progress::-webkit-progress-value { background: #2e7d4f; }
.bk-prog.is-done progress::-moz-progress-bar { background: #2e7d4f; }
.bk-prog.is-done .bk-prog-msg { color: #2e7d4f; font-weight: 700; font-size: 1.1rem; }
.bk-prog.is-failed .bk-prog-msg { color: #c62828; font-weight: 700; }
.bk-prog h2 { padding-right: 40px; }

/* Cron-oppsett, mobile: Backup box folds open/closed (closed by default) */
@media (max-width: 600px) {
  .bk-card:has(.card-head:not(.is-open)) { padding-top: 12px; padding-bottom: 12px; }
  .bk-card .card-head:not(.is-open) { margin-bottom: 0; }
  .bk-card .card-head:not(.is-open) .head-actions,
  .bk-card:has(.card-head:not(.is-open)) form > :not(.card-head):not(input),
  .bk-card:has(.card-head:not(.is-open)) > :not(form) { display: none !important; }
  .bk-card .bk-fold-h { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 4px 0; margin: 0; cursor: pointer; user-select: none; }
  .bk-card .bk-fold-h::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-3px, -3px); transition: transform .15s; }
  .bk-card .card-head.is-open .bk-fold-h::after { transform: rotate(-135deg) translate(-3px, -3px); }
}

/* Backup box lock: everything grey while locked (lock button stays active) */
.bk-lock { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bk-lock svg { width: 14px; height: 14px; }
.bk-locked .cron-list, .bk-locked .bk-last { opacity: .5; filter: grayscale(1); }
.bk-locked .cron-list * { cursor: not-allowed !important; }
.bk-locked .head-actions .btn:disabled { background: #eceff3; border-color: #c9d1da; color: #8a97a5; cursor: not-allowed; opacity: 1; }
/* Backup box locked: plain warm sand card (goes with the yellow Låst button) */
section.card.bk-locked { background: #f6f1e7; border-color: #ddd0b8; }
section.card.bk-locked input, .bk-locked .bk-day { background: #faf7f1; }
@media (max-width: 600px) {   /* Backup fold box on mobile: lower */
  section.card.bk-card { padding-top: 7px; }
  section.card.bk-card:has(.card-head:not(.is-open)) { padding-top: 7px; padding-bottom: 7px; }
  .bk-card .bk-fold-h { padding: 2px 0; }
}

/* Database check alert page */
.dbh-alert { border-color: #e6c34a; background: #fffbea; }
.dbh-list { margin: 0 0 10px; padding-left: 20px; } .dbh-list li { margin: 4px 0; font-weight: 600; }
.dbh-details summary { cursor: pointer; color: var(--muted); }
.dbh-details pre { white-space: pre-wrap; font-size: .8rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-x: auto; }

/* Serverkonfigurasjon: System box with bars, text inside the bar */
.sys-up { margin: 0 0 12px; }
.sys-bar { position: relative; height: 30px; margin: 0 0 8px; border-radius: 8px; background: #e3ebf3; overflow: hidden; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: .88rem; }
.sys-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #8fd1a6; transition: width .4s; }
.sys-bar.is-warn .sys-fill { background: #ffd66b; }
.sys-bar.is-bad .sys-fill { background: #f19a9a; }
.sys-txt, .sys-pct { position: relative; color: var(--text); white-space: nowrap; }
.sys-pct { font-weight: 700; }

/* Serverkonfigurasjon, desktop: lower boxes */
@media (min-width: 601px) {
  section.card.srv-card { padding: 14px 24px; }
  .srv-card h2 { margin-bottom: 6px; }
  .srv-card .access-row { padding: 6px 0; }
  .srv-card .seg-btn { padding: 4px 12px; }
  .srv-card .card-head { margin-bottom: 6px; }
  .srv-card .card-head .btn { padding: 4px 12px; }
  .srv-card input[type="text"] { padding: 5px 10px; margin-top: 0; }
  .srv-card .sys-bar { height: 24px; margin-bottom: 6px; }
  .srv-card .sys-up { margin-bottom: 8px; }
  .srv-card > p.muted:last-child { margin: 8px 0 0; }   /* Din IP line */
}
.srv-links { margin: 0 0 16px; }   /* Systeminformasjon button under the last box, left aligned with it */
.srv-links .btn + .btn { margin-left: 6px; }

/* Systemlogg */
.log-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.log-list { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.log-list li { display: grid; grid-template-columns: 9.5em 6.5em 9em 1fr; gap: 4px 12px; padding: 7px 4px; border-top: 1px solid var(--border); align-items: baseline; }
.log-list li:first-child { border-top: 0; }
.log-list li.log-user, .log-list li.log-admin { grid-template-columns: 9.5em 14em 1fr auto; }
.log-t { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-lvl { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.log-error .log-lvl { color: #c62828; } .log-warning .log-lvl { color: #a66f00; } .log-info .log-lvl { color: #2e7d4f; }
.log-error { background: #fdf3f3; }
.log-src, .log-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-msg { overflow-wrap: anywhere; }
.log-ip { font-size: .8rem; white-space: nowrap; }
.log-note { margin: 12px 0 0; font-size: .85rem; }
@media (max-width: 600px) {
  .log-list li, .log-list li.log-user, .log-list li.log-admin { grid-template-columns: auto 1fr; font-size: .84rem; }
  .log-list .log-msg { grid-column: 1 / -1; }
  .log-list .log-src, .log-list .log-ip { display: none; }
  .log-list .log-lvl { text-align: right; }
}

/* X top right on a sub page (Systemlogg): back to Serverkonfigurasjon */
section.card.log-card, section.card.sys-card, section.card.ma-card, section.card.bind-card { position: relative; }
.page-x { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 1.8rem; line-height: 1; color: var(--muted); text-decoration: none; }
.page-x:hover { background: var(--hover-tint); color: var(--text); }
.log-card h1 { padding-right: 44px; }
.sys-card .page-x { top: 8px; right: 12px; }
.ma-card .page-x { top: 23px; }   /* Epostkontoer: 9px lower, in line with the Webmail button */

/* Kunde detaljer: Logg ut + Logg ut alle enheter, left aligned at the bottom */
.acct-logout { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.acct-logout form { margin: 0; }

/* Pakker > Endre: direct order link with copy button */
.pkg-link { margin: 0 0 16px; }   /* no outer frame: link field + Kopier button on one line */
.pkg-link-l { display: block; font-weight: 600; font-size: .95rem; margin: 0 0 4px; }   /* label above the box, like the other fields */
.pkg-link-row { display: flex; gap: 8px; align-items: stretch; }
section.svc-edit .pkg-link-row input { flex: 1; min-width: 0; margin: 0; background: #fff; font-family: ui-monospace, monospace; font-size: .85rem; }
.pkg-link-help { display: block; margin-top: 6px; font-size: .85rem; }

/* Epostoppsett: Kontoer button next to the page title */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { margin-bottom: 0; }
.page-head + section { margin-top: 16px; }

/* Epostkontoer */
.ma-card .ma-head { padding-right: 44px; margin-bottom: 8px; }
.ma-card .ma-head h1 { margin: 0; }
.ma-new { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.ma-list { list-style: none; margin: 0; padding: 0; }
.ma-list li { display: flex; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ma-list li:first-child { border-top: 0; }
.ma-addr { font-weight: 700; }
.ma-info { font-size: .88rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ma-tags { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ma-tags form { margin: 0; }
.ma-list li.ma-edit { background: var(--card-tint); border-radius: 8px; padding: 10px 12px; border-top: 0; }
.ma-edit form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; width: 100%; margin: 0; }
.ma-edit label { margin: 0; flex: 1; min-width: 180px; font-size: .88rem; }
.ma-edit input { margin-top: 4px; padding: 6px 10px; }
.ma-edit-actions { display: flex; gap: 6px; }
.ma-at { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ma-at input { margin: 0; flex: 1; min-width: 0; }
.ma-at span { font-weight: 600; white-space: nowrap; }
.ma-note { margin: 12px 0 0; font-size: .85rem; }
@media (max-width: 600px) { .ma-info { flex-basis: 100%; order: 3; } }

/* Bind9 page */
.bind-card .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.bind-card .kv dt { font-weight: 600; }
.bind-card .kv dd { margin: 0; overflow-wrap: anywhere; }
.bind-card .card-head { padding-right: 44px; }
.bind-card + .bind-card .card-head { padding-right: 0; }
.bind-msg { white-space: pre-wrap; font-size: .8rem; background: #fde8e8; padding: 8px; border-radius: 6px; margin: 6px 0 0; }
.bind-card h3 { margin: 16px 0 6px; }
.bind-recs { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, monospace; font-size: .85rem; }
.bind-recs li { display: grid; grid-template-columns: 12em 4.5em 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--border); }
.bind-recs li:first-child { border-top: 0; }
.br-name { font-weight: 700; overflow-wrap: anywhere; }
.br-type { color: var(--brand, #1d4f80); font-weight: 700; }
.br-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .bind-card .kv { grid-template-columns: 1fr; gap: 0; }
  .bind-card .kv dd { margin-bottom: 8px; }
  .bind-recs li { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .br-val { grid-column: 1 / -1; }
}

/* Apache / MySQL pages (reuse the Bind9 layout) */
.bind-card .svc-mem { margin: 0; max-width: 420px; }
.ap-errs li { grid-template-columns: 7em 1fr; }
.ap-vh li { grid-template-columns: 12em 7em 1fr; }
.my-list li { grid-template-columns: 12em 9em 1fr; }
.ap-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ap-tags .sec { font-weight: 500; font-size: .8rem; }
.ap-renew { margin: 8px 0 0; font-size: .88rem; }
@media (max-width: 600px) { .ap-errs li, .ap-vh li, .my-list li { grid-template-columns: 1fr auto; } }

/* Omstart button in the Status head (left of the X) */
.bind-card .svc-head { padding-right: 44px; }
.svc-head form { margin: 0; }
@media (max-width: 600px) { .ap-vh .br-val { white-space: normal; overflow-wrap: anywhere; } }
.sys-card .svc-head { padding-right: 44px; }

/* Serverkonfigurasjon: the 5 page buttons on one line on mobile */
@media (max-width: 600px) {
  .srv-links { display: flex; flex-wrap: nowrap; gap: 6px; }
  .srv-links .btn { flex: 0 1 auto; min-width: 0; padding: 6px 7px; font-size: .78rem; margin: 0; }
  .srv-links .btn + .btn { margin-left: 0; }
}

/* Systeminformasjon: Load bar opens the load average pop-up */
.sys-bar.sys-click { cursor: pointer; }
.sys-bar.sys-click:hover, .sys-bar.sys-click:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
dialog.sys-load-dlg { position: fixed; inset: 0; margin: auto !important; height: fit-content; padding: 24px; text-align: center; }
@media (min-width: 900px) { dialog.sys-load-dlg { inset: 0 0 0 var(--nav-w); } }
.load-avg { font-size: 1.6rem; font-weight: 700; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.load-help { margin: 0; font-size: .88rem; }
.top-mem { list-style: none; margin: 14px 0 10px; padding: 0; text-align: left; }
.top-mem li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.top-mem li:first-child { border-top: 0; }
.tm-name { font-weight: 600; overflow-wrap: anywhere; }
.tm-mb { font-variant-numeric: tabular-nums; white-space: nowrap; }
.load-cpu { margin-top: 10px !important; font-variant-numeric: tabular-nums; }

/* Stripe LIVE help page */
.sh-card h1 { padding-right: 44px; }
.sh-steps { margin: 8px 0 0; padding-left: 1.4em; }
.sh-steps li { padding: 8px 0; border-top: 1px solid var(--border); }
.sh-steps li:first-child { border-top: 0; }
.sh-steps strong { display: block; margin-bottom: 2px; }
.sh-steps span { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.sh-sub { margin: 4px 0 0; padding-left: 1.1em; color: var(--muted); font-size: .92rem; }
.sh-sub li { padding: 1px 0; border: 0 !important; overflow-wrap: anywhere; }

/* Cancellation requests: dashboard box + details page */
.cr-box { border-left: 4px solid #e0a020; }
.cr-box h2 .sec { margin-left: 6px; vertical-align: middle; }
.cr-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cr-list li { border-top: 1px solid var(--border); }
.cr-list li:first-child { border-top: 0; }
.cr-list a { display: flex; gap: 6px 14px; align-items: baseline; padding: 9px 4px; text-decoration: none; color: inherit; flex-wrap: wrap; border-radius: 6px; }
.cr-list a:hover { background: var(--hover-tint); }
.cr-what { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cr-who { font-weight: 600; }
.cr-card .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 14px; }
.cr-card .kv dt { font-weight: 600; } .cr-card .kv dd { margin: 0; overflow-wrap: anywhere; }
.cr-note { font-size: .88rem; }
dialog.dlg-svc .svc-cancel-form { margin: 0 !important; padding: 0; display: flex; }   /* no extra gap/space around Avbestill */
dialog.dlg-svc .svc-cancel-form .btn { margin: 0 !important; }
.svc-cancel-sent { align-self: center; }
@media (max-width: 600px) { .cr-card .kv { grid-template-columns: 1fr; gap: 0; } .cr-card .kv dd { margin-bottom: 8px; } }
#confirmText { white-space: pre-line; }   /* a \n in a confirm text = new line */

/* Credit notes */
.cn-lines .cn-chk { width: 28px; } .cn-lines .cn-chk input { width: auto; margin: 0; }
.cn-lines .cn-amt { width: 110px; text-align: right; margin: 0; }
.cn-note { font-size: .88rem; }
.cn-cust { list-style: none; padding: 0; margin: 6px 0 0; } .cn-cust li { padding: 4px 0; }
.cn-card .head-row .btn { margin-right: 34px; }

