:root {
  --bg: #f7f4ef;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(15, 15, 15, 0.08);
  --line-strong: rgba(15, 15, 15, 0.14);
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.62);
  --muted-2: rgba(17, 17, 17, 0.45);
  --accent: #111111;
  --accent-soft: #f0ece6;
  --accent-warm: #ede6dd;
  --success: #2f6b42;
  --shadow: 0 24px 60px rgba(18, 18, 18, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --space-1: clamp(0.55rem, 0.48rem + 0.22vw, 0.75rem);
  --space-2: clamp(0.85rem, 0.7rem + 0.45vw, 1.1rem);
  --space-3: clamp(1.1rem, 0.9rem + 0.75vw, 1.5rem);
  --space-4: clamp(1.4rem, 1.1rem + 1.4vw, 2.2rem);
  --space-5: clamp(2rem, 1.55rem + 2.4vw, 3.2rem);
  --font-body: "Onest", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
html, body {
  min-height: 100%;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(0, 0, 0, 0.03), transparent 26%),
    linear-gradient(180deg, #fbfaf8 0%, var(--bg) 55%, #f1ece5 100%);
  color: var(--text);
}
a {
  color: inherit;
  text-decoration: none;
}
button, input, textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
img {
  display: block;
  max-width: 100%;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  font-size: 16px;
  outline: none;
}
input:focus, textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.05);
}
textarea {
  resize: vertical;
  min-height: 96px;
}

.page-shell,
.manage-shell {
  width: min(1320px, calc(100% - 1rem));
  margin: 0 auto;
  padding: 1rem 0 calc(2rem + env(safe-area-inset-bottom));
}
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 410px);
  gap: var(--space-4);
  align-items: start;
}

.panel-lite,
.sheet-card,
.manage-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand-row-manage {
  align-items: flex-start;
}
.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.small-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}
.eyebrow,
.panel-label {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-panel h1,
.manage-top h1,
.section-head h2,
.sheet-head h2 {
  margin: 0;
  font-size: clamp(2.2rem, 1.7rem + 2.6vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-weight: 800;
  text-wrap: balance;
}
.sheet-head h2 {
  font-size: clamp(1.7rem, 1.35rem + 0.9vw, 2.4rem);
}
.section-head h2,
.manage-top h1 {
  font-size: clamp(1.8rem, 1.45rem + 1vw, 2.8rem);
}
.lead,
.muted,
.form-hint,
.form-result,
.comment-box,
.status-strip span,
.status-strip strong + span {
  color: var(--muted);
}
.lead {
  margin: 0;
  max-width: 38rem;
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.12rem);
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.hero-button,
.ghost-button,
.ghost-link,
.primary-button,
.spot-chip,
.arrival-pill,
.counter button {
  min-height: 46px;
  border-radius: 999px;
  transition:
    transform 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease;
}
.hero-button,
.ghost-button,
.ghost-link,
.spot-chip,
.arrival-pill,
.counter button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}
.hero-button,
.ghost-button,
.ghost-link {
  padding: 0.9rem 1.15rem;
}
.hero-button-primary,
.primary-button,
.tag-dark,
.ghost-button:hover,
.ghost-link:hover,
.spot-chip.is-active,
.arrival-pill.is-active,
.counter button:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}
.hero-button:hover,
.hero-button-primary:hover,
.ghost-button:hover,
.ghost-link:hover,
.spot-chip:hover,
.arrival-pill:hover,
.primary-button:hover {
  transform: translateY(-1px);
}
.primary-button {
  width: 100%;
  padding: 0.95rem 1rem;
  font-weight: 700;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.hero-metrics div,
.timeline-card,
.success-card {
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
}
.hero-metrics strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.hero-metrics span {
  color: var(--muted);
}
.hero-gallery {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0.9rem;
}
.photo-stack {
  display: grid;
  gap: 0.9rem;
}
.photo-card {
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-large {
  min-height: 420px;
}
.photo-logo {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.photo-logo img {
  object-fit: contain;
}
.photo-small {
  min-height: 230px;
}

.status-strip,
.controls-panel,
.manage-top {
  display: grid;
  gap: var(--space-3);
  padding: 1.1rem;
  margin-bottom: var(--space-3);
}
.status-strip {
  grid-template-columns: 1fr 1fr;
}
.status-strip strong {
  display: block;
  font-size: 1.08rem;
  margin-bottom: 0.2rem;
}
.spot-row,
.arrival-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.spot-chip,
.arrival-pill {
  padding: 0.85rem 1rem;
}
.spot-chip {
  display: grid;
  text-align: left;
  gap: 0.1rem;
}
.spot-chip small {
  color: inherit;
  opacity: 0.65;
}
.catalog-section {
  display: grid;
  gap: var(--space-3);
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.product-card {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.product-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1.04;
  background: var(--accent-soft);
}
.product-image,
.product-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-tags {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.4rem 0.72rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.product-body {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}
.product-body h3,
.manage-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.16rem;
  line-height: 1.12;
}
.product-footer,
.sheet-head,
.eta-box,
.cart-row,
.manage-row,
.manage-top {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.product-footer strong,
.sheet-total {
  font-size: 1.12rem;
  font-weight: 800;
}
.order-sheet {
  position: sticky;
  top: 1rem;
}
.sheet-card {
  padding: 1rem;
}
.eta-box {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--accent-soft);
  padding: 1rem;
  margin: 1rem 0;
}
.eta-box strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.7rem;
  line-height: 0.95;
}
.cart-items {
  display: grid;
  gap: 0.8rem;
  max-height: 220px;
  overflow: auto;
  overscroll-behavior: contain;
}
.cart-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem 0.95rem;
  background: #fff;
}
.cart-row p,
.empty-state {
  margin: 0.2rem 0 0;
  color: var(--muted);
}
.counter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.counter button {
  width: 36px;
  height: 36px;
}
.checkout-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}
.checkout-form label {
  display: grid;
  gap: 0.35rem;
}
.checkout-form span {
  color: var(--muted);
  font-size: 0.92rem;
}
.form-hint,
.form-result {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.form-result {
  color: var(--success);
  min-height: 1.3em;
}
.success-card {
  margin-top: 1rem;
  background: #f6fbf6;
  border-color: rgba(47, 107, 66, 0.15);
}
.success-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.08rem;
}
.manage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.manage-card {
  padding: 1rem;
}
.manage-card dl {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0;
}
.manage-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}
.manage-card dt {
  color: var(--muted-2);
}
.comment-box {
  margin: 1rem 0 0;
  padding: 0.85rem 0.95rem;
  background: var(--accent-soft);
  border-radius: 18px;
}
.tag-new {
  background: #fff3cd;
  color: #856404;
}
.tag-accepted {
  background: #d4edda;
  color: #155724;
}
.tag-cancelled {
  background: #f8d7da;
  color: #721c24;
}
.manage-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
}
.mobile-cartbar {
  display: none;
}

@media (max-width: 1060px) {
  .app-grid,
  .status-strip,
  .product-grid,
  .manage-grid,
  .hero-gallery {
    grid-template-columns: 1fr;
  }
  .order-sheet {
    position: static;
  }
  .hero-gallery {
    gap: var(--space-2);
  }
}

@media (max-width: 860px) {
  body {
    overflow-x: hidden;
  }
  .page-shell,
  .manage-shell {
    width: min(100% - 0.75rem, 1000px);
    padding-left: 0;
    padding-right: 0;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell,
  .manage-shell {
    width: min(100% - 0.9rem, 1000px);
  }
  .page-shell {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  }
  .hero-panel h1 {
    font-size: clamp(2.25rem, 1.8rem + 2vw, 3.1rem);
  }
  .brand-mark {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hero-button {
    justify-content: center;
    text-align: center;
    padding: 0.8rem 0.9rem;
  }
  .hero-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .hero-metrics div:last-child {
    grid-column: 1 / -1;
  }
  .photo-large {
    min-height: 250px;
  }
  .photo-logo {
    min-height: 128px;
  }
  .photo-small {
    min-height: 164px;
  }
  .photo-stack {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: stretch;
  }
  .sheet-card,
  .panel-lite,
  .manage-card,
  .photo-card,
  .product-card {
    border-radius: 26px;
  }
  .sheet-head,
  .eta-box,
  .cart-row,
  .manage-row,
  .manage-top,
  .product-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .mobile-cartbar {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 22px;
    background: rgba(17, 17, 17, 0.95);
    color: #fff;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
    z-index: 30;
  }
  .mobile-cartbar span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.9rem;
  }
  .mobile-cartbar strong,
  .mobile-cartbar > span:last-child {
    color: #fff;
    font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
