:root {
  --bg: #f2f4f7; --card: #fff; --text: #1f2933; --muted: #6b7785; --line: #e1e4e8;
  --brand: #1f3a4d; --accent: #2b7bb9;
  color-scheme: light;
  --phishing: #c62828; --spam: #ef8f00; --legitimate: #2e7d32; --unsure: #546e7a; --suspicious: #6a1b9a; --newsletter: #1565c0; --security_alert: #d84315;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.top { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 24px; padding: 0 24px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: 2px; }
.brand span { font-weight: 400; letter-spacing: 0; opacity: .8; margin-left: 4px; }
.top nav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.top nav a { color: #d6e4ef; }
.top nav a:hover { color: #fff; text-decoration: none; }
.logout { display: flex; align-items: center; gap: 10px; color: #d6e4ef; }
.logout button { background: transparent; border: 1px solid #5d7a90; color: #fff; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.grid2 .card { margin-bottom: 0; }
.grid2 + .card, .card + .grid2 { margin-top: 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.tile-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.tile-value { font-size: 28px; font-weight: 700; margin: 2px 0; }
.tile-sub { color: var(--muted); font-size: 12px; }
.tile-ok { border-left: 4px solid var(--legitimate); }
.tile-bad { border-left: 4px solid var(--phishing); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 6px 8px; }
td { border-bottom: 1px solid #f0f2f4; padding: 7px 8px; vertical-align: top; }
dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; color: #fff; }
.badge-phishing { background: var(--phishing); }
.badge-spam { background: var(--spam); }
.badge-legitimate { background: var(--legitimate); }
.badge-unsure { background: var(--unsure); }
.badge-suspicious { background: var(--suspicious); }
.badge-newsletter { background: var(--newsletter); }
.badge-security_alert { background: var(--security_alert); }
.badge-none { background: #cfd6dd; color: #555; }

button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
button:hover { filter: brightness(.95); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select { font: inherit; padding: 6px 10px; border: 1px solid #cfd6dd; border-radius: 6px; background: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type=search] { flex: 1; min-width: 200px; }
form.inline { display: flex; gap: 6px; }
.verdict-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.verdict-buttons button { color: #fff; border: 0; font-weight: 600; }
.btn-phishing { background: var(--phishing); }
.btn-spam { background: var(--spam); }
.btn-legitimate { background: var(--legitimate); }
.btn-unsure { background: var(--unsure); }
.btn-suspicious { background: var(--suspicious); }
.btn-newsletter { background: var(--newsletter); }
.btn-security_alert { background: var(--security_alert); }

.login { max-width: 360px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.login label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.login input { display: block; width: 100%; margin-top: 4px; }
.login button { width: 100%; background: var(--brand); color: #fff; border: 0; padding: 9px; }

.flash { background: #e8f4fd; border: 1px solid #b6dcf5; border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; }
.error { color: var(--phishing); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: Consolas, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.pos { color: var(--phishing); font-weight: 600; }
.neg { color: var(--legitimate); font-weight: 600; }
.run { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.run:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

.chart { width: 100%; max-height: 220px; }
.chart .axis { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.bar-phishing { fill: var(--phishing); background: var(--phishing); }
.bar-spam { fill: var(--spam); background: var(--spam); }
.bar-legitimate { fill: var(--legitimate); background: var(--legitimate); }
.bar-unsure { fill: var(--unsure); background: var(--unsure); }
.bar-suspicious { fill: var(--suspicious); background: var(--suspicious); }
.bar-newsletter { fill: var(--newsletter); background: var(--newsletter); }
.bar-security_alert { fill: var(--security_alert); background: var(--security_alert); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  dl { grid-template-columns: 1fr; }
  .top { padding: 8px 16px; }
}
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 4px; }
.narrow { max-width: 560px; }
.links { margin-top: 14px; text-align: center; }
form.stacked label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
form.stacked input { display: block; width: 100%; max-width: 360px; margin-top: 4px; }
td form.inline { display: inline-flex; }
form.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2f6; border-radius: 12px; padding: 2px 8px; margin: 0 6px 6px 0; }
form.chip button.link { color: var(--muted); font-size: 12px; }
form.add-email { margin-top: 4px; }
form.add-email input { width: 220px; padding: 3px 8px; }
form.add-email button { padding: 3px 10px; }
form.stacked textarea { display: block; width: 100%; max-width: 480px; margin-top: 4px; font: inherit; padding: 6px 10px; border: 1px solid #cfd6dd; border-radius: 6px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 20px; align-items: end; }
.grid-form input { max-width: none !important; }
.customer-name { color: #d6e4ef; font-size: 13px; }
.customer-name a { color: #fff; text-decoration: underline; }
form.wrap { flex-wrap: wrap; }
.choose-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.choose-row button { min-width: 220px; text-align: left; font-weight: 600; }
.tile-value.small-value { font-size: 18px; margin-top: 8px; }
.costbox { background: #f7f9fb; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 8px 0 4px; }
.cost-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 8px; }
.costbar { width: 100%; height: 14px; border-radius: 4px; display: block; margin-bottom: 8px; }
.costtable td, .costtable th { padding: 3px 6px; font-size: 12px; }
.drivers { margin: 8px 0 0; padding-left: 18px; }
.preset-note { grid-column: 1 / -1; color: var(--muted); margin: 0; }
a.button-link { display: inline-block; font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); margin-right: 4px; }
a.button-link:hover { text-decoration: none; filter: brightness(.95); }
fieldset.checks { border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px 4px; margin: 4px 0 12px; }
fieldset.checks legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
label.check { display: block; color: var(--text) !important; font-size: 13.5px; margin-bottom: 8px; }
label.check input { display: inline !important; width: auto !important; margin: 0 6px 0 0; }
.new-vendor { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.verdict-form textarea { display: block; width: 100%; margin: 4px 0 8px; font: inherit; padding: 6px 10px; border: 1px solid #cfd6dd; border-radius: 6px; }
.verdict-form .verdict-buttons { margin-top: 8px; }
.usagebar { width: 100%; max-width: 220px; height: 8px; display: block; margin: 4px 0 2px; }
.bar-ok { fill: var(--legitimate); }
.bar-warn { fill: var(--spam); }
.bar-over { fill: var(--phishing); }
.warn-text { color: #b06a00; }
.tile-warn { border-left: 4px solid var(--spam); }
.tile-of { font-size: 14px; font-weight: 400; color: var(--muted); }
td.usagecell { min-width: 170px; }
.msg { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.msg-in { background: #fff; }
.msg-out { background: #f2f8fd; border-color: #cfe3f4; }
.msg-note { background: #fff8e1; border-color: #f3dfa6; }
.msg-draft { border: 2px dashed var(--spam); background: #fffaf0; }
.msg-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; }
.msg-body { white-space: normal; line-height: 1.5; }
textarea.full { display: block; width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #cfd6dd; border-radius: 6px; margin-bottom: 8px; }

/* MFA */
.mfa-qr { width: 220px; height: 220px; margin: 8px 0 12px; background: #fff; }
.mfa-qr svg { width: 100%; height: 100%; }
ul.codes { columns: 2; list-style: none; padding: 12px 16px; background: #f6f8fa; border-radius: 6px; font-size: 15px; }
ul.codes li { padding: 3px 0; }
button.linkish { background: none; border: none; color: var(--muted); padding: 0; text-decoration: underline; cursor: pointer; }
@media print { header, nav, .flash, button, a.button-link { display: none !important; } }
tr.subrow td { border-top: none; }
button.primary { background: var(--accent, #2b7bb9); color: #fff; border-color: transparent; }

/* Grouped top menu: opens on hover, keyboard focus or tap (focus-within) */
.top nav.menu { gap: 4px; align-items: stretch; }
.menu-group { position: relative; }
.menu-head { background: none; border: none; color: #d6e4ef; font: inherit; padding: 16px 12px; cursor: pointer; border-radius: 0; }
.menu-head::after { content: " ▾"; font-size: 11px; opacity: .7; }
.menu-group.current .menu-head { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); }
.menu-group:hover .menu-head, .menu-group:focus-within .menu-head { color: #fff; background: rgba(255,255,255,.08); }
.menu-items { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; background: #fff; border: 1px solid var(--line);
  border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px 0; z-index: 50; }
.menu-group:hover .menu-items, .menu-group:focus-within .menu-items { display: block; }
.top nav.menu .menu-items a { display: block; color: var(--text); padding: 8px 16px; white-space: nowrap; }
.top nav.menu .menu-items a:hover { background: #f1f4f7; text-decoration: none; }
.top nav.menu .menu-items a.active { font-weight: 600; color: var(--accent); }
@media (max-width: 700px) {
  .top nav.menu { flex-direction: column; width: 100%; }
  .menu-items { position: static; box-shadow: none; border: none; background: rgba(255,255,255,.06); }
  .top nav.menu .menu-items a { color: #d6e4ef; }
}

/* Server status */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; border-left: 4px solid; background: #fff; }
.alert-bad { border-color: var(--phishing); background: #fdecec; }
.alert-warn { border-color: #e0a100; background: #fff7e0; }
.alert-ok { border-color: var(--legitimate); background: #eaf6ec; }
svg.meter { display: block; width: 100%; margin: 4px 0; border-radius: 4px; }
svg.meter .meter-bg { fill: #e8ecf0; }
svg.meter .meter-fill { fill: var(--accent); }
svg.meter .meter-fill.warn { fill: #e0a100; }
svg.meter .meter-fill.bad { fill: var(--phishing); }
.top nav.menu a.menu-link { color: #d6e4ef; padding: 16px 12px; }
.top nav.menu a.menu-link:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.top nav.menu a.menu-link.current { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); }

/* Portal: the customer the user is working on, clearly visible in the header */
.customer-name { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: #fff;
  padding: 4px 0 4px 20px; border-left: 1px solid rgba(255,255,255,.25); }
.customer-name .customer-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  color: var(--brand); background: #d6e4ef; padding: 2px 7px; border-radius: 4px; }
.customer-name a.switch { font-size: 12px; font-weight: 400; color: #d6e4ef; border: 1px solid #5d7a90; border-radius: 12px; padding: 1px 9px; }
.customer-name a.switch:hover { color: #fff; text-decoration: none; }
@media (max-width: 700px) { .customer-name { border-left: 0; padding-left: 0; } }

/* Public product page (intake.tegra-systems.dk) */
body.site .top { position: sticky; top: 0; z-index: 40; }
body.site .login-link { color: #fff; border: 1px solid #5d7a90; border-radius: 6px; padding: 5px 14px; margin-left: auto; }
body.site .login-link.lang-link { margin-left: 8px; }
body.site .login-link:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.site-main { max-width: 1080px; margin: 0 auto; padding: 32px 20px 48px; }
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: center; margin: 12px 0 28px; }
.hero h1 { display: block; font-size: 34px; line-height: 1.2; margin: 6px 0 14px; color: var(--brand); }
.eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0; }
.lead { font-size: 17px; color: #3b4754; }
a.cta { display: inline-block; background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 6px; font-weight: 600; margin: 8px 8px 0 0; }
a.cta:hover { text-decoration: none; filter: brightness(1.08); }
a.cta.secondary { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.hero-card { background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(31,58,77,.15); overflow: hidden; }
.reply-banner { background: #b3261e; color: #fff; font-weight: 600; padding: 12px 18px; }
.reply-body { padding: 14px 18px 6px; }
.reply-body ul { padding-left: 18px; margin: 10px 0; }
.reply-body li { margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.facts div { background: var(--brand); color: #fff; border-radius: 8px; padding: 16px 18px; }
.facts strong { display: block; font-size: 20px; }
.facts span { color: #d6e4ef; font-size: 13.5px; }
.site-section { padding: 26px 28px; margin-bottom: 20px; scroll-margin-top: 70px; }
.site-section h2 { margin-top: 0; color: var(--brand); font-size: 23px; }
.compare { border-radius: 8px; padding: 4px 18px; }
.compare.bad { background: #fdf0ef; }
.compare.good { background: #eaf6ec; }
ol.steps { list-style: none; counter-reset: step; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
ol.steps li { counter-increment: step; background: #f6f8fa; border-radius: 8px; padding: 16px 18px 16px 58px; position: relative; }
ol.steps li::before { content: counter(step); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
ol.steps strong { display: block; margin-bottom: 4px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px 22px; }
.features h3, .features h4 { margin: 10px 0 4px; color: var(--brand); }
.features p { margin: 0; color: #3b4754; }
.small-features { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
ul.checks { list-style: none; padding: 0; }
ul.checks li { padding: 6px 0 6px 30px; position: relative; }
ul.checks li::before { content: "✓"; position: absolute; left: 4px; color: var(--legitimate); font-weight: 700; }
.contact-form label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.contact-form input[type=text], .contact-form input[type=email], .contact-form input[type=tel], .contact-form textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font: inherit; padding: 8px 10px; border: 1px solid #cfd6dd; border-radius: 6px; color: var(--text); }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
  .hero, .facts, ol.steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 27px; }
  body.site .top { position: static; }
}
/* Umbrella page (tegra-systems.dk) */
.brand a { color: inherit; }
.brand a:hover { text-decoration: none; }
.hero-card.network { padding: 22px; background: linear-gradient(160deg, #1f3a4d, #2b5470); }
.net-node { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px;
  padding: 10px 12px; text-align: center; font-weight: 600; font-size: 14px; }
.net-node span { display: block; font-weight: 400; font-size: 12px; color: #d6e4ef; }
.net-node.core { background: var(--accent); border-color: transparent; font-size: 16px; margin-bottom: 26px; position: relative; }
.net-node.core::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -18px; height: 12px;
  border: 2px solid rgba(255,255,255,.35); border-top: none; border-radius: 0 0 8px 8px; }
.net-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.product { background: #f6f8fa; border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; }
.product h3 { margin: 10px 0 6px; color: var(--brand); font-size: 18px; }
.product p { color: #3b4754; }
.product .checks { margin-top: 0; }
.product p:last-child { margin-top: auto; }
/* A new API key, shown once */
.secret-key { font-size: 15px; padding: 10px 12px; background: #f4f6f8; border: 1px dashed #cfd6dd; border-radius: 6px; user-select: all; }
/* Customer page (admin) */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 { margin-right: 6px; }
/* feed.tegra-systems.dk: example list in the hero */
.hero-card.feed-sample { background: #10212d; color: #d6e4ef; }
.feed-sample-head { background: #1f3a4d; color: #fff; font-size: 13px; font-weight: 600; padding: 10px 16px; }
.feed-sample pre { margin: 0; padding: 14px 16px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: #cfe8d4; }
.feed-sample-foot { font-size: 12px; color: #9fb8cc; padding: 0 16px 12px; }
/* Safe view of a reported mail (admin): filtered HTML, links as text with the real address */
.mailbody { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; max-height: 640px; overflow: auto; background: #fff; overflow-wrap: anywhere; }
.mailbody table { width: auto; }
.mail-link { text-decoration: underline dotted; color: #1f5f99; }
.mail-href { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #a3261c; background: #fdecec; border-radius: 3px; padding: 0 3px; }
.mail-img { color: #6b7785; font-style: italic; font-size: 12px; }
.mailtext { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 640px; overflow: auto; background: #f6f8fa; padding: 12px; border-radius: 6px; font-size: 13px; }
.mailheaders td:first-child { width: 1%; }
/* Popup windows (safe mail view): no menu, full width */
main.bare { max-width: none; padding-top: 16px; }
/* Help robot in the portal */
.helpchat .help-q { margin: 14px 0 6px auto; max-width: 80%; background: #eaf2fa; border-radius: 10px 10px 2px 10px; padding: 8px 12px; }
.helpchat .help-a { margin: 0 auto 14px 0; max-width: 85%; background: #f6f8fa; border-radius: 10px 10px 10px 2px; padding: 8px 12px; }
.helpchat .help-a p { margin: 6px 0 0; }
.helpchat .help-urgent { background: #fdecec; }
/* Sortable tables (click a header) */
table.sortable th.sort-head { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th.sort-head:hover { color: var(--accent); }
table.sortable th.sort-head::after { content: " ↕"; color: #b8c2cc; font-size: 11px; }
table.sortable th[data-dir="desc"]::after { content: " ▼"; color: var(--accent); }
table.sortable th[data-dir="asc"]::after { content: " ▲"; color: var(--accent); }

/* Edit panel (AI engines) */
.edit-panel { background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; }
.edit-panel h3 { margin: 0 0 10px; font-size: 15px; color: var(--brand); }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.edit-grid fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px 4px; background: #fff; margin: 0; min-width: 0; }
.edit-grid legend { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 0 4px; }
.edit-grid label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.edit-grid label input[type=text], .edit-grid label input[type=number], .edit-grid label input[type=password], .edit-grid label select {
  display: block; width: 100%; max-width: none; box-sizing: border-box; margin-top: 4px; }
.edit-grid label.check { color: var(--text); }
.edit-grid .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.edit-grid .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.edit-actions .right { margin-left: auto; display: flex; gap: 8px; }
button.danger { color: var(--phishing); border-color: #f0c4c1; }

/* Monthly DMARC report (two A4 pages; Print -> Save as PDF) */
.report { max-width: 820px; margin: 0 auto; }
.report-page { background: #fff; border: 1px solid #dde3e9; border-radius: 8px; padding: 32px 36px; margin-bottom: 20px; }
.report-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid #2b7bb9; padding-bottom: 12px; margin-bottom: 16px; }
.report-head h1 { margin: 4px 0 0; font-size: 24px; }
.report-brand { font-size: 11px; letter-spacing: 1px; font-weight: 700; color: #2b7bb9; }
.report-domain { margin: 2px 0 0; font-size: 15px; color: #5f6b78; }
.report-meta { text-align: right; font-size: 12px; color: #5f6b78; white-space: nowrap; }
.report-sample { background: #fdf6e7; border: 1px solid #ef8f00; color: #7a4a00; border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 600; }
.report-status { border-radius: 8px; padding: 16px 20px; margin: 14px 0 18px; color: #fff; }
.report-status p { margin: 6px 0 0; color: #fff; }
.report-status-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; opacity: .85; }
.report-status-word { font-size: 30px; font-weight: 700; }
.report-ok { background: #2e7d32; } .report-warn { background: #d97706; } .report-info { background: #546e7a; }
.report-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.report-tile { border: 1px solid #dde3e9; border-radius: 8px; padding: 12px 14px; }
.report-tile .tile-value { font-size: 30px; font-weight: 700; }
.report-tile .tile-value.report-small { font-size: 17px; line-height: 1.3; padding: 7px 0; }
.report-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.report-table th, .report-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #e6eaee; vertical-align: top; }
.report-actions { padding-left: 20px; } .report-actions li { margin-bottom: 8px; }
@media print {
  header, nav, .no-print, .menu, footer, .top { display: none !important; }
  body { background: #fff !important; }
  .report-page { border: 0; border-radius: 0; padding: 0; margin: 0; page-break-after: always; min-height: 250mm; }
  .report-page:last-child { page-break-after: auto; }
  .report-status, .badge, .report-ok, .report-warn, .report-info { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Public list prices on the product page */
.price-table { border-collapse: collapse; margin: 8px 0 12px; }
.price-table td { padding: 8px 18px 8px 0; border-bottom: 1px solid #e6eaee; }

/* Running trial, shown to the customer's admins and viewers */
.trial-banner { background: #e8f3ea; border-bottom: 1px solid #b7d9bc; color: #1b5e20; padding: 8px 20px; font-size: 14px; font-weight: 600; }

/* Cookie information bar and privacy page (public sites) */
.cookie-info { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--brand); color: #fff; padding: 12px 16px;
  display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; box-shadow: 0 -2px 8px rgba(0,0,0,.15); }
.cookie-info p { margin: 0; max-width: 760px; }
.cookie-info a { color: #cfe6f7; text-decoration: underline; }
.cookie-info button { background: #fff; color: var(--brand); border: 0; border-radius: 6px; padding: 7px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.cookie-info button:focus-visible { outline: 3px solid #cfe6f7; outline-offset: 2px; }
.privacy { max-width: 820px; margin: 0 auto; padding: 24px 16px 60px; }
.privacy h2 { margin-top: 28px; }
.privacy table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 13px; }
.privacy th, .privacy td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }

/* Agreements (the data processing agreement) */
.agreement { line-height: 1.55; }
.agreement h3 { margin-top: 22px; color: var(--brand); text-transform: none; letter-spacing: 0; font-size: 15px; }
.agreement h4 { margin: 14px 0 6px; font-size: 13.5px; }
.agreement table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 13px; }
.agreement th, .agreement td { text-align: left; vertical-align: top; padding: 6px 9px; border: 1px solid var(--line); }
.agreement th { background: #eef3f8; }
.agreement-list { list-style: none; padding-left: 0; } .agreement-list .num { font-weight: 600; display: inline-block; min-width: 2.2em; }
@media print { header, nav, .flash, .trial-banner, form, [data-print], .filters { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: 0; } }

/* Long tables inside a card scroll on their own (header stays visible), so the page does not get so long */
.tscroll { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.tscroll table { margin: 0; }
.tscroll th { position: sticky; top: 0; background: #f6f8fa; z-index: 1; }

/* Preformatted text that wraps (mail previews) */
.preformat { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; font-family: inherit; }

/* Langdock API key: what is in place, when it was added and when it expires */
.key-box { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 10px 0 6px; padding: 14px 18px; background: #f6f8fa; border-radius: 10px; }
.key-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #5b6772; }
.key-value { font-size: 22px; font-weight: 600; }
.key-value.warn { color: #b26a00; }
.key-value.error { color: #b3261e; }

/* Small screens (phones): bigger touch targets, no zoom on focus, filters and forms stacked, tables scroll sideways inside their card */
@media (max-width: 700px) {
  body { font-size: 15px; }
  main { padding: 16px 10px 40px; }
  .card { padding: 14px 12px; }
  h1 { font-size: 20px; flex-wrap: wrap; }
  input, select, textarea { font-size: 16px; }            /* iOS zooms into smaller fields */
  button, a.button-link, select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="date"], input[type="number"] { min-height: 40px; }
  .filters, .inline.wrap { flex-direction: column; align-items: stretch; gap: 8px; }
  .filters > *, .inline.wrap > * { width: 100%; max-width: none; }
  .filters input[size], .inline.wrap input[size] { width: 100%; }
  form.stacked input { max-width: none; }
  .top { gap: 6px; }
  .top nav.menu a.menu-link, .menu-head { padding: 12px 10px; width: 100%; text-align: left; }
  .menu-group { width: 100%; }
  .menu-items { min-width: 0; width: 100%; }
  .top nav.menu .menu-items a { padding: 12px 22px; white-space: normal; }
  .logout { width: 100%; justify-content: space-between; padding-bottom: 6px; }
  table { font-size: 13px; }
  th, td { padding: 6px 8px; }
  main > table, section > table { display: block; overflow-x: auto; max-width: 100%; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 12px; }
  .key-box { gap: 10px 24px; }
  pre, .mono.block { overflow-x: auto; max-width: 100%; }
}

/* server graphs */
svg.chart { display: block; width: 100%; height: auto; margin: 4px 0 14px; }
svg.chart .chart-grid { stroke: #e0e5ea; stroke-width: 1; }
svg.chart .chart-txt { fill: #5a6772; font-size: 10px; }
svg.chart .chart-gap { fill: rgba(198, 40, 40, .14); }
svg.chart .chart-ref { stroke: #e0a100; stroke-width: 1; stroke-dasharray: 4 3; }
svg.chart .chart-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
svg.chart .chart-line.c1, svg.chart .chart-dot.c1 { stroke: var(--accent); fill: none; }
svg.chart .chart-line.c2, svg.chart .chart-dot.c2 { stroke: #ef8f00; fill: none; }
svg.chart .chart-line.c3, svg.chart .chart-dot.c3 { stroke: var(--legitimate); fill: none; }
svg.chart .chart-dot { stroke-width: 2; }
.swatch { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; }
.swatch.c1 { background: var(--accent); }
.swatch.c2 { background: #ef8f00; }
.swatch.c3 { background: var(--legitimate); }

/* long tables: a scroll bar inside the card, the header stays visible */
.scroll-box { max-height: 440px; overflow-y: auto; border-top: 1px solid #e0e5ea; border-bottom: 1px solid #e0e5ea; }
.scroll-box table { margin: 0; }
.scroll-box th { position: sticky; top: 0; background: #f4f6f8; z-index: 1; }
@media print { .scroll-box { max-height: none; overflow: visible; border: 0; } }
/* Lists to copy line by line (the CSP forbids inline styles): as wide as the text above, in the page's own font */
textarea.copybox { display: block; width: 100%; margin: 6px 0 8px; padding: 8px 10px; font: inherit; font-size: 15px; line-height: 1.5; border: 1px solid #cfd6dd; border-radius: 6px; background: #fbfcfd; color: var(--text); resize: vertical; }
.scrollbox { max-height: 380px; overflow-y: auto; border: 1px solid #e3e8ee; border-radius: 6px; margin: 6px 0 10px; }
.scrollbox table { margin: 0; }
.scrollbox th { position: sticky; top: 0; background: #f4f6f8; }
.blk-actions button { margin: 0 4px 6px 0; }
.filters input[type=search] { padding: 5px 8px; border: 1px solid #cfd6dd; border-radius: 6px; min-width: 200px; }
