:root {
  --paper: #f4efe4;
  --paper-2: #ebe3d3;
  --card: #fffdf8;
  --ink: #1d2620;
  --ink-2: #4c564f;
  --line: #d8cfbd;
  --pine: #1f4a38;
  --pine-2: #173a2c;
  --berry: #9e2a38;
  --gold: #b8912a;
  --ok: #2e6b4a;
  --radius: 6px;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--body);
  /* faint paper grain */
  background-image: radial-gradient(rgba(60, 40, 10, .035) 1px, transparent 1px);
  background-size: 4px 4px;
}
a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--berry); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin: 0 0 .5em; }
h2 { font-size: 1.45rem; margin: 0 0 .6em; }
h3 { font-size: 1.15rem; margin: 0 0 .5em; }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-2); }
.mono { font-family: var(--mono); font-size: .82rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
main.wrap { padding-top: 34px; padding-bottom: 60px; min-height: 70vh; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.brand-tag { width: 34px; color: var(--berry); }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a.on, .nav a:hover { color: var(--ink); }
.nav .pill { border: 1.5px solid var(--ink); padding: 5px 12px; border-radius: 999px; color: var(--ink); }
.dot { display: inline-block; min-width: 20px; padding: 0 5px; margin-left: 3px; border-radius: 10px; background: var(--berry); color: #fff; font-size: .75rem; text-align: center; }
.announce { background: var(--pine); color: #f4efe4; font-size: .95rem; padding: 8px 0; }

form.inline { display: inline; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: var(--ink); }
button.link.danger { color: var(--berry); }

/* buttons */
.btn { display: inline-block; font: 700 1rem var(--body); padding: 11px 20px; border-radius: var(--radius); border: 2px solid transparent; text-decoration: none; cursor: pointer; transition: transform .08s ease, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-pine { background: var(--pine); color: #fbf8f1; }
.btn-pine:hover { background: var(--pine-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.btn-row form { margin: 0; }

/* flash */
.flash { padding: 10px 14px; border-radius: var(--radius); border-left: 4px solid; background: var(--card); margin: 0 0 20px; }
.flash.ok { border-color: var(--ok); }
.flash.err { border-color: var(--berry); }

/* hero */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center; padding: 20px 0 50px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--berry); font-weight: 700; margin: 0 0 14px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 56ch; }
.cta-row { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }

/* gift tag tally */
.tally { display: flex; justify-content: center; }
.tag {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--ink);
  padding: 30px 28px 24px 52px;
  width: 100%; max-width: 340px;
  clip-path: polygon(30px 0, 100% 0, 100% 100%, 30px 100%, 0 50%);
  transform: rotate(-2.5deg);
  box-shadow: 0 1px 0 var(--line);
}
.tag-hole { position: absolute; left: 22px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); }
.tag dl { margin: 0; display: grid; gap: 8px; }
.tag dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.tag dl div:last-child { border-bottom: 0; }
.tag dl div.sep { margin-top: 8px; }
.tag dt { color: var(--ink-2); font-size: .92rem; }
.tag dd { margin: 0; font-family: var(--display); font-size: 1.6rem; font-weight: 700; }
.tag dd.hot { color: var(--berry); }

/* how */
.how { border-top: 1px solid var(--line); padding-top: 40px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.steps { padding-left: 0; list-style: none; counter-reset: s; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 42px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--pine); color: var(--pine); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }

.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 46px; }
.note { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--pine); padding: 20px 22px; border-radius: 0 0 var(--radius) var(--radius); }
.note:nth-child(2) { border-top-color: var(--berry); }
.note:nth-child(3) { border-top-color: var(--gold); }
.note h2 { font-size: 1.15rem; }
.note p { margin: 0; color: var(--ink-2); }

/* cards and forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 22px; }
.card.narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.page-title { font-size: 2rem; margin-bottom: 22px; }
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 5px; }
.form label > span { font-weight: 700; }
.form label em { font-weight: 400; color: var(--ink-2); font-style: normal; }
.form small { color: var(--ink-2); }
input, textarea { font: inherit; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(31, 74, 56, .15); }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 5px; accent-color: var(--pine); }
.grid2 { grid-template-columns: 1fr 1fr; }
.span2 { grid-column: span 2; }

/* dashboard */
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.dash .notes { grid-column: span 2; }
.state { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--berry); margin: 0 0 8px; }
.big { font-family: var(--display); font-size: 2.6rem; margin: 0; }
.big .muted { font-size: 1rem; font-family: var(--body); }
.code { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .08em; background: var(--paper-2); border: 1.5px dashed var(--ink-2); padding: 10px 14px; display: inline-block; border-radius: var(--radius); user-select: all; }
.note-quote { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--paper); font-style: italic; }
.note-quote cite { display: block; font-style: normal; font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.giftee { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.giftee.assigned { border-color: var(--pine); border-width: 1.5px; }
.giftee-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.giftee p { margin: 8px 0; }
.profile-link { font-family: var(--mono); font-size: .82rem; word-break: break-all; }
.howto summary { cursor: pointer; font-weight: 700; color: var(--pine); }
.howto ol { margin: 8px 0 0; padding-left: 20px; }
.match-form { border-top: 1px dashed var(--line); padding-top: 18px; margin-top: 8px; }
.badge { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 3px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.b-assigned { background: var(--pine); color: #fff; }
.b-gifted { background: #e7dcb9; color: #5a4712; }
.b-confirmed { background: #d6e6da; color: var(--ok); }
.b-disputed { background: var(--berry); color: #fff; }
.notes-head { display: flex; justify-content: space-between; align-items: baseline; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--paper-2); }
.note-list li.unread span { font-weight: 700; }
.note-list time { color: var(--ink-2); font-size: .85rem; white-space: nowrap; }

/* prose */
.prose { max-width: 700px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: 6px; }

/* admin */
.subnav { display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.subnav a { text-decoration: none; color: var(--ink-2); }
.subnav a.on { color: var(--ink); font-weight: 700; }
.subnav .right { margin-left: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { text-decoration: none; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: .9rem; }
.tabs a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
.stat-strip a { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink-2); }
.stat-strip b { display: block; font-family: var(--display); font-size: 1.8rem; color: var(--ink); }
.stat-strip a.hot { border-color: var(--berry); }
.stat-strip a.hot b { color: var(--berry); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); font-size: .93rem; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: 10px; border-bottom: 1.5px solid var(--ink); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--paper-2); vertical-align: top; }
.tbl tr.banned td { opacity: .55; }
.note-cell { max-width: 240px; }
.actions form { margin: 0; }
.actions form + form, .actions small + form { margin-top: 8px; }
.reject { display: flex; gap: 6px; align-items: center; }
.reject input { padding: 4px 8px; font-size: .85rem; width: 130px; }
.search { display: flex; gap: 8px; max-width: 420px; margin-bottom: 18px; }

/* footer */
.foot { border-top: 1px solid var(--line); color: var(--ink-2); font-size: .86rem; padding: 22px 0 30px; }
.foot-row { display: grid; gap: 4px; }
.foot p { margin: 0; }

@media (max-width: 820px) {
  .hero, .cols, .why, .dash, .grid2 { grid-template-columns: 1fr; }
  .dash .notes, .span2 { grid-column: auto; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .tag { transform: none; }
}

.qty { display: flex; align-items: center; gap: 12px; }
.qty select { font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; min-width: 80px; }

.crew { margin-top: 46px; border-top: 1px solid var(--line); padding-top: 34px; }
.crew-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.crew-list li { border: 1.5px solid var(--ink); border-radius: 999px; padding: 5px 14px; background: var(--card); font-weight: 700; }
.crew-list a { text-decoration: none; color: var(--ink); }
.crew-list a:hover { color: var(--berry); }

.subnav-me { display: flex; gap: 16px; align-items: center; }
.temp-pw { border: 1.5px solid var(--pine); background: #eef4ef; }
.temp-pw .code { font-size: 1.3rem; }
.role { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 3px; background: var(--paper-2); color: var(--ink-2); }
.role.owner { background: var(--pine); color: #fff; }
.add-staff { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.add-staff label { display: grid; gap: 5px; }
.add-staff input[name=username] { width: 220px; }
.add-staff label.check { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; }
.add-staff label.check input { margin-top: 0; }

select { font: inherit; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; }
select:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(31, 74, 56, .15); }
.qty select { width: auto; }
.comm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.comm-card { display: grid; gap: 6px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); transition: transform .1s ease, box-shadow .1s ease; }
.comm-card:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); color: var(--ink); }
.comm-name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.comm-meta { color: var(--ink-2); font-size: .9rem; }
.comm-meta b { color: var(--berry); }
.eyebrow a { color: inherit; }
.hero-comm { padding-bottom: 30px; }
.cfilter { margin: -6px 0 18px; }
.cfilter label { display: inline-flex; gap: 10px; align-items: center; font-weight: 700; }
.cfilter select { width: auto; }
.comm-checks { border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 14px; width: 100%; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.comm-checks legend { font-weight: 700; padding: 0 6px; }
.comm-edit summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.comm-edit form { display: grid; gap: 4px; margin-top: 8px; justify-items: start; }
.comm-admin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.comm-admin-head h2 { margin: 0; }
.tbl select { width: auto; padding: 4px 6px; font-size: .85rem; }

.also-in { color: var(--pine); font-weight: 700; }
.tbl .badge { margin-left: 4px; }

.b-new { background: #f3e2b3; color: #6b4e00; }
.approve { display: grid; gap: 6px; justify-items: start; }
.vouch { display: flex; gap: 6px; align-items: center; font-size: .85rem; font-weight: 700; }
.vouch input { width: auto; }
.tab-n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--paper-2); color: var(--ink-2); font-size: .78rem; text-align: center; }
.tabs a.on .tab-n { background: var(--paper); color: var(--ink); }
.tbl td .role { margin-left: 4px; font-size: .68rem; }
.line-card { border: 1.5px solid var(--pine); border-radius: var(--radius); padding: 16px 18px; background: #f3f7f2; margin-top: 8px; }
.line-card .big { margin-bottom: 6px; }
.or-line { text-align: center; margin: 22px 0 6px; color: var(--ink-2); font-size: .9rem; position: relative; }
.or-line span { background: var(--card); padding: 0 10px; position: relative; z-index: 1; }
.or-line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line); }
.handoff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.queue { list-style: none; counter-reset: q; padding: 0; margin: 0; }
.queue li { counter-increment: q; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 10px 34px; border-bottom: 1px solid var(--paper-2); position: relative; }
.queue li::before { content: counter(q); position: absolute; left: 0; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper-2); color: var(--ink-2); font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.queue li form { margin: 0; flex-shrink: 0; }
.dm-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.dm-card.just { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(31, 74, 56, .15); }
.dm-card.sent { background: var(--paper); }
.dm-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.dm-meta { text-align: right; }
.dm-text { font-family: var(--mono); font-size: .82rem; background: #fff; }
.danger-text { color: var(--berry); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 820px) { .handoff-cols { grid-template-columns: 1fr; } .dm-meta { text-align: left; } }
