:root {
  color-scheme: dark;
  --ink: #0c261f;
  --ink-deep: #071b16;
  --ink-soft: #17392f;
  --cream: #fbf8ef;
  --paper: #f3f0e7;
  --clay: #c46d48;
  --sun: #e9ff64;
  --line: rgba(251, 248, 239, 0.16);
  --muted: rgba(251, 248, 239, 0.62);
  font-family: Arial, Helvetica, sans-serif;
  background: var(--ink-deep);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--ink-deep);
  color: var(--cream);
}

body {
  overflow-x: hidden;
}

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

button,
a,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

noscript {
  display: block;
  padding: 20px;
  background: var(--clay);
  color: #fff;
  font-weight: 700;
}

.eyebrow,
.sidebar-label,
.section-number {
  margin: 0;
  color: var(--clay);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.primary-button,
.preview-button,
.upload-button {
  min-height: 48px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: var(--sun);
  color: var(--ink-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.primary-button:hover,
.primary-button:focus-visible,
.upload-button:hover,
.upload-button:focus-visible {
  background: var(--cream);
}

.primary-button:disabled,
.upload-button.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.preview-button {
  border-color: var(--line);
  background: transparent;
  color: var(--cream);
}

.preview-button:hover,
.preview-button:focus-visible {
  border-color: var(--cream);
}

.auth-shell,
.fatal-state {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 24%, rgba(233, 255, 100, 0.07), transparent 28%),
    linear-gradient(135deg, var(--ink-deep), var(--ink));
}

.auth-shell::before,
.auth-shell::after {
  content: '';
  width: min(54vw, 740px);
  aspect-ratio: 1.8;
  position: absolute;
  right: -12vw;
  top: 13vh;
  border: 1px solid rgba(251, 248, 239, 0.12);
  border-radius: 50%;
  transform: rotate(18deg);
  pointer-events: none;
}

.auth-shell::after {
  right: -16vw;
  top: 18vh;
  border-color: rgba(196, 109, 72, 0.28);
}

.auth-panel {
  width: min(100%, 480px);
  position: relative;
  z-index: 1;
}

.auth-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.auth-brand,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.auth-brand img,
.sidebar-brand img {
  border-radius: 50%;
  object-fit: contain;
  filter: invert(1);
}

.auth-panel .eyebrow {
  margin-top: 68px;
}

.auth-panel h1,
.fatal-state h1 {
  margin: 18px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(44px, 8vw, 78px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.auth-intro {
  margin: 22px 0 36px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label,
.editor-form > section > label,
.field-group label {
  color: rgba(251, 248, 239, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-form input,
.editor-form input,
.editor-form textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  padding: 14px 16px;
  background: rgba(251, 248, 239, 0.055);
  color: var(--cream);
  transition: border-color 160ms ease, background 160ms ease;
}

.auth-form input:focus,
.editor-form input:focus,
.editor-form textarea:focus {
  border-color: var(--sun);
  background: rgba(251, 248, 239, 0.08);
}

.auth-form .primary-button {
  margin-top: 12px;
}

.form-message {
  min-height: 22px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-message.is-error {
  color: #ffad91;
}

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

.quiet-link,
.quiet-button,
.language-toggle {
  min-height: 44px;
  border: 0;
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: rgba(251, 248, 239, 0.54);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

select.language-toggle {
  min-width: 68px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 26px 0 12px;
  background-color: var(--ink-deep);
  color: var(--cream);
}

.language-picker-label {
  display: inline-flex;
}

.quiet-link:hover,
.quiet-button:hover,
.language-toggle:hover,
.quiet-link:focus-visible,
.quiet-button:focus-visible,
.language-toggle:focus-visible {
  color: var(--cream);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  background: var(--ink);
}

.product-sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 30px 24px 22px;
  border-right: 1px solid var(--line);
  background: var(--ink-deep);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sidebar-label {
  margin: 58px 0 16px;
}

#product-navigation {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.product-group-label {
  margin: 26px 0 9px;
  color: rgba(251, 248, 239, 0.38);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.product-nav-item {
  width: 100%;
  min-height: 66px;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  position: relative;
  background: transparent;
  color: var(--cream);
  text-align: left;
  cursor: pointer;
}

.product-nav-item::before {
  content: '';
  width: 2px;
  position: absolute;
  inset: 10px auto 10px -24px;
  background: transparent;
}

.product-nav-item.is-active::before {
  background: var(--sun);
}

.product-nav-item img {
  width: 38px;
  height: 46px;
  object-fit: cover;
  background: var(--paper);
}

.product-nav-item strong,
.product-nav-item small {
  display: block;
}

.product-nav-item strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 400;
}

.product-nav-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.product-nav-price {
  color: var(--sun);
  font-size: 10px;
  font-weight: 900;
}

.dirty-dot {
  width: 7px;
  height: 7px;
  position: absolute;
  right: 0;
  top: 8px;
  border-radius: 50%;
  background: var(--clay);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-language-field {
  display: grid;
  gap: 6px;
}

.sidebar-language-field > span {
  color: rgba(251, 248, 239, 0.46);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1.35;
  text-transform: uppercase;
}

.sidebar-language-field .language-toggle {
  width: 100%;
}

.language-toggle span {
  margin: 0 5px;
  color: var(--clay);
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}

.sidebar-close,
.sidebar-open {
  display: none;
}

.editor-shell {
  min-width: 0;
  background: var(--ink);
}

.editor-header {
  min-height: 114px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(24px, 4vw, 68px);
  background: rgba(12, 38, 31, 0.96);
  backdrop-filter: blur(16px);
}

.editor-header h1 {
  margin: 6px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.save-state {
  margin: 5px 0 0;
  color: rgba(251, 248, 239, 0.46);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.save-state[data-state='dirty'] {
  color: #ffad91;
}

.save-state[data-state='saving'] {
  color: var(--sun);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.editor-form {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 52px clamp(24px, 5vw, 74px) 120px;
}

.editor-section {
  padding: 38px 0 56px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.section-heading h2 {
  margin: 7px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(31px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.section-heading > span {
  color: rgba(251, 248, 239, 0.48);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.editor-form textarea {
  min-height: 230px;
  margin-top: 10px;
  resize: vertical;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 19px;
  line-height: 1.65;
}

.names-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.names-grid .field-note {
  margin-top: 0;
}

.field-note {
  max-width: 700px;
  margin: 12px 0 0;
  color: rgba(251, 248, 239, 0.47);
  font-size: 12px;
  line-height: 1.55;
}

.placeholder-warning {
  color: var(--sun);
}

.translate-field {
  max-width: 760px;
  min-height: 70px;
  margin-top: 22px;
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: rgba(251, 248, 239, 0.035);
  cursor: pointer;
}

.editor-form .translate-field input {
  width: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--sun);
}

.translate-field strong,
.translate-field small {
  display: block;
}

.translate-field strong {
  color: var(--cream);
  font-size: 12px;
  line-height: 1.45;
  text-transform: none;
}

.translate-field small {
  margin-top: 6px;
  color: rgba(251, 248, 239, 0.5);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
}

.wide-heading,
.switch-field {
  grid-column: 1 / -1;
}

.field-group {
  display: grid;
  gap: 10px;
}

.money-input {
  position: relative;
}

.money-input > span {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sun);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
}

.money-input input {
  padding-left: 45px;
}

.field-label {
  color: rgba(251, 248, 239, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.effective-price-field output {
  min-height: 52px;
  border: 1px solid rgba(233, 255, 100, 0.32);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(233, 255, 100, 0.055);
  color: var(--sun);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
}

.stock-sync-field {
  grid-column: 1 / -1;
  margin-top: 0;
  cursor: default;
}

.stock-sync-field input:disabled {
  opacity: 1;
}

.switch-field {
  min-height: 76px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.switch-field input {
  width: 1px;
  min-height: 1px;
  position: absolute;
  opacity: 0;
}

.switch-control {
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
  position: relative;
  border: 1px solid var(--line);
  background: rgba(251, 248, 239, 0.06);
}

.switch-control::after {
  content: '';
  width: 20px;
  height: 20px;
  position: absolute;
  left: 4px;
  top: 4px;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.switch-field input:checked + .switch-control {
  border-color: var(--sun);
}

.switch-field input:checked + .switch-control::after {
  transform: translateX(24px);
  background: var(--sun);
}

.switch-field input:focus-visible + .switch-control {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.switch-field strong,
.switch-field small {
  display: block;
}

.switch-field small {
  margin-top: 6px;
  color: rgba(251, 248, 239, 0.48);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
}

.photo-list {
  margin-top: 26px;
  display: grid;
  gap: 10px;
}

.photo-row {
  min-height: 112px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px;
  background: rgba(251, 248, 239, 0.025);
}

.photo-row img {
  width: 86px;
  height: 90px;
  object-fit: cover;
  background: var(--paper);
}

.photo-copy strong,
.photo-copy small {
  display: block;
}

.photo-copy strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 400;
}

.photo-copy small {
  margin-top: 8px;
  overflow: hidden;
  color: rgba(251, 248, 239, 0.48);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-actions {
  display: flex;
  gap: 6px;
}

.photo-actions button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}

.photo-actions button:hover:not(:disabled),
.photo-actions button:focus-visible:not(:disabled) {
  border-color: var(--sun);
  color: var(--sun);
}

.photo-actions button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.photo-actions .delete-photo:hover:not(:disabled),
.photo-actions .delete-photo:focus-visible:not(:disabled) {
  border-color: #ff9f82;
  color: #ff9f82;
}

.upload-panel {
  min-height: 96px;
  margin-top: 14px;
  border: 1px dashed rgba(251, 248, 239, 0.26);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
}

.upload-panel strong,
.upload-panel small {
  display: block;
}

.upload-panel strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 400;
}

.upload-panel small {
  margin-top: 7px;
  color: rgba(251, 248, 239, 0.48);
  font-size: 10px;
}

.upload-panel input {
  width: 1px;
  min-height: 1px;
  position: absolute;
  opacity: 0;
}

.mobile-save-bar {
  display: none;
}

.fatal-state {
  text-align: center;
}

.fatal-state p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.6;
}

.fatal-state .primary-button {
  margin-top: 18px;
}

.confirmation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 13, 10, 0.82);
  backdrop-filter: blur(8px);
}

.confirmation-modal {
  width: min(100%, 590px);
  border: 1px solid var(--line);
  padding: clamp(24px, 5vw, 44px);
  background: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.confirmation-modal h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 400;
  line-height: 1.08;
}

.confirmation-modal p {
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.confirmation-actions {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.confirmation-actions .quiet-button {
  padding: 0 18px;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .product-sidebar {
    width: min(86vw, 330px);
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.38);
    transition: transform 220ms ease;
  }

  .admin-shell.sidebar-visible::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(2, 13, 10, 0.7);
  }

  .admin-shell.sidebar-visible .product-sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .sidebar-open {
    display: grid;
  }

  .editor-header {
    min-height: 94px;
    padding: 14px 18px;
  }

  .editor-header > div:nth-child(2) {
    min-width: 0;
    flex: 1;
  }

  .editor-header h1 {
    overflow: hidden;
    font-size: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    display: none;
  }

  .editor-form {
    padding: 28px 18px 128px;
  }

  .two-column-section {
    grid-template-columns: 1fr;
  }

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

  .wide-heading,
  .switch-field,
  .stock-sync-field {
    grid-column: auto;
  }

  .photo-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .photo-row img {
    width: 72px;
    height: 78px;
  }

  .photo-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .upload-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .mobile-save-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 12;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 8px;
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    background: rgba(7, 27, 22, 0.97);
    backdrop-filter: blur(16px);
  }
}

@media (max-width: 520px) {
  .auth-shell {
    place-items: start stretch;
    padding: 28px 20px;
  }

  .auth-panel {
    margin-top: 7vh;
  }

  .auth-panel .eyebrow {
    margin-top: 48px;
  }

  .auth-panel h1 {
    font-size: 48px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 36px;
  }

  .confirmation-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
.new-product-dialog { width:min(560px,calc(100% - 32px)); max-height:90vh; overflow:auto; padding:24px; border:1px solid #b8c1b8; border-radius:16px; }
.new-product-dialog::backdrop { background:#172a2180; }
.new-product-dialog form { display:grid; gap:12px; }
.new-product-dialog input,.new-product-dialog textarea,.new-product-dialog select { width:100%; min-width:0; padding:10px; border:1px solid #aab6ab; border-radius:6px; }
#new-product-button { margin:0 16px 16px; }

/* Google's official sign-in button includes its multicolour G on the left. */
.google-signin { min-height:44px; margin:24px 0; max-width:100%; }
.google-retry { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; max-width:320px; min-height:44px; padding:10px 16px; border:1px solid #747775; border-radius:4px; background:#fff; color:#1f1f1f; font:500 15px Arial,sans-serif; cursor:pointer; }
.google-retry:focus-visible { outline:3px solid #4285f4; outline-offset:3px; }
