:root {
  color-scheme: light;
  --ink: #2a211c;
  --muted: #6d5c52;
  --line: #e4d8cc;
  --paper: #fbf7f2;
  --card: #fff;
  --wine: #7a2e2e;
  --gold: #8a6a32;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
}

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

button, .top-actions a {
  border: 0;
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  padding: 0.55rem 1rem;
  text-decoration: none;
  cursor: pointer;
}

button.ghost, .top-actions a {
  background: transparent;
  color: var(--wine);
  box-shadow: inset 0 0 0 1px var(--wine);
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.gate-card, .app {
  width: min(1080px, 100%);
}

.gate-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  display: grid;
  gap: 0.8rem;
}

.brand {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold);
}

h1 { margin: 0; font-weight: 500; }

label, .field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem 0.7rem;
}

textarea { min-height: 7rem; resize: vertical; }

.status { min-height: 1.2rem; color: var(--wine); }

.status.ok { color: #2f6b45; }

.app { margin: 0 auto; padding: 1.2rem; }

.top, .top-actions, .aside-actions, .row-actions, .langs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.top { justify-content: space-between; margin-bottom: 0.6rem; }

.langs { margin: 0.4rem 0 1rem; }

.langs button[aria-selected="true"] {
  background: var(--gold);
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}

aside, #editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem;
}

.group-title {
  margin: 0.8rem 0 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: none;
}

.item-btn[aria-current="true"] {
  background: #f3e7dc;
  color: var(--ink);
}

.editor-head, .pair {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: end;
}

.pair > * { flex: 1; }

.block {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

.row {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  display: grid;
  gap: 0.45rem;
}

.wine-photo {
  display: block;
  width: auto;
  max-width: 160px;
  max-height: 220px;
  object-fit: contain;
  background: #f3e7dc;
  border-radius: 12px;
}

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

.dato-name {
  margin: 0;
  font-size: 0.92rem;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
}
