.console-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 65% 45% at 80% 0%, rgba(255, 90, 38, 0.065), transparent 65%),
    var(--bg);
}

.workspace {
  flex: 1;
  padding-block: clamp(2rem, 4vw, 3.6rem);
}

.workspace-heading, .panel-title, .checkout-top, .order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.workspace-heading h1 {
  font-size: clamp(1.8rem, 2.8vw, 2.45rem);
  font-weight: 740;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--ink);
}

.account-type {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--signal-soft);
  padding: .24rem .72rem;
  border-radius: 999px;
  margin-bottom: .65rem;
}
.account-type:empty { display: none; }

.view, .notice { margin-top: 1.35rem; }

.notice {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .9rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 90, 38, 0.25);
  border-left: 3px solid var(--signal);
  background: #fff6f2;
  color: var(--ink);
  font-size: .92rem;
  box-shadow: var(--shadow-xs);
  overflow-wrap: anywhere;
}

.panel {
  min-width: 0;
  padding: clamp(1.3rem, 2.2vw, 1.85rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.panel-title {
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .85rem;
}

.panel h2 {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--ink);
}

.panel-intro, .footnote { color: var(--muted); }
.panel-intro {
  margin: .45rem 0 1.15rem;
  font-size: .9rem;
  line-height: 1.65;
}
.footnote { font-size: .84rem; margin-top: .75rem; line-height: 1.55; }
.footnote:empty { display: none; }

.context-label {
  font-size: .82rem;
  color: var(--muted);
}

.currency-pill {
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

/* Wallet Hero Card */
.wallet-bar {
  margin-top: 1.5rem;
  padding: clamp(1.4rem, 2.6vw, 2rem);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(ellipse 65% 95% at 92% 15%, rgba(255, 90, 38, 0.24), transparent 65%),
    linear-gradient(155deg, #171b24 0%, #0e1016 100%);
  color: #ffffff;
  box-shadow: var(--shadow-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem 1.8rem;
  flex-wrap: wrap;
}

.wallet-info, .wallet-actions {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  flex-wrap: wrap;
}

.wallet-icon {
  display: grid;
  place-items: center;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 14px;
  background: rgba(255, 90, 38, 0.16);
  border: 1px solid rgba(255, 118, 72, 0.34);
  color: #ff9c7a;
  flex: none;
}
.wallet-icon svg { width: 1.45rem; height: 1.45rem; }

.wallet-info h2 {
  font-size: .84rem;
  font-weight: 550;
  color: #a6aec0;
  letter-spacing: .01em;
}

.wallet-info strong {
  display: block;
  margin-top: .18rem;
  font-size: clamp(1.8rem, 2.8vw, 2.45rem);
  line-height: 1.1;
  font-weight: 740;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.wallet-actions .button {
  min-height: 2.75rem;
  padding-inline: 1.35rem;
}

.wallet-actions .button-light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #cfd5e3;
  box-shadow: none;
}

.wallet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 1.25rem;
  align-items: start;
}

.wallet-grid .view { margin-top: 1.35rem; }

/* Ledger & Order Lists */
.orders-list { list-style: none; margin: 0; padding: 0; }
.orders-list li {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.orders-list li:last-child { padding-bottom: 0; }

.orders-list .empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  border-top: 1px dashed var(--line-strong);
}

.order-head { flex-wrap: wrap; gap: .5rem 1rem; }
.order-head-left {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}
.order-head h3 {
  font-size: .96rem;
  font-weight: 650;
  color: var(--ink);
}
.order-head strong {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 700;
}
.amount-positive { color: #047857; }
.amount-negative { color: var(--ink); }

.order-detail {
  display: block;
  margin-top: .35rem;
  font-size: .8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .16rem .6rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 650;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pending { background: #fef3c7; color: #b45309; }
.status-credited { background: #d1fae5; color: #047857; }
.status-rejected { background: #ffe4e6; color: #be123c; }

/* Dialogs */
dialog {
  width: min(29rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.4rem, 3vw, 2rem);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px -14px rgba(10, 12, 18, 0.38);
}
dialog::backdrop {
  background: rgba(16, 19, 25, 0.55);
  backdrop-filter: blur(4px);
}
body:has(dialog[open]) { overflow: hidden; }
dialog.support-window { padding: 0; }

.checkout-top h2 {
  font-size: 1.35rem;
  font-weight: 730;
  letter-spacing: -.015em;
}
.close-button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 1.3rem;
  line-height: 1;
  transition: background-color .15s ease, color .15s ease;
}
.close-button:hover { background: var(--line-strong); color: var(--ink); }

.amount-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  margin-top: 1.15rem;
}
.amount-presets button {
  min-height: 2.45rem;
  padding: .4rem .5rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.amount-presets button:hover {
  border-color: var(--signal);
  background: var(--signal-soft);
  color: var(--accent-ink);
}

/* Forms & Inputs */
.form-label {
  display: block;
  color: var(--ink-secondary);
  margin: 1rem 0 .85rem;
  font-size: .86rem;
  font-weight: 600;
}
.form-label input, .form-label select {
  display: block;
  width: 100%;
  min-height: 2.85rem;
  margin-top: .38rem;
  padding: .55rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-size: .96rem;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.form-label input:hover:not(:disabled):not([readonly]),
.form-label select:hover:not(:disabled) {
  border-color: rgba(18, 21, 28, 0.3);
}
.form-label input:focus, .form-label select:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3.5px rgba(255, 90, 38, 0.14);
}
.form-label input[readonly] {
  background: var(--bg-subtle);
  color: var(--muted);
}

#code {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .38em;
  text-align: center;
  min-height: 3.25rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem 0;
  color: var(--accent-ink);
  background: transparent;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease;
}
.link-button:hover:not(:disabled) {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error {
  margin-top: .75rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.5;
}
.error:empty { display: none; }

/* Login Page */
.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 4.5rem) 1rem;
  background:
    radial-gradient(ellipse 65% 50% at 50% 0%, rgba(255, 90, 38, 0.08), transparent 65%),
    radial-gradient(rgba(18, 21, 28, 0.05) 1px, transparent 1px);
  background-size: auto, 24px 24px;
}

.login-card {
  width: min(100%, 27.5rem);
  padding: clamp(1.6rem, 3vw, 2.25rem);
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.login-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .84rem;
  font-weight: 650;
  color: var(--ink-secondary);
}
.login-brand-mark img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.login-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .28rem;
  padding: .26rem;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}
.login-switch button {
  min-height: 2.35rem;
  padding: .42rem .75rem;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: .88rem;
  font-weight: 550;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.login-switch button:hover:not(:disabled) { color: var(--ink); }
.login-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: var(--shadow-xs);
}

.login-card h1 {
  font-size: 1.65rem;
  font-weight: 740;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin-top: 1.45rem;
  color: var(--ink);
}
.login-card .panel-intro { margin: .4rem 0 1.25rem; }

.challenge-box {
  margin-top: .95rem;
  padding: .9rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.challenge-box #challenge-status {
  margin-top: 0;
  margin-bottom: .55rem;
  font-size: .82rem;
  color: var(--ink-secondary);
}
#challenge-widget {
  min-height: 65px;
  display: flex;
  align-items: center;
}
.challenge-box #challenge-error { margin-top: .55rem; }
.challenge-box #retry-verification { margin-top: .5rem; }

.full-width { width: 100%; margin-top: 1rem; }
#confirm-topup, #login-submit { width: 100%; margin-top: .85rem; }
#change-email { margin-top: .85rem; }
#login-status {
  margin-top: .9rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: .86rem;
  font-weight: 500;
}
#login-status:empty { display: none; }

.button:disabled {
  background: #e5e7ec;
  border-color: transparent;
  color: #828896;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.wallet-actions .button:disabled {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
}

/* Staff Workbench */
#review-list li {
  padding: 1.15rem;
  margin-top: .85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--bg);
}
#review-list li:first-child { margin-top: 0; }
#review-list h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#review-list small {
  display: block;
  margin-top: .25rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
}
#review-list form {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: .5rem;
}
#review-list label {
  flex: 1 1 10rem;
  margin: .35rem 0 0;
}
#review-list form button { min-height: 2.85rem; }

.desk-layout {
  display: grid;
  grid-template-columns: minmax(15.5rem, .78fr) minmax(0, 1.85fr);
  gap: 1.25rem;
  margin-top: 1.35rem;
  align-items: start;
}

.desk-inbox { align-self: start; }
#queue-count {
  padding: .18rem .6rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

#room-list {
  max-height: 62dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-top: .95rem;
}

.room-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  text-align: left;
  align-items: center;
  gap: .28rem .65rem;
  padding: .85rem .9rem;
  border-radius: 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.room-item:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}
.room-item[aria-pressed="true"] {
  border-color: rgba(255, 90, 38, 0.45);
  background: #fff7f4;
  box-shadow: 0 2px 10px -4px rgba(255, 90, 38, 0.2);
}
.room-item strong { font-size: .9rem; font-weight: 650; }
.room-item small {
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--signal-soft);
  color: var(--accent-ink);
  font-size: .74rem;
  font-weight: 650;
}
.room-item span {
  grid-column: 1 / -1;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  color: var(--muted);
  font-size: .84rem;
}

#desk-chat {
  border: 1px solid var(--line);
  margin-top: 1rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
#desk-chat .chat-log { height: clamp(16rem, 45dvh, 32rem); }

@media (max-width: 860px) {
  .wallet-grid { grid-template-columns: 1fr; }
  .desk-layout { grid-template-columns: 1fr; }
  #room-list { max-height: 15rem; }
}

@media (max-width: 680px), (max-height: 570px) {
  dialog:is(#checkout, #topup) { max-height: calc(100dvh - 5rem); margin-block: auto; }
}

@media (max-width: 680px) {
  .workspace-heading .button { min-height: 2.5rem; padding-inline: .95rem; }
  .wallet-bar { padding: 1.25rem; }
  .wallet-icon { width: 2.65rem; height: 2.65rem; border-radius: 11px; }
  .wallet-actions { width: 100%; }
  .wallet-actions .button { flex: 1; padding-inline: .9rem; }
  .login-card { padding: 1.4rem; }
  .amount-presets { grid-template-columns: repeat(2, 1fr); }
}
