@font-face {
  font-family: "Mont";
  src: url("/brand-assets/Dinky_logo/2_Fonts/Mont-Regular.ttf") format("truetype");
  font-weight: 400;
}

@font-face {
  font-family: "Mont";
  src: url("/brand-assets/Dinky_logo/2_Fonts/Mont-SemiBold.ttf") format("truetype");
  font-weight: 700;
}

:root {
  --brand: #9b610f;
  --ink: #251e18;
  --muted: #756c62;
  --paper: #fffdf9;
  --line: #eadfce;
  --pink: #ffdfde;
  --blue: #c3e2eb;
  --green: #e2e8d6;
  --beige: #f4f0e7;
  --purple: #d9d2f5;
  --honey: #ffe2be;
  --danger: #b3423b;
  --shadow: 0 18px 55px rgba(63, 42, 21, 0.1);
  --tg-viewport-height: 100vh;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-height: var(--tg-viewport-height);
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: var(--tg-viewport-height);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 223, 222, 0.4), rgba(195, 226, 235, 0.34)),
    var(--paper);
  font-family: "Mont", Arial, sans-serif;
  letter-spacing: 0;
}

body.telegram-miniapp {
  min-height: var(--tg-viewport-height);
  overflow-x: hidden;
  overscroll-behavior: none;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, 100%);
  min-height: 100vh;
  min-height: var(--tg-viewport-height);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}

body.telegram-miniapp .app-shell {
  width: 100%;
  padding-top: calc(10px + env(safe-area-inset-top));
}

body.telegram-fullscreen .topbar {
  top: env(safe-area-inset-top);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  width: 138px;
  min-width: 138px;
  height: 64px;
  align-items: center;
  overflow: hidden;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(234, 223, 206, 0.8);
  border-radius: 8px;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.tab.active {
  color: #fff;
  background: var(--brand);
}

.back-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 6px;
  margin: 4px 0 12px;
  padding: 0 12px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(63, 42, 21, 0.08);
}

.back-button::before {
  content: "<";
  font-weight: 700;
}

.back-button[hidden] {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  min-height: 280px;
  margin: 10px 0 22px;
  padding: 36px;
  background:
    linear-gradient(90deg, rgba(255, 253, 249, 0.96), rgba(255, 253, 249, 0.64)),
    url("/brand-assets/Dinky_logo/1_Dinky_logo/Dinky_logo_on beige.png") right 22px center / min(390px, 48vw) no-repeat,
    var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 700;
}

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

h1 {
  max-width: 620px;
  margin-bottom: 12px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 0.98;
}

h2 {
  margin-bottom: 4px;
  font-size: 30px;
}

h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

.hero-copy,
.section-heading p,
.muted {
  color: var(--muted);
}

.hero-copy {
  max-width: 520px;
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.55;
}

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

.quick-entry,
.trust-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-entry {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-entry button {
  min-height: 64px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 10px 28px rgba(63, 42, 21, 0.06);
}

.quick-entry span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.trust-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trust-strip span {
  min-height: 38px;
  align-content: center;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.shop-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  margin-bottom: 12px;
}

.primary,
.secondary,
.chip,
.small-action {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary {
  padding: 0 18px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 12px 28px rgba(155, 97, 15, 0.22);
}

.secondary {
  padding: 0 18px;
  color: var(--brand);
  background: #fff;
  border-color: var(--line);
}

.primary:hover,
.secondary:hover,
.chip:hover,
.small-action:hover {
  transform: translateY(-1px);
}

.wide {
  width: 100%;
}

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.compact-link {
  min-height: auto;
  margin: 0;
  font-size: 14px;
}

.chip {
  padding: 0 14px;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
}

.chip.active {
  color: #fff;
  background: var(--ink);
}

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

.product-card,
.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(63, 42, 21, 0.07);
}

.product-card {
  display: flex;
  min-height: 500px;
  flex-direction: column;
  overflow: hidden;
}

.product-image {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.82;
  background: var(--beige);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  width: 100%;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.badge {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 5px 8px;
  color: var(--brand);
  background: var(--honey);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.product-title {
  margin-bottom: 6px;
  font-size: 20px;
}

.product-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.product-desc {
  flex: 1;
  color: var(--muted);
  line-height: 1.45;
}

.product-signals {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-signals span {
  min-height: 28px;
  align-content: center;
  padding: 0 8px;
  color: var(--ink);
  background: var(--green);
  border: 1px solid rgba(37, 30, 24, 0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0;
}

.price {
  color: var(--brand);
  font-size: 20px;
  font-weight: 700;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
}

.size-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.size-option {
  min-width: 46px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--ink);
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.quick-sizes {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.size-chip {
  min-width: 44px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--brand);
  white-space: nowrap;
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.size-option.active {
  color: #fff;
  background: var(--brand);
}

.size-option:disabled {
  color: #b8aca0;
  background: #f3eee6;
  cursor: not-allowed;
}

.stock-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
}

.panel {
  padding: 18px;
}

.cart-list,
.order-list,
.ticket-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  color: var(--muted);
  background: var(--beige);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.cart-item,
.order-card,
.ticket-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.small-action {
  min-width: 36px;
  padding: 0 10px;
  color: var(--brand);
  background: #fff;
  border-color: var(--line);
}

.payment-help {
  padding: 12px;
  color: var(--ink);
  background: var(--honey);
  border: 1px solid rgba(155, 97, 15, 0.18);
  border-radius: 8px;
  line-height: 1.45;
}

.receipt-preview a {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  color: var(--brand);
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.receipt-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
}

.checkout-summary {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.checkout-steps span {
  min-height: 32px;
  align-content: center;
  color: var(--muted);
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.checkout-steps span.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.checkout-steps span.done {
  color: var(--brand);
  background: var(--honey);
}

.checkout-step {
  display: none;
  gap: 12px;
}

.checkout-step.active {
  display: grid;
}

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

.checkout-actions button {
  width: 100%;
}

.checkout-actions button[hidden] {
  display: none;
}

#checkout-submit {
  grid-column: 1 / -1;
}

.checkout-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.form-panel {
  display: grid;
  gap: 12px;
  align-self: start;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(155, 97, 15, 0.12);
}

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

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  color: var(--brand);
  background: var(--honey);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.order-items {
  color: var(--muted);
  line-height: 1.45;
}

.client-order-card {
  gap: 12px;
}

.order-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline-step {
  display: grid;
  gap: 5px;
  justify-items: center;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.timeline-step span {
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
}

.timeline-step strong {
  color: var(--ink);
  font-size: 12px;
}

.timeline-step small {
  min-height: 24px;
  line-height: 1.15;
}

.timeline-step.done span {
  background: var(--brand);
  border-color: var(--brand);
}

.timeline-step.active span {
  background: var(--honey);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(155, 97, 15, 0.14);
}

.order-summary-grid {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-summary-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-summary-grid span,
.tracking-box span {
  color: var(--muted);
}

.order-summary-grid strong {
  text-align: right;
}

.tracking-box {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--green);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.dashboard-panel {
  grid-column: 1 / -1;
}

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

.stat-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  color: var(--brand);
  font-size: 18px;
}

.admin-grid .panel:last-child {
  grid-column: 1 / -1;
}

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

.delivery-action-form {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.delivery-action-form label {
  min-width: 0;
}

.delivery-action-form button {
  min-height: 42px;
  white-space: nowrap;
}

.issue-action-form {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: rgba(255, 223, 222, 0.28);
  border: 1px solid rgba(179, 66, 59, 0.2);
  border-radius: 8px;
}

.issue-action-form textarea {
  min-height: 74px;
}

.issue-action-form button {
  min-height: 42px;
  white-space: nowrap;
}

.order-history {
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.order-history summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}

.support-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.support-panel {
  max-width: 620px;
}

.staff-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-top: 14px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: underline;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal[hidden] {
  display: none;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 30, 24, 0.42);
}

.modal-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.detail-image {
  display: grid;
  place-items: center;
  min-height: 360px;
  background: var(--beige);
  border-radius: 8px;
}

.detail-image img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.thumb-button {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: var(--beige);
  border: 2px solid transparent;
  border-radius: 8px;
}

.thumb-button.active {
  border-color: var(--brand);
}

.thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-content {
  display: grid;
  align-content: start;
  gap: 10px;
}

.variant-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.variant-table div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 64px;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.variant-table div:first-child {
  border-top: 0;
}

.variant-table strong {
  color: var(--ink);
  text-align: right;
}

.admin-body {
  background: #fbf8f2;
}

.admin-login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(140deg, rgba(255, 253, 249, 0.94), rgba(249, 240, 225, 0.9)),
    url("/brand-assets/Dinky_logo/1_Dinky_logo/Dinky_logo_on beige.png") right 8vw bottom 6vh / min(360px, 62vw) no-repeat;
}

.admin-login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(62, 49, 37, 0.14);
}

.admin-login-card img {
  width: 118px;
}

.admin-login-card h1 {
  margin: 0;
  font-size: 34px;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav-item {
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.admin-nav-item.active {
  color: #fff;
  background: var(--brand);
}

.admin-shop-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  text-decoration: none;
}

.admin-main {
  padding: 24px;
}

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

.admin-header h1 {
  margin-bottom: 0;
  font-size: 40px;
}

.admin-header-actions,
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: grid;
  gap: 16px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
}

.warehouse-list,
.admin-product-list,
.integration-list {
  display: grid;
  gap: 10px;
}

.warehouse-card,
.admin-product-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.warehouse-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px minmax(120px, 0.7fr) 70px;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.admin-product-row {
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
}

.admin-product-row img {
  width: 74px;
  height: 58px;
  object-fit: contain;
  background: var(--beige);
  border-radius: 8px;
}

.integration-list div {
  padding: 12px;
  background: var(--beige);
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout,
  .admin-grid,
  .support-actions,
  .shop-tools,
  .quick-entry,
  .trust-strip,
  .stat-grid,
  .detail-layout,
  .admin-shell,
  .admin-two-col {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-main {
    padding: 14px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .delivery-action-form button,
  .issue-action-form button {
    grid-column: 1 / -1;
  }

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

  .warehouse-line {
    grid-template-columns: 1fr;
  }

  .hero-band {
    grid-template-columns: 1fr;
    background:
      linear-gradient(90deg, rgba(255, 253, 249, 0.97), rgba(255, 253, 249, 0.84)),
      url("/brand-assets/Dinky_logo/1_Dinky_logo/Dinky_logo_on beige.png") right 12px bottom 12px / 260px no-repeat,
      var(--beige);
  }
}

@media (max-width: 620px) {
  body {
    background: var(--paper);
  }

  .app-shell {
    padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
  }

  body.telegram-miniapp .app-shell {
    padding-top: 10px;
  }

  .topbar {
    position: static;
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 0 0 10px;
  }

  .brand {
    width: 84px;
    min-width: 84px;
    height: 48px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .brand img {
    width: 86px;
  }

  .topbar .mode-tabs {
    flex: 1;
    min-width: 0;
    padding: 4px;
  }

  .topbar .tab {
    min-height: 40px;
    padding: 0 7px;
    font-size: 12px;
  }

  .mode-tabs {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 30;
    justify-content: space-between;
    padding: 7px;
    border-color: rgba(234, 223, 206, 0.94);
    box-shadow: 0 16px 45px rgba(63, 42, 21, 0.18);
  }

  .topbar .mode-tabs {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    box-shadow: none;
  }

  body.telegram-miniapp .topbar {
    height: 0;
    overflow: visible;
    padding: 0;
    pointer-events: none;
  }

  body.telegram-miniapp .brand {
    display: none;
  }

  body.telegram-miniapp .topbar .mode-tabs {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 30;
    box-shadow: 0 16px 45px rgba(63, 42, 21, 0.18);
    pointer-events: auto;
    transform: none;
  }

  body.telegram-miniapp .back-button {
    margin-top: calc(62px + env(safe-area-inset-top));
  }

  .tab {
    flex: 1;
    min-height: 48px;
    padding: 0 8px;
    font-size: 13px;
  }

  .hero-band {
    min-height: auto;
    margin-top: 0;
    margin-bottom: 16px;
    padding: 15px;
    background:
      linear-gradient(90deg, rgba(255, 253, 249, 0.98), rgba(255, 253, 249, 0.94)),
      url("/brand-assets/Dinky_logo/1_Dinky_logo/Dinky_logo_on beige.png") right 8px bottom 8px / 120px no-repeat,
      var(--beige);
  }

  body.telegram-miniapp .hero-band {
    padding-top: calc(72px + env(safe-area-inset-top));
  }

  h1 {
    max-width: 270px;
    margin-bottom: 8px;
    font-size: 27px;
    line-height: 1.06;
  }

  h2 {
    font-size: 24px;
  }

  .hero-copy {
    max-width: 270px;
    font-size: 13px;
    line-height: 1.38;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: row;
    gap: 8px;
    margin-top: 12px;
  }

  .hero-actions .primary,
  .hero-actions .secondary {
    flex: 1;
    min-height: 44px;
    padding: 0 10px;
    font-size: 14px;
  }

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

  .trust-strip {
    grid-template-columns: 1fr 1fr;
  }

  .shop-tools {
    gap: 8px;
    margin-bottom: 10px;
  }

  .filters {
    margin-bottom: 12px;
    padding-bottom: 2px;
  }

  .chip {
    min-height: 40px;
    padding: 0 14px;
  }

  .result-row {
    gap: 6px;
    margin-bottom: 10px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .result-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-timeline {
    grid-template-columns: 1fr;
  }

  .timeline-step {
    grid-template-columns: 20px minmax(0, 86px) 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .timeline-step small {
    min-height: auto;
  }

  .order-summary-grid div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .order-summary-grid strong {
    text-align: left;
  }

  .product-card {
    min-height: auto;
  }

  .product-image {
    aspect-ratio: 1 / 0.72;
  }

  .product-image img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
  }

  .product-info {
    padding: 14px;
  }

  .product-title {
    font-size: 18px;
  }

  .product-desc {
    font-size: 14px;
  }

  .size-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .size-option {
    min-width: 50px;
    min-height: 40px;
  }

  .primary,
  .secondary {
    min-height: 48px;
  }

  .panel {
    padding: 14px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .cart-item,
  .order-head {
    align-items: start;
    flex-direction: column;
  }

  .toast {
    right: 10px;
    bottom: 78px;
    left: 10px;
    max-width: none;
  }

  .modal {
    padding: 10px;
    align-items: end;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .detail-layout {
    padding: 14px;
  }

  .detail-image {
    min-height: 220px;
  }
}
