/* =========================================================
   TempMail UI  Minimal Dark (Lightweight)
   - Clean, muted, low-contrast, mobile-first
   ========================================================= */

:root{
  --bg: #0f141a;
  --bg-2: #121923;
  --surface: #151c24;
  --surface-2: #1a2330;
  --surface-3: #1f2a38;
  --ink: #e8eef6;
  --muted: #9aa7b8;

  --line: #2a3340;
  --line-strong: #343f50;

  --accent: #7bb6ff;
  --accent-2: #68e0c6;
  --accent-3: #ff9b8a;

  --danger: #ff7b7b;

  --shadow: 0 12px 28px rgba(6, 10, 16, .45);
  --shadow-soft: 0 6px 16px rgba(6, 10, 16, .32);

  --r: 16px;
  --r2: 12px;

  --display: "Trebuchet MS", "Segoe UI", "Verdana", sans-serif;
  --sans: "Trebuchet MS", "Segoe UI", "Verdana", sans-serif;
  --mono: "Cascadia Code", "Consolas", "Courier New", monospace;

  --t: 160ms;
  --ease: cubic-bezier(.2,.8,.2,1);
}

html.light{
  --bg: #eef2f7;
  --bg-2: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --surface-3: #e9eef5;
  --ink: #1d2530;
  --muted: #58687c;
  --line: #d6dde7;
  --line-strong: #c7d0dc;
  --shadow: 0 12px 26px rgba(20, 28, 40, .12);
  --shadow-soft: 0 6px 16px rgba(20, 28, 40, .08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  overflow-x:hidden;
}

a{ color: inherit; }

.wrap{
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 16px 90px;
}

/* =========================================================
   Header
   ========================================================= */
.header{
  display:grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
  z-index: 20;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

.logo{
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(123,182,255,.35), rgba(104,224,198,.35));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display:grid;
  place-items:center;
  flex: 0 0 50px;
}

.logo img{
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display:block;
}

.brand h1{
  margin:0;
  font-size: 1.35rem;
  font-family: var(--display);
  letter-spacing:.2px;
  font-weight: 700;
  line-height: 1.1;
}

.brand .sub{
  margin-top: 4px;
  font-size: .88rem;
  color: var(--muted);
}

.brand .sub b{ color: var(--ink); font-weight: 700; }

.header-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pill{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-soft);
  white-space:nowrap;
}

.pill-label{
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .2px;
}

.pill b{
  font-family: var(--mono);
  font-weight: 700;
}

.badge{
  font-family: var(--mono);
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
}

/* =========================================================
   Buttons & Inputs
   ========================================================= */
.btn{
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
  letter-spacing:.1px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
  box-shadow: var(--shadow-soft);
  user-select:none;
}

.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); box-shadow: 0 2px 8px rgba(0,0,0,.2); }

.btn.primary{
  background: linear-gradient(135deg, rgba(104,224,198,.28), rgba(123,182,255,.28));
}

.btn.ghost{
  background: transparent;
  box-shadow:none;
}

.btn.mini{
  padding: 7px 9px;
  border-radius: 10px;
  font-size: .88rem;
}

.input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  outline:none;
  font-family: var(--mono);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.input:focus{
  border-color: rgba(123,182,255,.8);
  box-shadow: 0 0 0 3px rgba(123,182,255,.2);
}

/* =========================================================
   Layout
   ========================================================= */
.layout{
  display:grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 16px;
  margin-top: 16px;
  align-items:start;
}

.sidebar{ position: sticky; top: 100px; }

.card{
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
  position: relative;
  animation: rise 240ms var(--ease) both;
}

@keyframes rise{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}

.card .hd{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
}

.card .hd .title{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 700;
  letter-spacing:.12px;
}

.flag{
  width: 10px; height: 10px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.card .bd{ padding: 12px; }
.card.no-hd .bd{ padding-top: 8px; }

/* =========================================================
   Identity panel
   ========================================================= */
.row{
  display:flex;
  gap: 10px;
  align-items:center;
}

.row .btn{ flex: 0 0 140px; }
.row .input{ flex: 1 1 auto; }

.field-row{
  display:flex;
  flex-direction:column;
  gap: 6px;
  margin-top: 10px;
}

.label{
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .3px;
  text-transform: uppercase;
}

.domain-count{
  display:inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2px;
}

.domain-select{ position: relative; z-index: 2; }

.domain-btn{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 600;
  cursor:pointer;
  box-shadow: var(--shadow-soft);
}

.domain-btn:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(123,182,255,.25);
}

.caret{
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.domain-menu{
  position:absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-soft);
  display:none;
  z-index: 60;
}

.domain-menu.open{ display:block; }

.domain-item{
  width: 100%;
  text-align:left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.3;
  cursor:pointer;
  position: relative;
  padding-right: 32px;
}

.domain-item:hover{ background: var(--surface-2); }

.domain-item[aria-selected="true"],
.domain-item.is-active{
  background: rgba(123,182,255,.14);
  border-color: var(--line-strong);
  font-weight: 700;
}

.domain-item[aria-selected="true"]::after,
.domain-item.is-active::after{
  content: "✓";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  color: var(--ink);
}

.identity-box{
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--r2);
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
}

.email-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap:wrap;
}

.email{
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing:.1px;
  word-break: break-all;
}

.name{
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.stack{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}

.stack .btn{ flex:1; }

.helper{
  margin-top: 10px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

/* Recent section */
.sep{
  border:0;
  border-top: 1px solid var(--line-strong);
  margin: 12px 0;
  opacity:1;
}

.recent{ margin-top: 2px; }

.recent-hd{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.recent-list{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 220px;
  overflow:auto;
  padding-right: 4px;
}

.recent-item{
  width: 100%;
  text-align:left;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing:.1px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor:pointer;
  transition: transform var(--t) var(--ease);
  color: var(--ink);
  font-size: .86rem;
}

.recent-item:hover{ transform: translateY(-1px); }
.recent-item:active{ transform: translateY(0); }

/* =========================================================
   Inbox panel
   ========================================================= */
.toolbar{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
  width: 100%;
}

.search{
  position:relative;
  flex:1;
  min-width: 240px;
}

.search input{ padding-left: 40px; }
.search svg{
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity:.75;
}

.status{
  display:flex;
  align-items:center;
  gap: 8px;
  color: var(--muted);
  font-size: .88rem;
  min-width: 150px;
  justify-content:flex-end;
}

.toolbar .btn{ white-space: nowrap; }

.toolbar-btn{
  padding: 8px 11px;
  font-size: .88rem;
}

.spinner{
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--accent-2);
  animation: spin .75s linear infinite;
}

@keyframes spin{ to{ transform: rotate(360deg); } }

.split{
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  padding: 12px;
}

.pane{
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  overflow:hidden;
  background: var(--surface-2);
  min-height: 560px;
}

.pane .phd{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
}

.pane .phd b{ font-weight: 700; }

.pane .pbd{
  padding: 10px;
  max-height: 660px;
  overflow:auto;
}

.list{ display:flex; flex-direction:column; gap: 10px; }

.item{
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor:pointer;
  transition: transform var(--t) var(--ease);
  animation: enter 200ms var(--ease) both;
  position: relative;
}

.item::before{
  content:"";
  position:absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

@keyframes enter{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}

.item:hover{ transform: translateY(-1px); }
.item:active{ transform: translateY(0); }

.item .subj{ font-weight: 700; margin-bottom: 4px; }

.meta{
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.25;
}

.item.is-new{
  border-color: rgba(255, 155, 138, .6);
  box-shadow: 0 0 0 3px rgba(255, 155, 138, .18), var(--shadow-soft);
  animation: pulse 1.1s var(--ease) 1;
}

@keyframes pulse{
  0%{ transform: translateY(0); }
  45%{ transform: translateY(-2px); }
  100%{ transform: translateY(0); }
}

/* Viewer */
.viewer{
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow:hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.viewer .vh{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
}

.viewer .vb{
  padding: 10px;
  max-height: 610px;
  overflow:auto;
  line-height: 1.55;
}

.viewer .vb img{
  max-width:100%;
  height:auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.viewer .vb a{
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: none;
}

.viewer .vb a:hover{ text-decoration: underline; }

.empty{
  padding: 26px 10px;
  text-align:center;
  color: var(--muted);
}

.empty h3{
  margin:0 0 6px;
  font-size: 1.05rem;
  color: var(--ink);
}

.empty p{ margin:0; }

.err{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,123,123,.55);
  background: rgba(255,123,123,.12);
}

/* =========================================================
   Mobile layout
   ========================================================= */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .split{ grid-template-columns: 1fr; }
  .sidebar{ position: static; }
}

@media (min-width: 900px){
  .recent-list{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px){
  html{ -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  body{ font-size: 13.5px; }

  .wrap{ padding: 12px 12px 90px; }

  .header{
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .brand h1{ font-size: 1.2rem; }
  .brand .sub{ font-size: .8rem; line-height: 1.35; }

  .header-actions{
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .pill{
    width: 100%;
    justify-content: space-between;
    padding: 8px 10px;
  }

  #activeEmailMini{
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .layout{ grid-template-columns: 1fr; gap: 14px; }
  .split{ grid-template-columns: 1fr; padding: 10px; gap: 10px; }

  .row{ flex-direction: column; align-items: stretch; }
  .row .input, .row .btn{ width: 100%; }
  .row .btn{ flex: 0 0 auto; padding: 10px 12px; }

  .email-line{ flex-direction: column; align-items: stretch; }
  #copyBtn{ width: 100%; }

  .stack{ flex-direction: column; gap: 8px; }
  .stack .btn{ width: 100%; }

  .toolbar{ flex-direction: column; align-items: stretch; gap: 8px; }
  .search{ min-width: 0; }
  .status{ width: 100%; justify-content: flex-start; }

  .pane{ min-height: unset; }
  .pane .pbd{ max-height: 56vh; }
  .viewer .vb{ max-height: 52vh; }

  .recent-list{ max-height: 180px; grid-template-columns: 1fr; }
}

/* =========================================================
   Toast
   ========================================================= */
.toast-wrap{
  position: fixed;
  right: 12px;
  bottom: 16px;
  display:flex;
  flex-direction:column;
  gap: 10px;
  z-index: 9999;
  pointer-events:none;
}

.toast{
  pointer-events:none;
  min-width: 220px;
  max-width: 340px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display:flex;
  align-items:flex-start;
  gap: 10px;
  opacity:0;
  transform: translateY(8px);
  animation: toastIn 200ms var(--ease) forwards;
}

@keyframes toastIn{ to{ opacity:1; transform: translateY(0); } }
@keyframes toastOut{ to{ opacity:0; transform: translateY(8px); } }

.toast .ico{
  width: 24px; height: 24px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  display:grid;
  place-items:center;
  background: var(--surface-2);
  font-weight: 700;
  flex:0 0 auto;
}

.toast b{ display:block; font-weight: 700; }
.toast small{ display:block; margin-top: 2px; color: var(--muted); line-height: 1.35; }

/* Inline tabs for mobile */
.inline-tabs{ display:none; }

@media (max-width: 720px){
  .inline-tabs{ display:flex; gap:8px; width:100%; margin-top: 6px; }
}

.tab-btn{
  flex:1;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.tab-btn.active{
  background: linear-gradient(135deg, rgba(104,224,198,.18), rgba(123,182,255,.16));
}

.is-hidden{ display:none !important; }

/* =========================================================
   Access Gate + Admin
   ========================================================= */
.auth-page{
  min-height: 100vh;
  min-height: 100svh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 16px;
  width: 100%;
}

.auth-card{
  width: min(520px, 100%);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-head{
  display:flex;
  align-items:center;
  gap: 12px;
}

.auth-sticker{
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display:grid;
  place-items:center;
  overflow: hidden;
}

.auth-sticker img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  border-radius: 12px;
}

.auth-head h1{
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--display);
}

.auth-head p{
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.auth-form{
  margin-top: 14px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.auth-input{
  font-size: 1rem;
  font-family: var(--mono);
  letter-spacing: .12em;
}

.auth-btn{ width:100%; }

.auth-error{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,123,123,.55);
  background: rgba(255,123,123,.12);
}

.auth-note{
  margin-top: 12px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.5;
}

.admin-shell{
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 18px 90px;
}

.admin-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-title{
  display:flex;
  align-items:center;
  gap: 12px;
}

.admin-title h1{
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--display);
}

.admin-title p{
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.admin-grid{
  margin-top: 16px;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
  align-items: stretch;
}

.admin-card{
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

.admin-card-hd{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-weight: 700;
}

.admin-form{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.admin-field{ display:flex; flex-direction:column; gap: 6px; }

.admin-field-inline{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 10px;
}

.admin-flash{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(104,224,198,.35);
  background: rgba(104,224,198,.12);
}

.admin-metrics{
  padding: 14px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.admin-metrics > div{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}

.metric-label{
  display:block;
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.metric-value{
  display:block;
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 4px;
}

.admin-note{
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: .88rem;
}

.admin-table{
  display:grid;
  overflow:auto;
  border-top: 1px solid var(--line-strong);
  font-variant-numeric: tabular-nums;
}

.admin-row{
  min-width: 0;
  display:grid;
  grid-template-columns:
    minmax(170px, 2fr)
    minmax(90px, 1fr)
    minmax(90px, .8fr)
    minmax(70px, .6fr)
    minmax(130px, 1fr)
    minmax(110px, .9fr)
    minmax(170px, 1.1fr)
    minmax(180px, 1.3fr);
  gap: 10px;
  align-items:center;
  padding: 10px 12px;
  border-top: 1px solid var(--line-strong);
}

.admin-row > div{ min-width: 0; }

.admin-row-head{
  border-top: none;
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 2;
}

.admin-row-empty{
  padding: 16px 12px;
  color: var(--muted);
}

.admin-row:not(.admin-row-head):hover{
  background: rgba(255,255,255,.03);
}

.admin-row > div:last-child{
  justify-self: end;
  text-align: right;
}

.admin-row > div:nth-child(3){
  display:flex;
  align-items:center;
  justify-content:center;
}

.ua-cell{
  display:flex;
  flex-direction:column;
  gap: 4px;
  font-size: .82rem;
  color: var(--muted);
  max-width: 240px;
  overflow: hidden;
}

.ua-cell .ua-agent{
  color: var(--ink);
  font-size: .84rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ua-cell .ua-ip{
  font-family: var(--mono);
  font-size: .78rem;
}

.key-cell{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap:wrap;
}

.key-text{
  font-family: var(--mono);
  font-weight: 700;
  white-space: normal;
  word-break: break-all;
}

.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  min-width: 86px;
  justify-self: center;
  text-align: center;
}

.status-pill.is-ready{ background: rgba(104,224,198,.16); }
.status-pill.is-used{ background: rgba(255,180,84,.18); }
.status-pill.is-expired{ background: rgba(255,123,123,.18); }
.status-pill.is-pending{ background: rgba(123,182,255,.18); }

.admin-actions{
  display:flex;
  flex-direction:column;
  gap: 8px;
  align-items:flex-end;
}

.admin-edit-form{
  width: 100%;
  max-width: 210px;
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.admin-edit-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.admin-edit-row select{ grid-column: 1 / -1; }

.admin-edit-form .input{
  padding: 7px 8px;
  font-size: .78rem;
}

@media (max-width: 980px){
  .admin-grid{ grid-template-columns: 1fr; }
  .admin-header{ flex-direction: column; align-items: flex-start; }
}
