:root {
  color-scheme: light;
  --ink: #243449;
  --muted: #66778f;
  --line: #e4dacb;
  --paper: #fffaf1;
  --surface: #fff4df;
  --yellow: #f3c950;
  --blue: #78b5d4;
  --green: #77c8a6;
  --red: #dd6861;
  --shadow: 0 28px 80px rgba(83, 66, 42, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 6%, rgba(120, 181, 212, 0.22), transparent 28rem),
    radial-gradient(circle at 8% 88%, rgba(243, 201, 80, 0.2), transparent 26rem),
    var(--paper);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 32px;
  min-height: 82px;
  padding: 14px clamp(20px, 4vw, 54px) 12px;
  overflow: hidden;
  border-bottom: 1px solid rgba(96, 76, 48, 0.14);
  background: rgba(255, 250, 241, 0.9);
  backdrop-filter: blur(18px);
}

.app-header::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -84px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(221, 104, 97, 0.22), transparent 64%),
    radial-gradient(circle at 38% 34%, var(--yellow) 0 14px, transparent 15px),
    radial-gradient(circle at 66% 58%, var(--green) 0 18px, transparent 19px),
    radial-gradient(circle at 52% 72%, var(--blue) 0 10px, transparent 11px);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 238px;
  position: relative;
  z-index: 1;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  gap: clamp(16px, 3vw, 34px);
  position: relative;
  z-index: 1;
  padding-bottom: 5px;
  color: #536b8c;
  font-size: 14px;
  font-weight: 700;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--ink);
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  padding-bottom: 2px;
}

.user-email {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  cursor: pointer;
}

.icon-button svg,
.primary-button svg {
  width: 19px;
  height: 19px;
}

.icon-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 78px) 0 80px;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(320px, 420px);
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 210px);
}

.auth-copy h1,
.page-title h1 {
  max-width: 760px;
  margin: 0;
  color: #2a3542;
  font-size: clamp(34px, 4.3vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-copy p:not(.eyebrow),
.page-title p {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 14px;
  color: #8a6b22;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-panel,
.panel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel {
  display: grid;
  gap: 22px;
  justify-items: center;
  padding: 34px;
  text-align: center;
}

.login-panel::before,
.metric-card::before,
.panel::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  opacity: 0.28;
  background: rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.login-panel::before {
  right: -70px;
  bottom: -78px;
}

.login-panel img {
  position: relative;
  width: 250px;
  max-width: 100%;
  height: auto;
}

.login-panel h1 {
  position: relative;
  margin: 0;
  color: #2a3542;
  font-size: 28px;
  line-height: 1.15;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 18px 40px rgba(221, 104, 97, 0.25);
  font-weight: 800;
  cursor: pointer;
}

.primary-button svg {
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.page-title {
  margin-bottom: 34px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 38px;
}

.metric-card {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.metric-card::before {
  right: -72px;
  top: -62px;
}

.metric-card span,
.metric-card strong,
.metric-card p {
  position: relative;
}

.metric-card span {
  display: block;
  min-height: 42px;
  color: rgba(36, 52, 73, 0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
}

.metric-card p {
  margin: 18px 0 0;
  color: rgba(36, 52, 73, 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.metric-card.yellow {
  background: #f4cf63;
}

.metric-card.blue {
  background: #9bc9df;
}

.metric-card.green {
  background: #91d5b9;
}

.metric-card.red {
  background: #e88983;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 24px;
}

.panel {
  padding: 28px;
}

.panel::before {
  right: -96px;
  bottom: -84px;
}

.panel h2 {
  position: relative;
  margin: 0 0 18px;
  font-size: 22px;
}

.action-list,
.queue-list {
  position: relative;
  display: grid;
  gap: 10px;
}

.action-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--yellow);
  font-weight: 800;
  text-decoration: none;
}

.action-list a::after {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  clip-path: path("M8.7 3.3 7.3 4.7 10.6 8H3v2h7.6l-3.3 3.3 1.4 1.4L14.4 9z");
}

.token-details {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
  font-size: 14px;
}

.token-details.compact {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(96, 76, 48, 0.14);
  font-size: 12px;
}

.queue-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.queue-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  font-weight: 800;
  cursor: pointer;
}

.queue-tab.active {
  background: var(--yellow);
}

.queue-status {
  position: relative;
  min-height: 22px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.queue-item {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.queue-item strong {
  font-size: 15px;
}

.queue-item span,
.queue-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state {
  position: relative;
  display: grid;
  min-height: 92px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.token-details dt {
  color: var(--muted);
  font-weight: 800;
}

.token-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .app-header {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .brand {
    width: 210px;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .auth-panel,
  .workbench {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 28px, 1180px);
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .auth-copy h1,
  .page-title h1 {
    font-size: 34px;
  }
}
