:root {
  --ivory: #f7f4ec;
  --ivory-2: #efe9dc;
  --ink: #283029;
  --ink-soft: #55605a;
  --sage: #5b7d6f;
  --sage-deep: #3f5b50;
  --gold: #b08d57;
  --gold-soft: #c9a86a;
  --danger: #a75a4f;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-brd: rgba(255, 255, 255, 0.75);
  --shadow: 0 20px 45px -25px rgba(40, 55, 45, 0.45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 78% -8%, #ffffff 0%, rgba(255,255,255,0) 55%),
    radial-gradient(900px 600px at 8% 12%, rgba(91,125,111,0.10) 0%, rgba(91,125,111,0) 60%),
    linear-gradient(160deg, var(--ivory) 0%, var(--ivory-2) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- floating pills / tablets ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.pill, .tablet {
  position: absolute;
  opacity: 0.28;
  animation: drift var(--dur, 26s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}
.pill {
  width: var(--w, 68px); height: var(--h, 27px);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c1) 0 50%, var(--c2) 50% 100%);
  box-shadow: inset 0 3px 6px rgba(255,255,255,0.65), inset 0 -4px 8px rgba(0,0,0,0.10), 0 10px 22px -12px rgba(40,55,45,0.5);
  transform: rotate(var(--rot, 0deg));
}
.pill::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0) 45%);
}
.tablet {
  width: var(--d, 42px); height: var(--d, 42px); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--c1) 45%, var(--c2) 100%);
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.8), inset 0 -5px 10px rgba(0,0,0,0.10), 0 10px 22px -12px rgba(40,55,45,0.5);
}
.tablet::after {
  content: ""; position: absolute; top: 12%; bottom: 12%; left: 50%;
  width: 1.5px; transform: translateX(-50%); background: rgba(0,0,0,0.12);
}
@keyframes drift {
  0%   { transform: translate(0,0) rotate(var(--rot,0deg)); }
  33%  { transform: translate(18px,-26px) rotate(calc(var(--rot,0deg) + 18deg)); }
  66%  { transform: translate(-14px,-12px) rotate(calc(var(--rot,0deg) - 12deg)); }
  100% { transform: translate(0,0) rotate(var(--rot,0deg)); }
}
@media (prefers-reduced-motion: reduce) { .pill, .tablet { animation: none; } }

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 60px 22px 90px; }
.eyebrow {
  text-align: center; text-transform: uppercase; letter-spacing: 0.42em;
  font-size: 11px; font-weight: 600; color: var(--gold); margin: 0 0 14px 2px;
}
h1 {
  font-family: var(--serif); font-weight: 500; text-align: center;
  font-size: clamp(38px, 8vw, 64px); letter-spacing: 0.01em; margin: 0 0 10px; color: var(--ink);
}
.sub { text-align: center; color: var(--ink-soft); font-size: 17px; margin: 0 auto; max-width: 32em; line-height: 1.55; }
.location { text-align: center; font-family: var(--serif); font-size: 18px; color: var(--sage-deep); margin: 12px auto 0; }
.location b { color: var(--gold); font-weight: 500; }
.rule { width: 54px; height: 1px; margin: 22px auto 36px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }

.daylabel {
  font-family: var(--serif); font-size: 20px; color: var(--sage-deep);
  margin: 30px 0 14px; display: flex; align-items: center; gap: 12px;
}
.daylabel::after { content:""; flex:1; height:1px; background: linear-gradient(90deg, rgba(176,141,87,0.4), transparent); }

/* ---------- newsfeed ---------- */
.news { margin: 0 0 30px; }
.news:empty { display: none; }
.news-head {
  font-family: var(--serif); font-size: 20px; color: var(--sage-deep);
  margin: 0 0 14px; display: flex; align-items: center; gap: 12px;
}
.news-head::after { content:""; flex:1; height:1px; background: linear-gradient(90deg, rgba(176,141,87,0.4), transparent); }
.news-item {
  background: var(--glass); border: 1px solid var(--glass-brd); border-left: 3px solid var(--gold-soft);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-radius: 16px; padding: 15px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.news-date { font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--gold); text-transform: uppercase; margin-bottom: 6px; }
.news-body { color: var(--ink); font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--glass); border: 1px solid var(--glass-brd);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-radius: 18px; padding: 17px 20px; margin-bottom: 13px; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 26px 55px -26px rgba(40,55,45,0.55); }
.card .time { font-family: var(--serif); font-size: 21px; letter-spacing: .01em; }
.card .meta { color: var(--ink-soft); font-size: 13.5px; margin-top: 3px; }
.card.booked { opacity: .78; }

.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  border: none; cursor: pointer; border-radius: 999px; padding: 11px 22px; color: #fff;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  box-shadow: 0 10px 20px -10px rgba(63,91,80,0.8); transition: transform .2s ease, filter .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }
.btn-block { width: 100%; padding: 14px; font-size: 15px; }
.btn-ghost {
  background: transparent; color: var(--sage-deep); box-shadow: none;
  border: 1px solid rgba(63,91,80,0.35);
}
.btn-danger { background: linear-gradient(135deg, #b96c60, var(--danger)); box-shadow: 0 10px 20px -10px rgba(167,90,79,0.7); }
.link-danger {
  background: none; border: none; cursor: pointer; color: var(--danger);
  font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 6px 4px; text-decoration: underline;
}

.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--gold);
  background: rgba(176,141,87,0.12); border: 1px solid rgba(176,141,87,0.35);
  padding: 8px 15px; border-radius: 999px; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.booked-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.loading, .empty { text-align: center; color: var(--ink-soft); padding: 30px 10px; font-size: 15px; }
.empty { font-family: var(--serif); font-size: 18px; }

/* ---------- fields ---------- */
.field {
  width: 100%; font-size: 16px; font-family: var(--sans);
  padding: 13px 15px; border-radius: 13px; border: 1px solid rgba(63,91,80,0.25);
  background: rgba(255,255,255,0.72); color: var(--ink);
}
.field::placeholder { color: #9aa39d; }
.field:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(91,125,111,0.15); }
textarea.field { resize: vertical; min-height: 76px; line-height: 1.5; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 6px 2px; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(40,48,41,0.35); backdrop-filter: blur(4px); padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 420px; background: rgba(255,255,255,0.82);
  border: 1px solid var(--glass-brd); backdrop-filter: blur(20px) saturate(1.1);
  border-radius: 22px; padding: 28px 26px; box-shadow: 0 30px 70px -25px rgba(40,55,45,0.6); text-align: center;
}
.modal h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0 0 4px; }
.modal p { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.modal .field { margin-bottom: 14px; text-align: left; }
.modal .row { display: flex; gap: 10px; }
.modal .row .btn { flex: 1; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(10px);
  background: rgba(40,48,41,0.94); color: #f2efe6; font-size: 14px; letter-spacing: .01em;
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: opacity .25s, transform .25s;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(120,52,44,0.95); }

/* ---------- admin ---------- */
.panel {
  background: var(--glass); border: 1px solid var(--glass-brd);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-radius: 20px; padding: 22px 22px; box-shadow: var(--shadow); margin-bottom: 26px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.notice {
  background: rgba(167,90,79,0.10); border: 1px solid rgba(167,90,79,0.4); color: #7d3a31;
  border-radius: 14px; padding: 14px 16px; font-size: 14px; margin-bottom: 22px; text-align: center;
}
.admin-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid rgba(63,91,80,0.14);
}
.admin-item:last-child { border-bottom: none; }
.admin-item .ai-time { font-family: var(--serif); font-size: 17px; }
.admin-item .ai-meta { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }
.admin-item .ai-status-free { color: var(--sage-deep); font-weight: 600; font-size: 13px; }
.admin-item .ai-status-booked { color: var(--gold); font-weight: 600; font-size: 13px; }
.del-btn {
  border: none; cursor: pointer; background: rgba(167,90,79,0.12); color: var(--danger);
  width: 34px; height: 34px; border-radius: 10px; font-size: 18px; line-height: 1; flex-shrink: 0;
}
.del-btn:hover { background: rgba(167,90,79,0.22); }

.foot { text-align: center; color: var(--ink-soft); font-size: 12.5px; margin-top: 54px; letter-spacing: .03em; }
.foot .crest { font-family: var(--serif); color: var(--gold); font-size: 15px; margin-bottom: 4px; }
.foot a { color: var(--sage-deep); }

@media (max-width: 480px) {
  .card { flex-direction: column; align-items: stretch; text-align: left; }
  .card .btn, .card .booked-actions { align-self: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}
