:root {
  --bg: #f6efe6;
  --bg-2: #f0e2d2;
  --ink: #1f1d1a;
  --muted: #6e655a;
  --accent: #c04b2b;
  --accent-2: #2a7f62;
  --card: rgba(255, 255, 255, 0.7);
  --border: rgba(31, 29, 26, 0.15);
  --shadow: 0 18px 60px rgba(31, 29, 26, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg), var(--bg-2));
}

code {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 600;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(192, 75, 43, 0.3), transparent 60%);
  top: -20vw;
  right: -10vw;
  filter: blur(40px);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.6'/></svg>");
}

.hero {
  padding: 48px 8vw 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(32px, 5vw, 56px);
  margin: 6px 0 8px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
}

.lang-switch {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.lang-btn {
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
}

.lang-btn.active {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  min-width: 110px;
  box-shadow: var(--shadow);
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 24px;
  padding: 0 8vw 56px;
}

.filters .panel {
  position: sticky;
  top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.panel h2 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font-size: 14px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-mode {
  margin: 6px 0 10px;
}

.star-btn {
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
}

.star-btn.active {
  border-color: #d3a016;
  color: #d3a016;
  box-shadow: var(--shadow);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 160ms ease;
}

.chip input {
  accent-color: var(--accent);
}

.chip.active {
  border-color: var(--accent);
  background: rgba(192, 75, 43, 0.08);
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.btn {
  border: 1px solid var(--border);
  background: var(--ink);
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary {
  background: white;
  color: var(--ink);
}

.hidden {
  display: none;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reminder {
  margin-bottom: 12px;
}

.row .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.comment-box {
  width: 100%;
  min-height: 72px;
  max-height: 140px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font-size: 13px;
  line-height: 1.3;
  overflow: auto;
  white-space: pre-wrap;
  max-width: 100%;
  box-sizing: border-box;
}

.control-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
}

.control-pill input[type="checkbox"] {
  accent-color: var(--accent);
}

.control-pill select {
  border: none;
  background: transparent;
  font-size: 13px;
  outline: none;
}

.content .toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.list {
  display: grid;
  gap: 12px;
}

.row {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.row.has-image {
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.1fr);
  align-items: start;
  padding-right: 24px;
  column-gap: 16px;
}

.row-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.row h3 {
  margin: 0;
  font-size: 18px;
  font-family: "Playfair Display", serif;
}

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

.rating-badge {
  background: rgba(42, 127, 98, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(42, 127, 98, 0.4);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  min-width: 64px;
  text-align: center;
}

.row .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(42, 127, 98, 0.1);
  color: var(--accent-2);
  font-weight: 600;
  line-height: 1.4;
}

.row .history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.extra-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
  display: grid;
  gap: 6px;
}

.extra-panel .label {
  font-size: 12px;
  color: var(--muted);
}

.extra-panel .value {
  font-size: 13px;
  line-height: 1.4;
}

.extra-panel .value.empty {
  color: var(--muted);
}

.extra-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-click {
  cursor: pointer;
  border: 1px solid rgba(42, 127, 98, 0.4);
  background: rgba(42, 127, 98, 0.08);
}

.tag-click:hover {
  border-color: var(--accent-2);
}

.image-slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  align-self: stretch;
  width: 100%;
  max-width: none;
  min-height: 160px;
}

.image-slider img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.slider-notes {
  grid-column: 1 / -1;
}

.image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  gap: 16px;
  padding: 24px;
}

.image-overlay img {
  max-width: calc(92vw - 120px);
  max-height: calc(92vh - 80px);
  object-fit: contain;
  border-radius: 16px;
  background: #111;
}

.overlay-title {
  color: white;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  padding: 0 24px;
}

.overlay-header {
  width: 92vw;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  justify-items: center;
}

.overlay-meta {
  color: #cfcfcf;
  font-size: 12px;
  text-align: center;
}

.overlay-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 92vw;
  justify-items: center;
}

.overlay-nav {
  font-size: 20px;
  padding: 10px 16px;
}

.overlay-counter {
  color: #ddd;
  font-size: 14px;
}

.history span {
  background: rgba(31, 29, 26, 0.06);
  padding: 4px 8px;
  border-radius: 999px;
}

@media (max-width: 1200px) {
  .row.has-image {
    grid-template-columns: 1fr;
    padding-right: 18px;
  }

  .image-slider {
    order: 2;
  }

  .row-main {
    order: 1;
  }
}

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

  .filters .panel {
    position: static;
  }
}
