:root {
  --ink: #151515;
  --muted: #615d59;
  --paper: #f8f5ef;
  --panel: #fffdf8;
  --line: #dfd7ca;
  --burgundy: #7d1831;
  --burgundy-strong: #5f1024;
  --sage: #25645f;
  --gold: #c49a4b;
  --danger: #b42318;
  --success: #166534;
  --shadow: 0 24px 70px rgba(13, 13, 13, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background: var(--paper);
}

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
  background: var(--paper);
}

.hero {
  position: relative;
  min-height: calc(100vh - 94px);
  overflow: hidden;
  color: #fff;
  isolation: isolate;
}

.hero__media,
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media {
  background-image: url("/assets/hero-cellar.jpg");
  background-position: center;
  background-size: cover;
  transform: scale(1.01);
}

.hero__shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 8, 7, 0.9) 0%, rgba(10, 8, 7, 0.76) 38%, rgba(10, 8, 7, 0.3) 70%, rgba(10, 8, 7, 0.7) 100%),
    linear-gradient(180deg, rgba(10, 8, 7, 0.72) 0%, rgba(10, 8, 7, 0.2) 45%, rgba(10, 8, 7, 0.82) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(125, 24, 49, 0.78);
  font-weight: 800;
}

.brand__name {
  font-size: 1.1rem;
  font-weight: 800;
}

.topbar__state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #71d17a;
  box-shadow: 0 0 0 4px rgba(113, 209, 122, 0.18);
}

.hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  align-items: center;
  gap: 56px;
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 188px);
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero__copy {
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #f1d393;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 22px;
  font-size: 4.4rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero__lead {
  max-width: 590px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.14rem;
  line-height: 1.65;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-strip span {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  white-space: nowrap;
}

.auth-panel {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.is-active {
  background: var(--burgundy);
  color: #fff;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.auth-form.is-hidden {
  display: none;
}

.form-head {
  display: grid;
  gap: 8px;
}

.form-head h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.form-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field,
.check-field {
  display: grid;
  gap: 8px;
}

.field span,
.check-field span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.field-label-row label {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfc6b8;
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 96px;
  padding: 12px 13px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9f968b;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(37, 100, 95, 0.14);
}

.check-field {
  grid-template-columns: 20px 1fr;
  align-items: start;
  color: var(--muted);
}

.check-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--burgundy);
}

.primary-action,
.secondary-action,
.ghost-action,
.danger-action {
  min-height: 48px;
  border-radius: 6px;
  font-weight: 850;
}

.primary-action {
  border: 1px solid var(--burgundy-strong);
  background: var(--burgundy);
  color: #fff;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--burgundy-strong);
}

.primary-action:disabled,
.secondary-action:disabled,
.ghost-action:disabled,
.danger-action:disabled,
.price-lookup-action:disabled {
  cursor: wait;
  opacity: 0.7;
}

.secondary-action {
  border: 1px solid rgba(37, 100, 95, 0.34);
  background: rgba(37, 100, 95, 0.08);
  color: var(--sage);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  border-color: var(--sage);
  background: rgba(37, 100, 95, 0.13);
}

.ghost-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-action {
  border: 1px solid rgba(180, 35, 24, 0.34);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.price-lookup-action {
  min-height: 28px;
  border: 1px solid #cfc6b8;
  border-radius: 999px;
  padding: 0 9px;
  background: #f7f9f8;
  color: var(--sage);
  font-size: 0.76rem;
  font-weight: 850;
}

.price-lookup-action:hover,
.price-lookup-action:focus-visible {
  border-color: rgba(37, 100, 95, 0.45);
  background: #edf4f1;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--success);
}

.baseline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.baseline div {
  min-height: 74px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.baseline__label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.baseline strong {
  color: var(--ink);
  font-size: 1rem;
}

.workspace {
  min-height: 100vh;
  background: #eef3f1;
  color: var(--ink);
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1320px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  padding: 14px 0;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.app-brand .brand__mark {
  color: #fff;
}

.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid #d7dfdc;
  border-radius: 8px;
  background: #fff;
}

.app-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
}

.app-nav__link.is-active {
  background: var(--sage);
  color: #fff;
}

.app-topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-state {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(37, 100, 95, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--sage);
  font-size: 0.9rem;
  font-weight: 800;
}

.app-logout {
  min-height: 38px;
  padding: 0 12px;
}

.workspace__body {
  display: grid;
  gap: 16px;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 28px;
}

.app-message {
  min-height: 24px;
}

.app-page {
  min-width: 0;
}

.page-grid {
  display: grid;
  align-items: start;
  gap: 16px;
}

.page-grid--cave {
  grid-template-columns: minmax(0, 1fr);
}

.page-grid--configuration {
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
}

.config-panel,
.virtual-panel,
.shelves-panel {
  border: 1px solid #d7dfdc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(26, 36, 34, 0.08);
}

.config-panel,
.shelves-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.config-panel {
  position: sticky;
  top: 16px;
}

.virtual-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title h1,
.panel-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.25;
}

.panel-title h1 {
  font-size: 1.35rem;
}

.panel-title span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

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

.control-grid .field span {
  font-size: 0.82rem;
}

.button-row,
.selection-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row > button {
  flex: 1 1 130px;
  padding: 0 12px;
}

.selection-tools {
  align-items: center;
}

.selection-tools button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.selection-tools span {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.zoom-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zoom-field strong {
  color: var(--sage);
  font-size: 0.88rem;
}

.zoom-field input[type="range"] {
  accent-color: var(--sage);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #e2e7e5;
  border-bottom: 1px solid #e2e7e5;
  background: #f7faf9;
}

.metric-strip div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid #e2e7e5;
}

.metric-strip div:last-child {
  border-right: 0;
}

.metric-strip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-strip strong {
  display: block;
  color: var(--ink);
  font-size: 1.18rem;
}

.virtual-panel .panel-title {
  padding: 18px;
}

.cellar-visual {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 234px);
  min-height: 420px;
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(37, 100, 95, 0.05), rgba(125, 24, 49, 0.04)),
    #fbfcfb;
}

.virtual-shelf {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #d9dedb;
  border-left: 5px solid var(--sage);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.virtual-shelf__select {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.virtual-shelf.is-selected {
  border-left-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(125, 24, 49, 0.1);
}

.virtual-shelf__label,
.virtual-shelf__select {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.virtual-shelf__label strong,
.virtual-shelf__select strong,
.shelf-card__title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.virtual-shelf__label span,
.virtual-shelf__select span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.shelf-slots {
  --shelf-width: 8;
  display: grid;
  grid-template-columns: repeat(var(--shelf-width), minmax(7px, 1fr));
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.bottle-slot-frame {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 1 / 1.7;
}

.bottle-slot {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 1px solid rgba(95, 16, 36, 0.32);
  border-radius: 999px 999px 5px 5px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0) 42%),
    var(--burgundy);
  cursor: pointer;
  opacity: 0.9;
}

.bottle-slot:hover,
.bottle-slot:focus-visible {
  outline: 3px solid rgba(37, 100, 95, 0.22);
  outline-offset: 2px;
}

.bottle-slot.is-empty {
  border-style: dashed;
  background: #f3f6f4;
  opacity: 1;
}

.bottle-slot__photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.bottle-slot__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--bottle-photo-zoom, 1));
  transform-origin: center;
  transition: transform 0.18s ease;
}

.bottle-slot-frame:hover .bottle-slot__photo img,
.bottle-slot-frame:focus-within .bottle-slot__photo img {
  transform: scale(calc(var(--bottle-photo-zoom, 1) * 1.08));
}

.bottle-slot.is-occupied::after {
  position: absolute;
  z-index: 3;
  right: 2px;
  bottom: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f1d393;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.78);
  content: "";
}

.bottle-slot__type {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  padding: 0 6px;
  background: #697571;
  box-shadow: 0 2px 7px rgba(18, 24, 23, 0.18);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
}

.bottle-slot__zoom-action {
  position: absolute;
  z-index: 5;
  left: 3px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  padding: 0;
  background: rgba(21, 21, 21, 0.72);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(18, 24, 23, 0.22);
}

.bottle-slot__zoom-action:hover,
.bottle-slot__zoom-action:focus-visible {
  background: rgba(21, 21, 21, 0.9);
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 1px;
}

.bottle-slot__type.type-rouge {
  background: #7d1831;
}

.bottle-slot__type.type-blanc {
  border-color: rgba(83, 73, 42, 0.28);
  background: #fff4bf;
  color: #4b4127;
}

.bottle-slot__type.type-rose {
  background: #d75f87;
}

.bottle-slot__type.type-effervescent {
  background: #d7a928;
  color: #2d2817;
}

.bottle-slot__type.type-spiritueux {
  background: #25645f;
}

.bottle-slot__type.type-aperitif {
  background: #b85624;
}

.shelf-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 174px);
  overflow: auto;
  padding-right: 2px;
}

.shelf-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe1de;
  border-radius: 8px;
  background: #fbfdfc;
}

.shelf-card.is-selected {
  border-color: rgba(125, 24, 49, 0.45);
  background: #fff8fa;
}

.shelf-card__title {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.shelf-card__title input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--burgundy);
}

.shelf-card__title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.shelf-card__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 86px;
  gap: 10px;
}

.shelf-card .field input {
  min-height: 42px;
}

.bottle-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: stretch end;
}

.bottle-modal--center {
  place-items: center;
  padding: 16px;
}

.bottle-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 23, 0.46);
}

.photo-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.photo-zoom-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 12, 0.76);
}

.photo-zoom-viewer {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(920px, 100%);
  height: min(760px, calc(100vh - 36px));
  border-radius: 8px;
  overflow: hidden;
  background: #101514;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.photo-zoom-viewer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.photo-zoom-viewer__head h2 {
  margin: 0;
  font-size: 1rem;
}

.photo-zoom-viewer__head span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.photo-zoom-viewer__close {
  width: 42px;
  min-height: 42px;
  padding: 0;
}

.photo-zoom-viewer__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 16px 58px;
}

.photo-zoom-viewer__stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.photo-zoom-viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.photo-zoom-viewer__nav:hover,
.photo-zoom-viewer__nav:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.photo-zoom-viewer__nav:disabled {
  cursor: default;
  opacity: 0.24;
}

.photo-zoom-viewer__nav[data-photo-zoom-prev] {
  left: 14px;
}

.photo-zoom-viewer__nav[data-photo-zoom-next] {
  right: 14px;
}

.bottle-identify,
.bottle-editor {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(560px, 100%);
  max-height: 100vh;
  background: #fff;
  box-shadow: -22px 0 50px rgba(18, 24, 23, 0.22);
}

.bottle-identify {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 58px rgba(18, 24, 23, 0.26);
}

.bottle-editor__head,
.bottle-editor__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid #e2e7e5;
}

.bottle-editor__head {
  justify-content: space-between;
}

.bottle-editor__head span {
  display: block;
  margin-bottom: 5px;
  color: var(--sage);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.bottle-editor__head h2 {
  margin: 0;
  font-size: 1.28rem;
}

.bottle-editor__close {
  width: 42px;
  min-height: 42px;
  padding: 0;
}

.bottle-editor__body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.bottle-editor__actions {
  justify-content: flex-end;
  border-top: 1px solid #e2e7e5;
  border-bottom: 0;
}

.bottle-editor__actions button {
  min-width: 118px;
  padding: 0 14px;
}

.bottle-identify > .form-message,
.bottle-editor > .form-message {
  padding: 0 18px 16px;
}

.photo-picker {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
}

.photo-picker input {
  width: 100%;
}

.camera-tools {
  display: grid;
  gap: 12px;
}

.camera-preview {
  display: grid;
  gap: 10px;
}

.camera-preview video {
  display: block;
  width: 100%;
  max-height: 360px;
  border: 1px solid #dbe1de;
  border-radius: 8px;
  background: #101514;
  object-fit: cover;
}

.identify-photo {
  overflow: hidden;
  border: 1px solid #dbe1de;
  border-radius: 8px;
}

.identify-photo img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

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

.photo-preview__item {
  position: relative;
  min-width: 0;
}

.photo-preview__zoom {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.photo-preview__zoom:focus-visible {
  outline: 3px solid rgba(37, 100, 95, 0.24);
  outline-offset: 2px;
}

.photo-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #dbe1de;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.18s ease;
}

.photo-preview__zoom:hover img,
.photo-preview__zoom:focus-visible img {
  transform: scale(1.08);
}

.photo-preview__remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  min-height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 21, 21, 0.76);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

@media (max-width: 940px) {
  .hero {
    min-height: auto;
  }

  .hero__shade {
    background:
      linear-gradient(180deg, rgba(10, 8, 7, 0.88) 0%, rgba(10, 8, 7, 0.64) 48%, rgba(10, 8, 7, 0.88) 100%),
      linear-gradient(90deg, rgba(10, 8, 7, 0.72), rgba(10, 8, 7, 0.36));
  }

  .hero__content {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    padding-top: 24px;
  }

  .hero__copy {
    max-width: 760px;
  }

  h1 {
    max-width: 620px;
    font-size: 3.1rem;
    line-height: 1.02;
  }

  .auth-panel {
    max-width: 620px;
  }

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

  .config-panel {
    position: static;
  }

  .cellar-visual,
  .shelf-list {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    width: min(100% - 24px, 1180px);
    padding: 16px 0;
  }

  .topbar__state {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .hero__content {
    width: min(100% - 24px, 1180px);
    gap: 30px;
    padding: 12px 0 32px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .hero__lead {
    font-size: 1rem;
    line-height: 1.55;
  }

  .trust-strip span {
    white-space: normal;
  }

  .auth-form {
    padding: 18px;
  }

  .auth-tab {
    min-height: 42px;
    font-size: 0.9rem;
  }

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

  .baseline {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 1180px);
    padding-top: 14px;
  }

  .app-topbar,
  .workspace__body {
    width: min(100% - 24px, 1180px);
  }

  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-topbar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .app-nav {
    width: 100%;
  }

  .app-nav__link {
    flex: 1 1 0;
    justify-content: center;
  }

  .control-grid,
  .metric-strip,
  .shelf-card__fields {
    grid-template-columns: 1fr;
  }

  .virtual-shelf {
    grid-template-columns: 1fr;
  }

  .bottle-slot__type {
    top: 2px;
    right: 2px;
    min-width: 25px;
    height: 25px;
    border-width: 1px;
    padding: 0 3px;
    box-shadow: 0 1px 4px rgba(18, 24, 23, 0.16);
    font-size: 0.41rem;
  }

  .bottle-slot__zoom-action {
    left: 2px;
    bottom: 2px;
    width: 18px;
    min-height: 18px;
    font-size: 0.78rem;
  }

  .bottle-editor {
    width: 100%;
  }

  .bottle-editor__actions {
    flex-wrap: wrap;
  }

  .bottle-editor__actions button {
    flex: 1 1 150px;
  }

  .cellar-visual {
    min-height: 260px;
    padding: 12px;
  }

  .photo-zoom-modal {
    padding: 10px;
  }

  .photo-zoom-viewer {
    height: min(640px, calc(100vh - 20px));
  }

  .photo-zoom-viewer__stage {
    padding: 12px;
  }

  .photo-zoom-viewer__nav {
    top: auto;
    bottom: 12px;
    width: 38px;
    min-height: 38px;
    transform: none;
  }
}

@media (max-width: 400px) {
  .brand__name {
    display: none;
  }

  .topbar {
    gap: 12px;
  }

  .topbar__state {
    max-width: 170px;
  }

  h1 {
    font-size: 2rem;
  }
}
