:root {
  color-scheme: light;
  --ink: #1a1f1c;
  --muted: #5d675d;
  --line: #d7ddd4;
  --paper: #eef1ee;
  --panel: #ffffff;
  --accent: #1f6b45;
  --side: #163528;
  --side-text: #dce8e1;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { color: inherit; font-weight: 700; text-decoration: none; letter-spacing: 0.04em; }
nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
nav a, button.link {
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
main { padding: 28px 20px 48px; }
.panel {
  max-width: 980px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
}
.admin-panel {
  max-width: none;
  margin: 0;
}
.narrow { max-width: 460px; }
.narrow-form { max-width: 420px; }
h1 { font-size: 28px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 20px 0 8px; }
p { line-height: 1.5; }
.eyebrow, .note { color: var(--muted); }
.flash {
  max-width: 980px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  background: #fff4e8;
  border: 1px solid #e6c8a4;
}
.admin-flash { max-width: none; margin: 0 0 12px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; }
input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}
button, .button {
  display: inline-block;
  width: fit-content;
  background: var(--accent);
  color: white;
  border: 0;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
button.ghost, a.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.captcha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px dashed var(--accent);
  background: #f3f8f4;
}
.captcha strong { font-size: 28px; letter-spacing: 0.28em; }
.search { grid-template-columns: 1fr auto; align-items: center; margin: 16px 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 16px; }
.facts div { border-top: 1px solid var(--line); padding-top: 8px; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 4px 0 0; font-size: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.tree, .tree ul { list-style: none; padding-left: 18px; }
.tree { padding-left: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
article { border-top: 1px solid var(--line); padding-top: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Admin shell */
.admin-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--paper);
}
.admin-side {
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 18px;
}
.admin-brand span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #9bb5a8;
}
.admin-menu {
  display: grid;
  gap: 4px;
  margin-top: 24px;
  overflow: auto;
}
.admin-menu a {
  color: var(--side-text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
}
.admin-menu a:hover,
.admin-menu a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.admin-side-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
}
.admin-side-foot .ghost {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  margin-top: 8px;
}
.admin-main {
  padding: 24px;
  overflow: auto;
}
.admin-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #163528, #2f5d47 45%, #eef1ee);
}
.login-card { width: min(420px, 92vw); }

/* Mobile app shell */
.app-body { background: #f3f5f3; max-width: 480px; margin: 0 auto; min-height: 100vh; }
.app-top { padding: 16px; background: #163528; color: #fff; }
.app-top a { color: #fff; text-decoration: none; }
.app-content { padding: 16px 16px 88px; }
.app-card { background: #fff; border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; }
.app-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(480px, 100%);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line);
}
.app-nav a {
  text-align: center; padding: 10px 4px; font-size: 12px;
  color: var(--muted); text-decoration: none;
}
.app-nav a.active { color: var(--accent); font-weight: 600; }
.app-top { display: flex; justify-content: space-between; align-items: baseline; }
.app-top-sub { opacity: 0.7; font-size: 12px; }
.app-hero h1 { margin: 4px 0 8px; font-size: 22px; }
.app-balance {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px;
}
.app-balance div {
  background: #f3f7f4; padding: 10px 8px; border-radius: 8px; text-align: center;
}
.app-balance span { display: block; color: var(--muted); font-size: 12px; }
.app-balance strong { font-size: 15px; }
.app-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px;
}
.app-action {
  display: block; text-align: center; padding: 12px 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink);
  font-size: 13px;
}
.app-action.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.app-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.app-facts div { margin: 0; }
.app-card label { display: block; margin: 8px 0; }
.app-card input, .app-card select { width: 100%; padding: 10px; margin-top: 4px; }
.app-card button, .button {
  display: inline-block; margin-top: 10px; padding: 10px 14px;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px; text-decoration: none;
}

@media (max-width: 860px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-menu { grid-template-columns: repeat(2, 1fr); }
}

.task-live { margin-top: 12px; }
.task-warn {
  background: #fff4e5;
  border: 1px solid #f0d2a0;
  color: #7a4b00;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.assist-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--muted);
}
.progress-track {
  height: 18px;
  background: #e3e8e3;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1f6b45, #3fa06c);
  transition: width 0.4s ease;
}
.pay-box {
  background: #f3f7f4;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.pay-box h3 { margin: 0 0 8px; font-size: 15px; }
.pay-box p { margin: 4px 0; }
.pay-box small { color: var(--muted); margin-right: 6px; }
.mono { word-break: break-all; font-family: ui-monospace, monospace; font-size: 13px; }
.row-actions form { display: inline-block; margin: 2px 0; }
.pay-channel-form fieldset {
  border: 1px solid var(--line);
  margin: 0 0 16px;
  padding: 14px 16px 8px;
  max-width: 640px;
}
.pay-channel-form legend { padding: 0 6px; font-weight: 600; }
.pay-channel-form label {
  display: block;
  margin: 0 0 12px;
}
.pay-channel-form input,
.pay-channel-form select {
  display: block;
  width: 100%;
  max-width: 560px;
  margin-top: 6px;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.kyc-preview { max-width: 220px; max-height: 160px; border: 1px solid var(--line); }
.status-banner {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8eee9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.status-banner.wait {
  background: #fff4e5;
  color: #7a4b00;
}
.status-banner.ok {
  background: #e5f6ec;
  color: #1f6b45;
}
.pay-channel-form textarea {
  display: block;
  width: 100%;
  max-width: 560px;
  margin-top: 6px;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.checkout-media {
  margin: 0 0 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f7f4;
}
.checkout-media img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}
.ship-eu-hint { margin: 0 0 10px; }
.ship-eu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin: 0 0 14px;
}
.ship-eu-grid .ship-full { grid-column: 1 / -1; }
.ship-eu-grid .ship-street { grid-column: 1 / 2; }
.ship-eu-grid .ship-house { grid-column: 2 / 3; }
.ship-eu-grid label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.ship-eu-grid select,
.ship-eu-grid input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
@media (max-width: 420px) {
  .ship-eu-grid { grid-template-columns: 1fr; }
  .ship-eu-grid .ship-street,
  .ship-eu-grid .ship-house { grid-column: 1; }
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qty-stepper .qty-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: #f3f7f4;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.qty-stepper input[type="number"] {
  width: 64px;
  height: 40px;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  font: inherit;
  -moz-appearance: textfield;
}
.qty-stepper input[type="number"]::-webkit-outer-spin-button,
.qty-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pay-balance-only {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3f7f4;
  font-weight: 600;
}
.checkout-summary {
  margin: 8px 0 16px;
}
.checkout-lines {
  margin: 0;
}
.checkout-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.checkout-lines dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}
.checkout-lines dd {
  margin: 0;
  font-weight: 600;
}
.checkout-lines .total {
  border-bottom: 0;
  padding-top: 10px;
}
.checkout-lines .total dt,
.checkout-lines .total dd {
  color: inherit;
  font-size: 1.05em;
}
.product-card .desc {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 8px;
  min-height: 2.4em;
}
.app-form textarea {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.app-form .file-label input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7faf8;
}
