:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #66716d;
  --line: #d8dfdc;
  --panel: #ffffff;
  --page: #f5f7f4;
  --accent: #0f6f5c;
  --accent-dark: #0a5748;
  --warn: #a34b19;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

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

.app {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(110px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 10px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.panel,
.itemCard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 12px 0;
}

.modeTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #e7ece9;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 12px;
}

.modeTabs button {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.modeTabs button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 33, 31, 0.12);
}

.field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bdc8c3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  min-height: 48px;
  padding: 11px 12px;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 111, 92, 0.16);
}

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

.sectionHeader,
.itemHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.itemCard {
  margin: 0 0 12px;
  background: #fbfcfb;
}

.itemTitle {
  font-size: 15px;
}

.primary,
.secondary,
.download,
.iconButton {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.secondary {
  color: var(--ink);
}

.primary {
  background: var(--accent);
  color: #ffffff;
  width: 100%;
}

.primary:active {
  background: var(--accent-dark);
}

.secondary,
.iconButton {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.compact {
  min-height: 38px;
}

.fullWidth {
  width: 100%;
  margin-top: 10px;
}

.deliveryStatus {
  margin-top: 10px;
}

.photoActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 12px;
}

.photoButton {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 58px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.photoButton input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.primaryPhoto {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.experimental {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.experimental summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.bottleTools {
  padding-top: 4px;
}

.results {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.resultButton {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  padding: 9px 10px;
}

.resultButton strong {
  display: block;
}

.resultButton span,
.selected span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.selected {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #eef5f2;
  font-weight: 800;
}

.selected.empty {
  background: #fafafa;
  color: var(--muted);
  font-weight: 600;
}

.photoPreview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  display: none;
  border: 1px solid var(--line);
}

.actionBar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  background: rgba(245, 247, 244, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.download {
  background: #ffffff;
  color: var(--accent);
  border-color: var(--accent);
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 84px;
  max-width: 592px;
  margin: 0 auto;
  background: #18211f;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.adminTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0 14px;
}

.adminTable th,
.adminTable td {
  border-bottom: 1px solid var(--line);
  padding: 6px 4px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.selected h3 {
  font-size: 14px;
  margin: 10px 0 6px;
}

.hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .grid2,
  .photoActions {
    grid-template-columns: 1fr;
  }

  .app {
    padding-left: 10px;
    padding-right: 10px;
  }

  .panel,
  .itemCard {
    padding: 12px;
    margin: 10px 0;
  }

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

  .iconButton {
    min-width: 72px;
  }

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