:root {
  --paper: #f3ecdf;
  --paper-deep: #e7dccb;
  --card: #fffaf3;
  --ink: #241910;
  --muted: #6d5e52;
  --line: #e3d5c4;
  --accent: #9d2c38;
  --accent-ink: #fff8f4;
  --pine: #1d5c45;
  --gold: #8a5a12;
  --shadow: 0 16px 40px rgba(60, 36, 18, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --radius: 18px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent); }
a:hover { color: #711f28; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 0.4rem; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: 1.7rem; margin-top: 2rem; }
p { margin: 0.3rem 0 0.8rem; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: white; padding: 0.5rem 0.8rem; }
.skip:focus { top: 1rem; z-index: 5; }

.shell { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding-bottom: 3rem; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.2rem; padding: 1rem 0; position: sticky; top: 0; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.45rem; font-weight: 680; }
.mark { width: 0.85rem; height: 0.85rem; border-radius: 3px; background: var(--accent); box-shadow: inset 0 -6px 0 var(--accent-ink), inset 0 0 0 2px var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; }
nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
nav form { margin: 0; }
.foot { margin-top: 3rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; }

.hero { padding: 2.2rem 0 1rem; max-width: 40rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 600; color: var(--gold); margin-bottom: 0.4rem; }
.page-head { margin: 1.2rem 0 1rem; }
.row-actions, .nudge { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.row-actions { margin: 1rem 0; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.5rem; align-items: start; margin-top: 1rem; }
.steps { padding: 0; margin: 0; list-style: none; display: grid; gap: 1rem; }
.steps li { display: grid; gap: 0.15rem; }
.steps span, .hint, .meta, .tags { color: var(--muted); }
.sample { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.sample ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.sample li { display: grid; }
.sample small { color: var(--muted); }

.button, button, .secondary, .danger {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 0.55rem 1rem;
  font: 600 1rem/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button:hover, button:hover { background: #7e212b; }
.secondary, button.secondary, a.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.secondary:hover, button.secondary:hover { background: white; }
.danger, button.danger { background: #6e2430; }
a.button { color: var(--accent-ink); }
a.button.secondary { color: var(--ink); }

.stack-form, .stack { display: grid; gap: 0.9rem; }
.narrow { max-width: 32rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; }
.optional { font-weight: 500; color: var(--muted); }
input, textarea, select {
  width: 100%;
  font: 400 1rem/1.4 var(--sans);
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  min-height: 44px;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, white); outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 500; }
.check input { width: 1.15rem; min-height: 1.15rem; margin-top: 0.2rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem; display: grid; gap: 0.7rem; }
legend { padding: 0 0.3rem; font-family: var(--serif); }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

.banner { background: #efe4cf; border-radius: 12px; padding: 0.75rem 0.9rem; }
.banner.bad { background: #f8e4e2; color: #6e2430; }
.list-grid, .stack { margin-top: 0.6rem; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.list-card, .item-card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.list-card { display: grid; gap: 0.2rem; padding: 1rem; color: inherit; text-decoration: none; }
.list-card strong { font-family: var(--serif); font-size: 1.3rem; }
.item-card { display: grid; grid-template-columns: 96px 1fr; gap: 0.9rem; padding: 0.85rem; }
.item-card.is-taken { opacity: 0.72; }
.thumb { width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--paper-deep); display: grid; place-items: center; color: var(--ink); font-family: var(--serif); font-size: 1.8rem; text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-top { display: flex; justify-content: space-between; gap: 0.6rem; align-items: flex-start; }
.card-top h2 { font-size: 1.35rem; }
.card-top a { color: inherit; text-decoration: none; }
.nudge form { margin: 0; }
.nudge button { min-height: 36px; padding: 0.3rem 0.7rem; }
.meta, .tags { display: flex; flex-wrap: wrap; gap: 0.45rem 0.7rem; align-items: center; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.1rem 0.55rem; background: var(--paper-deep); color: var(--ink); font-size: 0.85rem; font-weight: 600; }
.pill.taken { background: #e7efe9; color: var(--pine); }
.pill.open { background: #f3ead2; color: var(--gold); }
.expired { color: var(--accent); }
.panel { padding: 1rem; }
.panel.danger { border-color: #e7c4c4; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.6rem; }
.gallery img, .photo-row img { border-radius: 12px; width: 100%; height: 160px; object-fit: cover; background: var(--paper-deep); }
.photo-row { grid-template-columns: 72px auto 1fr; align-items: center; }
.photo-row img { width: 72px; height: 72px; }
.links, .claims, .notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.links a { overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; }
.empty { padding: 1.5rem 0; max-width: 36rem; }
.ranker { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 1rem; }
.ranker ol { list-style: none; padding: 0; margin: 0.4rem 0 0; display: grid; gap: 0.4rem; }
.ranker li { display: flex; gap: 0.6rem; align-items: center; background: var(--paper); border-radius: 12px; padding: 0.55rem 0.7rem; cursor: grab; }
.ranker li.dragging { opacity: 0.45; }
.grip { color: var(--muted); letter-spacing: 0.15em; }

@media (max-width: 760px) {
  .split, .split-fields, .item-card { grid-template-columns: 1fr; }
  .thumb { width: 100%; height: 180px; }
  .shell { width: min(1080px, calc(100% - 1.2rem)); }
  .top { position: static; }
}
