:root {
  color-scheme: light;
  --bg: #e7e5df;
  --panel: #fbf3d1;
  --surface: #ffffff;
  --surface-soft: #f6f2e8;
  --ink: #33302c;
  --muted: #7a736a;
  --line: rgba(0, 0, 0, 0.06);
  --accent: #6f8e68;
  --accent-strong: #5d7a57;
  --accent-soft: #e5ebe4;
  --accent-text: #60785b;
  --danger: #c0563f;
  --danger-strong: #a8472f;
  --reserved: #f6f2e8;
  --shadow-card: 0 10px 30px rgba(80, 60, 40, 0.08);
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.1);
  --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "Spectral", Georgia, "Times New Roman", serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-weight: 700;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(111, 142, 104, 0.22);
  transform: translateY(-1px);
}

button.secondary {
  background: var(--ink);
}

button.secondary:hover {
  background: #211f1c;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger-strong);
  box-shadow: 0 10px 24px rgba(192, 86, 63, 0.22);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent-text);
}

button.ghost:hover {
  background: var(--accent-soft);
  box-shadow: none;
}

button.taken {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

a {
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  margin: 0 auto;
  max-width: 600px;
  min-height: 100vh;
  padding: 20px 16px 44px;
  width: 100%;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 18px;
  padding: 12px 4px 6px;
}

.eyebrow {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-text);
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  padding: 5px 12px;
}

h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}

.icon-button {
  background: var(--accent);
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 1.1rem;
  height: 46px;
  padding: 0;
  width: 46px;
  box-shadow: 0 10px 24px rgba(111, 142, 104, 0.24);
}

.notice,
.admin-panel,
.guest-intro,
.settings-panel,
.login-panel,
.guest-link-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-panel);
  margin-bottom: 14px;
}

.login-panel {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.login-panel h2,
.guest-link-panel h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

.login-panel p,
.guest-link-panel p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.login-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin: 0;
}

.guest-link-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.guest-link-row {
  display: flex;
  gap: 8px;
}

.guest-link-row input {
  flex: 1 1 auto;
}

.guest-link-row button {
  flex: 0 0 auto;
}

.login-panel.hidden,
.guest-link-panel.hidden {
  display: none;
}

.notice {
  color: var(--muted);
  font-size: 0.94rem;
  padding: 13px 15px;
}

.admin-panel {
  padding: 16px;
}

.admin-panel h2,
.guest-intro h2,
.settings-panel h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

.admin-panel h2 {
  margin-bottom: 12px;
}

.guest-intro {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.guest-intro p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.settings-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.settings-panel.hidden {
  display: none;
}

.settings-panel p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 4px 0 0;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.toggle-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px;
}

.toggle-row span {
  color: var(--ink);
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.toggle-row input {
  appearance: none;
  background: #d6d2c8;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 auto;
  height: 31px;
  padding: 0;
  position: relative;
  transition: background 160ms ease;
  width: 51px;
}

.toggle-row input::after {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
  content: "";
  height: 27px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 160ms ease;
  width: 27px;
}

.toggle-row input:checked {
  background: var(--accent);
}

.toggle-row input:checked::after {
  transform: translateX(20px);
}

.settings-actions {
  display: grid;
  gap: 10px;
}

.item-form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

input,
textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  min-width: 0;
  outline: none;
  padding: 12px 13px;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(111, 142, 104, 0.16);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.form-actions {
  display: grid;
  gap: 9px;
  grid-template-columns: 1fr;
}

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

.item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  min-height: 104px;
  overflow: hidden;
}

.item.reserved {
  background: var(--reserved);
}

.image-wrap {
  background-image: repeating-linear-gradient(45deg, #efeadd 0 8px, #f6f2e8 8px 16px);
  overflow: hidden;
  position: relative;
}

.image-wrap img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.image-wrap img:not([src]) {
  display: none;
}

.image-fallback {
  color: #b8a98a;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  left: 50%;
  letter-spacing: 0.08em;
  position: absolute;
  text-transform: uppercase;
  top: 50%;
  transform: translate(-50%, -50%);
}

.reserved-badge {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: var(--accent-text);
  display: none;
  font-size: 0.7rem;
  font-weight: 700;
  left: 10px;
  padding: 4px 9px;
  position: absolute;
  top: 10px;
}

.item.reserved .reserved-badge {
  display: inline-block;
}

.item-body {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 15px 16px;
}

.item-heading {
  align-items: start;
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.item h2 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

.price {
  align-self: start;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-text);
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
  max-width: 112px;
  overflow: hidden;
  padding: 4px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-low {
  background: #e9f0e4;
  color: #4f7138;
}

.price-mid {
  background: #f5ecd6;
  color: #99701a;
}

.price-high {
  background: #f6e3d8;
  color: #b04a1f;
}

.price:empty {
  display: none;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
  min-height: 1px;
  overflow-wrap: anywhere;
}

.note:empty {
  display: none;
}

.item-link {
  font-size: 0.9rem;
  justify-self: start;
}

.item-link.hidden,
.hidden {
  display: none;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.item-actions button {
  border-radius: 14px;
  flex: 1 1 100%;
  min-height: 44px;
}

.empty {
  color: var(--muted);
  font-size: 0.98rem;
  padding: 44px 10px;
  text-align: center;
}

.modal-backdrop {
  align-items: end;
  background: rgba(51, 48, 44, 0.32);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 16px;
  position: fixed;
  z-index: 20;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-sheet {
  animation: sheetIn 180ms ease-out;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  display: grid;
  gap: 14px;
  max-width: 460px;
  padding: 22px;
  width: 100%;
}

.modal-kicker {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-text);
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  padding: 5px 12px;
}

.modal-sheet h2 {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 8px;
}

.modal-sheet p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.modal-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 2px;
}

.heart-pop {
  animation: heartPop 900ms ease-out forwards;
  color: var(--danger);
  font-size: 2rem;
  left: 50%;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 10px 22px rgba(192, 86, 63, 0.22);
  top: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  z-index: 30;
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heartPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.4);
  }

  24% {
    opacity: 1;
    transform: translate(-50%, -75%) scale(1.18);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1.65);
  }
}

@media (min-width: 700px) {
  .shell {
    padding: 40px 24px 64px;
  }

  .topbar {
    margin: 0 0 24px;
    padding: 12px 4px 6px;
  }

  .admin-panel,
  .guest-intro,
  .notice,
  .settings-panel {
    margin-bottom: 16px;
  }

  .admin-panel,
  .settings-panel {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .modal-backdrop {
    align-items: center;
  }

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