:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2a2622;
  --muted: #7a716a;
  --line: #e8e0d5;
  --accent: #b5562b;      /* terracotta */
  --accent-soft: #f6e6dc;
  --sea: #1f5562;         /* Sardinian sea */
  --sea-soft: #e1eef0;
  --tabby: #a8865e;      /* muted tabby, for the cat touches */
  --ok: #3d7a4f;
  --warn: #b7862b;
  --radius: 14px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--sea); }
button, input, select, textarea { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px; background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.mark { font: 600 22px var(--serif); color: var(--accent); }
.title { font: 600 20px var(--serif); letter-spacing: .02em; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav button {
  border: 0; background: none; padding: 7px 12px; border-radius: 999px;
  color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 500;
}
.nav button:hover { color: var(--ink); background: var(--accent-soft); }
.nav button.active { color: #fff; background: var(--sea); }
.who { margin-left: auto; display: flex; gap: 14px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.quiet { color: var(--muted); }

main { max-width: 1180px; margin: 0 auto; padding: 32px 28px 60px; }
.loading { color: var(--muted); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 12px; }
h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }

.hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: stretch; margin-bottom: 24px;
}
.countdown {
  background: linear-gradient(135deg, var(--sea), #2c7181); color: #fff;
  border-radius: var(--radius); padding: 28px 32px; position: relative; overflow: hidden;
}
/* ---------- tabby touches ---------- */
.logo-cat { width: 26px; height: 26px; color: var(--tabby); align-self: center; display: inline-flex; }
.logo-cat svg { width: 100%; height: 100%; }
.cat-watermark {
  position: absolute; right: 22px; bottom: -6px; width: 128px; color: #fff; opacity: .13; pointer-events: none;
}
.cat-watermark svg, .cat-peek svg, .cat-sleep svg, .cat-sit-small svg, .foot-cat svg { display: block; width: 100%; height: auto; }
.countdown > *:not(.cat-watermark) { position: relative; z-index: 1; }
.peek-host { position: relative; }
.cat-peek {
  position: absolute; top: -27px; right: 34px; width: 62px; color: var(--tabby); opacity: .6; pointer-events: none;
}
.cat-sleep { display: block; width: 112px; margin: 0 auto 10px; color: var(--tabby); opacity: .45; }
.cat-sit-small { display: block; width: 54px; color: var(--tabby); opacity: .55; margin-bottom: 14px; }
.foot-cat { width: 16px; color: var(--tabby); opacity: .7; align-self: center; }
.countdown .big { font: 600 72px/1 var(--serif); }
.countdown .sub { opacity: .85; margin-top: 6px; }
.countdown button { margin-top: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
}
.card h3 { display: flex; justify-content: space-between; align-items: baseline; }
.card h3 a { font: 500 13px var(--sans); }
.stat { font: 600 34px/1.1 var(--serif); }
.stat small { font: 400 14px var(--sans); color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; }
.list li:last-child { border-bottom: 0; }
.muted { color: var(--muted); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar h1 { margin: 0 auto 0 0; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.summary { color: var(--muted); margin: -6px 0 16px; }

button.primary, button.ghost, button.danger, .btn {
  border-radius: 10px; padding: 8px 16px; cursor: pointer; font-weight: 500; border: 1px solid transparent; text-decoration: none; display: inline-block;
}
button.primary, .btn { background: var(--accent); color: #fff; }
button.primary:hover, .btn:hover { filter: brightness(.95); }
button.ghost { background: #fff; border-color: var(--line); }
button.danger { background: #fff; border-color: #e3b5a8; color: #a8371b; }
button[disabled] { opacity: .5; cursor: wait; }
.countdown button.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #fcfaf7; cursor: pointer; user-select: none; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fdf8f3; }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.done td { color: var(--muted); }
.done td:first-child { text-decoration: line-through; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--line); color: var(--ink); }
.pill.green { background: #e3f0e6; color: var(--ok); }
.pill.amber { background: #f7ecd6; color: #8a6116; }
.pill.blue { background: var(--sea-soft); color: var(--sea); }
.pill.red { background: #f6e0da; color: #a8371b; }
.pill.terracotta { background: var(--accent-soft); color: var(--accent); }

dialog {
  border: 0; border-radius: var(--radius); padding: 0; width: min(560px, 94vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
dialog form { max-height: 88vh; overflow-y: auto; }
dialog::backdrop { background: rgba(30, 26, 22, .35); }
dialog form { padding: 24px 26px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fields label { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
.fields label.wide { grid-column: 1 / -1; }
.fields input, .fields select, .fields textarea {
  width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 15px;
}
.fields textarea { min-height: 84px; resize: vertical; }
.fields input:focus, .fields select:focus, .fields textarea:focus { outline: 2px solid var(--sea-soft); border-color: var(--sea); }
.actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.spacer { flex: 1; }
.error { color: #a8371b; background: #fbeeea; padding: 8px 12px; border-radius: 8px; }

.folders { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.folders button { border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 99px; cursor: pointer; }
.folders button.active { background: var(--sea); color: #fff; border-color: var(--sea); }
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted);
  margin-bottom: 16px; background: #fff; transition: .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.file { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.file:hover { border-color: var(--sea); }
.file .thumb { height: 120px; background: #f3eee7 center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.file .meta { padding: 10px 12px; font-size: 13px; }
.file .name { font-weight: 500; word-break: break-word; }

.setup { max-width: 560px; }
.setup .card { margin-top: 18px; }
.setup label { display: block; margin: 14px 0 4px; font-weight: 500; }
.setup input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.setup .hint { font-size: 13px; color: var(--muted); }

.foot { text-align: center; color: var(--muted); padding: 0 0 40px; display: flex; gap: 10px; justify-content: center; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 20;
}
.toast.bad { background: #a8371b; }

/* ---------- venues tracker ---------- */
.venue-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; }
.pipeline button {
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--muted);
}
.pipeline button b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.pipeline button.active { background: var(--sea); border-color: var(--sea); color: #fff; }
.pipeline button.active b { color: #fff; }
.pipeline button.out { border-style: dashed; }
.guests { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.guests input { width: 84px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.import { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 18px; background: var(--accent-soft); border-color: #efd3c3; }
.import-actions { display: flex; gap: 8px; flex-shrink: 0; }
.venues { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.venue {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; cursor: pointer;
  display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, box-shadow .15s;
}
.v-img {
  position: relative; margin: -18px -20px 0; height: 150px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
  background: linear-gradient(135deg, #efe6da, #f6efe6 55%, #e6eef0);
}
.v-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.v-img.has-img img { opacity: 1; }
.v-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--tabby); }
.v-ph svg { width: 40px; height: 40px; opacity: .55; }
.v-ph span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.v-img.has-img .v-ph { display: none; }
.venue:hover { border-color: var(--tabby); box-shadow: 0 6px 22px rgba(120, 90, 60, .08); }
.venue.ruled-out { opacity: .6; }
.venue header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.venue h3 { margin: 0 0 2px; font-size: 22px; line-height: 1.15; }
.venue header p { margin: 0; font-size: 13px; }
.status-select { border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px; font-size: 12px; background: #fcfaf7; max-width: 140px; cursor: pointer; }
.vc { display: flex; gap: 22px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vc > div { display: flex; flex-direction: column; }
.vc small { color: var(--muted); font-size: 12px; }
.vc.none { font-size: 14px; color: var(--ink); display: block; }
.v-big { font: 600 24px/1.1 var(--serif); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }
.pos, .neg {
  margin: 0; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pos b { color: var(--ok); }
.neg b { color: #a8371b; }
.venue footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; font-size: 13px; flex-wrap: wrap; }
.venue .links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.venue .dot { color: var(--line); }
.ratings { display: flex; gap: 12px; color: var(--muted); white-space: nowrap; }
.stars { color: var(--tabby); letter-spacing: 1px; }
.stars span { color: var(--line); }
.vdates { margin: -4px 0 0; font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .venues { grid-template-columns: 1fr; }
  .import { flex-direction: column; align-items: flex-start; }
  .top { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .nav { order: 3; width: 100%; flex: none; }
  main { padding: 20px 16px 48px; }
  .hero { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
  .countdown .big { font-size: 56px; }
  .hide-sm { display: none; }
}
