:root {
  color-scheme: dark;
  --vw: 1vw;
  --vh: 1vh;
  --bg: #15130f;
  --surface: #211d17;
  --surface-soft: #2d271f;
  --surface-raised: #342d23;
  --ink: #f7eddb;
  --muted: #b8a991;
  --line: #493f32;
  --primary: #d9b66f;
  --primary-strong: #f0cf86;
  --accent: #8fb7a0;
  --danger: #e27b66;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: calc(var(--vh) * 100);
  background:
    radial-gradient(circle at 18% 0%, rgba(217, 182, 111, 0.16), transparent 32%),
    radial-gradient(circle at 82% 8%, rgba(143, 183, 160, 0.1), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

#app {
  min-height: 100vh;
  min-height: calc(var(--vh) * 100);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.login-shell {
  min-height: 100vh;
  min-height: calc(var(--vh) * 100);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
}

.login-visual {
  position: relative;
  display: flex;
  align-items: end;
  padding: 48px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(21, 19, 15, 0.92), rgba(83, 66, 43, 0.72)),
    url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  color: var(--ink);
}

.login-copy {
  max-width: 680px;
}

.login-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(247, 237, 219, 0.82);
  font-size: 18px;
  line-height: 1.55;
}

.login-panel {
  display: flex;
  align-items: center;
  padding: 34px;
  background: var(--surface);
}

.login-box {
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  font-weight: 800;
  line-height: 1.15;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-strong), #a9813e);
  color: #16120d;
  overflow: hidden;
}

.logo-mark {
  border: 0;
  background: transparent;
  box-shadow: none;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17140f;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.field textarea {
  min-height: 94px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 182, 111, 0.16);
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.captcha-question {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid rgba(217, 182, 111, 0.26);
  border-radius: 8px;
  background: rgba(217, 182, 111, 0.09);
  color: var(--primary-strong);
  padding: 0 12px;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.captcha-refresh {
  min-width: 68px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-btn {
  background: var(--primary);
  color: #17130d;
}

.primary-btn:hover {
  background: var(--primary-strong);
}

.secondary-btn {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-btn {
  background: rgba(189, 62, 53, 0.11);
  color: var(--danger);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
}

.full {
  width: 100%;
}

.hint {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  min-height: calc(var(--vh) * 100);
  grid-template-columns: 260px minmax(0, 1fr);
}

.mobile-header,
.nav-scrim {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(33, 29, 23, 0.94);
  padding: 24px 18px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
}

.nav button.active,
.nav button:hover {
  border-color: rgba(217, 182, 111, 0.34);
  background: linear-gradient(135deg, rgba(217, 182, 111, 0.18), rgba(143, 183, 160, 0.08));
  color: var(--primary-strong);
}

.nav button.admin-nav {
  border-color: rgba(143, 183, 160, 0.24);
  background: linear-gradient(135deg, rgba(143, 183, 160, 0.12), rgba(217, 182, 111, 0.07));
  color: #d9cdb8;
}

.nav button.admin-nav::before {
  content: "ADMIN";
  margin-right: 4px;
  border-radius: 999px;
  background: rgba(143, 183, 160, 0.16);
  color: var(--accent);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 950;
}

.nav button.admin-nav.active,
.nav button.admin-nav:hover {
  border-color: rgba(143, 183, 160, 0.52);
  background: linear-gradient(135deg, rgba(143, 183, 160, 0.22), rgba(217, 182, 111, 0.12));
  color: var(--ink);
}

.admin-only-panel {
  border-color: rgba(143, 183, 160, 0.3);
  background: linear-gradient(180deg, rgba(42, 48, 39, 0.88), rgba(29, 31, 25, 0.96));
}

.compact-edit-list {
  margin-top: 0;
}

.content {
  min-width: 0;
  width: 100%;
  padding: 28px clamp(18px, 4vw, 52px) 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(52, 45, 35, 0.94), rgba(33, 29, 23, 0.96));
  box-shadow: var(--shadow);
}

.metric {
  padding: 20px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  color: var(--primary-strong);
}

.section {
  margin-top: 18px;
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(217, 182, 111, 0.18);
  background: rgba(217, 182, 111, 0.12);
  color: var(--primary-strong);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

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

.category-stack {
  display: grid;
  gap: 18px;
}

.category-section {
  border: 1px solid rgba(217, 182, 111, 0.2);
  border-radius: 8px;
  padding: 16px;
}

.category-section.personal {
  background: linear-gradient(180deg, rgba(63, 52, 37, 0.76), rgba(33, 29, 23, 0.86));
}

.category-section.business {
  background: linear-gradient(180deg, rgba(42, 48, 39, 0.78), rgba(28, 31, 25, 0.9));
  border-color: rgba(181, 153, 96, 0.28);
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.category-heading h4 {
  color: var(--primary-strong);
  font-size: 18px;
}

.category-heading span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 28px;
  border: 1px solid rgba(217, 182, 111, 0.22);
  border-radius: 999px;
  color: var(--primary-strong);
  font-weight: 900;
}

.category-section .table-wrap {
  border-radius: 8px;
}

.category-section .bank-grid,
.category-section .conditions-grid {
  margin-top: 0;
}

.partner-rate-stack {
  display: grid;
  gap: 16px;
}

.partner-rate-panel {
  border: 1px solid rgba(217, 182, 111, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(42, 37, 29, 0.88), rgba(27, 25, 20, 0.94));
  padding: 16px;
}

.partner-rate-panel.is-minimized {
  background: linear-gradient(180deg, rgba(37, 34, 28, 0.84), rgba(26, 24, 20, 0.92));
}

.partner-rate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.partner-rate-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.icon-btn {
  width: 38px;
  min-height: 34px;
  padding: 0;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.partner-rate-summary {
  border: 1px dashed rgba(217, 182, 111, 0.2);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
}

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

.condition-card {
  padding: 18px;
}

.bank {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.bank h3 {
  font-size: 20px;
}

.instruction-card {
  max-width: 920px;
}

.instruction-text {
  min-height: 180px;
  border: 1px solid rgba(217, 182, 111, 0.18);
  border-radius: 8px;
  background: rgba(21, 19, 15, 0.34);
  color: var(--ink);
  padding: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bank-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.method-card {
  position: relative;
  display: grid;
  gap: 9px;
  place-items: center;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px 10px;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.method-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.method-card:has(input:checked),
.method-card.selected {
  border-color: rgba(217, 182, 111, 0.68);
  background: rgba(217, 182, 111, 0.13);
  box-shadow: inset 0 0 0 2px rgba(217, 182, 111, 0.16);
}

.method-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  padding: 4px;
}

.method-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.method-logo.crypto {
  background: #f0a62f;
}

.method-logo.blik {
  background: #151515;
}

.method-logo.revolut {
  background: #176bff;
}

.method-logo.sepa {
  background: #315b92;
}

.method-logo.zen {
  background: #1d1d1f;
}

.method-fields {
  margin-top: 4px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.split-actions {
  justify-content: space-between;
}

.split-actions button {
  flex: 1 1 180px;
}

.edit-list {
  display: grid;
  gap: 12px;
}

.edit-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 19, 15, 0.24);
  padding: 14px;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.message {
  margin-top: 12px;
  border-radius: 8px;
  background: rgba(14, 124, 102, 0.1);
  color: var(--primary-strong);
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 800;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 80;
  transform: translate(-50%, 12px);
  border: 1px solid rgba(217, 182, 111, 0.34);
  border-radius: 8px;
  background: rgba(33, 29, 23, 0.96);
  color: var(--primary-strong);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chat-panel {
  display: grid;
  gap: 16px;
}

.chat-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
}

.chat-message {
  max-width: 78%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 19, 15, 0.34);
  padding: 12px;
}

.chat-message.mine {
  justify-self: end;
  border-color: rgba(217, 182, 111, 0.38);
  background: rgba(217, 182, 111, 0.12);
}

.chat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.chat-meta strong {
  color: var(--primary-strong);
}

.chat-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-message p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  gap: 10px;
}

.emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emoji-row button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 20px;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-compose input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17140f;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.support-widget {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 50;
}

.support-fab {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(217, 182, 111, 0.4);
  border-radius: 50%;
  background: var(--primary);
  color: #17130d;
  box-shadow: var(--shadow);
  font-size: 25px;
  font-weight: 950;
}

.support-panel {
  position: absolute;
  left: 0;
  bottom: 72px;
  display: none;
  width: min(380px, calc(100vw - 44px));
  max-height: min(70vh, 620px);
  overflow-y: auto;
  padding: 16px;
}

.support-widget.open .support-panel {
  display: grid;
  gap: 14px;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.support-minimize {
  width: 38px;
  min-height: 34px;
  padding: 4px;
  font-size: 22px;
}

.support-history,
.ticket-list,
.ticket-messages {
  display: grid;
  gap: 10px;
}

.support-ticket,
.ticket-item {
  display: grid;
  gap: 10px;
}

.support-ticket {
  border: 1px solid rgba(217, 182, 111, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(217, 182, 111, 0.15), rgba(143, 183, 160, 0.08)),
    rgba(21, 19, 15, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  padding: 12px;
}

.support-ticket .pill {
  border-color: rgba(143, 183, 160, 0.32);
  background: rgba(143, 183, 160, 0.13);
  color: #cfe0d5;
}

.support-ticket .section-head,
.support-conversation .section-head {
  margin-bottom: 0;
}

.ticket-message {
  max-width: 86%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 19, 15, 0.34);
  padding: 10px 12px;
}

.ticket-message.mine {
  justify-self: end;
  border-color: rgba(217, 182, 111, 0.38);
  background: rgba(217, 182, 111, 0.12);
}

.ticket-message p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ticket-window-btn {
  width: 38px;
  min-height: 34px;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.ticket-item.collapsed {
  background: linear-gradient(135deg, rgba(143, 183, 160, 0.12), rgba(21, 19, 15, 0.32));
}

.ticket-item.collapsed .ticket-body {
  display: none;
}

.ticket-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ticket-close {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ticket-reply input,
.ticket-close input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17140f;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.support-conversation {
  display: grid;
  gap: 12px;
}

@media (max-width: 920px), (pointer: coarse) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(33, 29, 23, 0.97);
    padding: calc(12px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
    backdrop-filter: blur(14px);
  }

  .mobile-header .brand {
    min-width: 0;
    margin: 0;
    font-size: 15px;
  }

  .mobile-header .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-toggle {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(330px, calc(100vw - 44px));
    height: calc(var(--vh) * 100);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    background: rgba(33, 29, 23, 0.99);
    box-shadow: 24px 0 48px rgba(0, 0, 0, 0.36);
    transform: translateX(-104%);
    transition: transform 180ms ease;
    overflow-y: auto;
  }

  .sidebar .brand {
    gap: 9px;
    font-size: 15px;
  }

  .sidebar .muted {
    display: block;
  }

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

  .nav button {
    min-height: 44px;
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(8, 7, 5, 0.58);
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  body.menu-open .nav-scrim {
    display: block;
  }

  .content {
    padding: 24px 22px 44px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

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

  .stats .metric:first-child {
    grid-column: auto;
  }

  .bank-grid,
  .conditions-grid {
    grid-template-columns: 1fr;
  }

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

  .chat-message {
    max-width: 92%;
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }

  .chat-compose .primary-btn {
    width: 100%;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .section {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  h2 {
    font-size: clamp(30px, 5vw, 40px);
  }

  .table-wrap {
    max-width: 100%;
  }

  th,
  td {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 920px) {
  .login-shell,
  .app-shell,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 38vh;
  }

  .stats,
  .bank-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  html,
  body,
  #app,
  .app-shell {
    width: calc(var(--vw) * 100);
    max-width: calc(var(--vw) * 100);
    overflow-x: hidden;
  }

  body {
    background:
      linear-gradient(180deg, rgba(217, 182, 111, 0.12), rgba(21, 19, 15, 0) 260px),
      var(--bg);
  }

  .login-shell {
    min-height: 100svh;
    min-height: calc(var(--vh) * 100);
  }

  .login-panel,
  .login-visual,
  .content {
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }

  .login-visual {
    min-height: 32svh;
    align-items: center;
    background-position: 42% center;
  }

  .login-copy h1 {
    max-width: 11ch;
    margin-bottom: 12px;
    font-size: 38px;
    line-height: 1;
  }

  .login-copy p {
    max-width: 30ch;
    font-size: 15px;
    line-height: 1.45;
  }

  .login-panel {
    align-items: flex-start;
    border-radius: 18px 18px 0 0;
    margin-top: -16px;
    min-height: 68svh;
    position: relative;
  }

  .login-box {
    padding-top: 8px;
  }

  .brand {
    gap: 10px;
    margin-bottom: 22px;
    font-size: 15px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .field {
    margin-bottom: 14px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 46px;
    padding: 12px;
    font-size: 16px;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .captcha-question,
  .captcha-refresh {
    width: 100%;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn,
  .ghost-btn {
    min-height: 46px;
    padding: 11px 13px;
  }

  .app-shell {
    min-height: 100svh;
    min-height: calc(var(--vh) * 100);
  }

  .mobile-header {
    left: 0;
    right: 0;
    width: calc(var(--vw) * 100);
    max-width: calc(var(--vw) * 100);
    padding: calc(10px + env(safe-area-inset-top)) 10px 10px;
  }

  .mobile-header .brand {
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
  }

  .mobile-header .brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .mobile-header .brand span:last-child {
    max-width: calc((var(--vw) * 100) - 132px);
    line-height: 1.12;
    white-space: normal;
  }

  .menu-toggle {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .support-widget {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: auto;
  }

  .support-fab {
    width: 54px;
    height: 54px;
  }

  .support-panel {
    right: 0;
    left: auto;
    bottom: 66px;
    width: calc((var(--vw) * 100) - 32px);
    max-height: min(72vh, 620px);
  }

  .ticket-reply,
  .ticket-close {
    grid-template-columns: 1fr;
  }

  .ticket-reply .primary-btn,
  .ticket-close .danger-btn {
    width: 100%;
  }

  .sidebar .brand {
    max-width: 100%;
    margin-bottom: 18px;
  }

  .sidebar .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav {
    display: grid;
    gap: 8px;
    margin: 20px 0 0;
    overflow: visible;
    padding: 0;
  }

  .nav button {
    flex: initial;
    justify-content: flex-start;
    width: auto;
    min-height: 44px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    padding: 10px 12px;
    white-space: nowrap;
  }

  .nav button.active {
    border-color: rgba(217, 182, 111, 0.58);
    background: var(--primary);
    color: #17130d;
  }

  .content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 16px 12px calc(34px + env(safe-area-inset-bottom));
  }

  .content > * {
    min-width: 0;
    max-width: 100%;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .topbar .secondary-btn {
    width: 100%;
  }

  .eyebrow {
    font-size: 11px;
  }

  h2 {
    font-size: clamp(24px, 9vw, 34px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  h3 {
    font-size: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .grid {
    gap: 12px;
  }

  .stats {
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
  }

  .card {
    border-color: rgba(73, 63, 50, 0.92);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  }

  .section,
  .card,
  .edit-item,
  .empty {
    max-width: 100%;
    overflow: hidden;
  }

  .metric {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 15px 16px;
    min-height: auto;
  }

  .metric strong {
    margin-top: 0;
    max-width: 100%;
    font-size: clamp(22px, 8vw, 30px);
    line-height: 1;
    text-align: left;
    white-space: nowrap;
  }

  .section {
    margin-top: 12px;
    padding: 16px;
  }

  .section-head .primary-btn,
  .section-head .secondary-btn {
    width: 100%;
  }

  .bank {
    padding: 16px;
  }

  .bank h3 {
    font-size: 18px;
  }

  .bank-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .method-card {
    min-height: 92px;
    padding: 11px 8px;
  }

  .method-logo {
    width: 38px;
    height: 38px;
  }

  .table-wrap {
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 12px;
  }

  tr:last-child td {
    border-bottom: 1px solid var(--line);
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  td:first-child {
    padding-top: 0;
  }

  td:last-child,
  tr:last-child td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .admin-layout {
    gap: 12px;
  }

  .admin-layout .section {
    margin-top: 0;
  }

  .admin-layout .section:nth-child(2) {
    order: -1;
  }

  .admin-layout .section h3 {
    margin-bottom: 14px;
  }

  .message:empty {
    display: none;
  }

  .edit-item {
    padding: 12px;
  }
}

@media (min-width: 561px) and (max-width: 760px) {
  .content {
    padding: 24px 24px 42px;
  }

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

  .stats .metric:first-child {
    grid-column: 1 / -1;
  }

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

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

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 390px) and (max-width: 560px) {
  .login-copy h1 {
    max-width: 13ch;
    font-size: 42px;
  }

  .login-panel,
  .login-visual {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

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

@media (max-width: 380px) {
  .login-copy h1,
  h2 {
    font-size: 26px;
  }

  .sidebar .brand span:last-child {
    max-width: 240px;
  }

  .login-panel,
  .login-visual {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
}

@media (max-width: 360px) {
  .brand {
    font-size: 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .nav button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .metric {
    align-items: flex-start;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .metric strong {
    text-align: left;
  }

  td {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

@media (max-height: 520px) and (orientation: landscape) {
  .login-shell {
    grid-template-columns: 0.85fr 1.15fr;
  }

  .login-visual {
    min-height: 100svh;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .login-copy h1 {
    font-size: 32px;
  }

  .login-copy p {
    font-size: 14px;
  }

  .login-panel {
    min-height: 100svh;
    margin-top: 0;
    border-radius: 0;
    overflow-y: auto;
  }

  .sidebar {
    position: static;
  }
}

@media (min-width: 561px) and (max-width: 920px) and (orientation: landscape) {
  .content {
    padding: 20px 22px 38px;
  }

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