:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --panel: #fffdf8;
  --ink: #1f2326;
  --muted: #6f685f;
  --line: #ddd4c6;
  --accent: #116466;
  --accent-2: #d69b2d;
  --danger: #9b2d20;
  --shadow: 0 10px 24px rgba(35, 31, 25, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: #26211c;
  color: #fffaf0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-weight: 800; letter-spacing: .02em; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.shell { width: min(1180px, calc(100vw - 32px)); margin: 28px auto 60px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}
h1 { font-size: 34px; margin: 2px 0 0; }
h2 { font-size: 20px; margin: 0 0 6px; }
h3 { font-size: 14px; text-transform: uppercase; margin: 18px 0 6px; color: var(--muted); }
.eyebrow { margin: 0; color: var(--accent); font-weight: 800; text-transform: uppercase; font-size: 12px; }
.actions, .row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-height: 38px;
  padding: 8px 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.ghost { color: var(--ink); }
.button.danger { color: white; background: var(--danger); border-color: var(--danger); }
.list { display: grid; gap: 12px; }
.row {
  display: grid;
  grid-template-columns: 180px minmax(300px, 1fr) 132px minmax(240px, auto);
  gap: 18px;
  align-items: center;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.thumb, .print-image {
  width: 164px;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.thumb img, .print-image img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 8px; }
.image-trigger {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: zoom-in;
}
.image-trigger:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: -3px;
}
.placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}
.summary p { margin: 0 0 6px; color: var(--muted); }
.summary .notes { color: var(--ink); }
.row-details {
  margin: 8px 0 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.row-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}
.row-details p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.meta, .source { font-size: 12px; color: var(--muted); }
.selectbox label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); }
.image-preview[hidden] { display: none; }
.image-preview {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(31, 35, 38, 0.64);
}
.image-preview-frame {
  width: min(720px, calc(100vw - 42px));
  height: min(720px, calc(100vh - 42px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  cursor: zoom-out;
  display: grid;
  place-items: center;
  padding: 24px;
}
.image-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body:has(.image-preview:not([hidden])) {
  overflow: hidden;
}
form { margin: 0; }
.editor, .login-card {
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.editor.compact { align-self: start; }
label { display: grid; gap: 6px; font-weight: 750; color: var(--muted); }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
textarea { resize: vertical; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tasting-editor { margin-bottom: 18px; }
.tasting-heading-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 750;
  font-size: 18px;
}
.tasting-print-meta {
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.login {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 44px;
  align-items: center;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  color: #fffaf0;
}
.login::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(15, 18, 17, 0.42), rgba(15, 18, 17, 0.76)),
    url("/static/images/highlands-login.png") center / cover no-repeat;
}
.login::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 20% 15%, rgba(214, 155, 45, 0.2), transparent 30%);
  pointer-events: none;
}
.login h1 { font-size: 54px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.login p:not(.alert) { color: rgba(255, 250, 240, 0.86); }
.login .eyebrow { color: #e8bb63; }
.login-card {
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(12px);
}
.alert { background: #ffe8df; color: var(--danger); padding: 10px; border-radius: 8px; margin: 0; }
.empty {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
}
.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.print-list { display: grid; gap: 20px; }
.distillery-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.distillery-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.distillery-head h2 { margin: 0; }
.distillery-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
  background: #f8f1e5;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.distillery-info p {
  margin: 0 0 8px;
  line-height: 1.5;
}
.distillery-map {
  width: 260px;
  display: grid;
}
.distillery-map iframe {
  width: 260px;
  height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.distillery-whiskies {
  display: grid;
  gap: 12px;
}
.print-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.print-item .print-image { width: 120px; }
.facts { color: var(--muted); font-weight: 750; }

@media (max-width: 900px) {
  .row { grid-template-columns: 124px minmax(0, 1fr); }
  .thumb { width: 112px; }
  .selectbox, .row-actions { grid-column: 1 / -1; }
  .distillery-info { grid-template-columns: 1fr; }
  .distillery-map, .distillery-map iframe { width: min(260px, 100%); }
  .login, .split, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .page-head { align-items: start; flex-direction: column; }
}

@media print {
  body { background: white; }
  .shell { width: auto; margin: 0; }
  .topbar, .actions { display: none; }
  .distillery-group, .print-item { break-inside: avoid; box-shadow: none; border-color: #bbb; }
  .distillery-info { background: #f7f7f7; }
  .distillery-map iframe { display: none; }
}
