:root {
  --bg: #09090b;
  --bg-2: #050507;
  --card: #15151a;
  --card-2: #1f1f27;
  --red: #dc2626;
  --red-2: #991b1b;
  --text: #f8fafc;
  --muted: #a1a1aa;
  --line: #2e2e38;
  --ok: #22c55e;
  --warn: #f59e0b;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at top, #2a0c0c 0, #09090b 38%, #050507 100%);
  padding-bottom: 18px;
}

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 9, 11, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-menu {
  margin-left: auto;
}

.nav-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-2), #16161d);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-menu[open] .nav-toggle {
  border-color: rgba(220, 38, 38, 0.5);
  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.12);
}

.menu-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
}

.nav-menu:not([open]) .menu-panel {
  display: none;
}

.menu-panel a,
.menu-panel button,
.btn {
  border: 0;
  border-radius: 14px;
  padding: 10px 13px;
  background: var(--card-2);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.menu-panel a,
.menu-panel button,
.btn,
.nav-toggle,
.item-card,
.choice-btn,
.item-modal-close {
  touch-action: manipulation;
}

.menu-panel a:hover,
.menu-panel button:hover,
.btn:hover,
.nav-toggle:hover {
  background: var(--red);
}

.menu-panel a:active,
.menu-panel button:active,
.btn:active,
.nav-toggle:active {
  transform: translateY(1px);
}

.page {
  padding-top: 14px;
  display: grid;
  gap: 14px;
}

.flash {
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  border: 1px solid transparent;
}

.flash.ok {
  background: #052e16;
  border-color: rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}

.flash.err {
  background: #450a0a;
  border-color: rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

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

.card {
  grid-column: span 12;
  background: linear-gradient(180deg, rgba(21, 21, 26, 0.98), rgba(13, 13, 17, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card.half {
  grid-column: span 6;
}

.card.third {
  grid-column: span 4;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 12px;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0d0d12;
  color: #fff;
  margin: 6px 0 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(220, 38, 38, 0.6);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.btn.red {
  background: linear-gradient(135deg, var(--red), var(--red-2));
}

.btn.gray {
  background: #3f3f46;
}

.btn.danger {
  background: linear-gradient(135deg, #7f1d1d, #450a0a);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.btn.danger:hover {
  background: linear-gradient(135deg, #991b1b, #5f1111);
}

.btn.ok {
  background: #15803d;
}

.btn.small {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #fca5a5;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d0d12;
  margin-bottom: 10px;
}

.items-list {
  display: grid;
  gap: 10px;
}

.items-list .list-item {
  margin-bottom: 0;
}

.item-card {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  font: inherit;
  color: #f8fafc;
  cursor: pointer;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 15px;
  background: #0b0b10;
  border-color: rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.item-card:hover {
  transform: translateY(-1px);
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.item-card:focus-visible {
  outline: 3px solid rgba(220, 38, 38, 0.35);
  outline-offset: 2px;
}

.item-card.is-bought {
  background: #0d1110;
  border-color: rgba(34, 197, 94, 0.24);
}

.item-card.is-pending {
  background: #110d07;
  border-color: rgba(245, 158, 11, 0.24);
}

.item-card-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.item-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-width: 0;
}

.item-action-icon,
.item-warning-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.ui-icon {
  width: 17px;
  height: 17px;
  display: block;
}

.item-card-name {
  font-size: 1.12rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  word-break: break-word;
}

.item-card-meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.28;
}

.item-card-note {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.35;
}

.item-card-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  min-width: 132px;
}

.item-card-price {
  font-size: 1.08rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.05;
}

.item-card.is-bought .item-card-price {
  color: #bbf7d0;
}

.item-card.is-pending .item-card-price {
  color: #fde68a;
}

.item-card-summary .muted {
  font-size: 0.83rem;
  line-height: 1.2;
}

.item-card-summary .muted:last-child {
  line-height: 1.25;
}

.item-modal[hidden] {
  display: none;
}

.item-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 12px;
}

body.modal-open {
  overflow: hidden;
}

.item-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 6, 0.72);
  backdrop-filter: blur(8px);
}

.item-modal-panel {
  position: relative;
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(21, 21, 26, 0.99), rgba(12, 12, 16, 0.99));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: 18px;
}

.item-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.item-modal-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fca5a5;
  margin-bottom: 6px;
}

.item-modal-head h2 {
  margin-bottom: 6px;
}

.item-modal-summaryline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.item-modal-summaryline .pill {
  padding: 7px 10px;
  background: #0f1015;
  border: 1px solid var(--line);
}

.item-modal-summaryline .item-status.ok {
  background: #14532d;
  border-color: rgba(34, 197, 94, 0.25);
}

.item-modal-summaryline .item-status.warn {
  background: #713f12;
  border-color: rgba(245, 158, 11, 0.25);
}

.pill-total {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(153, 27, 27, 0.28)) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.item-modal-form {
  display: grid;
  gap: 14px;
}

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

.choice-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d0d12;
  color: #fff;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.choice-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(220, 38, 38, 0.38);
}

.choice-btn.is-active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.28), rgba(153, 27, 27, 0.34));
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.12);
}

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

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

.item-modal-field {
  display: grid;
  gap: 6px;
}

.item-modal-field label {
  font-weight: 700;
  color: #f3f4f6;
}

.item-modal-field-wide {
  grid-column: 1 / -1;
}

.item-modal-more {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d0d12;
  padding: 10px 12px;
}

.item-modal-more[open] {
  padding-bottom: 12px;
}

.item-modal-more > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  color: #f3f4f6;
}

.item-modal-more > summary::-webkit-details-marker {
  display: none;
}

.item-modal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.item-modal-actions .btn {
  min-width: 0;
}

.item-modal-actions .item-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
}

.item-modal-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.item-modal-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(69, 10, 10, 0.32);
  color: #fecaca;
  font-size: 0.92rem;
  line-height: 1.35;
}

.item-warning-icon .ui-icon {
  width: 18px;
  height: 18px;
  color: #fca5a5;
  margin-top: 1px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #27272a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.pill.ok {
  background: #14532d;
}

.pill.warn {
  background: #713f12;
}

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

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-header-copy {
  min-width: 0;
}

.list-header-copy h1 {
  margin-bottom: 8px;
}

.list-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: stretch;
}

.list-header-actions .btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.list-header-actions .action-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  justify-content: flex-start;
  text-align: left;
  min-height: 58px;
  padding: 12px 14px;
  flex: 1 1 150px;
}

.action-tile-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  flex: 0 0 auto;
}

.action-tile-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.action-tile-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.action-tile-label {
  display: block;
  font-weight: 900;
  line-height: 1.05;
}

.action-tile-subtitle {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.1;
}

.btn.red.action-tile .action-tile-icon {
  background: rgba(255, 255, 255, 0.14);
}

.add-item-modal-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.summary .box {
  flex: 1;
  min-width: 150px;
  border-radius: 18px;
  background: #0d0d12;
  border: 1px solid var(--line);
  padding: 14px;
}

.summary .box.highlight {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.22), rgba(153, 27, 27, 0.28));
  border-color: rgba(239, 68, 68, 0.45);
}

.summary .box .price {
  font-size: 24px;
}

.price {
  font-size: 26px;
  font-weight: 900;
  color: #fca5a5;
  line-height: 1.05;
}

.spent-hero {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(239, 68, 68, 0.32);
}

body.has-spent-float {
  padding-bottom: 124px;
}

.spent-float {
  grid-column: 1 / -1;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(15, 15, 20, 0.96), rgba(45, 13, 13, 0.96));
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: none;
  isolation: isolate;
  overflow: hidden;
}

.spent-float::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(252, 165, 165, 0.12), rgba(255, 255, 255, 0) 48%);
  pointer-events: none;
}

.spent-float__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.22), rgba(153, 27, 27, 0.3));
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #fecaca;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.spent-float__icon .ui-icon {
  width: 20px;
  height: 20px;
}

.spent-float__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.spent-float__label {
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  font-weight: 800;
}

.spent-float__value {
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
}

.spent-hero .label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: #fca5a5;
  font-weight: 800;
}

.spent-value {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  margin-top: 8px;
  color: #fff;
}

.spent-note {
  margin-top: 8px;
  color: var(--muted);
}

.ad-slot {
  width: 100%;
  max-width: 728px;
  margin: 0 auto 14px;
  padding: 10px;
  background: rgba(21, 21, 26, 0.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.ad-slot-top {
  height: 128px;
  overflow: hidden;
  margin-bottom: 14px;
}

.ad-slot-footer {
  margin-top: 14px;
}

.ad-inner {
  width: 100%;
  min-height: 90px;
}

.ad-slot-top .ad-inner {
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-top .adsbygoogle,
.ad-slot-top iframe {
  display: block;
  width: 100%;
  height: 100%;
}

.ad-slot.is-empty {
  display: none;
}

.ad-label {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.premium-box {
  border: 1px solid #f59e0b;
  background: linear-gradient(135deg, #211400, #111);
  border-radius: 24px;
  padding: 18px;
}

.login {
  max-width: 430px;
  margin: 40px auto;
  display: grid;
  gap: 12px;
}

.login form {
  display: grid;
  gap: 0;
}

.login-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.login-actions .btn {
  width: 100%;
}

.login > p > .btn {
  display: block;
  width: 100%;
  text-align: center;
}

.login-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0d0d12;
  color: var(--muted);
  line-height: 1.45;
}

.copy {
  font-family: Consolas, "Courier New", monospace;
  background: #050507;
  border: 1px dashed #444;
  border-radius: 12px;
  padding: 12px;
  word-break: break-all;
}

.admin-users {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.admin-user-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 13, 18, 0.98), rgba(9, 9, 13, 0.98));
}

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

.admin-user-title {
  min-width: 0;
}

.admin-user-title h2 {
  font-size: 1.08rem;
  margin-bottom: 6px;
  word-break: break-word;
}

.admin-user-email {
  color: var(--muted);
  font-size: 0.95rem;
  word-break: break-word;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-user-id {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
  background: #0d0d12;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

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

.admin-actions form {
  margin: 0;
}

.icon-btn {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
}

.action-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.admin-request-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.admin-request-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 13, 18, 0.98), rgba(9, 9, 13, 0.98));
  min-width: 0;
}

.admin-request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.admin-request-title {
  min-width: 0;
}

.admin-request-title h2 {
  margin-bottom: 4px;
  font-size: 1.08rem;
  line-height: 1.15;
  word-break: break-word;
}

.admin-request-email {
  color: var(--muted);
  font-size: 0.95rem;
  word-break: break-word;
}

.admin-request-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.admin-request-id {
  color: var(--muted);
  font-weight: 800;
  background: #0d0d12;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.admin-request-message {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0d0d12;
  color: #e5e7eb;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.admin-request-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-request-actions form {
  margin: 0;
}

.admin-request-actions .btn {
  width: 100%;
  min-height: 46px;
}

.admin-empty-state {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: rgba(13, 13, 18, 0.75);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  body {
    padding-bottom: 14px;
  }

  .wrap {
    padding: 10px;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-menu {
    width: 100%;
    margin-left: 0;
  }

  .nav-toggle {
    width: 100%;
  }

  .menu-panel {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-panel a,
  .menu-panel button {
    text-align: center;
  }

  .card.half,
  .card.third {
    grid-column: span 12;
  }

  .login {
    margin: 24px auto;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .actions .btn,
  .actions a,
  .actions form {
    flex: 1 1 0;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .list-header-copy h1 {
    margin-bottom: 6px;
  }

  .list-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .list-header-actions .btn {
    width: 100%;
  }

  .list-header-actions .action-tile {
    min-height: 54px;
    padding: 10px 12px;
  }

  .action-tile-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .action-tile-subtitle {
    font-size: 11px;
  }

  .add-item-modal-actions {
    grid-template-columns: 1fr;
  }

  .item-card {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .item-card-summary {
    min-width: 0;
    text-align: left;
    align-items: flex-start;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 2px;
  }

  .item-card-price {
    font-size: 1.08rem;
  }

  .item-modal {
    padding: 10px;
  }

  .item-modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 14px;
    border-radius: 22px;
  }

  .item-modal-head {
    flex-direction: column;
  }

  .item-modal-summaryline {
    gap: 6px;
  }

  .item-modal-grid {
    grid-template-columns: 1fr;
  }

  .item-modal-grid-compact {
    grid-template-columns: 1fr;
  }

  .item-modal-field-wide {
    grid-column: auto;
  }

  .item-modal-actions {
    grid-template-columns: 1fr;
  }

  .item-modal-close {
    width: 100%;
    justify-content: center;
  }

  .login-note {
    padding: 11px 12px;
  }

  body.has-spent-float {
    padding-bottom: 20px;
  }

  .spent-hero {
    display: none;
  }

  .spent-float {
    position: sticky;
    top: calc(86px + env(safe-area-inset-top, 0px));
    left: auto;
    right: auto;
    width: 100%;
    max-width: none;
    padding: 12px 14px;
    border-radius: 18px;
    transform: none;
    margin-bottom: 2px;
    z-index: 30;
  }

  .spent-float__icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .spent-float__value {
    font-size: 1rem;
  }

  .summary .box {
    min-width: calc(50% - 5px);
  }

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

  .admin-user-card {
    padding: 14px;
    border-radius: 18px;
  }

  .admin-user-head {
    flex-direction: column;
  }

  .admin-user-id {
    align-self: flex-start;
  }

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

  .admin-users-page .admin-actions .btn {
    min-height: 48px;
  }

  .admin-users-page .icon-btn {
    justify-content: flex-start;
  }

  .action-text {
    display: none;
  }

  .admin-users-page .action-text {
    display: block;
  }

  .admin-request-head {
    flex-direction: column;
  }

  .admin-request-side {
    width: 100%;
    justify-items: start;
  }

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

  .ad-slot {
    border-radius: 18px;
  }

  .ad-slot-top {
    height: 112px;
    padding: 8px;
  }

  .price {
    font-size: 22px;
  }

  .spent-value {
    font-size: 2.15rem;
  }

  th,
  td {
    font-size: 13px;
    padding: 8px;
  }
}

@media (max-width: 540px) {
  .top {
    border-bottom-width: 1px;
  }

  .wrap {
    padding: 8px;
  }

  .nav {
    gap: 8px;
  }

  .brand {
    font-size: 17px;
    text-align: center;
  }

  .nav-toggle {
    min-height: 44px;
    padding: 0 14px;
  }

  .list-header-actions .btn,
  .actions .btn,
  .actions a,
  .actions form .btn {
    min-height: 48px;
    font-size: 0.98rem;
  }

  .card form .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .menu-panel {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .menu-panel a,
  .menu-panel button {
    width: 100%;
    min-height: 46px;
    text-align: center;
  }

  .card {
    padding: 14px;
    border-radius: 20px;
  }

  .list-header {
    gap: 10px;
  }

  .list-header-actions {
    gap: 8px;
    display: grid;
    grid-template-columns: 1fr;
  }

  .summary {
    gap: 8px;
  }

  .summary .box {
    min-width: 100%;
    padding: 12px;
  }

  .summary .box .price,
  .price {
    font-size: 20px;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn,
  .actions a,
  .actions form {
    width: 100%;
  }

  .actions form .btn {
    width: 100%;
  }

  .item-card {
    gap: 9px;
    padding: 12px;
    border-radius: 16px;
  }

  .item-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .item-card-name {
    font-size: 1rem;
  }

  .item-card-meta,
  .item-card-note,
  .item-card-summary .muted {
    display: none;
  }

  .item-card-summary {
    min-width: 0;
    align-items: flex-start;
    text-align: left;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }

  .item-card-price {
    font-size: 1rem;
  }

  .item-modal {
    align-items: end;
    padding: 0;
  }

  .item-modal-panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .item-modal-head {
    margin-bottom: 12px;
  }

  .item-modal-summaryline {
    gap: 6px;
    margin-bottom: 12px;
  }

  .item-modal-close {
    width: 100%;
    justify-content: center;
  }

  .item-modal-actions {
    gap: 8px;
  }

  .list-item {
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
  }

  body.has-spent-float {
    padding-bottom: 20px;
  }

  .spent-float {
    top: calc(80px + env(safe-area-inset-top, 0px));
    width: 100%;
    padding: 11px 12px;
    border-radius: 16px;
  }

  .spent-float__icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .spent-float__label {
    font-size: 0.62rem;
  }

  .spent-float__value {
    font-size: 0.92rem;
  }
}
