:root {
  --paper: #f6f3ea;
  --surface: #fffdf8;
  --ink: #16232e;
  --muted: #56626c;
  --line: #ddd7c8;
  --line-strong: #bfb8a6;
  --sea: #14506b;
  --sea-deep: #0d3548;
  --sea-tint: #e3edf0;
  --wheat: #e9b63b;
  --wheat-tint: #f9eecd;
  --stitch: #a9342a;
  --stitch-tint: #f7e4df;
  --green: #2f6f4e;
  --violet: #5e5288;
  --font-display: 'Literata', Georgia, 'Times New Roman', serif;
  --font-ui: 'Golos Text', 'Segoe UI', system-ui, sans-serif;
  --radius: 10px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15.5px/1.5 var(--font-ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px var(--gutter) 56px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--sea); }
ul { list-style: none; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }

/* Cross-stitch band: the site's identity element. */
.stitch {
  height: 14px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='14' shape-rendering='crispEdges'%3E%3Cpath fill='%23a9342a' d='M16 0h4v2h-4zM14 2h8v2h-8zM12 4h4v2h-4zM20 4h4v2h-4zM10 6h4v2h-4zM22 6h4v2h-4zM12 8h4v2h-4zM20 8h4v2h-4zM14 10h8v2h-8zM16 12h4v2h-4z'/%3E%3Cpath fill='%2316232e' d='M0 6h4v2H0zM32 6h4v2h-4zM17 6h2v2h-2z'/%3E%3C/svg%3E") repeat-x center;
}

/* ---------- Header ---------- */
#app-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.brand-text span { font-size: 12.5px; color: var(--muted); }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500;
}
.main-nav a:hover { background: var(--paper); }
.main-nav a[aria-current='page'] { background: var(--sea-tint); color: var(--sea-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--sea); }
.btn-primary { background: var(--sea); border-color: var(--sea); color: #fff; }
.btn-primary:hover { background: var(--sea-deep); border-color: var(--sea-deep); }
.btn-small { min-height: 34px; padding: 4px 10px; font-size: 14px; }
kbd {
  font: 500 11.5px var(--font-ui); padding: 1px 5px; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .45); opacity: .9;
}
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--sea);
  text-decoration: underline; text-underline-offset: 2px; text-align: left; font: inherit;
}
.link-btn.danger { color: var(--stitch); }
.danger-armed { font-weight: 600; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 8px; border: 0; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn.small { width: 30px; height: 30px; font-size: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- Segmented control ---------- */
.seg { border: 0; margin: 0; padding: 0; display: inline-flex; flex-wrap: nowrap; gap: 2px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: block; padding: 8px 12px; border-radius: 7px; font-weight: 500; font-size: 14px; white-space: nowrap;
  border: 1px solid transparent;
}
.seg label:hover span { background: var(--paper); }
.seg input:checked + span { background: var(--sea-deep); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--sea); outline-offset: 2px; }
.seg-wrap { display: flex; flex-wrap: wrap; }
.seg-wrap legend { width: 100%; padding: 0; margin-bottom: 6px; }
.seg-wrap span { border-color: var(--line); }

/* ---------- Quick capture ---------- */
.capture-row {
  display: flex; align-items: center; gap: 8px; padding: 6px;
  background: var(--surface); border: 1.5px solid var(--sea); border-radius: 12px;
}
.capture-input {
  flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; padding: 0 8px; font-size: 16px;
}
.capture-input:focus { outline: none; }
.capture-row:focus-within { box-shadow: 0 0 0 3px var(--wheat-tint); }
.capture-input::placeholder { color: #6f7a83; }
.capture-hint { margin-top: 8px; font-size: 13.5px; color: var(--muted); min-height: 20px; }

/* ---------- Panels and lists ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head a { font-size: 14px; white-space: nowrap; }
.empty { color: var(--muted); padding: 10px 0; }

.row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0;
  border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
li:first-child > .row { border-top: 0; }
.row:hover .row-title { color: var(--sea); text-decoration: underline; text-underline-offset: 2px; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 500; overflow-wrap: anywhere; }
.row-meta { display: block; font-size: 13.5px; color: var(--muted); }

.date-tile {
  flex: none; width: 46px; text-align: center; line-height: 1.1;
  border-radius: 8px; padding: 5px 0; background: var(--paper);
}
.date-tile b { display: block; font: 600 18px var(--font-display); }
.date-tile span { font-size: 11.5px; color: var(--muted); }

/* Category colours, used by chips, dots and row accents. */
[data-cat='culture'] { --c: var(--sea); }
[data-cat='aid'] { --c: var(--stitch); }
[data-cat='community'] { --c: var(--green); }
[data-cat='memorial'] { --c: #33393f; }
[data-cat='admin'] { --c: var(--violet); }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 500;
  background: var(--paper); white-space: nowrap;
}
.tag-draft { background: #ece8dc; color: #4a4638; }
.tag-review { background: var(--wheat-tint); color: #694e08; }
.tag-published { background: #e0efe6; color: #1f5238; }

/* ---------- Home ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: stretch; margin-bottom: 28px; }
.home-intro { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.home-intro .lede { font-size: 17px; color: var(--muted); max-width: 54ch; margin-bottom: 8px; }
.next-card {
  background: var(--sea-deep); color: #fff; border-radius: 14px; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.next-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: #c9dbe3; }
.next-when { color: var(--wheat); font-weight: 600; }
.next-title { font: 600 24px/1.2 var(--font-display); color: #fff; overflow-wrap: anywhere; }
.next-meta { color: #d9e6eb; font-size: 14.5px; }
.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--wheat); }
.next-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: #d9e6eb; }
.next-card .btn { align-self: flex-start; background: #fff; border-color: #fff; color: var(--sea-deep); margin-top: 6px; }
.next-card .btn:hover { background: var(--wheat-tint); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }

.attention-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.attention-item:first-child { border-top: 0; }
.attention-item .pip { flex: none; width: 8px; height: 8px; transform: rotate(45deg); background: var(--wheat); }
.attention-item.urgent .pip { background: var(--stitch); }
.attention-text { flex: 1; min-width: 0; }
.attention-text .link-btn { color: var(--ink); text-decoration: none; font-weight: 500; }
.attention-text .link-btn:hover { color: var(--sea); text-decoration: underline; }
.attention-text small { display: block; font-size: 13.5px; color: var(--muted); }

.log-list li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.log-list li:first-child { border-top: 0; }
.log-list time { font-size: 12.5px; color: var(--muted); }
.log-list .link-btn { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.log-list .link-btn:hover { color: var(--sea); text-decoration: underline; }

/* ---------- Page heads ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* ---------- Publications ---------- */
.pub-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.search { flex: 1 1 240px; min-height: 40px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.filter-tab {
  min-height: 36px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-weight: 500; font-size: 14px;
}
.filter-tab:hover { border-color: var(--sea); }
.filter-tab[aria-pressed='true'] { background: var(--sea-deep); border-color: var(--sea-deep); color: #fff; }
.filter-tab .n { opacity: .7; margin-left: 3px; font-weight: 400; }

.pub-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pub-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: center; }
.pub-item:first-child { border-top: 0; }
.pub-open { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; min-width: 0; }
.pub-open:hover .pub-title { color: var(--sea); text-decoration: underline; text-underline-offset: 2px; }
.pub-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.pub-title { display: block; font: 600 18px/1.3 var(--font-display); overflow-wrap: anywhere; }
.pub-excerpt { display: block; color: var(--muted); font-size: 14.5px; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pub-channels { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pub-action { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pub-item.has-thumb { grid-template-columns: 112px minmax(0, 1fr) auto; }
.pub-thumb { width: 112px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }

/* ---------- Event page ---------- */
.recent-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); margin-bottom: 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
.recent-card:hover { border-color: var(--sea); }
.recent-card img { width: 100%; height: 100%; max-height: 320px; object-fit: cover; display: block; }
.recent-text { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 24px 28px; }
.recent-title { font: 600 clamp(24px, 3vw, 32px)/1.15 var(--font-display); }
.recent-outcome { color: var(--muted); }
.recent-more { color: var(--sea); font-weight: 500; }

.event-page { display: grid; gap: 24px; max-width: 960px; margin: 0 auto; }
.back-link { justify-self: start; font-size: 14px; }
.event-head { display: grid; gap: 8px; }
.event-when { font-size: 17px; color: var(--muted); }
.event-when::first-letter { text-transform: uppercase; }
.photo { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-hero { aspect-ratio: 16 / 9; }
.event-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
.event-story { display: grid; gap: 14px; font-size: 18px; line-height: 1.6; max-width: 62ch; }
.event-side { display: grid; gap: 10px; justify-items: start; font-size: 14.5px; }
.event-side h2 { font-size: 16px; margin-top: 8px; }
.gallery-title { margin-bottom: 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gallery .photo { aspect-ratio: 4 / 3; }

#lightbox {
  width: min(1200px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto;
  background: var(--ink); color: #fff; border-radius: 12px; overflow: hidden;
}
#lightbox[open] { display: flex; flex-direction: column; }
#lightbox > img { flex: 1; min-height: 0; width: 100%; max-height: calc(100dvh - 110px); object-fit: contain; display: block; }
.lightbox-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; font-size: 14px; }
.lightbox-tools { display: flex; align-items: center; gap: 8px; }

/* ---------- Calendar ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { font: 600 clamp(26px, 3.4vw, 34px)/1.15 var(--font-display); text-transform: capitalize; min-width: 8.5em; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 12px; }
.cal-legend button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 10px;
  background: none; border: 1px solid transparent; border-radius: 99px; cursor: pointer; font-size: 13.5px;
}
.cal-legend button:hover { border-color: var(--line-strong); }
.cal-legend button[aria-pressed='false'] { opacity: .45; text-decoration: line-through; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.cal-dow { background: var(--paper); padding: 6px 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.cal-day {
  background: var(--surface); min-height: 112px; padding: 5px; display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; position: relative; min-width: 0;
}
.cal-day:hover { background: #fbf8ef; }
.cal-day.is-other { background: #f3efe5; }
.cal-day.is-other .cal-num { color: #7a8289; }
.cal-day.is-drop { box-shadow: inset 0 0 0 2px var(--sea); }
.cal-num-row { display: flex; align-items: center; justify-content: space-between; }
.cal-num {
  width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.cal-day.is-today .cal-num { background: var(--stitch); color: #fff; }
.cal-plus { color: var(--sea); font-size: 16px; line-height: 1; opacity: 0; padding-right: 4px; }
.cal-day:hover .cal-plus { opacity: 1; }
.cal-observance { font-size: 11.5px; line-height: 1.25; color: var(--muted); padding: 0 3px; }
.chip {
  display: block; width: 100%; padding: 2px 6px; border: 0; border-left: 3px solid var(--c); border-radius: 3px;
  background: color-mix(in srgb, var(--c) 11%, var(--surface));
  font-size: 12.5px; line-height: 1.3; text-align: left; cursor: pointer;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.chip:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.chip b { font-weight: 600; }
.chip.is-idea { border-left-style: dashed; background: transparent; }
.chip.is-done { opacity: .6; }
.chip.is-cancelled { opacity: .55; text-decoration: line-through; }
.cal-tip { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

.agenda-day { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.agenda-day:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.agenda-day h3 { color: var(--muted); font-weight: 500; font-size: 13px; margin-bottom: 4px; }
.agenda-item {
  display: block; width: 100%; padding: 5px 0 5px 10px; border: 0; border-left: 3px solid var(--c); background: none;
  text-align: left; cursor: pointer; margin-top: 4px;
}
.agenda-item:hover strong { color: var(--sea); text-decoration: underline; }
.agenda-item strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.agenda-item small { font-size: 13px; color: var(--muted); }

/* ---------- Forms ---------- */
input[type='text'], input[type='search'], input[type='date'], input[type='time'], select, textarea {
  width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
.capture-input[type='text'] { border: 0; background: transparent; }
textarea { resize: vertical; line-height: 1.5; display: block; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }

/* ---------- Dialogs ---------- */
dialog { color: inherit; border: 0; padding: 0; }
dialog::backdrop { background: rgba(13, 53, 72, .42); }
#drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw;
  background: var(--surface); overflow-y: auto; box-shadow: -8px 0 32px rgba(13, 53, 72, .18);
}
#drawer[open] { animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #drawer[open] { animation: none; } }
.drawer-form { display: flex; flex-direction: column; gap: 16px; padding: 16px 24px 24px; min-height: 100%; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-right: -8px; }
.title-input[type='text'] {
  border: 0; border-bottom: 1.5px solid var(--line-strong); border-radius: 0; padding: 4px 0 8px; background: transparent;
  font: 600 23px/1.25 var(--font-display);
}
.title-input[type='text']:focus { outline: none; border-color: var(--sea); }
.drawer-section h3 { margin-bottom: 6px; }
.drawer-section .count { font-weight: 400; color: var(--muted); margin-left: 4px; }
.task-list { margin-bottom: 8px; }
.task-list li { display: flex; align-items: center; gap: 6px; }
.task-list label { flex: 1; display: flex; gap: 9px; align-items: flex-start; padding: 5px 0; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.task-list input { width: 17px; height: 17px; margin: 3px 0 0; flex: none; accent-color: var(--sea); }
.task-list .is-done span { color: var(--muted); text-decoration: line-through; }
.link-list li { padding: 3px 0; }
.check-row { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.check-row legend { padding: 0; margin-bottom: 6px; }
.check { display: inline-flex; gap: 6px; align-items: center; min-height: 30px; cursor: pointer; }
.check input { accent-color: var(--sea); width: 16px; height: 16px; margin: 0; }
.drawer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto;
  position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 0; border-top: 1px solid var(--line);
}

#quick-dialog {
  width: min(620px, calc(100vw - 32px)); max-width: none; margin: 12vh auto auto; border-radius: 14px;
  background: var(--surface); padding: 16px 20px 20px; box-shadow: 0 16px 48px rgba(13, 53, 72, .25);
}
.quick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quick-more { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; }

/* ---------- Toasts and footer ---------- */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 2147483647; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast button { background: none; border: 0; color: var(--wheat); font-weight: 600; cursor: pointer; padding: 2px; }

#app-footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 16px var(--gutter); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 13.5px; }
.footer-note { color: var(--muted); }
.footer-tools { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ---------- Public pages ---------- */
a.row, a.pub-open, a.agenda-item, a.chip { color: inherit; text-decoration: none; }
.pub-open { display: block; }
.pub-empty { padding: 24px 20px; }
.pub-item-public { grid-template-columns: minmax(0, 1fr); }
.pub-item-public.has-thumb { grid-template-columns: 112px minmax(0, 1fr); }
.post-photo { display: block; width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius); }
.next-foot .btn { align-self: flex-start; }
.home-intro .btn-row { margin-top: 0; }
[data-mode='public'] .cal-day { cursor: default; min-height: 92px; }
[data-mode='public'] .cal-day:hover { background: var(--surface); }
[data-mode='public'] .cal-day.is-other:hover { background: #f3efe5; }
[data-mode='public'] .cal-num { cursor: default; }
.visibility-hint { font-size: 13.5px; color: var(--muted); margin-top: -6px; }
.footer-tools a { color: var(--sea); }

/* ---------- Accounts ---------- */
input[type='email'], input[type='password'] {
  width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
[hidden] { display: none !important; }
.btn:disabled { opacity: .6; cursor: progress; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.badge {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--stitch); color: var(--surface); font-size: 12.5px; line-height: 20px; text-align: center;
}
.auth-card {
  display: grid; gap: 14px; width: 100%; max-width: 440px; margin: 16px auto; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.auth-form { display: grid; gap: 14px; }
.auth-form .btn { justify-self: start; }
.auth-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.form-status { font-size: 14px; color: var(--green); }
.form-status:empty { display: none; }
.form-status.is-error { color: var(--stitch); }
.check-top { align-items: flex-start; }
.check-top input { margin-top: 3px; flex: none; }
.check-column { display: grid; gap: 4px; border: 0; margin: 0; padding: 0; }
.check-column legend { padding: 0; margin-bottom: 6px; }
.access-note { display: grid; gap: 10px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px var(--gutter); flex: 1; }
.users-panel { padding: 0; overflow-x: auto; }
.users-empty { padding: 20px; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td { padding: 10px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.users-table th { border-top: 0; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.users-table select { min-width: 150px; }
.users-email { overflow-wrap: anywhere; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .home-top, .home-grid, .recent-card, .event-body { grid-template-columns: minmax(0, 1fr); }
  .event-body { gap: 20px; }
}
@media (max-width: 700px) {
  :root { --gutter: 16px; }
  main { padding-top: 20px; }
  .header-inner { flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; }
  .main-nav { order: 3; flex: 1 0 100%; }
  .main-nav a { flex: 1; text-align: center; padding: 8px 4px; }
  #quick-add kbd { display: none; }
  .capture-row { flex-wrap: wrap; }
  .capture-row .seg { flex: 1 0 100%; }
  .capture-row .seg label { flex: 1; text-align: center; }
  .capture-input { flex: 1 0 100%; padding: 0 6px; }
  .capture-row .btn { flex: 1; }
  .pub-item, .pub-item.has-thumb { grid-template-columns: minmax(0, 1fr); }
  .pub-thumb { width: 100%; height: 160px; }
  .pub-action { justify-content: flex-start; }
  .recent-text { padding: 16px; }
  .event-story { font-size: 16.5px; }
  .cal-title { min-width: 0; flex: 1 0 100%; order: -1; }
  .cal-nav { flex-wrap: wrap; }
  .cal-day { min-height: 54px; padding: 3px; align-items: center; gap: 2px; }
  .cal-plus, .cal-observance { display: none; }
  .cal-num { pointer-events: none; }
  .chip { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--c); font-size: 0; pointer-events: none; -webkit-line-clamp: unset; }
  .chip.is-idea { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
  .cal-events { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
  .cal-dow { padding: 4px 2px; text-align: center; }
  .cal-tip { display: none; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .drawer-form { padding: 12px 16px 16px; }
}
