:root {
  color-scheme: light;
  --bg: #f8fbf8;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-soft: #eef8f3;
  --text: #101f1b;
  --muted: #65766f;
  --line: #dbe9e3;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --accent: #eab308;
  --ok: #16a34a;
  --warn: #b77905;
  --shadow: 0 24px 70px rgba(19, 59, 49, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #081311;
    --surface: rgba(17, 31, 28, 0.88);
    --surface-solid: #10201c;
    --surface-soft: #152d28;
    --text: #eef8f3;
    --muted: #9fb5ae;
    --line: #26483f;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 30rem),
    radial-gradient(circle at 85% 12%, rgba(234, 179, 8, 0.13), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100vh;
  padding: env(safe-area-inset-top) clamp(1rem, 4vw, 3rem) 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.brand:hover .brand-title {
  filter: brightness(1.08);
}

.brand-mark {
  display: grid;
  width: 3.15rem;
  height: 3.15rem;
  place-items: center;
  border-radius: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 44%),
    linear-gradient(135deg, #0f766e, #14b8a6 60%, #facc15);
  color: white;
  font-size: 1.25rem;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.brand-title {
  display: block;
  background: linear-gradient(90deg, var(--text), var(--primary) 58%, #b77905);
  background-clip: text;
  color: transparent;
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 950;
  line-height: 1.05;
}

.brand-subtitle,
.muted {
  color: var(--muted);
}

.brand-subtitle {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.3rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999rem;
  background: var(--surface);
  color: var(--primary-dark);
  font-size: 0.86rem;
  font-weight: 850;
}

.topbar-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 99rem;
  background: var(--ok);
  box-shadow: 0 0 0 0.35rem rgba(22, 163, 74, 0.13);
}

.shell,
.workspace-grid,
.history-shell {
  max-width: 76rem;
  margin: 0 auto;
}

.shell,
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(22rem, 0.92fr);
  gap: 1rem;
  align-items: start;
}

.history-shell {
  margin-top: 1rem;
}

.history-shell .side-panel {
  grid-template-columns: 1fr;
  align-items: start;
}

.collapsible-panel,
.hero-panel,
.side-panel,
.list-panel,
.market-panel,
.history-panel,
.offline-card {
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.collapsible-panel {
  overflow: hidden;
}

.list-panel {
  border-color: rgba(217, 154, 34, 0.34);
  background: linear-gradient(180deg, rgba(255, 250, 232, 0.96), rgba(255, 247, 237, 0.72));
}

.collapse-bar {
  display: flex;
  width: 100%;
  min-height: 4.1rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(238, 248, 243, 0.58));
}

.collapse-toggle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.2rem;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.is-closed .collapse-bar {
  border-bottom: 0;
}

.collapse-copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.collapse-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.48rem;
}

.collapse-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapse-copy.has-leading-icon strong {
  overflow: visible;
  line-height: 1.08;
  text-overflow: clip;
  white-space: normal;
}

.phone-save-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 0.86rem;
  height: 1.22rem;
  border: 2px solid currentColor;
  border-radius: 0.24rem;
}

.phone-save-icon::after {
  position: absolute;
  left: 50%;
  bottom: 0.12rem;
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 999rem;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.collapse-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapse-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999rem;
  background: var(--surface-solid);
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 950;
  line-height: 1;
}

.clear-all-button {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0 0.58rem;
  border: 1px solid rgba(194, 65, 12, 0.2);
  border-radius: 999rem;
  background: rgba(194, 65, 12, 0.08);
  color: #b83d0d;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 900;
}

.clear-all-button:hover {
  background: rgba(194, 65, 12, 0.14);
}

.collapse-content {
  padding: 0;
}

.collapsible-panel .hero-panel,
.collapsible-panel .list-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
}

.hero-panel {
  display: grid;
  gap: 0.9rem;
  min-height: 25rem;
  padding: clamp(0.9rem, 2.6vw, 1.55rem);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.74), rgba(238, 248, 243, 0.42)),
    radial-gradient(circle at 50% 38%, rgba(20, 184, 166, 0.12), transparent 19rem);
}

.hero-copy {
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.42rem;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0.48rem;
  font-size: clamp(2rem, 4.6vw, 3.55rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.3rem;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.hero-copy p:last-child {
  max-width: 30rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.5vw, 1.02rem);
  line-height: 1.45;
}

.voice-stage {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}

.mic-button {
  position: relative;
  display: grid;
  width: clamp(6.8rem, 22vw, 9.2rem);
  height: clamp(6.8rem, 22vw, 9.2rem);
  place-items: center;
  border: 0;
  border-radius: 999rem;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(145deg, #0f766e, #14b8a6 58%, #facc15);
  color: white;
  cursor: pointer;
  box-shadow: 0 22px 52px rgba(15, 118, 110, 0.24);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.mic-button:hover {
  transform: translateY(-2px);
}

.mic-button.is-listening {
  animation: pulse 1.35s ease-in-out infinite;
  box-shadow: 0 24px 64px rgba(20, 184, 166, 0.34);
}

.mic-symbol {
  position: relative;
  width: 1.55rem;
  height: 2.75rem;
  border: 0.28rem solid currentColor;
  border-radius: 999rem;
}

.mic-symbol::before {
  position: absolute;
  left: 50%;
  bottom: -0.95rem;
  width: 2.55rem;
  height: 0.9rem;
  border-bottom: 0.28rem solid currentColor;
  border-left: 0.28rem solid currentColor;
  border-right: 0.28rem solid currentColor;
  border-radius: 0 0 999rem 999rem;
  content: "";
  transform: translateX(-50%);
}

.mic-symbol::after {
  position: absolute;
  left: 50%;
  bottom: -1.58rem;
  width: 0.28rem;
  height: 0.78rem;
  border-radius: 99rem;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

.voice-state {
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.transcript-box {
  width: min(100%, 36rem);
  min-height: 5.35rem;
  padding: 0.78rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-solid);
  box-shadow: 0 14px 34px rgba(19, 59, 49, 0.08);
}

.transcript-box textarea {
  width: 100%;
  min-height: 3.2rem;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.45;
}

.transcript-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.48rem;
}

.primary-button,
.secondary-button,
.template-button,
.icon-check {
  border: 0;
  border-radius: 0.9rem;
  cursor: pointer;
  font-weight: 900;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.primary-button {
  gap: 0.55rem;
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.2);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.primary-button.is-loading {
  background: var(--primary-dark);
}

.loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: white;
  border-radius: 999rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.secondary-button,
.template-button {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--primary-dark);
}

.templates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  justify-content: center;
}

.template-button {
  min-height: 1.9rem;
  padding: 0 0.52rem;
  border-radius: 0.72rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.usage-pill {
  display: inline-flex;
  grid-column: 1 / -1;
  justify-self: center;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.95rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999rem;
  background: rgba(238, 248, 243, 0.72);
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.usage-pill span {
  color: var(--muted);
}

.premium-card {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.52rem;
  padding: 0.85rem;
  border: 1px solid rgba(202, 138, 4, 0.26);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.94), rgba(238, 248, 243, 0.88));
  color: var(--text);
}

.premium-card.is-locked {
  border-color: rgba(184, 61, 13, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(238, 248, 243, 0.88));
}

.premium-card.is-active {
  border-color: rgba(15, 118, 110, 0.28);
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(238, 248, 243, 0.88));
}

.premium-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.premium-badge {
  width: max-content;
  padding: 0.18rem 0.48rem;
  border-radius: 999rem;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 950;
}

.premium-close {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 999rem;
  background: rgba(255, 255, 255, 0.62);
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.premium-card strong {
  font-size: 1rem;
  line-height: 1.08;
}

.premium-card p {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.premium-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.premium-benefits span {
  display: inline-flex;
  min-height: 1.6rem;
  align-items: center;
  padding: 0 0.52rem;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 999rem;
  background: rgba(255, 255, 255, 0.62);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.premium-price {
  display: flex;
  align-items: baseline;
  gap: 0.28rem;
}

.premium-price strong {
  font-size: 1.35rem;
}

.premium-price span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.premium-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.premium-legal span {
  width: 100%;
}

.premium-legal a {
  color: var(--primary-dark);
  font-weight: 950;
  text-decoration: underline;
  text-underline-offset: 0.16rem;
}

.premium-cta {
  display: inline-flex;
  width: max-content;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.68rem;
  border-radius: 999rem;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
}

.premium-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.46rem;
  align-items: center;
}

.premium-restore {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.68rem;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999rem;
  background: rgba(255, 255, 255, 0.68);
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.premium-product,
.premium-message {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.premium-message {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.58);
}

.premium-cta.is-disabled {
  opacity: 0.72;
  cursor: not-allowed;
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.side-panel,
.list-panel,
.market-panel,
.history-panel {
  padding: 1rem;
}

.side-panel {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.side-panel .collapsible-panel {
  box-shadow: none;
  min-width: 0;
}

.side-panel .collapse-bar {
  min-height: 3.45rem;
  padding: 0.55rem 0.65rem;
}

.side-panel .collapse-icon {
  width: 1.95rem;
  height: 1.95rem;
}

.side-panel .history-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0.75rem;
}

.side-panel .section-head {
  margin-bottom: 0.55rem;
}

.side-panel .section-head h3 {
  margin-bottom: 0.05rem;
  font-size: 1rem;
}

.side-panel .section-head p {
  font-size: 0.78rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 0.85rem;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.save-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0.9rem;
}

.save-option {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 999rem;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.16);
}

.save-button-icon {
  width: 0.78rem;
  height: 1.08rem;
  border-width: 1.8px;
}

.favorite-star-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  color: currentColor;
  font-size: 0.95rem;
  line-height: 1;
}

.save-option.is-saved,
.save-option:disabled {
  background: var(--surface-soft);
  color: var(--primary);
  cursor: default;
  box-shadow: none;
}

.clear-list-option {
  border-color: rgba(194, 65, 12, 0.2);
  background: rgba(194, 65, 12, 0.08);
  color: #b83d0d;
  box-shadow: none;
}

.favorite-option {
  border-color: rgba(202, 138, 4, 0.28);
  background: linear-gradient(135deg, #b7791f, #d97706);
}

.favorite-option.is-saved {
  border-color: rgba(15, 118, 110, 0.2);
  background: var(--surface-soft);
}

.command-list,
.saved-list,
.favorite-list,
.products-list,
.market-list {
  display: grid;
  gap: 0.65rem;
}

.small-card,
.product-card,
.market-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-solid);
}

.small-card {
  padding: 0.85rem;
}

.small-card button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.small-card small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
}

.compact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.58rem 0.62rem;
}

.compact-card .history-open {
  min-width: 0;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.25;
}

.compact-card .history-open span,
.compact-card .history-open small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-card .history-open span {
  display: block;
  white-space: nowrap;
}

.compact-card .history-open small {
  display: block;
  margin-top: 0.16rem;
  white-space: nowrap;
  font-size: 0.74rem;
}

.history-delete {
  width: auto !important;
  min-width: 1.9rem;
  min-height: 1.9rem;
  padding: 0 !important;
  border: 1px solid rgba(194, 65, 12, 0.2) !important;
  border-radius: 999rem;
  background: rgba(194, 65, 12, 0.07) !important;
  color: #b83d0d !important;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  text-align: center !important;
}

.history-delete:hover {
  background: rgba(194, 65, 12, 0.14) !important;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1rem;
  max-width: 76rem;
  margin: 1rem auto 0;
}

.main-grid.list-only {
  grid-template-columns: minmax(0, 1fr);
}

.under-voice-list {
  margin: 1rem auto 0;
}

.list-panel {
  min-height: 32rem;
}

[data-panel="shopping-list"] {
  border-color: rgba(217, 154, 34, 0.45);
  background: linear-gradient(180deg, rgba(255, 249, 220, 0.98), rgba(255, 244, 204, 0.86));
}

[data-panel="shopping-list"] .collapse-bar {
  border-bottom-color: rgba(217, 154, 34, 0.25);
  background: linear-gradient(180deg, rgba(255, 246, 205, 0.98), rgba(255, 238, 176, 0.8));
}

[data-panel="shopping-list"] .list-panel {
  border-color: rgba(217, 154, 34, 0.28);
  background: linear-gradient(180deg, rgba(255, 250, 232, 0.96), rgba(255, 247, 237, 0.82));
}

.progress-wrap {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0 1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.progress-track {
  height: 0.68rem;
  overflow: hidden;
  border-radius: 999rem;
  background: var(--surface-soft);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #14b8a6, var(--accent));
  transition: width 220ms ease;
}

.product-card {
  display: grid;
  gap: 0.48rem;
  padding: 0.72rem 0.78rem;
}

.product-card.is-done {
  opacity: 0.62;
}

.product-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.product-row-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.48rem;
  align-items: center;
  justify-content: space-between;
}

.icon-check {
  display: inline-flex;
  min-width: 4.7rem;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999rem;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 0.78rem;
  line-height: 1;
}

.product-card.is-done .icon-check {
  background: var(--ok);
  color: white;
  border-color: transparent;
}

.check-remove {
  display: inline-grid;
  width: 1.1rem;
  height: 1.1rem;
  place-items: center;
  border-radius: 999rem;
  background: rgba(255, 255, 255, 0.22);
  color: currentColor;
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
}

.product-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-weight: 950;
  min-width: 0;
  font-size: 0.96rem;
  line-height: 1.15;
}

.product-title span {
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  min-height: 1.55rem;
  align-items: center;
  padding: 0 0.5rem;
  border-radius: 999rem;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 900;
}

.product-meta {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.unit-meta,
.quantity-control {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: center;
}

.quantity-control {
  order: 1;
  padding: 0.18rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-soft);
}

.product-row-controls .icon-check {
  order: 2;
  margin-left: auto;
}

.quantity-input {
  width: 2.75rem;
  min-height: 1.88rem;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.quantity-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  outline: none;
}

.quantity-stepper {
  display: inline-flex;
  flex: 0 0 auto;
  width: 1.88rem;
  min-height: 1.88rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.75);
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
}

.quantity-stepper:hover {
  background: rgba(20, 184, 166, 0.12);
}

.unit-label {
  padding: 0 0.28rem 0 0.04rem;
  color: var(--muted);
  font-weight: 850;
}

.delete-button {
  justify-self: end;
  width: 1.9rem;
  height: 1.9rem;
  min-height: 1.9rem;
  padding: 0;
  border: 1px solid rgba(194, 65, 12, 0.2);
  border-radius: 999rem;
  background: rgba(194, 65, 12, 0.08);
  color: #b83d0d;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

.delete-button:hover {
  background: rgba(194, 65, 12, 0.14);
}

.needs-review {
  color: var(--warn);
}

.market-card {
  padding: 0.85rem;
}

.market-card.best {
  border-color: rgba(15, 118, 110, 0.52);
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.12), var(--surface-solid));
}

.market-card strong {
  display: block;
}

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

.market-total {
  margin: 0.5rem 0 0.15rem;
  font-size: 1.45rem;
  font-weight: 950;
}

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

.offline-card {
  max-width: 34rem;
  margin: 12vh auto;
  padding: 2rem;
  text-align: center;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.2rem;
  padding: 1rem 0.25rem 1.6rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.app-footer a {
  display: inline-flex;
  min-height: 2.2rem;
  align-items: center;
  padding: 0 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary-dark);
}

.app-footer a:hover {
  background: var(--surface-solid);
  color: var(--primary);
}

@media (max-width: 980px) {
  .shell,
  .workspace-grid,
  .history-shell,
  .main-grid {
    grid-template-columns: 1fr;
  }

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

  .history-shell .side-panel {
    grid-template-columns: 1fr;
  }

  .app-footer {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .app {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .topbar {
    align-items: flex-start;
  }

  .status-chip {
    display: none;
  }

  .brand-mark {
    width: 2.75rem;
    height: 2.75rem;
  }

  h1 {
    font-size: 2.45rem;
  }

  .hero-panel {
    border-radius: 1.25rem;
    gap: 0.72rem;
    padding: 0.85rem;
    min-height: auto;
  }

  .eyebrow {
    margin-bottom: 0.32rem;
    font-size: 0.68rem;
  }

  .hero-copy p:last-child {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .mic-button {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 6.5rem;
    height: 6.5rem;
  }

  .voice-stage {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    column-gap: 0.78rem;
    row-gap: 0.62rem;
  }

  .voice-state {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 3rem;
    display: flex;
    align-items: center;
    padding: 0.62rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.86rem;
    text-align: left;
  }

  .transcript-box {
    grid-column: 1 / -1;
    min-height: 4.35rem;
    padding: 0.68rem;
  }

  .transcript-box textarea {
    min-height: 2.35rem;
    font-size: 0.92rem;
  }

  .transcript-actions {
    align-items: stretch;
  }

  .transcript-actions .muted {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
  }

  .templates {
    grid-column: 1 / -1;
    gap: 0.28rem;
    margin-top: -0.18rem;
  }

  .workspace-grid {
    gap: 0.85rem;
  }

  .collapse-bar {
    min-height: 3.75rem;
    padding: 0.75rem 0.85rem;
  }

  .list-panel {
    min-height: 18rem;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .history-shell .side-panel {
    grid-template-columns: 1fr;
  }

  .product-row-controls .icon-check {
    margin-left: 0;
  }

  .app-footer {
    margin-top: 0.85rem;
    padding-bottom: 1.2rem;
  }

  .app-footer nav,
  .app-footer a {
    width: 100%;
  }

  .app-footer a {
    justify-content: center;
  }

}
