:root {
  --bg: #fffaf5; --surface: #ffffff; --surface-2: #fff1e6; --text: #1f1a17; --muted: #6b625c;
  --line: #ecdfd4; --brand: #c2410c; --brand-ink: #ffffff; --brand-soft: #ffedd5; --hl: #f59e0b;
  --radius: 14px; --shadow: 0 1px 2px rgba(60,30,10,.06), 0 6px 20px rgba(60,30,10,.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171311; --surface: #211b18; --surface-2: #2a221d; --text: #f5eee8; --muted: #b3a79e;
    --line: #3a302a; --brand: #fb923c; --brand-ink: #1b1007; --brand-soft: #3b2415; --hl: #fbbf24;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171311; --surface: #211b18; --surface-2: #2a221d; --text: #f5eee8; --muted: #b3a79e;
  --line: #3a302a; --brand: #fb923c; --brand-ink: #1b1007; --brand-soft: #3b2415; --hl: #fbbf24; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: .3em 0; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.h3, h3 { font-size: 1.1rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.section { padding: 28px 0; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.center { text-align: center; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 680px; }
.center .lead { margin-inline: auto; }

/* header */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.head-row { display: flex; align-items: center; gap: 16px; height: 62px; }
.logo { font-weight: 600; font-size: 1.2rem; color: var(--text); white-space: nowrap; }
.logo b { color: var(--brand); }
.logo:hover { text-decoration: none; }
.logo-mark { color: var(--hl); }
.head-search { flex: 1; max-width: 420px; margin-left: auto; }
.head-search input, .big-search input, .fields input, .fields textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit;
}
.head-nav { display: flex; gap: 16px; }
.head-nav a { color: var(--text); font-weight: 500; }
@media (max-width: 720px) {
  .head-row { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 10px; }
  .head-search { order: 3; flex-basis: 100%; max-width: none; }
  .head-nav { margin-left: auto; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-sm { padding: 7px 14px; font-size: .86rem; }
.btn.copied { background: #15803d; border-color: #15803d; color: #fff; }
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }

/* hero */
.hero { background: radial-gradient(1000px 400px at 10% -10%, var(--brand-soft), transparent), var(--bg); padding: 44px 0 26px; }
.hl { color: var(--brand); }
.big-search { display: flex; gap: 8px; max-width: 640px; margin: 22px 0; }
.big-search input { padding: 14px 20px; font-size: 1.05rem; box-shadow: var(--shadow); background: var(--surface); }
.center .big-search { margin-inline: auto; }
.upcoming { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.up { flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 10px 16px 10px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); color: var(--text); }
.up:hover { text-decoration: none; box-shadow: var(--shadow); }
.up-emoji { grid-row: span 2; font-size: 1.6rem; align-self: center; }
.up-name { font-weight: 600; }
.up-when { font-size: .8rem; color: var(--muted); }

/* grids */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card, .acard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card-img, .acard-img { position: relative; aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.card-img img, .acard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img, .acard:hover .acard-img img { transform: scale(1.03); }
.badge { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; padding: 3px 9px; border-radius: 999px; }
.card-body, .acard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3, .acard h3 { margin: 0; font-size: 1.02rem; }
.card h3 a, .acard h3 a { color: var(--text); }
.snippet { margin: 0; color: var(--muted); font-size: .88rem; flex: 1; }
.chip { align-self: flex-start; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip { color: color-mix(in srgb, var(--accent) 55%, #fff); } }
.card-actions, .embed-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.link-more { font-size: .88rem; font-weight: 500; }
.occ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.occ { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600;
  border-top: 4px solid var(--accent); }
.occ:hover { text-decoration: none; box-shadow: var(--shadow); }
.occ small { color: var(--muted); font-weight: 400; }
.occ-emoji { font-size: 1.6rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; padding: 0; list-style: none; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-right: 8px; }

/* occasion */
.occ-hero { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--bg)), var(--bg)); padding: 22px 0 8px; }
.crumbs { font-size: .86rem; color: var(--muted); padding-top: 14px; }
.countdown { display: inline-block; background: var(--surface); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; }

/* prompt page */
.prompt-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .prompt-grid { grid-template-columns: 1fr; } .prompt-aside { order: -1; } }
.prompt-aside { position: sticky; top: 80px; }
@media (max-width: 860px) { .prompt-aside { position: static; } }
.example img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.example { margin: 0; }
.example figcaption { margin-top: 6px; }
.prompt-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 16px 0; }
.prompt-box-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
.prompt-text { white-space: pre-wrap; word-wrap: break-word; font: .95rem/1.6 var(--mono); background: var(--surface-2); border-radius: 10px; padding: 14px; margin: 0 0 12px; max-height: 420px; overflow: auto; }
.prompt-text mark { background: color-mix(in srgb, var(--hl) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.customize { background: var(--brand-soft); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.customize h2 { margin: 0 0 8px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 600; }
.fields input { border-radius: 10px; background: var(--surface); }
.notice { background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 10px 14px; border-radius: 8px; }
.tips { margin-top: 8px; }

/* articles */
.article { max-width: 780px; }
.article-hero { margin: 18px 0; }
.article-hero img { border-radius: var(--radius); width: 100%; }
.byline { margin: 0; }
.prose { font-size: 1.04rem; }
.prose h2 { margin-top: 1.8em; }
.prose img { border-radius: 10px; margin: 12px 0; }
.prose blockquote { border-left: 4px solid var(--brand); margin: 1em 0; padding: .2em 1em; color: var(--muted); }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.prose li { margin: .3em 0; }
.narrow { max-width: 760px; }
.intro { max-width: 820px; }
.embed { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; box-shadow: var(--shadow); }
.embed-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.badge-inline { font-size: .78rem; background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
.embed .prompt-text { font-size: .9rem; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }

/* footer, toast */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; padding: 26px 0 18px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.foot-row nav { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot-row nav a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1f1a17; color: #fff; padding: 10px 18px; border-radius: 999px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 50; font-weight: 500; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* admin */
.admin { padding: 20px 0 40px; }
.admin table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .92rem; }
.admin th, .admin td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.form { display: grid; gap: 14px; max-width: 900px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.form input[type=text], .form input[type=date], .form input[type=password], .form select, .form textarea {
  font: 400 .95rem var(--font); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
.form textarea { min-height: 140px; font-family: var(--mono); font-size: .88rem; }
.form textarea.tall { min-height: 460px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.help { font-weight: 400; color: var(--muted); font-size: .82rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 1.6rem; }
.table-wrap { overflow-x: auto; }
@media (max-width: 860px) { .prompt-aside.no-img { order: 0; } }

/* ads */
.ad-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 28px auto; min-height: 270px; max-width: 100%; overflow: hidden; }
.ad-label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-grid { grid-column: 1 / -1; margin: 6px 0; }
.prose .ad-slot { margin: 26px auto; }
