/* Postfend theme — navy #0A1F44, teal #19C8A5, Logo A, self-hosted Sora */
@font-face{
  font-family:"Sora";
  src:url("fonts/Sora.woff2") format("woff2");
  font-weight:100 800;
  font-style:normal;
  font-display:swap;
}
:root{
  --brand-navy:#0A1F44; --brand-navy-deep:#07152E; --brand-teal:#19C8A5; --brand-teal-dark:#0F9C80;
  --bg:#E7EEF6; --card:#FFFFFF; --text:#0A1F44; --muted:#3E5270; --line:#D4DEEA;
  --danger:#B42318; --warn:#8A3B00; --ok:#067647;
  --font:"Sora", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow:0 1px 2px rgba(10,31,68,.05), 0 10px 28px rgba(10,31,68,.06);
  --radius:14px;
  --side:248px;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:var(--font);background:var(--bg);color:var(--text);font-size:15px;line-height:1.5;min-height:100vh}
a{color:var(--brand-navy)} a:hover{color:var(--brand-teal-dark)}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--brand-teal);outline-offset:2px}
.skip{position:absolute;left:-999px;top:8px;background:var(--brand-teal);color:var(--brand-navy-deep);padding:8px 12px;border-radius:8px;z-index:100;font-weight:700}
.skip:focus{left:12px}

/* ----- App shell: sidebar + main ----- */
.has-app{display:flex;min-height:100vh;background:
  radial-gradient(1200px 500px at 80% -10%, rgba(25,200,165,.12), transparent 50%),
  radial-gradient(800px 400px at 0% 100%, rgba(10,31,68,.06), transparent 50%),
  var(--bg)}
.sidebar{width:var(--side);flex:0 0 var(--side);background:linear-gradient(180deg,var(--brand-navy) 0%,var(--brand-navy-deep) 100%);color:#fff;display:flex;flex-direction:column;min-height:100vh;position:sticky;top:0;height:100vh;overflow-y:auto;z-index:40}
.brand{display:flex;align-items:center;padding:22px 20px 16px;text-decoration:none}
.brand img{height:38px;width:auto;max-width:100%;display:block}
.sidebar nav{display:flex;flex-direction:column;padding:6px 12px 16px;gap:2px;flex:1}
.sidebar nav a{display:flex;align-items:center;gap:10px;color:#D5DEEA;text-decoration:none;font-weight:600;font-size:13.5px;padding:8px 10px;border-radius:9px;border-left:3px solid transparent;margin-left:0}
.sidebar nav a:hover{background:rgba(25,200,165,.12);color:#fff}
.sidebar nav a.on{background:rgba(25,200,165,.16);color:var(--brand-teal);border-left-color:var(--brand-teal)}
.sidebar nav a .ico{width:18px;height:18px;flex:none}
.side-foot{padding:14px 16px 18px;border-top:1px solid rgba(255,255,255,.1);display:flex;flex-direction:column;gap:8px}
.side-foot .who-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.side-foot a.user{color:#fff;font-weight:600;font-size:13px;text-decoration:none}
.side-foot a.user:hover{color:var(--brand-teal)}
.badge{background:var(--brand-teal);color:var(--brand-navy-deep);border-radius:4px;padding:2px 8px;font-weight:700;font-size:11px;letter-spacing:.04em}
.shell{flex:1;min-width:0;display:flex;flex-direction:column}
.mobilebar{display:none}
main{max-width:1180px;width:100%;margin:0 auto;padding:28px 28px 12px;flex:1}
footer{max-width:1180px;width:100%;margin:0 auto;padding:8px 28px 28px;color:var(--muted);font-size:12px}
.nav-backdrop,.nav-toggle{display:none}

/* ----- Typography, cards, forms ----- */
h1{font-size:26px;font-weight:700;letter-spacing:-.02em;margin:0 0 6px;color:var(--brand-navy)}
h2{font-size:16px;font-weight:700;margin:0 0 10px;color:var(--brand-navy)}
h3{font-size:15px;font-weight:700;margin:0 0 6px}
.pagehead{margin-bottom:18px}
.pagehead .lead,.lead{margin:0 0 4px;color:var(--muted);max-width:62rem}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:20px 22px;margin-bottom:16px;box-shadow:var(--shadow);min-width:0;max-width:100%}
.card>h2:first-child{display:flex;align-items:center;gap:8px}
.card h2 .ico{color:var(--brand-teal-dark);width:18px;height:18px}
table{width:100%;max-width:100%;border-collapse:separate;border-spacing:0;font-size:14px}
th,td{text-align:left;padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:break-word}
th{overflow-wrap:normal;word-break:normal;hyphens:none}
table.domains{width:100%;table-layout:fixed}
table.domains th:nth-child(1),table.domains td:nth-child(1){width:auto}
table.domains th:nth-child(2),table.domains td:nth-child(2){width:38%}
table.domains td.actions-col,table.domains th:nth-child(3){width:9.25rem}
table.domains .actions{flex-direction:column;align-items:stretch;gap:6px}
table.domains .actions .btn,table.domains .actions button{width:100%;justify-content:flex-start}
table.domains .dom-name{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:4px}
.mx-status{overflow-wrap:break-word;word-break:normal}
.tablewrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.shell,main{min-width:0}
th{color:var(--muted);font-weight:600;font-size:12px;letter-spacing:.02em;background:#F4F7FB}
tr:first-child th:first-child{border-radius:8px 0 0 0} tr:first-child th:last-child{border-radius:0 8px 0 0}
tr:has(td):hover td{background:#F7FBFA}
input[type=text],input[type=password],input[type=number],input[type=email],select,textarea{
  border:1px solid #B8C2D3;border-radius:8px;padding:8px 10px;font:inherit;background:#fff;color:var(--text)
}
input:hover,select:hover,textarea:hover{border-color:#8AA0BD}
button,.btn{background:var(--brand-navy);color:#fff;border:0;border-radius:8px;padding:8px 16px;font:inherit;font-weight:700;cursor:pointer;text-decoration:none;display:inline-block;line-height:1.3;box-shadow:0 1px 2px rgba(10,31,68,.15)}
button:hover,.btn:hover{filter:brightness(1.08)}
button.teal,.btn.teal{background:var(--brand-teal);color:var(--brand-navy-deep);box-shadow:0 1px 2px rgba(15,156,128,.25)}
button.danger{background:var(--danger);color:#fff}
button.light,.btn.light{background:#E8EDF5;color:var(--text);box-shadow:none}
button.small,.btn.small{height:32px;padding:0 12px;font-size:13px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;line-height:1;box-sizing:border-box;margin:0}
button.small .ico,.btn.small .ico{width:14px;height:14px;flex:none}
.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.actions form{margin:0;display:inline-flex}
.btn.ghost,button.ghost{background:#fff;color:var(--brand-navy);border:1px solid #B8C2D3;box-shadow:none}
.btn.ghost:hover,button.ghost:hover{background:#E8EDF5;border-color:var(--brand-navy);filter:none}
.btn.danger-outline,button.danger-outline{background:#fff;color:var(--danger);border:1px solid #F5C2C0;box-shadow:none}
.btn.danger-outline:hover,button.danger-outline:hover{background:#FEF3F2;border-color:var(--danger);filter:none}
.mx-status{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-weight:600;line-height:1.35}
.mx-status .ico{width:16px;height:16px;flex:none}
.mx-status.ok{color:var(--ok)}
.mx-status.warn{color:var(--warn)}
.mx-status.todo,.mx-status.unknown{color:var(--muted);font-weight:500}
.mx-status .mono{font-weight:600}
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}
.row label{display:flex;flex-direction:column;font-size:13px;color:var(--muted);gap:3px;font-weight:600}

/* ----- Metrics / tiles ----- */
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px}
.metric{background:linear-gradient(180deg,#fff 0%,#F6FAF9 100%);border:1px solid var(--line);border-radius:var(--radius);padding:16px 16px 14px;box-shadow:var(--shadow);min-width:0;position:relative;overflow:hidden}
.metric b{font-size:26px;display:block;color:var(--brand-navy);letter-spacing:-.03em;line-height:1.15;margin:4px 0 2px}
.metric b a{color:inherit;text-decoration:none}
.metric b a:hover{color:var(--brand-teal-dark)}
.metric-icon{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:rgba(10,31,68,.08);color:var(--brand-navy);margin-bottom:4px}
.metric-icon .ico{width:20px;height:20px}
.metric.m-teal{background:linear-gradient(180deg,#E6F9F4 0%,#fff 72%);border-color:#B6EBDE}
.metric.m-teal .metric-icon{background:var(--brand-teal);color:var(--brand-navy-deep)}
.metric.m-navy{background:linear-gradient(180deg,#E7EDF6 0%,#fff 72%);border-color:#C5D0E0}
.metric.m-navy .metric-icon{background:var(--brand-navy);color:var(--brand-teal)}
.metric.m-amber{background:linear-gradient(180deg,#FFF6E5 0%,#fff 72%);border-color:#F3D7A0}
.metric.m-amber .metric-icon{background:#F3C96B;color:var(--brand-navy-deep)}
.metric.m-rose{background:linear-gradient(180deg,#FDECEC 0%,#fff 72%);border-color:#F5C2C0}
.metric.m-rose .metric-icon{background:#F4B4B0;color:#7A1C16}

/* ----- Pills, flashes, bars ----- */
.flash{padding:12px 14px;border-radius:10px;margin-bottom:16px;border:1px solid;font-weight:500}
.flash.ok{background:#ECFDF3;border-color:#ABEFC6;color:var(--ok)}
.flash.err{background:#FEF3F2;border-color:#FECDCA;color:var(--danger)}
.flash.warn{background:#FFFAEB;border-color:#F5D08A;color:var(--warn)}
.pill{display:inline-block;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:700;background:#E8EDF5;color:var(--brand-navy);letter-spacing:.01em;white-space:nowrap;line-height:1.35;max-width:none;overflow-wrap:normal}
.pill.held,.pill.pending{background:#FFFAEB;color:var(--warn)}
.pill.released,.pill.verified,.pill.attested,.pill.active{background:#ECFDF3;color:var(--ok)}
.pill.virus,.pill.deleted,.pill.suspended,.pill.lapsed,.pill.disabled,.pill.blocked{background:#FEF3F2;color:var(--danger)}
.pill.ok{background:#ECFDF3;color:var(--ok)}
.pill.warn,.pill.todo{background:#FFFAEB;color:var(--warn)}
.pill.bad{background:#FEF3F2;color:var(--danger)}
.pill.unknown{background:#E8EDF5;color:var(--muted)}
.muted{color:var(--muted)} .mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;overflow-wrap:anywhere}
pre.preview{white-space:pre-wrap;word-break:break-word;background:#F8FAFC;border:1px solid var(--line);padding:12px;border-radius:8px;max-height:520px;overflow:auto}
.bar{height:8px;background:#E8EDF5;border-radius:6px;overflow:hidden;margin-top:6px}
.bar span{display:block;height:100%;background:var(--brand-teal)}
.bar.over span{background:var(--danger)}

/* ----- Empty states ----- */
.empty{text-align:center;padding:28px 16px;color:var(--muted)}
.empty-art{width:64px;height:64px;margin:0 auto 10px;border-radius:18px;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#E6F9F4,#E7EDF6);color:var(--brand-navy);border:1px solid #C9EDE4}
.empty-art .ico-lg{width:32px;height:32px;color:var(--brand-teal-dark)}
.empty h3{color:var(--brand-navy);margin:0 0 4px;font-size:16px}
.empty p{margin:0 auto;max-width:36rem}

/* ----- Login ----- */
.login-wrap{min-height:100vh;display:grid;grid-template-columns:1fr 1fr;background:var(--brand-navy-deep)}
.login-hero{display:flex;flex-direction:column;justify-content:center;padding:48px 56px;color:#fff;background:
  radial-gradient(600px 400px at 20% 20%, rgba(25,200,165,.28), transparent 60%),
  radial-gradient(500px 300px at 90% 80%, rgba(25,200,165,.12), transparent 50%),
  linear-gradient(160deg,var(--brand-navy-deep),var(--brand-navy));position:relative;overflow:hidden}
.login-hero img.logo{height:48px;width:auto;margin-bottom:28px}
.login-hero h1{color:#fff;font-size:32px;margin:0 0 10px;letter-spacing:-.03em}
.login-hero p{color:#C9D3E3;max-width:28rem;margin:0 0 28px;font-size:16px}
.login-hero .art{width:min(100%,420px);height:auto;display:block}
.login{background:#fff;border-radius:0;padding:0;width:auto;min-height:100vh;display:flex;flex-direction:column;justify-content:center;padding:48px 56px;box-shadow:none}
.login .login-card{width:100%;max-width:400px}
.login img.logo-light{height:44px;margin-bottom:8px}
.login label{display:block;font-size:13px;color:var(--muted);margin:12px 0 4px;font-weight:600}
.login input{width:100%}
.login button{width:100%;margin-top:18px;background:var(--brand-teal);color:var(--brand-navy-deep);padding:12px 16px;font-size:16px}
.login .mono{word-break:break-all}

/* ----- DNS setup guide ----- */
.steps{counter-reset:step;list-style:none;padding:0;margin:0}
.steps>li{position:relative;padding:0 0 22px 48px;border-left:2px solid #C9EDE4;margin-left:16px}
.steps>li:last-child{border-left-color:transparent}
.steps>li::before{counter-increment:step;content:counter(step);position:absolute;left:-16px;top:-2px;width:30px;height:30px;border-radius:50%;background:var(--brand-navy);color:var(--brand-teal);font-weight:700;display:flex;align-items:center;justify-content:center;font-size:14px;box-shadow:0 0 0 4px rgba(25,200,165,.28)}
.steps>li h3{font-size:16px;margin:0 0 6px}
.rec{display:grid;grid-template-columns:10.5rem minmax(0,1fr);gap:8px 16px;align-items:start;background:#F7FBFA;border:1px solid var(--line);border-left:4px solid var(--brand-teal);border-radius:10px;padding:12px 14px;margin:10px 0}
.rec-row{display:contents}
.rec-label{color:var(--muted);font-size:12px;font-weight:600;line-height:1.3;padding-top:5px}
.rec-value{display:flex;align-items:flex-start;gap:8px;min-width:0}
.rec-value code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:1.45;word-break:break-word;overflow-wrap:anywhere;background:#fff;border:1px solid var(--line);border-radius:5px;padding:4px 8px;min-width:0;flex:1 1 auto}
button.copy{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:4px;height:26px;padding:0 8px;font-size:12px;font-weight:600;line-height:1;background:#fff;color:var(--brand-navy);border:1px solid #B8C2D3;border-radius:5px;box-shadow:none;white-space:nowrap}
button.copy:hover{background:#E8EDF5;border-color:var(--brand-navy);filter:none}
button.copy.copied,button.copy.copied:hover{background:var(--brand-teal);color:var(--brand-navy-deep);border-color:var(--brand-teal-dark)}
button.copy .copy-icon{width:12px;height:12px;display:block;flex:none}
.status td:first-child{width:130px;font-weight:600}
.tips dt{font-weight:700;margin-top:10px;color:var(--brand-navy)} .tips dd{margin:2px 0 0 0}

/* ----- Spam stats ----- */
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}
.seg a{padding:7px 14px;text-decoration:none;color:var(--text);font-weight:600;font-size:14px}
.seg a.on{background:var(--brand-navy);color:#fff}
.btn.light{background:#E8EDF5;color:var(--text);padding:6px 12px;font-size:13px}
.tiles{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))} .tiles .metric b{font-size:26px}
a.metric{display:block;color:inherit;text-decoration:none;padding-right:28px;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}
a.metric:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(10,31,68,.12);border-color:var(--brand-teal);filter:none}
a.metric:focus{outline:2px solid var(--brand-teal);outline-offset:2px}
a.metric .metric-go{display:block;margin-top:8px;font-size:12px;font-weight:700;color:var(--brand-teal-dark)}
.evtable{table-layout:fixed;width:100%;max-width:100%;min-width:0}
.evtable td{vertical-align:top;font-size:13px}
.evtable .nowrap{white-space:normal}
.evtable th{overflow-wrap:normal;word-break:normal}
.evtable th:nth-child(1),.evtable td:nth-child(1){width:7rem}
.evtable th:nth-child(2),.evtable td:nth-child(2){width:14%}
.evtable th:nth-child(3),.evtable td:nth-child(3){width:13%}
.evtable th:nth-child(4),.evtable td:nth-child(4){width:13%}
.evtable th:nth-child(5),.evtable td:nth-child(5){width:12%}
.evtable th:nth-child(6),.evtable td:nth-child(6){width:auto}
.evtable th:nth-child(7),.evtable td:nth-child(7){width:12rem}
@media (max-width:1100px){
  table.stack.evtable{table-layout:auto;display:block;min-width:0 !important;max-width:100% !important;width:100% !important}
  table.stack.evtable tr{display:block;border-bottom:1px solid var(--line);padding:10px 0}
  table.stack.evtable td,table.stack.evtable th{display:block;border:0;padding:3px 0;background:transparent;width:auto !important;position:static !important;box-shadow:none}
  table.stack.evtable tr.head{display:none}
  table.stack.evtable .lbl{display:inline}
  .tablewrap:has(table.stack.evtable){overflow-x:visible}
}
.ev-conn{margin-top:4px;font-size:12px;overflow-wrap:anywhere}

.pill.connection{background:#E7EDF6;color:var(--brand-navy)}
.pill.spam_rejected{background:#FEF3F2;color:var(--danger)}
.pill.quarantined{background:#FFFAEB;color:var(--warn)}
.pill.tagged{background:#E8F4FF;color:#1849A9}
.pill.clean{background:#ECFDF3;color:var(--ok)}
.pill.tempfail{background:#E8EDF5;color:var(--muted)}
.pagehead .lead{color:var(--muted);margin:6px 0 0;max-width:46rem}
.chartwrap{width:100%;overflow:hidden} svg.chart{width:100%;height:auto;display:block}
.legend{display:flex;flex-wrap:wrap;gap:14px;font-size:13px;color:var(--muted);margin-top:8px}
.legend i,.sw{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:18px}
.hbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;margin-bottom:9px;font-size:14px;min-width:0} .hbar .bar{grid-column:1/3} .hbar .mono,.hbar a{min-width:0;overflow-wrap:anywhere;word-break:break-word}
td .lbl{display:none}
.ico{width:18px;height:18px;display:block;flex:none}

/* ----- Plan cards ----- */
.plan-card{border-top:4px solid var(--brand-teal)}
.plan-card h2{font-size:18px}

.sidebar .nav-close{display:none}
.side-foot button{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%}
.side-foot a.user{display:inline-flex;align-items:center;gap:6px}
/* ----- Mobile ----- */
@media (max-width:900px){
  .has-app{display:block}
  .sidebar{position:fixed;left:0;top:0;transform:translateX(-105%);transition:transform .2s ease;box-shadow:none;height:100%;}
  body.nav-open .sidebar{transform:none;box-shadow:8px 0 30px rgba(10,31,68,.35)}
  .nav-toggle{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;background:transparent;color:#fff;border:0;box-shadow:none;padding:0;border-radius:8px}
  .nav-toggle:hover{background:rgba(255,255,255,.1);filter:none}
  .nav-toggle .ico{width:22px;height:22px}
  .mobilebar{display:flex;align-items:center;gap:8px;background:var(--brand-navy);color:#fff;padding:8px 12px;position:sticky;top:0;z-index:30}
  .mobilebar img{height:28px;width:auto}
  .mobilebar .badge{margin-left:auto}
  .nav-backdrop{display:none;position:fixed;inset:0;background:rgba(7,21,46,.5);z-index:35}
  body.nav-open .nav-backdrop{display:block}
  .sidebar .nav-close{display:flex;margin:8px 8px 0 auto}
  main,footer{padding-left:16px;padding-right:16px}
  .login-wrap{grid-template-columns:1fr}
  .login-hero{padding:28px 24px 20px;min-height:auto}
  .login-hero h1{font-size:24px}
  .login-hero .art{max-width:240px}
  .login{min-height:auto;padding:28px 24px 48px;border-radius:20px 20px 0 0}
}
@media (max-width:720px){
  main{padding-top:18px} .card{padding:16px}
  .steps>li{padding-left:34px}
  .grid2{grid-template-columns:1fr}
}
@media (max-width:640px){
  table.stack{table-layout:auto;display:block;min-width:0 !important;max-width:100% !important;width:100% !important}
  table.stack tr{display:block;border-bottom:1px solid var(--line);padding:8px 0}
  table.stack td,table.stack th{display:block;border:0;padding:3px 0;background:transparent;width:auto !important;position:static !important;box-shadow:none}
  table.stack tr.head{display:none}
  td .lbl{display:inline}
  .tablewrap:has(table.stack){overflow-x:visible}
}
@media (max-width:520px){
  .rec{grid-template-columns:1fr;gap:0;padding:8px 12px}
  .rec-row{display:grid;grid-template-columns:1fr;gap:4px;padding:8px 0}
  .rec-row + .rec-row{border-top:1px solid var(--line)}
  .rec-label{padding-top:0}
  h1{font-size:22px}
}

/* ----- Security features (switches, locked rows) ----- */
.feat-list{display:flex;flex-direction:column}
.feat{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;align-items:center;padding:14px 0;border-top:1px solid var(--line)}
.feat:first-child{border-top:0;padding-top:4px}
.feat h3{font-size:15px;margin:0 0 3px;color:var(--brand-navy);display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.feat p{margin:0;color:var(--muted);font-size:13px;max-width:52rem}
.feat .feat-ctl{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.feat .feat-ctl form{margin:0;display:inline-flex}
.feat.locked h3{color:var(--muted)}
.feat.locked p{color:#8A94A6}
.tier{display:inline-block;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.02em;background:#E8EDF5;color:var(--brand-navy)}
.tier.t2{background:#E6F9F4;color:#0B6E5A}.tier.t3{background:#E7EDF6;color:#1D3A6E}.tier.t4{background:var(--brand-navy);color:var(--brand-teal)}
.lockpill{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:8px;background:#F2F4F7;color:var(--muted);font-size:13px;font-weight:600;white-space:nowrap}
.lockpill .ico{width:14px;height:14px}
button.switch{position:relative;width:52px;height:32px;padding:0;border-radius:999px;background:#C9D1DE;box-shadow:inset 0 1px 2px rgba(10,31,68,.2);flex:none}
button.switch::after{content:"";position:absolute;top:4px;left:4px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(10,31,68,.3);transition:left .15s ease}
button.switch.on{background:var(--brand-teal)}
button.switch.on::after{left:24px}
button.switch:focus-visible{outline:2px solid var(--brand-navy);outline-offset:2px}
.sw-state{font-size:13px;font-weight:700;min-width:2.2em;color:var(--muted)}
.sw-state.on{color:var(--ok)}
.note-box{background:#F7FBFA;border:1px solid var(--line);border-left:4px solid var(--brand-teal);border-radius:10px;padding:10px 14px;margin:10px 0;font-size:14px}
.note-box.warn{border-left-color:#F3C96B;background:#FFFBF0}
@media (max-width:640px){
  .feat{grid-template-columns:1fr}
  .feat .feat-ctl{justify-content:flex-start}
}

/* ---------- Spam stats redesign (2026-11) ---------- */
.glyph{display:inline-flex;align-items:center;justify-content:center;border-radius:14px;flex:none;background:color-mix(in srgb,var(--c) 14%,#fff);color:var(--c)}
.glyph .ico{width:55%;height:55%;stroke-width:2}
.st-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.st-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.st-hero{display:flex;align-items:center;gap:22px;background:linear-gradient(120deg,#0A1F44 0%,#12305F 60%,#0F4C5C 100%);color:#fff;border-radius:18px;padding:20px 22px;margin-bottom:16px;text-decoration:none;position:relative;overflow:hidden;box-shadow:0 10px 30px rgba(10,31,68,.18)}
.st-hero:hover{filter:brightness(1.05)}
.st-hero h2{color:#fff;margin:4px 0 6px;font-size:22px;letter-spacing:-.02em}
.st-hero p{color:#C9D6EA;margin:0 0 10px;max-width:560px}
.st-hero .eyebrow{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#7FE3CC}
.st-hero .st-go{color:#7FE3CC}
.st-hero .trend,.st-hero .trend.up,.st-hero .trend.down{background:rgba(255,255,255,.14);color:#fff}
.st-hero-text{flex:1;min-width:0}
.st-hero-art{width:190px;flex:none;opacity:.95}
.st-ring{flex:none}
.st-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;margin-bottom:16px}
.st-tile{display:flex;flex-direction:column;gap:4px;background:#fff;border:1px solid var(--line);border-top:4px solid var(--c);border-radius:16px;padding:16px;text-decoration:none;color:inherit;box-shadow:var(--shadow);transition:transform .12s,box-shadow .12s}
.st-tile:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(10,31,68,.12)}
.st-tile:focus{outline:2px solid var(--c);outline-offset:2px}
.st-tile-wide{background:linear-gradient(180deg,color-mix(in srgb,var(--c) 10%,#fff) 0%,#fff 70%)}
.st-tile-top{display:flex;align-items:center;gap:10px}
.st-tile-title{font-weight:700;color:var(--brand-navy);font-size:15px;line-height:1.25}
.st-num{font-size:34px;font-weight:700;color:var(--brand-navy);letter-spacing:-.03em;line-height:1.1;margin-top:6px;font-variant-numeric:tabular-nums}
.st-explain{margin:0;color:var(--muted);font-size:13.5px;line-height:1.4;min-height:38px}
.st-tile-foot{display:flex;flex-direction:column-reverse;align-items:flex-start;gap:8px;margin-top:6px}
.spark{display:block;width:100%;height:34px}
.st-go{font-size:12.5px;font-weight:700;color:var(--brand-teal-dark);margin-top:6px}
.trend{display:inline-block;font-size:12px;font-weight:700;padding:3px 8px;border-radius:999px;background:#EEF2F7;color:var(--brand-navy);white-space:nowrap}
.trend.up{background:#E7EDF6}.trend.down{background:#E6F9F4;color:#0B7A60}
.small{font-size:13px}
.tsender{display:grid;grid-template-columns:32px minmax(0,1fr) 30% auto;align-items:center;gap:10px;padding:7px 0;text-decoration:none;color:inherit;border-bottom:1px solid #F0F2F5}
.tsender:last-child{border-bottom:0}
.tsender:hover .tsender-name{color:var(--brand-teal-dark)}
.tsender-name{font-family:var(--mono,monospace);font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tsender b{font-variant-numeric:tabular-nums}
.avatar{width:32px;height:32px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:14px;flex:none}
.empty-ill{text-align:center;padding:18px 10px}
.empty-ill img{width:180px;max-width:70%}
.empty-ill h3{margin:8px 0 4px;color:var(--brand-navy)}
.empty-ill p{margin:0;color:var(--muted)}
/* drill-down */
.dd-hero{display:flex;align-items:center;gap:16px;background:linear-gradient(180deg,color-mix(in srgb,var(--c) 10%,#fff) 0%,#fff 100%);border:1px solid var(--line);border-left:6px solid var(--c);border-radius:18px;padding:18px;margin-bottom:8px;flex-wrap:wrap}
.dd-hero h1{margin:0;font-size:24px}
.dd-hero .lead{margin:4px 0 0}
.dd-hero-text{flex:1;min-width:220px}
.dd-hero-num{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.dd-hero-num .ring circle:first-child{stroke:#E8EDF5}.dd-hero-num .ring text{fill:var(--brand-navy)}
.dd-trend{display:flex;align-items:center;gap:8px}.dd-trend .spark{width:120px}
.dd-client{font-size:16px;font-weight:600}
.dd-more{margin:0 0 14px;color:var(--muted)}.dd-more summary{cursor:pointer;font-weight:600;color:var(--brand-navy);font-size:14px}.dd-more p{margin:6px 0 0}
.dd-split{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.dd-split-i{display:inline-flex;align-items:center;gap:6px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:5px 12px;font-size:13px}
.dd-split-i i{width:10px;height:10px;border-radius:50%;background:var(--c)}
.dd-filter{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.dd-search{flex:1;min-width:220px;display:flex!important;flex-direction:row!important;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:0 10px;background:#fff}
.dd-search .ico{width:18px;height:18px;color:var(--muted);flex:none}
.dd-search input{border:0!important;box-shadow:none!important;padding:10px 0!important;flex:1;min-width:0;outline:0}
.dd-adv{width:100%}.dd-adv summary{cursor:pointer;color:var(--brand-navy);font-weight:600;font-size:14px}.dd-adv .row{margin-top:8px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--brand-navy);text-decoration:none;font-size:13px;font-weight:600}
.chip i{width:9px;height:9px;border-radius:50%;background:var(--c,#98A2B3)}
.chip.on{background:var(--brand-navy);color:#fff;border-color:var(--brand-navy)}
.dd-listhead{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:10px}
.bulkbar{position:sticky;top:0;z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:10px;background:#F6FAF9;border:1px solid #D7EFE8;border-radius:12px;padding:8px 12px;margin-bottom:8px}
.bulkbar .bulk-type{flex-direction:row!important;align-items:center;gap:6px;font-size:14px;margin:0}
.bulkbar select{padding:6px 8px}
.chk{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:8px;margin:0;cursor:pointer}
.chk input{width:18px;height:18px;accent-color:var(--brand-teal-dark)}
button.allow{background:#12A37F;color:#fff;border-color:#12A37F}
button.light.allow{background:#fff;color:#0B7A60;border-color:#9FDCCB}
button.light.block{background:#fff;color:#B42318;border-color:#F5C2C0}
button .ico{width:16px;height:16px;vertical-align:-3px}
.act-buttons button,.bulkbar button,.ev-actions button,.toast button{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.evlist{list-style:none;margin:0;padding:0}
.ev{display:grid;grid-template-columns:auto 36px minmax(0,1fr) auto;gap:12px;align-items:start;padding:12px 4px;border-bottom:1px solid #EEF1F5}
.ev:last-child{border-bottom:0}
.ev:hover{background:#FAFCFD}
.ev .avatar{width:36px;height:36px;margin-top:2px}
.ev-chk{padding-top:9px;min-width:18px}
.ev-who{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.ev-sender{color:var(--brand-navy);font-size:15px;word-break:break-all}
.ev-dom{font-size:13px;color:var(--muted);text-decoration:none}.ev-dom:hover{color:var(--brand-teal-dark)}
.ev-subj{margin-top:2px;color:var(--text);font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ev-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:6px}
.ev-why{font-size:13px;color:var(--muted)}
.ev-tech{font-size:12px;margin-top:4px;word-break:break-word}
.ev-raw{text-decoration:underline dotted;cursor:help}
.ev-side{display:flex;flex-direction:column;align-items:flex-end;gap:6px;text-align:right}
.ev-time{font-size:13px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.ev-q{font-size:13px;font-weight:600}
.ev-actions{display:flex;gap:6px}
.ev-actions button{padding:5px 10px}
.rbadge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px 3px 7px;border-radius:999px;font-size:12.5px;font-weight:700;white-space:nowrap}
.rbadge .ico{width:14px;height:14px;stroke-width:2.2}
.rb-connection{background:#E7ECF7;color:#2C4478}.rb-spam_rejected{background:#FDECEC;color:#B42318}.rb-quarantined{background:#FFF4DE;color:#9A5B00}
.rb-virus{background:#F8E8EF;color:#8E2A4F}.rb-clean{background:#E3F6EF;color:#0B7A60}.rb-tagged{background:#E8F4FF;color:#1849A9}.rb-tempfail{background:#EEF2F7;color:#475467}
.onlist{font-size:11.5px;font-weight:700;padding:1px 8px;border-radius:999px}
.onlist.allow{background:#E3F6EF;color:#0B7A60}.onlist.block{background:#FDECEC;color:#B42318}
.pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;margin-top:14px}
.pg{min-width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;border:1px solid var(--line);text-decoration:none;color:var(--brand-navy);font-weight:600}
.pg.on{background:var(--brand-navy);color:#fff;border-color:var(--brand-navy)}
.flash.toast{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:8px;z-index:20;box-shadow:0 8px 24px rgba(10,31,68,.14)}
.act-head{display:flex;align-items:center;gap:14px;margin-bottom:14px}
.act-table .act-duplicate{opacity:.7}
.warnbox{background:#FFFAEB;border:1px solid #F5D08A;border-radius:10px;padding:10px 12px;margin:12px 0;color:var(--warn);font-weight:600}
.act-buttons{gap:10px;margin-top:12px;align-items:center}
@media (max-width:720px){
  .st-hero{flex-wrap:wrap;gap:14px;padding:16px}
  .st-ring svg{width:96px;height:96px}
  .st-hero h2{font-size:19px}
  .st-hero-text{flex-basis:100%}
  .st-hero-art{display:none}
  .st-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .st-tile .trend{white-space:normal;line-height:1.3}
  .st-tile-title{font-size:14px}
  .st-tile{padding:12px}
  .st-num{font-size:26px}
  .st-explain{font-size:12.5px;min-height:0}
  .st-tile-foot .trend{font-size:11px;padding:2px 6px}
  .ev{grid-template-columns:auto 32px minmax(0,1fr);gap:10px}
  .ev .avatar{width:32px;height:32px}
  .ev-side{grid-column:3;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;text-align:left;width:100%}
  .dd-hero-num{align-items:flex-start;width:100%}
  .tsender{grid-template-columns:32px minmax(0,1fr) auto}.tsender .bar{display:none}
}
@media (max-width:340px){.st-tiles{grid-template-columns:1fr}}

/* =====================================================================
   PostFend design system v2 (2026-11). One source of truth for every page:
   tokens -> type scale -> surfaces (card, tile) -> controls (button, input)
   -> data (table, badge) -> feedback (flash, empty). Pages get it automatically.
   ===================================================================== */
:root{
  /* brand + category palette (same values as the app theme) */
  --pf-navy:#0A1F44; --pf-navy-deep:#07152E; --pf-teal:#19C8A5; --pf-teal-ink:#0B7A60;
  --pf-indigo:#3D5A99; --pf-coral:#E5484D; --pf-amber:#F5A524; --pf-plum:#8E2A4F; --pf-green:#12A37F;
  /* text: all pass WCAG AA on white and on --bg */
  --text:#0A1F44; --muted:#3B4E6B; --subtle:#53647F; --line:#D2DCE8; --bg:#EDF2F8;
  --danger:#B42318; --warn:#8A3B00; --ok:#067647;
  /* type scale */
  --fs-body:16.5px; --fs-small:14.5px; --fs-tiny:13px; --fs-h1:30px; --fs-h2:19px; --fs-h3:17px;
  /* spacing + shape */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px;
  --radius:16px; --radius-sm:10px; --control-h:44px;
  --shadow:0 1px 2px rgba(10,31,68,.05), 0 8px 24px rgba(10,31,68,.07);
}
body{font-size:var(--fs-body);line-height:1.55;color:var(--text)}
main{padding:32px 32px 16px}
h1{font-size:var(--fs-h1);line-height:1.2;margin:0 0 8px}
h2{font-size:var(--fs-h2);line-height:1.3;margin:0 0 12px}
h3{font-size:var(--fs-h3)}
.lead,.pagehead .lead{font-size:17px;color:var(--muted);line-height:1.5}
.muted{color:var(--muted)}
small,.small{font-size:var(--fs-small)}
.mono{font-size:14px}
footer{font-size:var(--fs-tiny);color:var(--muted)}

/* sidebar: bigger, calmer */
.sidebar nav a{font-size:15.5px;padding:10px 12px;gap:12px}
.sidebar nav a .ico{width:20px;height:20px}
.side-foot a.user{font-size:14.5px}

/* page header: title + one helper line, optional glyph chip */
.pagehead{margin-bottom:var(--sp-6)}
h1.ph{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.ph-glyph{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:52px;height:52px;border-radius:15px;flex:none;
  background:color-mix(in srgb,var(--c,#19C8A5) 14%,#fff);color:var(--c,#0B7A60)}
.ph-glyph .ico{width:28px;height:28px;stroke-width:2}

/* cards */
.card{border-radius:var(--radius);padding:var(--sp-6);margin-bottom:var(--sp-5)}
.card>h2:first-child{font-size:var(--fs-h2)}
.card h2 .ico{width:22px;height:22px;padding:4px;border-radius:8px;background:#E6F9F4;color:var(--pf-teal-ink);box-sizing:content-box}
.card .help,.help{color:var(--muted);font-size:var(--fs-small);margin:-6px 0 12px}

/* metric tiles everywhere use the stats tile look */
.metric{background:#fff;border:1px solid var(--line);border-top:4px solid var(--c,var(--pf-navy));border-radius:var(--radius);padding:var(--sp-5)}
.metric.m-teal{--c:var(--pf-teal);background:linear-gradient(180deg,#EAFAF6 0%,#fff 70%)}
.metric.m-navy{--c:var(--pf-indigo);background:#fff}
.metric.m-amber{--c:var(--pf-amber);background:#fff}
.metric.m-rose{--c:var(--pf-coral);background:#fff}
.metric-icon,.metric.m-teal .metric-icon,.metric.m-navy .metric-icon,.metric.m-amber .metric-icon,.metric.m-rose .metric-icon{
  width:46px;height:46px;border-radius:14px;background:color-mix(in srgb,var(--c) 14%,#fff);color:var(--c)}
.metric.m-amber .metric-icon{color:#9A5B00}
.metric-icon .ico{width:24px;height:24px;stroke-width:2}
.metric b,.tiles .metric b{font-size:32px;margin:8px 0 2px;font-variant-numeric:tabular-nums}
.metric{font-size:15px;color:var(--muted)}

/* controls: one size, one radius */
input[type=text],input[type=password],input[type=number],input[type=email],input[type=search],input[type=file],select,textarea{
  min-height:var(--control-h);border-radius:var(--radius-sm);padding:9px 12px;font-size:16px;border-color:#9AAAC0}
button,.btn{min-height:var(--control-h);border-radius:var(--radius-sm);padding:10px 18px;font-size:15.5px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
button.small,.btn.small{min-height:36px;height:auto;padding:7px 14px;font-size:14.5px;border-radius:9px}
button.light,.btn.light{background:#E4EAF3;color:var(--text)}
button.danger{background:var(--danger)}
.row label,label{font-size:15px;color:var(--text);font-weight:600}
.row{gap:var(--sp-4)}

/* tables: roomier rows, readable headers, key info first */
table{font-size:15.5px}
th,td{padding:14px 14px}
th{font-size:13.5px;font-weight:700;letter-spacing:.02em;color:var(--muted);background:#F2F6FA;text-transform:none}
td .mono{font-size:14.5px}
tr:has(td):hover td{background:#F5FAF8}

/* badges / pills: same look as stats reason badges */
.pill{font-size:13px;padding:3px 10px;border-radius:999px;font-weight:700}
.pill.held,.pill.pending,.pill.warn,.pill.todo{background:#FFF4DE;color:#8A4B00}
.pill.released,.pill.verified,.pill.attested,.pill.active,.pill.ok{background:#E3F6EF;color:#0B6B53}
.pill.virus,.pill.deleted,.pill.suspended,.pill.lapsed,.pill.disabled,.pill.blocked,.pill.bad{background:#FDECEC;color:#A11D15}
.pill.unknown{background:#E8EDF5;color:#3B4E6B}
.badge{font-size:12px}

/* feedback */
.flash{font-size:16px;border-radius:12px;padding:14px 16px}
.empty{padding:var(--sp-8) var(--sp-4)}
.empty-art{width:auto;height:auto;background:none;border:0}
.empty-art img{width:170px;max-width:60%}
.empty h3{font-size:18px}
.empty p{font-size:15.5px}

/* login */
.login label{font-size:15px}
.login input{font-size:17px}
.login-hero p{font-size:17px}

@media (max-width:720px){
  :root{--fs-body:16px;--fs-h1:25px;--fs-h2:18px}
  main{padding:20px 16px 12px}
  .card{padding:var(--sp-4)}
  h1.ph{gap:10px}
  .ph-glyph{width:44px;height:44px}
  th,td{padding:12px 10px}
  table.stack td{padding:8px 4px}
}
footer.site-foot{padding:20px 32px 28px;line-height:1.6}
footer.site-foot p{margin:0 0 4px}
footer .legal-links,.login .legal-links{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:6px}
footer .legal-links a,.login .legal-links a{color:var(--muted);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.login .legal-links{justify-content:flex-start;margin-top:28px;font-size:14px}
.login .operator{font-size:13px;color:var(--muted);margin-top:8px}
@media (max-width:720px){footer.site-foot{padding:16px}}
/* stats: clickable rows + email details */
.ev{position:relative}
.ev a.ev-open{position:absolute;inset:0;z-index:0;border-radius:inherit}
.ev a.ev-open:focus-visible{outline:3px solid var(--pf-teal);outline-offset:-3px}
.ev .ev-chk,.ev .ev-dom,.ev .ev-q,.ev .ev-actions,.ev button,.ev input{position:relative;z-index:1}
.ev:hover{background:#F5FAF8;cursor:pointer}
.evd-head{display:flex;gap:16px;align-items:center}
.avatar.lg{width:56px;height:56px;font-size:24px}
.evd-title{font-size:24px;margin:0;overflow-wrap:anywhere}
.evd-sub{margin:4px 0 0}
.evd-subject{font-size:17px;margin:14px 0 0}
.evd-actions{margin-top:16px}
dl.kv{display:grid;grid-template-columns:13rem minmax(0,1fr);gap:10px 18px;margin:0}
dl.kv dt{color:var(--muted);font-weight:600}
dl.kv dd{margin:0;overflow-wrap:anywhere}
ul.deliv{list-style:none;padding:0;margin:0;display:grid;gap:10px}
table.sym td.pos{color:var(--danger);font-weight:700} table.sym td.neg{color:var(--ok);font-weight:700}
@media (max-width:720px){dl.kv{grid-template-columns:1fr;gap:2px}dl.kv dd{margin-bottom:10px}}
table.qtable{width:100%}
table.qtable .q-subj{font-weight:700;font-size:16.5px;color:var(--text)}
table.qtable .q-from{color:var(--muted);margin-top:2px;overflow-wrap:anywhere}
table.qtable td.q-time{white-space:nowrap;color:var(--muted)}
table.qtable td.mono{font-size:14px}
.public-page{max-width:760px;margin:0 auto}
.danger-zone{border:1px solid #F5C2C0}

/* Livelier redesign (2026-11-10, Calgary). Merged from the approved preview overlay.
   Visual only — no template or behaviour changes. No preview ribbon. */
:root{
  --coral:#F05A3A; --coral-soft:#FDECE6;
  --gold:#F0B429; --gold-soft:#FFF6E0;
  --sky:#2EA8E6; --sky-soft:#E7F5FC;
  --violet:#5B6CDB; --violet-soft:#EEF0FB;
  --teal-soft:#E7F8F3;
  --shadow:0 1px 2px rgba(10,31,68,.06), 0 12px 32px -12px rgba(10,31,68,.18);
  --shadow-lg:0 4px 8px rgba(10,31,68,.06), 0 22px 44px -18px rgba(10,31,68,.22);
}
body.has-app{
  overflow-x:hidden;
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(25,200,165,.18), transparent 55%),
    radial-gradient(800px 420px at -8% 108%, rgba(46,168,230,.12), transparent 52%),
    radial-gradient(640px 320px at 35% 0%, rgba(91,108,219,.10), transparent 50%),
    var(--bg,#EDF2F8);
}
body.has-app .sidebar{
  background:linear-gradient(180deg,#0A1F44 0%,#0C274F 48%,#07152E 100%);
  box-shadow:8px 0 32px -16px rgba(7,21,46,.45);
}
body.has-app .sidebar::after{
  content:"";position:absolute;inset:auto 0 0 0;height:180px;pointer-events:none;
  background:radial-gradient(200px 120px at 30% 100%, rgba(25,200,165,.22), transparent 70%);
}
body.has-app .shell{position:relative}
body.has-app .shell::before{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
  background-image:radial-gradient(rgba(10,31,68,.055) 1px, transparent 1.2px);
  background-size:22px 22px;
  mask-image:linear-gradient(180deg,#000 0%, transparent 85%);
  opacity:.7;
}
body.has-app .shell > *{position:relative;z-index:1}

/* Colourful nav icon chips */
.sidebar nav a{--nav-c:var(--brand-teal,#19C8A5)}
.sidebar nav a:nth-child(1){--nav-c:#19C8A5}
.sidebar nav a:nth-child(2){--nav-c:#2EA8E6}
.sidebar nav a:nth-child(3){--nav-c:#5B6CDB}
.sidebar nav a:nth-child(4){--nav-c:#F0B429}
.sidebar nav a:nth-child(5){--nav-c:#F05A3A}
.sidebar nav a:nth-child(6){--nav-c:#19C8A5}
.sidebar nav a:nth-child(7){--nav-c:#2EA8E6}
.sidebar nav a:nth-child(8){--nav-c:#5B6CDB}
.sidebar nav a:nth-child(9){--nav-c:#F0B429}
.sidebar nav a:nth-child(10){--nav-c:#F05A3A}
.sidebar nav a:nth-child(11){--nav-c:#19C8A5}
.sidebar nav a:nth-child(12){--nav-c:#2EA8E6}
.sidebar nav a:nth-child(13){--nav-c:#5B6CDB}
.sidebar nav a .ico{
  width:20px;height:20px;padding:5px;border-radius:8px;box-sizing:content-box;
  background:color-mix(in srgb,var(--nav-c) 18%, transparent);
  color:var(--nav-c);
}
.sidebar nav a.on{
  background:color-mix(in srgb,var(--nav-c) 18%, rgba(255,255,255,.04));
  color:#fff;border-left-color:var(--nav-c);
}
.sidebar nav a.on .ico{background:var(--nav-c);color:#07152E}
.sidebar nav a:hover{background:color-mix(in srgb,var(--nav-c) 14%, transparent)}
.badge{box-shadow:0 0 0 3px rgba(25,200,165,.18)}

/* Depth on cards, metrics, tiles */
.card{
  box-shadow:var(--shadow);
  border-color:color-mix(in srgb,var(--line,#D2DCE8) 80%, #fff);
  transition:transform .18s ease, box-shadow .18s ease;
}
.card:hover{box-shadow:var(--shadow-lg);transform:translateY(-1px)}
.metric{
  box-shadow:var(--shadow);
  transition:transform .18s ease, box-shadow .18s ease;
}
.metric:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}
.metric.m-navy{background:linear-gradient(180deg,#E8EEF8 0%,#fff 72%);border-top-color:var(--violet,#5B6CDB);--c:var(--violet,#5B6CDB)}
.metric.m-teal{background:linear-gradient(180deg,#E6F9F4 0%,#fff 72%)}
.metric.m-amber{background:linear-gradient(180deg,#FFF6E0 0%,#fff 72%)}
.metric.m-rose{background:linear-gradient(180deg,#FDECE6 0%,#fff 72%)}
.metric-icon{box-shadow:0 6px 14px -8px color-mix(in srgb,var(--c,#0A1F44) 60%, transparent)}
.ph-glyph{
  box-shadow:0 8px 18px -10px color-mix(in srgb,var(--c,#0B7A60) 70%, transparent);
}

/* Richer spam-stats hero, still the existing standard */
.st-hero{
  background:linear-gradient(120deg,#07152E 0%,#0A1F44 42%,#0E4A52 78%,#0B7A60 100%);
  box-shadow:0 16px 40px -16px rgba(7,21,46,.55);
}
.st-hero h2{overflow-wrap:anywhere;max-width:100%;color:#fff}
.st-hero-text{min-width:0;z-index:1}
.st-hero::before{
  content:"";position:absolute;inset:auto -40px -60px auto;width:220px;height:220px;
  background:radial-gradient(circle,rgba(25,200,165,.35),transparent 70%);pointer-events:none;
}
.st-tile{transition:transform .18s ease, box-shadow .18s ease}
.st-tile:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}
.tk-tile{
  box-shadow:var(--shadow);
  transition:transform .18s ease, box-shadow .18s ease;
}
.tk-tile:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}

/* Buttons */
button.teal,.btn.teal{box-shadow:0 8px 18px -10px rgba(15,156,128,.7)}
button:not(.light):not(.ghost):not(.danger-outline),.btn:not(.light):not(.ghost):not(.danger-outline){
  box-shadow:0 6px 16px -8px rgba(10,31,68,.45);
}

/* Subtle enter motion */
@keyframes pf-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.pagehead,.st-head{animation:pf-rise .45s ease both}
.metric,.st-hero,.st-tile,.tk-tile,.card{animation:pf-rise .5s ease both}
.grid .metric:nth-child(1),.st-tiles .st-tile:nth-child(1),.tk-tiles .tk-tile:nth-child(1){animation-delay:.04s}
.grid .metric:nth-child(2),.st-tiles .st-tile:nth-child(2),.tk-tiles .tk-tile:nth-child(2){animation-delay:.08s}
.grid .metric:nth-child(3),.st-tiles .st-tile:nth-child(3),.tk-tiles .tk-tile:nth-child(3){animation-delay:.12s}
.grid .metric:nth-child(4),.st-tiles .st-tile:nth-child(4),.tk-tiles .tk-tile:nth-child(4){animation-delay:.16s}
.grid .metric:nth-child(5),.st-tiles .st-tile:nth-child(5){animation-delay:.2s}
.grid .metric:nth-child(6),.st-tiles .st-tile:nth-child(6){animation-delay:.24s}
.st-hero{animation-delay:.06s}
.card:nth-of-type(1){animation-delay:.1s}
.card:nth-of-type(2){animation-delay:.16s}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none !important;transition:none !important;scroll-behavior:auto !important}
  .card:hover,.metric:hover,.st-tile:hover,.tk-tile:hover{transform:none}
}

.lead,.pagehead .lead{color:var(--muted,#3B4E6B)}

/* Portal design v2 — live overlay. Visual only; respects prefers-reduced-motion. */
:root{
  --coral:#F05A3A; --gold:#F0B429; --sky:#2EA8E6; --violet:#5B6CDB;
  --shadow:0 1px 2px rgba(10,31,68,.06), 0 14px 36px -12px rgba(10,31,68,.2);
  --shadow-lg:0 8px 28px -10px rgba(10,31,68,.28);
}

/* Colourful gradient sidebar + sheen */
body.has-app .sidebar{
  background: linear-gradient(180deg,#0A1F44 0%,#16325C 32%,#2A3D8F 62%,#0E4A52 100%);
  box-shadow: 8px 0 32px -16px rgba(7,21,46,.5);
  overflow: hidden;
}
body.has-app .sidebar::before{
  content:""; position:absolute; inset:-20% -40% auto -40%; height:46%;
  background: radial-gradient(closest-side, rgba(25,200,165,.35), transparent 70%);
  animation: pfSideGlow 8s ease-in-out infinite alternate;
  pointer-events:none;
}
@keyframes pfSideGlow { to { transform: translateY(18%) scale(1.15); } }
body.has-app .mobilebar{
  background: linear-gradient(90deg,#0A1F44,#16325C,#0E4A52);
}
body.has-app{
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(25,200,165,.22), transparent 55%),
    radial-gradient(700px 400px at 0% 100%, rgba(91,108,219,.16), transparent 50%),
    radial-gradient(600px 300px at 70% 80%, rgba(240,90,58,.08), transparent 50%),
    var(--bg,#EDF2F8);
}

/* Page enter */
@keyframes pfPageIn { from { opacity:0; transform: translateY(16px);} to { opacity:1; transform:none;} }
body.has-app main { animation: pfPageIn .55s ease both; }

/* Stat tiles: hover lift + count-up ready */
.metric, .st-tile, .tk-tile{
  transition: transform .2s ease, box-shadow .2s ease;
}
.metric:hover, .st-tile:hover, .tk-tile:hover{
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.metric b, .st-num, .tk-tile b { font-variant-numeric: tabular-nums; }

/* Charts draw on load */
.chartwrap svg rect, .chart rect, svg.chart rect{
  transform-box: fill-box;
  transform-origin: bottom;
  animation: pfBar .8s ease both;
}
.chartwrap svg rect:nth-child(odd){ animation-delay:.05s; }
.spark polyline, .spark path{
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: pfDraw 1.1s ease forwards;
}
@keyframes pfBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pfDraw { to { stroke-dashoffset: 0; } }
.st-hero .ring circle:last-of-type,
.st-ring circle:last-of-type{
  animation: pfDraw 1.2s ease both;
}

/* Richer hero */
.st-hero{
  background: linear-gradient(115deg,#07152E 0%,#0A1F44 35%,#5B6CDB 72%,#0B7A60 100%);
  background-size: 160% 160%;
  animation: pfHeroShift 14s ease-in-out infinite alternate;
}
@keyframes pfHeroShift { to { background-position: 100% 50%; } }

/* Empty states */
.empty-art, .empty-ill img, .empty-ill{
  animation: pfIconBob 3.6s ease-in-out infinite;
}
.empty-ill { position: relative; }
.empty-ill::before{
  content:""; position:absolute; left:50%; top:20px; width:160px; height:160px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(25,200,165,.18), transparent 70%);
  pointer-events:none;
}
@keyframes pfIconBob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-6px);} }

/* Cards */
.card{ transition: transform .2s ease, box-shadow .2s ease; }
.card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-lg); }

@media (prefers-reduced-motion: reduce){
  .pf-preview *, .pf-preview *::before, .pf-preview *::after,
  body.has-app *, body.has-app *::before, body.has-app *::after{
    animation: none !important; transition: none !important;
  }
  body.has-app main, .metric, .st-tile, .tk-tile, .card { transform: none !important; opacity: 1 !important; }
  .spark polyline, .spark path { stroke-dashoffset: 0 !important; }
}
