.restock-error {
  margin-top: 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 1rem;
  background: rgba(248, 113, 113, 0.08);
  padding: 0.65rem 0.8rem;
  color: var(--muted);
}

.restock-error summary {
  cursor: pointer;
  font-weight: 800;
  color: #fecaca;
}

.restock-error pre {
  margin: 0.5rem 0 0;
  max-height: 18rem;
  overflow: auto;
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
}

.restock-error-inline {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px dashed rgba(248, 113, 113, 0.4);
  color: #fecaca;
  font-size: 0.85rem;
}

.analysis-table-card {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.85);
  padding: 1rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(12px);
}

.analysis-summary {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.analysis-table-wrapper {
  overflow-x: auto;
}

.restock-analysis-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

.restock-analysis-table th,
.restock-analysis-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
}

.restock-analysis-table th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.restock-analysis-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.restock-analysis-table td.restock-pull {
  font-weight: 800;
  color: var(--accent);
}
:root {
  color-scheme: dark;
  --background: #0f172a;
  --panel: #111827;
  --panel-soft: #1f2937;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #f59e0b;
  --accent-dark: #b45309;
  --line: rgba(255, 255, 255, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.24), transparent 32rem),
    linear-gradient(135deg, #020617, var(--background));
}

body.restock-camera-landscape {
  background: #000;
}

body.restock-camera-landscape .app-header,
body.restock-camera-landscape .app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
}

body.restock-camera-landscape .app-shell {
  padding: 0;
}

body.restock-camera-landscape #restockView {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  padding: clamp(0.5rem, 3vw, 1.5rem);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 45%),
    #000;
}

body.restock-camera-landscape .restock-hero,
body.restock-camera-landscape .restock-panel:not(.camera-stage-panel) {
  display: none;
}

body.restock-camera-landscape .camera-stage-panel {
  position: relative;
  min-height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.restock-camera-landscape .camera-frame {
  height: 100vh;
  width: 100vw;
  border-radius: 0;
}

body.restock-camera-landscape .camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: rotate(0deg);
}

body.restock-camera-landscape.restock-camera-portrait-video .camera-frame video {
  width: auto;
  height: 100%;
  max-width: none;
  transform: rotate(90deg);
}

body.restock-camera-landscape .camera-shot-list {
  position: absolute;
  top: clamp(0.6rem, 3vh, 1.4rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  margin: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow-x: auto;
  max-width: 90vw;
}

body.restock-camera-landscape .restock-fallback {
  display: none;
}

body.restock-camera-landscape .camera-stage-panel > h3,
body.restock-camera-landscape .camera-stage-panel > p {
  display: none;
}

body.restock-camera-landscape .camera-controls {
  position: absolute;
  bottom: clamp(1rem, 4vh, 2.2rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

body.restock-camera-landscape .camera-stage-panel .restock-empty {
  position: absolute;
  bottom: clamp(4rem, 12vh, 5.5rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
}

body.restock-camera-landscape .camera-shot-list li {
  border: 0;
  padding: 0;
  background: transparent;
  min-width: 6rem;
}

body.restock-camera-landscape .camera-shot-list button {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 800;
}

body.restock-camera-landscape .camera-shot-list li.active button {
  background: var(--accent);
  color: #111827;
}

body.restock-camera-landscape .camera-shot-list small,
body.restock-camera-landscape .camera-shot-list img,
body.restock-camera-landscape .camera-shot-list .ghost-button.tiny {
  display: none;
}

body.restock-camera-landscape .camera-overlay p {
  bottom: clamp(0.6rem, 3vh, 1.6rem);
  font-size: clamp(1rem, 2vw, 1.4rem);
}

button,
input,
select {
  font: inherit;
}

.app-header,
.app-shell {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 1rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 0.95;
}

.install-button,
.card-nav button {
  border: 0;
  border-radius: 999px;
  color: #111827;
  background: var(--accent);
  padding: 0.8rem 1.1rem;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(245, 158, 11, 0.25);
}

.app-shell {
  padding-bottom: 2rem;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
}

.mode-tabs button {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  padding: 0.75rem 1rem;
  font-weight: 900;
}

.analyze-button.secondary {
  color: var(--accent);
  background: rgba(245, 158, 11, 0.15);
  border: 1px dashed rgba(245, 158, 11, 0.5);
}

.analyze-button:disabled,
.analyze-button.secondary:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.restock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.mode-tabs button.active {
  color: #111827;
  background: var(--accent);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(11rem, 15rem);
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(18px);
}

.search-field,
.select-field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--text);
  background: var(--panel-soft);
  padding: 0.9rem 1rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0.25rem;
  color: var(--muted);
}

.summary strong {
  color: var(--text);
}

.search-results {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  display: grid;
  gap: 1rem;
}

.search-results-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.search-results-headline h2 {
  margin: 0;
  font-size: 1.2rem;
}

.search-results-headline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.search-results-grid button {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0.9rem 1rem;
  font-weight: 700;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-results-grid button:hover,
.search-results-grid button:focus-visible {
  border-color: var(--accent);
}

.search-results-grid button.active {
  background: var(--accent);
  color: #111827;
  border-color: transparent;
}

.card-stage {
  min-height: 34rem;
  touch-action: pan-y;
}

.drink-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.96), rgba(17, 24, 39, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

.drink-card {
  padding: clamp(1.1rem, 4vw, 2rem);
}

.drink-art {
  margin: 0 0 1.2rem;
  border-radius: 1.6rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.drink-art img {
  width: 100%;
  height: auto;
  max-height: clamp(260px, 60vw, 460px);
  object-fit: contain;
  display: block;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drink-card h2 {
  margin: 0.35rem 0 1.2rem;
  font-size: clamp(2rem, 9vw, 4.8rem);
  line-height: 0.92;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.5rem;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0.2rem 0 0;
  font-weight: 800;
}

h3 {
  margin-bottom: 0.6rem;
  color: var(--accent);
}

ol {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1.4rem;
  padding-left: 1.5rem;
  color: var(--text);
}

li::marker {
  color: var(--accent);
  font-weight: 900;
}

.garnish {
  margin: 0;
  color: var(--muted);
}

.card-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.card-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.empty-state {
  display: grid;
  min-height: 20rem;
  place-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.restock-hero,
.restock-panel {
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: rgba(17, 24, 39, 0.86);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.26);
}

.restock-hero {
  margin-bottom: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.restock-hero h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 0.95;
}

.restock-hero p {
  margin-bottom: 0;
  color: var(--muted);
}

.restock-panel {
  padding: 1rem;
}

.restock-panel + .restock-panel {
  margin-top: 1rem;
}

.restock-panel h3 {
  margin-bottom: 0.8rem;
}

.restock-panel ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.3rem;
  color: var(--muted);
}

.restock-empty {
  margin-bottom: 0;
  color: var(--muted);
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--text);
  background: var(--panel-soft);
  padding: 0.9rem 1rem;
  resize: vertical;
}

.photo-upload {
  display: block;
  margin: 0.85rem 0;
  border: 1px dashed rgba(245, 158, 11, 0.55);
  border-radius: 1rem;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
  padding: 1rem;
  font-weight: 900;
  text-align: center;
}

.photo-upload input {
  width: 100%;
  margin-top: 0.75rem;
  color: var(--muted);
}

.camera-placeholder {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 1.1rem;
  background: rgba(17, 24, 39, 0.65);
  text-align: center;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.2rem;
  background: #000;
  aspect-ratio: 3 / 4;
}

.camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.camera-border {
  width: 75%;
  height: 70%;
  border: 3px solid rgba(245, 158, 11, 0.8);
  border-radius: 1.5rem;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.25);
}

.camera-overlay p {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  font-weight: 800;
}

.camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.camera-shot-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.camera-shot-list li {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 0.6rem;
  display: grid;
  gap: 0.4rem;
  background: rgba(17, 24, 39, 0.7);
}

.camera-shot-list li.active {
  border-color: var(--accent);
}

.camera-shot-list li.captured {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
}

.camera-shot {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: 800;
}

.camera-shot small {
  color: var(--muted);
  font-weight: 600;
}

.camera-shot-list img {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ghost-button.tiny {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  justify-self: start;
}

.restock-fallback summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
}

.restock-fallback[open] {
  margin-top: 0.75rem;
}

.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.file-preview {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.8);
  overflow: hidden;
}

.file-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.file-preview figcaption {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.analyze-button {
  border: 0;
  border-radius: 999px;
  color: #111827;
  background: var(--accent);
  padding: 0.8rem 1.1rem;
  font-weight: 900;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  padding: 0.8rem 1.1rem;
  font-weight: 900;
}

.analysis-result {
  overflow: auto;
  max-height: 22rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--text);
  background: var(--panel-soft);
  padding: 1rem;
  white-space: pre-wrap;
}

.reference-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.85rem;
}

.reference-photos figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
}

.reference-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.reference-photos figcaption {
  padding: 0.65rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

@media (max-width: 680px) {
  .app-header {
    align-items: flex-start;
    padding-top: 1rem;
  }

  .toolbar,
  .search-results,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .summary {
    flex-direction: column;
  }
}
