:root {
  color-scheme: light;
  --bg: #eef7f4;
  --surface: #ffffff;
  --surface-2: #f6fbfa;
  --ink: #15302d;
  --muted: #647875;
  --line: #d8e7e3;
  --brand: #0f766e;
  --brand-2: #8bc34a;
  --accent: #f6c646;
  --danger: #d9534f;
  --ok: #159947;
  --shadow: 0 14px 30px rgba(20, 54, 49, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #e7f7f1 0%, #f7fbf6 45%, #eef5f5 100%);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

#app {
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.08);
  position: relative;
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  background: rgba(247, 253, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cute-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--brand);
  background: #e8f7ee;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.14);
}

.cute-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cute-icon .icon-fill {
  fill: var(--brand-2);
  stroke: currentColor;
}

.cute-icon .icon-cut {
  fill: none;
  stroke: white;
  stroke-width: 2.1;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h2 {
  margin: 0;
}

.icon-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.icon-chip {
  min-height: 62px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.liff-card {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fffb, #edf8f2);
}

.line-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid white;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(21, 48, 45, 0.16);
}

.screen {
  padding: 16px 16px 94px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(560px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.bottom-nav button,
.icon-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
}

.bottom-nav button {
  min-width: 0;
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 2px;
}

.bottom-nav span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 21px;
}

.bottom-nav b {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav button.active {
  color: var(--brand);
  background: #e8f7ee;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 24px;
}

.hero {
  min-height: 190px;
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(135deg, rgba(11, 79, 74, 0.92), rgba(17, 123, 83, 0.8)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='420' viewBox='0 0 700 420'%3E%3Crect width='700' height='420' fill='%230f766e'/%3E%3Cg fill='none' stroke='%23b6e879' stroke-width='18' stroke-linecap='round' opacity='.55'%3E%3Cpath d='M45 315c135-130 235-127 300-28s162 96 284-49'/%3E%3Cpath d='M85 120c97 30 169 14 215-48s117-55 211 25'/%3E%3C/g%3E%3Cg fill='%23f6c646'%3E%3Ccircle cx='575' cy='86' r='42'/%3E%3Ccircle cx='120' cy='318' r='18'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow);
}

.hero h2,
.section-title h2 {
  margin: 0;
}

.hero p {
  max-width: 390px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

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

.quick-card,
.card,
.product-card,
.order-row,
.plan-stop {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(21, 48, 45, 0.06);
}

.quick-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
}

.quick-card span {
  font-size: 26px;
}

.quick-card b {
  font-size: 16px;
}

.quick-card small,
.muted {
  color: var(--muted);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin: 18px 0 10px;
}

.field-row,
.filter-row {
  display: grid;
  gap: 10px;
}

.filter-row {
  grid-template-columns: 1.4fr 1fr;
  margin: 12px 0;
}

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

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.card {
  padding: 14px;
  margin-bottom: 10px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #edf8f2;
  color: var(--brand);
}

.status-pill.busy {
  background: #fff1d6;
  color: #9b6200;
}

.status-pill.offline {
  background: #ffe9e8;
  color: var(--danger);
}

.button,
.ghost-button,
.danger-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.link-button {
  display: inline-grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.button {
  color: white;
  background: var(--brand);
}

.button .cute-icon,
.ghost-button .cute-icon {
  width: 24px;
  height: 24px;
  margin-right: 6px;
  color: currentColor;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  vertical-align: middle;
}

.button .cute-icon svg,
.ghost-button .cute-icon svg {
  width: 18px;
  height: 18px;
}

.ghost-button {
  color: var(--brand);
  background: #eaf7f2;
  border-color: #cfe9e1;
}

.danger-button {
  color: white;
  background: var(--danger);
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.button-row > * {
  flex: 1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.metric {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.metric b {
  display: block;
  font-size: 18px;
}

.station-map {
  position: relative;
  min-height: 170px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.1) 1px, transparent 1px),
    #f7fcfa;
  background-size: 34px 34px;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border: 3px solid white;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: var(--brand);
  box-shadow: var(--shadow);
}

.map-pin.busy {
  background: var(--accent);
}

.map-pin span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  rotate: 45deg;
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.planner-form,
.scout-form,
.profile-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plan-line {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.plan-stop {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 12px;
}

.stop-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--brand);
  font-weight: 900;
}

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

.product-card {
  overflow: hidden;
  text-align: left;
}

.product-art {
  min-height: 116px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f8f7e8, #e2f4ed);
  font-size: 46px;
}

.product-info {
  padding: 10px;
}

.product-info h3 {
  min-height: 42px;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.price {
  color: #0a6a53;
  font-size: 20px;
  font-weight: 900;
}

.detail-art {
  min-height: 210px;
  display: grid;
  place-items: center;
  gap: 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff6d8, #d9f0ea);
  font-size: 82px;
}

.large-product-icon {
  width: 58px;
  height: 58px;
}

.product-icon {
  width: 46px;
  height: 46px;
}

.product-gallery {
  display: grid;
  gap: 12px;
  margin: 10px 0 18px;
}

.gallery-img {
  display: block;
  width: 100%;
  aspect-ratio: 1.55;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: 0 8px 20px rgba(21, 48, 45, 0.08);
}

.buy-bar {
  position: sticky;
  bottom: 78px;
  display: grid;
  grid-template-columns: 1fr 104px 128px;
  gap: 8px;
  align-items: center;
  margin: 18px -6px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.qty-control {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.qty-control button {
  min-height: 40px;
  border: 0;
  background: #eef7f4;
  color: var(--brand);
  font-weight: 900;
}

.qty-control output {
  text-align: center;
  font-weight: 900;
}

.qr-box {
  width: 210px;
  height: 210px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 12px auto;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.qr-box i {
  background: var(--ink);
}

.order-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
}

.logistics-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.logistics-track span {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 8px;
  color: var(--muted);
  background: #edf4f2;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.logistics-track span.done {
  color: white;
  background: var(--brand);
}

.compact-title {
  margin-top: 6px;
}

.empty-state {
  padding: 24px 14px;
  border: 1px dashed #bdd8d2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 30;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(5, 30, 27, 0.45);
}

.modal {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 14px;
}

@media (max-width: 420px) {
  .screen {
    padding-inline: 12px;
  }

  .quick-grid,
  .shop-grid,
  .two-col,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .buy-bar {
    grid-template-columns: 1fr;
    bottom: 82px;
  }

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