:root {
  --bg: #07111f;
  --card: rgba(255,255,255,.10);
  --card-strong: rgba(255,255,255,.15);
  --line: rgba(255,255,255,.18);
  --text: #eef7ff;
  --muted: #a9bad0;
  --accent: #75e4ff;
  --accent-2: #8d7bff;
  --success: #48e59b;
  --warning: #ffe16a;
  --danger: #ff6f8f;
  --shadow: 0 24px 90px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(117,228,255,.24), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(141,123,255,.26), transparent 35%),
    linear-gradient(135deg, #06111f, #0b1021 45%, #070816);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(25px);
  opacity: .22;
  pointer-events: none;
  z-index: 0;
}
.orb-1 { background: var(--accent); left: -120px; top: 170px; }
.orb-2 { background: var(--accent-2); right: -150px; bottom: 80px; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 60px;
  display: grid;
  grid-template-columns: .9fr 1.25fr;
  gap: 22px;
  align-items: start;
}

.hero-card, .result-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.075));
  backdrop-filter: blur(22px);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  position: sticky;
  top: 20px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  width: 62px;
  height: 62px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -1px;
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), var(--success));
  box-shadow: 0 14px 35px rgba(117,228,255,.28);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .14em;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -2px;
  line-height: .95;
}
.subtitle {
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}
.order-link {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  padding: 13px 16px;
  border-radius: 18px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  background: rgba(117,228,255,.12);
  border: 1px solid rgba(117,228,255,.28);
}

.search-box {
  margin-top: 24px;
  padding: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.search-box label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 10px;
}
.input-row {
  display: flex;
  gap: 10px;
}
input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  outline: none;
  background: rgba(2,10,22,.66);
  color: var(--text);
  border-radius: 18px;
  padding: 16px;
  font-size: 16px;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(117,228,255,.13);
}
button {
  border: 0;
  border-radius: 18px;
  padding: 0 18px;
  min-height: 54px;
  cursor: pointer;
  font-weight: 900;
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), var(--success));
  box-shadow: 0 12px 28px rgba(72,229,155,.18);
}
button:disabled { opacity: .5; cursor: not-allowed; }
.ghost-btn {
  background: rgba(255,255,255,.1);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}
.status-grid div {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
}
.status-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.status-grid strong { font-size: 15px; }

.result-panel { padding: 20px; min-height: 560px; }
.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 10px 8px 18px;
}
h2 { margin: 0; font-size: 26px; letter-spacing: -.8px; }
.empty-state {
  min-height: 390px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,.22);
  border-radius: 28px;
  padding: 34px;
}
.mail-icon { font-size: 58px; margin-bottom: 16px; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.messages { display: grid; gap: 14px; }
.message-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.09);
  border-radius: 26px;
  padding: 18px;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.message-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.badge-new {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  color: #06111f;
  background: var(--warning);
  white-space: nowrap;
}
.subject { margin: 0 0 6px; font-size: 18px; }
.meta { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.codes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  color: #04111e;
  background: linear-gradient(135deg, var(--warning), #fff4ad);
  font-weight: 950;
  font-size: 22px;
  letter-spacing: 1.8px;
}
.copy-btn, .link-btn, .detail-btn {
  min-height: auto;
  padding: 9px 11px;
  border-radius: 12px;
  box-shadow: none;
  font-size: 12px;
}
.copy-btn { background: rgba(4,17,30,.13); color: #04111e; }
.detail-btn, .link-btn { background: rgba(117,228,255,.12); color: var(--text); border: 1px solid rgba(117,228,255,.22); }
.body-preview {
  color: #d6e5f5;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
  background: rgba(0,0,0,.16);
  border-radius: 18px;
  padding: 14px;
  max-height: 132px;
  overflow: hidden;
}
.body-preview.open { max-height: none; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.links a { text-decoration: none; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(24px);
  opacity: 0;
  pointer-events: none;
  background: var(--success);
  color: #06111f;
  padding: 13px 18px;
  border-radius: 99px;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  z-index: 10;
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; padding-top: 14px; width: min(100% - 18px, 1120px); }
  .hero-card { position: relative; top: 0; padding: 20px; border-radius: 26px; }
  .result-panel { padding: 14px; border-radius: 26px; min-height: 440px; }
  .input-row { flex-direction: column; }
  button { width: 100%; }
  .panel-header { align-items: flex-start; }
  h1 { font-size: 38px; }
}
