:root {
  color-scheme: light;
  --ink: #2f2926;
  --muted: #81766f;
  --paper: #fffdfb;
  --line: #eadfd7;
  --rose: #a96e68;
  --rose-dark: #81514d;
  --green: #4f765f;
  --red: #9a5754;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #f8eee9 0, transparent 26rem),
    #faf7f4;
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 64px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 6vw, 48px); font-weight: 500; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 500; }

.refresh-button, .primary-button, .secondary-button, .status-button {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  transition: .18s ease;
}

.refresh-button, .secondary-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 11px 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 12px 14px 14px;
  white-space: nowrap;
  font-weight: 800;
}

.tab.active { color: var(--ink); border-bottom-color: var(--rose); }
.badge { display: inline-grid; place-items: center; min-width: 23px; height: 23px; margin-left: 5px; padding: 0 6px; border-radius: 999px; background: #eee5df; font-size: 12px; }

.wish-list { display: grid; gap: 12px; padding-top: 18px; }
.wish-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 251, .92);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(75, 55, 44, .04);
}

.wish-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.wish-name { margin: 0; font-size: 17px; }
.wish-time { color: var(--muted); font-size: 12px; }
.wish-message { margin: 0; white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; }
.wish-actions { display: flex; align-items: flex-start; gap: 8px; }
.status-button { border: 0; padding: 10px 13px; color: white; }
.status-button.approve { background: var(--green); }
.status-button.reject { background: var(--red); }
.status-button.edit { background: #f1ebe7; color: var(--ink); }
.status-button:disabled { opacity: .55; cursor: wait; }

.state { margin-top: 18px; border: 1px dashed var(--line); border-radius: 18px; padding: 48px 20px; text-align: center; color: var(--muted); }
.state.error-state { color: var(--red); }

dialog {
  width: min(620px, calc(100% - 28px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(53, 39, 32, .22);
}
dialog::backdrop { background: rgba(47, 41, 38, .35); backdrop-filter: blur(4px); }
#editForm, .confirm-card { padding: 24px; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.icon-button { border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }

label { display: grid; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 800; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
input:focus, textarea:focus { outline: 2px solid #d6aaa3; border-color: transparent; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.primary-button { border: 0; background: var(--rose); color: white; padding: 12px 16px; }
.primary-button:hover { background: var(--rose-dark); }
.error { color: var(--red); margin: 12px 0 0; font-size: 13px; }

.changes { display: grid; gap: 10px; margin-top: 16px; }
.change-row { border-radius: 12px; background: #f7f1ed; padding: 12px; }
.change-row strong { display: block; margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.change-old { color: var(--red); text-decoration: line-through; }
.change-arrow { margin: 5px 0; color: var(--muted); }
.change-new { color: var(--green); white-space: pre-wrap; overflow-wrap: anywhere; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  padding: 13px 16px;
  box-shadow: 0 12px 40px rgba(47, 41, 38, .18);
}

@media (max-width: 680px) {
  .shell { width: min(100% - 22px, 980px); padding-top: 28px; }
  .topbar { align-items: center; }
  .wish-card { grid-template-columns: 1fr; }
  .wish-actions { flex-wrap: wrap; }
}
