/* Layout: one centered column; sticky tab bar; wishes as gift tags in a wrapping grid */
:root {
  --bg: #dbd7c1;
  --surface: #ffffff;
  --fg: #17282a;
  --muted: #4f6062;
  --line: #c5bfa4;
  --fir: #1f5b4c;
  --fir-soft: #e2efeb;
  --berry: #b3263e;
  --berry-soft: #f8e4e7;
  --gold: #b9892b;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(23,40,42,.06), 0 4px 14px rgba(23,40,42,.06);
  --f-display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a1b; --surface: #172526; --fg: #e6eeee; --muted: #9bb0b1; --line: #2a3b3c;
    --fir: #5fbf9f; --fir-soft: #1b3530; --berry: #f0788b; --berry-soft: #3a1d23; --gold: #e0b75c;
    --on-accent: #0f1a1b; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1a1b; --surface: #172526; --fg: #e6eeee; --muted: #9bb0b1; --line: #2a3b3c;
  --fir: #5fbf9f; --fir-soft: #1b3530; --berry: #f0788b; --berry-soft: #3a1d23; --gold: #e0b75c;
  --on-accent: #0f1a1b; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
header.top { padding-block: 28px 8px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--fir); font-weight: 600; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(30px, 6vw, 44px); line-height: 1.05; margin: 6px 0 8px; text-wrap: balance; }
.lede { color: var(--muted); max-width: 60ch; margin: 0; }
.countdown { display: inline-flex; gap: 8px; align-items: baseline; margin-top: 14px; padding: 6px 12px; border-radius: 999px; background: var(--berry-soft); color: var(--berry); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

nav.tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); margin-top: 18px; }
nav.tabs .wrap { display: flex; gap: 4px; overflow-x: auto; }
nav.tabs a { flex: 0 0 auto; text-decoration: none; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 3px solid transparent; display: inline-flex; gap: 8px; align-items: center; }
nav.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--berry); }
nav.tabs a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--fir); outline-offset: 2px; }
.count { font-size: 12px; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--fg); text-align: center; font-variant-numeric: tabular-nums; }

main { padding-block: 22px 60px; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--fir-soft); color: var(--fg); margin-bottom: 18px; font-size: 14px; }
.notice.warn { background: var(--berry-soft); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar h2 { font-family: var(--f-display); font-size: 22px; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 8px 12px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--fir); color: var(--on-accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tag { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 6px 18px 18px 6px; padding: 18px 18px 16px 34px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tag::before { content: ""; position: absolute; left: 12px; top: 22px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); }
.tag h3 { font-family: var(--f-display); font-size: 19px; font-weight: 600; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.tag p { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.price { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.heart { color: var(--berry); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.tag a.link { color: var(--fir); font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.tag .actions { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag.mine { border-color: var(--fir); }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fir-soft); color: var(--fir); }

.btn { font: inherit; font-weight: 600; font-size: 14px; border-radius: 10px; padding: 10px 14px; border: 1px solid transparent; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: 42px; }
.btn.primary { background: var(--fir); color: var(--on-accent); }
.btn.accent { background: var(--berry); color: var(--on-accent); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.btn.danger { background: transparent; border-color: var(--berry); color: var(--berry); }
.btn[disabled] { opacity: .55; cursor: default; }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }

.empty { border: 1.5px dashed var(--line); border-radius: 14px; padding: 32px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--fg); font-family: var(--f-display); font-size: 18px; margin-bottom: 4px; }

.tablebox { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; 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; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .t { font-weight: 600; }
tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.exports { display: flex; gap: 8px; flex-wrap: wrap; }

form.add { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
form.add .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-weight: 500; font-size: 14px; }
input[type=text], input[type=url], textarea { font: inherit; font-size: 15px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
.formrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list-admin { display: flex; flex-direction: column; gap: 10px; }
.row-admin { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.row-admin .info { min-width: 0; flex: 1 1 220px; }
.row-admin .info strong { overflow-wrap: anywhere; }
.status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.status.open { background: var(--fir-soft); color: var(--fir); }
.status.taken { background: var(--berry-soft); color: var(--berry); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
footer { color: var(--muted); font-size: 13px; padding-block: 0 40px; }
@media (max-width: 560px) {
  form.add { grid-template-columns: 1fr; }
  .tag .actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .tag { transition: transform .15s ease; }
  .tag:hover { transform: translateY(-2px); }
}
.codebox { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.codebox h3 { font-family: var(--f-display); margin: 0; font-size: 17px; }
.codebox p { margin: 0; color: var(--muted); font-size: 14px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: .12em; font-weight: 600; color: var(--fg); user-select: all; }
.login { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; max-width: 520px; }
.login label { flex: 1 1 220px; }
input[type=password] { font: inherit; font-size: 15px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.guests { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 26px; display: flex; flex-direction: column; gap: 14px; }
.guests .row-admin { background: var(--bg); }
input[type=email] { font: inherit; font-size: 15px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.small { font-size: 13px; color: var(--muted); }
