:root {
  --bg: #fbf3e9;
  --bg-grad-1: #fdf6ec;
  --bg-grad-2: #f6e7d6;
  --card: #fffdf9;
  --ink: #4a3b30;
  --ink-soft: #8a7663;
  --line: #ecdcc9;
  --accent: #e28a5f;      /* warm terracotta */
  --accent-deep: #c76a41;
  --accent-soft: #fbe6d8;
  --sage: #8fae86;        /* fulfilled */
  --sage-soft: #e7efe1;
  --gold: #d9a441;        /* reserved */
  --gold-soft: #f7eccf;
  --shadow: 0 10px 30px rgba(120, 80, 50, 0.10);
  --shadow-sm: 0 4px 14px rgba(120, 80, 50, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--bg-grad-1), transparent),
    radial-gradient(1000px 500px at -10% 110%, var(--bg-grad-2), transparent),
    var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Header */
.site-header {
  padding: 26px 20px 10px;
}
.header-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-size: 34px; background: var(--accent-soft);
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.brand-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.brand-sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.header-actions { display: flex; gap: 10px; }

/* Buttons */
.btn {
  font-family: inherit; font-weight: 700; font-size: 15px;
  border: none; border-radius: 999px; padding: 11px 18px;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(226,138,95,.35); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: #fff7ee; }
.btn-soft { background: var(--accent-soft); color: var(--accent-deep); }
.btn-soft:hover { background: #f8dcc8; }
.btn-danger { background: #f6e0da; color: #b5482f; }
.btn-danger:hover { background: #f2cfc5; }

/* Container */
.container { max-width: 1080px; margin: 0 auto; padding: 10px 20px 60px; }

.owner-bar {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0 18px;
}
.owner-badge {
  background: var(--sage-soft); color: #4c6a44;
  padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
}

/* Grid */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Card */
.card {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(120,80,50,.15); }
.card.is-reserved, .card.is-fulfilled { opacity: .72; }
.card.is-fulfilled .card-img { filter: grayscale(.5); }

.card-img-wrap {
  position: relative; aspect-ratio: 4 / 3; background: var(--accent-soft);
  overflow: hidden;
}
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 46px; color: #d9b79c;
}
.status-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(3px);
}
.badge-reserved { background: var(--gold-soft); color: #916312; }
.badge-fulfilled { background: var(--sage-soft); color: #47693f; }

.card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.25; }
.card-desc { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.price-tag { font-weight: 800; color: var(--accent-deep); font-size: 16px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f6efe6; color: var(--ink-soft);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  text-decoration: none;
}
.store-badge:hover { background: var(--accent-soft); color: var(--accent-deep); }
.reserved-note { font-size: 13px; color: #916312; font-weight: 700; }

.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.card-actions .btn { flex: 1; min-width: 0; }
.owner-actions { display: flex; gap: 8px; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; }
.icon-btn {
  background: #f6efe6; border: none; border-radius: 10px; cursor: pointer;
  padding: 8px 10px; font-size: 14px; color: var(--ink-soft); font-weight: 700;
  flex: 1;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-deep); }
.icon-btn.done:hover { background: var(--sage-soft); color: #47693f; }

/* Empty */
.empty { text-align: center; padding: 70px 20px; color: var(--ink-soft); }
.empty-emoji { font-size: 54px; }
.empty h2 { margin: 12px 0 4px; color: var(--ink); }

/* Footer */
.site-footer { text-align: center; color: var(--ink-soft); padding: 30px; font-size: 13px; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(74, 59, 48, .38);
  display: grid; place-items: center; padding: 18px; z-index: 50;
  backdrop-filter: blur(2px);
}
.modal-card {
  background: var(--card); border-radius: var(--radius); width: 100%; max-width: 520px;
  box-shadow: 0 24px 60px rgba(74,59,48,.3); max-height: 92vh; overflow: auto;
}
.modal-sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 6px; }
.modal-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-soft); }

.form { padding: 8px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.form input, .form textarea {
  font-family: inherit; font-size: 15px; font-weight: 500;
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fffdfa; color: var(--ink); outline: none; transition: border .15s;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.hint { font-size: 13px; color: var(--ink-soft); margin: 0; }
.hint-error { color: #b5482f; font-weight: 700; }
.img-preview-wrap { border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--line); }
.img-preview-wrap img { width: 100%; max-height: 200px; object-fit: cover; display: block; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow); z-index: 60;
}

@media (max-width: 560px) {
  .brand-sub { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .url-row { flex-direction: column; }
}
