:root{
  color-scheme:light;
  --ink:#17211d;
  --muted:#64716a;
  --line:#dbe4df;
  --paper:#ffffff;
  --canvas:#f2f6f3;
  --green:#176b4a;
  --green-dark:#0f4e37;
  --green-soft:#e7f4ec;
  --amber:#9a5c10;
  --amber-soft:#fff4df;
  --red:#aa3434;
  --red-soft:#fff0f0;
  --shadow:0 24px 70px rgba(18,43,31,.12);
}
*{box-sizing:border-box}
html{min-height:100%;background:var(--canvas)}
body{
  margin:0;
  min-height:100vh;
  color:var(--ink);
  background:
    radial-gradient(circle at 5% 0%,rgba(60,160,112,.15),transparent 26rem),
    radial-gradient(circle at 95% 5%,rgba(220,177,81,.11),transparent 22rem),
    var(--canvas);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
button,input{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.brand-mark{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;
  color:#fff;background:linear-gradient(145deg,var(--green),#2f956c);
  box-shadow:0 10px 25px rgba(23,107,74,.25);
  font-weight:900;letter-spacing:-.04em;
}
.brand-row{display:flex;align-items:center;gap:12px}
.brand-title{font-size:16px;font-weight:800;line-height:1.15}
.brand-subtitle{font-size:12px;color:var(--muted);margin-top:3px}
.login-shell{
  min-height:100vh;padding:34px;
  display:grid;grid-template-columns:minmax(280px,520px) minmax(440px,680px);
  justify-content:center;align-items:stretch;gap:24px;
}
.login-story,.login-card{
  min-height:620px;border:1px solid rgba(255,255,255,.65);
  border-radius:28px;box-shadow:var(--shadow);
}
.login-story{
  position:relative;overflow:hidden;
  padding:46px;color:#fff;
  background:
    linear-gradient(145deg,rgba(10,55,38,.96),rgba(24,111,76,.9)),
    #174e39;
  display:flex;flex-direction:column;justify-content:space-between;
}
.login-story:after{
  content:"";position:absolute;width:360px;height:360px;border-radius:50%;
  right:-145px;bottom:-130px;border:70px solid rgba(255,255,255,.07);
}
.login-story .brand-mark{background:#fff;color:var(--green)}
.eyebrow{
  margin:0 0 14px;color:#bde5d2;font-size:12px;font-weight:800;
  text-transform:uppercase;letter-spacing:.16em;
}
.login-story h1{max-width:460px;margin:0;font-size:clamp(34px,4vw,56px);line-height:1.03;letter-spacing:-.045em}
.login-story p{max-width:460px;margin:22px 0 0;color:#dcebe4;font-size:16px;line-height:1.65}
.trust-list{position:relative;z-index:1;display:grid;gap:13px;margin-top:38px}
.trust-item{display:flex;align-items:center;gap:11px;color:#e9f4ef;font-size:14px}
.trust-dot{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.13);font-size:12px}
.login-card{
  padding:46px;background:rgba(255,255,255,.92);
  display:flex;flex-direction:column;justify-content:center;
}
.login-card-inner{width:min(100%,410px);margin:auto}
.login-card h2{margin:38px 0 8px;font-size:31px;letter-spacing:-.035em}
.login-card .intro{margin:0 0 30px;color:var(--muted);line-height:1.55}
.field{display:grid;gap:8px;margin:0 0 18px}
.field label{font-size:13px;font-weight:750}
.field input{
  width:100%;height:50px;padding:0 15px;border:1px solid var(--line);border-radius:13px;
  color:var(--ink);background:#fff;outline:none;transition:.18s border-color,.18s box-shadow;
}
.field input:focus{border-color:#3f9873;box-shadow:0 0 0 4px rgba(63,152,115,.12)}
.primary,.secondary,.danger,.quiet,.reveal-button{
  border:0;border-radius:12px;font-weight:750;min-height:42px;padding:0 16px;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
}
.primary{background:var(--green);color:#fff;box-shadow:0 9px 22px rgba(23,107,74,.19)}
.primary:hover{background:var(--green-dark)}
.primary:disabled,.secondary:disabled,.reveal-button:disabled{opacity:.55;cursor:not-allowed}
.secondary{color:var(--green-dark);background:var(--green-soft);border:1px solid #cce5d7}
.quiet{color:var(--muted);background:transparent}
.quiet:hover{background:#edf2ef;color:var(--ink)}
.danger{color:var(--red);background:var(--red-soft);border:1px solid #f0d0d0}
.login-submit{width:100%;height:50px;margin-top:5px}
.error-box,.notice{
  border-radius:12px;padding:12px 14px;font-size:13px;line-height:1.45;
}
.error-box{margin:0 0 16px;color:var(--red);background:var(--red-soft);border:1px solid #f1cccc}
.security-note{margin:24px 0 0;color:var(--muted);font-size:12px;line-height:1.55;text-align:center}
.legal-link{color:var(--green);font-weight:700;text-decoration:none}.legal-link:hover{text-decoration:underline}
.legal-shell{width:min(820px,calc(100% - 32px));margin:42px auto 70px}.legal-card{padding:clamp(24px,5vw,48px)}
.legal-card h1{margin:26px 0 10px;font-size:clamp(30px,5vw,44px);letter-spacing:-.04em}
.legal-card h2{margin:30px 0 8px;font-size:18px}.legal-card p,.legal-card li{color:var(--muted);line-height:1.72}
.legal-card code{color:var(--green-dark);background:var(--green-soft);border-radius:6px;padding:2px 6px}
.app-header{
  position:sticky;z-index:20;top:0;height:76px;padding:0 max(22px,calc((100vw - 1180px)/2));
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  border-bottom:1px solid rgba(204,218,210,.9);background:rgba(248,251,249,.88);
  backdrop-filter:blur(18px);
}
.header-actions{display:flex;align-items:center;gap:9px}
.user-chip{padding:8px 12px;border-radius:12px;background:#e9f0ec;text-align:right}
.user-name{font-size:13px;font-weight:800}
.user-role{font-size:11px;color:var(--muted);text-transform:capitalize;margin-top:2px}
.app-main{width:min(1180px,calc(100% - 44px));margin:34px auto 64px}
.hero-row{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:22px}
.hero-row h1{margin:0;font-size:clamp(29px,4vw,43px);line-height:1.04;letter-spacing:-.045em}
.hero-row p{margin:10px 0 0;color:var(--muted);line-height:1.55}
.refresh-meta{font-size:12px;color:var(--muted);white-space:nowrap}
.grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.7fr);gap:22px;align-items:start}
.stack{display:grid;gap:18px}
.card{background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:20px;box-shadow:0 13px 38px rgba(24,54,39,.07)}
.card-pad{padding:21px}
.status-card{padding:18px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.status-main{display:flex;align-items:center;gap:13px;min-width:0}
.status-light{width:12px;height:12px;border-radius:50%;background:#a8b2ad;box-shadow:0 0 0 5px #edf1ef}
.status-light.connected{background:#2e9b6d;box-shadow:0 0 0 5px #e3f3ea}
.status-title{font-size:14px;font-weight:850}
.status-copy{margin-top:4px;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sender-lock{
  display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;
  color:var(--green-dark);background:var(--green-soft);font-size:11px;font-weight:800;
}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px}
.section-head h2{margin:0;font-size:17px;letter-spacing:-.02em}
.message-list{display:grid;gap:11px}
.message{
  padding:16px;border:1px solid var(--line);border-radius:16px;background:#fff;
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:15px;align-items:center;
}
.message:hover{border-color:#c3d7cc;box-shadow:0 8px 23px rgba(31,69,50,.06)}
.message-subject{font-weight:820;line-height:1.35;overflow-wrap:anywhere}
.message-meta{display:flex;flex-wrap:wrap;gap:8px 13px;margin-top:7px;color:var(--muted);font-size:12px}
.message-meta span{display:inline-flex;align-items:center;gap:5px}
.reveal-button{min-width:120px;color:#fff;background:var(--green)}
.reveal-button:hover{background:var(--green-dark)}
.reveal-button.expired{color:#8b6d44;background:#f5eee3}
.code-panel{
  grid-column:1/-1;padding:15px 16px;border-radius:13px;background:#102c20;color:#fff;
  display:flex;align-items:center;justify-content:space-between;gap:14px;
}
.code-label{font-size:11px;color:#a9c9b9;text-transform:uppercase;letter-spacing:.12em;font-weight:800}
.code-value{font:800 29px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.13em;margin-top:3px}
.copy-button{border:1px solid rgba(255,255,255,.18);border-radius:10px;background:rgba(255,255,255,.1);color:#fff;padding:9px 12px;font-weight:750}
.empty{padding:38px 18px;text-align:center;border:1px dashed #cbd8d1;border-radius:15px;color:var(--muted)}
.empty-icon{font-size:28px;margin-bottom:9px}
.notice{color:var(--amber);background:var(--amber-soft);border:1px solid #f0ddb7}
.notice.success{color:var(--green-dark);background:var(--green-soft);border-color:#c9e4d5}
.notice.error{color:var(--red);background:var(--red-soft);border-color:#efcccc}
.mini-list{display:grid;gap:10px}
.mini-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px;border:1px solid var(--line);border-radius:13px;
}
.mini-title{font-size:13px;font-weight:800}
.mini-copy{margin-top:3px;font-size:11px;color:var(--muted);overflow-wrap:anywhere}
.switch{position:relative;width:42px;height:24px;flex:0 0 auto}
.switch input{position:absolute;opacity:0;pointer-events:none}
.switch span{position:absolute;inset:0;border-radius:20px;background:#cbd5cf;transition:.18s}
.switch span:after{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.18);transition:.18s}
.switch input:checked+span{background:var(--green)}
.switch input:checked+span:after{transform:translateX(18px)}
.audit-list{display:grid;gap:0;max-height:370px;overflow:auto}
.audit-row{padding:11px 2px;border-bottom:1px solid #e8eeea}
.audit-row:last-child{border-bottom:0}
.audit-action{font-size:12px;font-weight:800}
.audit-meta{margin-top:3px;color:var(--muted);font-size:11px;line-height:1.4}
.blocked{max-width:620px;margin:80px auto;padding:34px;text-align:center}
.blocked h2{font-size:27px;margin:4px 0 10px}
.blocked p{color:var(--muted);line-height:1.6}
.skeleton{height:83px;border-radius:15px;background:linear-gradient(90deg,#f1f4f2 25%,#e5ebe8 38%,#f1f4f2 63%);background-size:400% 100%;animation:pulse 1.2s infinite}
@keyframes pulse{0%{background-position:100% 0}100%{background-position:0 0}}
@media(max-width:900px){
  .login-shell{grid-template-columns:1fr;padding:18px}.login-story{min-height:360px}.login-card{min-height:520px}
  .grid{grid-template-columns:1fr}.app-header{padding:0 18px}.app-main{width:min(100% - 30px,720px)}
}
@media(max-width:620px){
  .login-story,.login-card{padding:28px;border-radius:21px}.login-shell{gap:14px}
  .brand-subtitle,.user-chip{display:none}.app-header{height:68px}.header-actions{gap:2px}.quiet{padding:0 10px}
  .hero-row{align-items:flex-start;flex-direction:column}.status-card{align-items:flex-start;flex-direction:column}
  .message{grid-template-columns:1fr}.reveal-button{width:100%}.code-panel{align-items:flex-start;flex-direction:column}.copy-button{width:100%}
}
