:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #202420;
  background: #f4f5f2;
  --border: #dedfd9;
  --muted: #687068;
  --field: #f8f9f6;
  --radius: 10px;
  --control-height: 46px;
}
*, *::before, *::after { box-sizing: border-box; }
body, form { margin: 0; }
[hidden], input[type="hidden"] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #a8b2a6; outline-offset: 3px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -.025em; }
h2 { margin: 0 0 16px; font-size: 19px; line-height: 1.35; }
p { margin: 0 0 12px; }
.muted { margin: 0; color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; }
.back { display: inline-block; color: var(--muted); font-size: 14px; }
.back:hover, .table-link:hover { color: #202420; text-decoration: underline; }
.table-link { font-weight: 600; text-decoration: underline; text-decoration-color: #c1c6bd; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* One control style for all forms, independent of their layout container. */
label { display: flex; flex-direction: column; min-width: 0; gap: 8px; font-size: 14px; font-weight: 600; }
label small, .form-grid small, .settings-card small, .feedback-compose small { color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
:where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: var(--control-height);
  margin: 0;
  border: 1px solid #cbd0c7;
  border-radius: var(--radius);
  padding: 11px 14px;
  color: #202420;
  background: var(--field);
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  box-shadow: inset 0 1px 2px rgb(32 36 32 / 3%);
}
input::placeholder, textarea::placeholder { color: #8a9187; opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: #677b61;
  outline: 0;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgb(103 123 97 / 15%);
}
textarea { resize: vertical; line-height: 1.5; min-height: 112px; }
select:not([multiple]) {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23687068' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
}
input[readonly], textarea[readonly] { color: var(--muted); background-color: #eef0ea; box-shadow: none; }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background-color: #eef0ea; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: #202420; }
.checkbox { flex-direction: row; align-items: center; gap: 10px; min-height: var(--control-height); font-weight: 400; }
input[type="file"] { padding: 8px; }
input::file-selector-button { margin-right: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; background: #fff; color: #202420; font: inherit; cursor: pointer; }

.button, button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: var(--control-height);
  max-width: 100%;
  margin: 0;
  border: 1px solid #cbd0c7;
  border-radius: var(--radius);
  padding: 11px 16px;
  background: #fff;
  color: #202420;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  text-decoration: none;
}
.button:hover, button:hover { border-color: #aab2a5; background: #f3f5ef; }
.primary { color: #fff; background: #202420; border-color: #202420; }
.primary:hover { color: #fff; background: #343c32; border-color: #343c32; }
.secondary { background: #fff; }
.danger { color: #a12b2b; border-color: #e9c9c9; background: #fff8f8; }
.danger:hover { color: #8d2222; border-color: #dca5a5; background: #fff0f0; }
button:disabled { opacity: .5; cursor: not-allowed; }
.link-button { border-color: transparent; padding: 4px 8px; background: transparent; color: var(--muted); font-weight: 400; }
.link-button:hover { border-color: transparent; text-decoration: underline; }
.actions, .filter-row, .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.actions > *, .filter-row > * { max-width: 100%; }
.actions > form { flex: 0 0 auto; }
.form-actions { padding-top: 20px; margin-top: 4px; border-top: 1px solid var(--border); }
.form-actions > .button, .form-actions > button { min-width: 140px; }
.form-actions > .muted { font-size: 13px; }

/* Page frame and spacing. */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--border); }
.brand { flex: 0 0 auto; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.topbar nav { display: flex; flex: 1 1 620px; flex-wrap: wrap; align-items: center; min-width: 0; gap: 4px; }
.topbar nav a { padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.topbar nav a:hover { background: #f4f5f2; color: #202420; }
.topbar nav a[aria-current="page"] { color: #202420; background: #edf0e8; font-weight: 600; }
.account { display: flex; flex: 0 1 auto; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; min-width: 0; max-width: 100%; font-size: 14px; }
.account > span { overflow-wrap: anywhere; min-width: 0; }
.container { width: 100%; max-width: 1360px; margin: 0 auto; padding: 32px 28px 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.page-head > div { min-width: 0; }
.page-head > div:first-child { flex: 1 1 260px; }
.page-head h1 + p, .page-head h2 + p { margin-top: 8px; }
.page-head h2 { margin-bottom: 0; }
.page-head .back { margin-bottom: 10px; }
.card { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgb(32 36 32 / 3%); }
.alert, .success { margin: 0 0 24px; padding: 14px 18px; border: 1px solid; border-radius: var(--radius); overflow-wrap: anywhere; }
.alert { background: #fff3f1; border-color: #edceca; color: #8b3026; }
.success { background: #f0f7eb; border-color: #d3e4c7; color: #35562c; }
.alert a, .success a { text-decoration: underline; text-underline-offset: 3px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; max-width: 900px; }
.form-grid > * { min-width: 0; }
.wide { grid-column: 1 / -1; }
.stack, .settings-layout, .message-form { display: grid; gap: 20px; min-width: 0; max-width: 900px; }
.stack { margin-top: 24px; }
.settings-card { display: grid; gap: 20px; }
.settings-card h2, .settings-card p { margin: 0; }
.inline-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 16px; }
.delete-form { max-width: 900px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 32px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.login-card h1 { margin-bottom: 8px; }
.login-card .alert { margin-top: 20px; }

/* Tables scroll inside the card, never the whole page. */
.table-wrap, .calendar-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.data-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 14px 12px; border-bottom: 1px solid #eceee8; text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 12px; font-weight: 600; background: #f8f9f6; }
.data-table td { overflow-wrap: anywhere; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td .small { margin-top: 5px; }
.status { display: inline-block; max-width: 100%; margin-top: 6px; padding: 4px 9px; border-radius: 7px; background: #f0f1ed; color: #62695e; font-size: 12px; line-height: 1.4; vertical-align: middle; }
.status.ok { background: #eaf4e4; color: #416132; }
.status.off { background: #f0f1ed; color: #62695e; }
.status.pending { background: #fff4d7; color: #806222; }
.status.error { background: #fff0ed; color: #963c32; }
.pagination { justify-content: center; margin-top: 24px; }
.filter-row { margin-bottom: 20px; }
.row-actions { min-width: 160px; }
.search-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.search-form input { flex: 1 1 260px; }
.search-form select { flex: 0 1 220px; }
.registration-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; max-width: 900px; margin-top: 24px; }
.registration-summary > div { min-width: 0; flex: 1 1 280px; }
.registration-summary h2 { margin-bottom: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.detail-grid > div { min-width: 0; display: grid; gap: 6px; overflow-wrap: anywhere; }
.section-title { margin-top: 28px; }

/* Calendar. */
.calendar-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 840px; }
.weekday-grid { margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.day { min-height: 150px; padding: 10px; background: #fff; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.day:nth-child(7n+1) { border-left: 1px solid var(--border); }
.day:nth-child(-n+7) { border-top: 1px solid var(--border); }
.day.outside { background: #f8f9f6; color: #9ba294; }
.day.today { box-shadow: inset 0 0 0 2px #586b50; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-weight: 600; }
.day-head a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #f0f3eb; }
.events { display: grid; gap: 6px; }
.event { min-width: 0; display: grid; gap: 4px; padding: 8px; border-radius: 7px; background: #f2f4ee; font-size: 12px; overflow-wrap: anywhere; }
.event:hover { background: #e9eee1; }

/* Admin access and cooperative membership. */
.admin-list { display: grid; gap: 16px; margin-top: 24px; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); align-items: center; gap: 24px; }
.admin-row > div { min-width: 0; overflow-wrap: anywhere; }
.admin-row > div:first-child > .muted { margin-top: 6px; font-size: 12px; }
.admin-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 16px; }
.admin-actions > form { min-width: 0; }
.password-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.cooperative-members { margin-top: 24px; scroll-margin-top: 24px; }
.cooperative-person { min-width: 0; padding: 20px 0; border-top: 1px solid var(--border); }
.cooperative-person:last-child { padding-bottom: 0; }
.cooperative-person summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 46px; cursor: pointer; list-style: none; }
.cooperative-person summary::-webkit-details-marker { display: none; }
.cooperative-person summary::before { content: "+"; flex: 0 0 24px; font-size: 20px; color: var(--muted); text-align: center; }
.cooperative-person[open] > summary::before { content: "−"; }
.cooperative-person summary strong { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.cooperative-person summary .status { margin: 0; }
.cooperative-person .form-grid { margin: 20px 0; }
.cooperative-person .cooperative-cancel { margin: 0 0 16px; }
.cooperative-history { display: grid; gap: 14px; margin: 16px 0 20px; padding: 16px 20px 16px 36px; border-radius: var(--radius); background: #f7f8f4; font-size: 13px; overflow-wrap: anywhere; }
.cooperative-history .table-link, .cooperative-history .status { margin: 4px 0 4px 8px; }

/* Accounting. */
.accounting-page { display: grid; gap: 24px; min-width: 0; overflow-wrap: anywhere; }
.accounting-page > * { min-width: 0; margin-block: 0; }
.accounting-month-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.accounting-month-switch { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: center; gap: 12px; flex: 0 1 340px; min-width: 0; }
.accounting-month-switch > .button { padding: 10px; }
.accounting-month-switch h2 { margin: 0; text-align: center; font-size: 18px; }
.accounting-month-picker { display: grid; grid-template-columns: minmax(0, 200px) auto; align-items: end; gap: 8px 12px; min-width: 0; }
.accounting-month-picker > label { grid-column: 1 / -1; }
.accounting-empty { display: grid; justify-items: start; gap: 16px; }
.accounting-empty h2 { margin: 0; }
.accounting-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.accounting-summary .card { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.accounting-summary .card > span { font-size: 13px; }
.accounting-summary strong { margin-top: auto; font-size: 23px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-positive { color: #357034; }
.money-negative { color: #ac3737; }
.accounting-summary .money, .accounting-event-totals .money, .accounting-contribution-totals .money, .event-finances .money { white-space: normal; overflow-wrap: anywhere; }
.accounting-summary .accounting-closing { color: #fff; border-color: #202420; background: #202420; }
.accounting-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.accounting-breakdown > div { min-width: 0; }
.accounting-breakdown dl { display: grid; gap: 14px; margin: 0; }
.accounting-breakdown dl > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.accounting-breakdown dt { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.accounting-breakdown dd { max-width: 100%; margin: 0 0 0 auto; white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
.accounting-events-table { min-width: 480px; }
.accounting-contributions-table { min-width: 780px; }
.accounting-table { min-width: 960px; }
.accounting-page .data-table .money, .accounting-rate-history .money { text-align: right; }
.accounting-date { white-space: nowrap; }
.accounting-description { max-width: 340px; white-space: pre-wrap; overflow-wrap: anywhere; }
.accounting-audit { min-width: 160px; max-width: 220px; overflow-wrap: anywhere; }
.accounting-member-name { min-width: 140px; max-width: 240px; overflow-wrap: anywhere; }
.accounting-contributions-table .status { margin: 0; }
.accounting-row-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 136px; }
.accounting-row-actions > *, .accounting-row-actions button { width: 100%; }
.accounting-row-actions .back { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 10px; }
.accounting-deleted { background: #f8f9f6; }
.accounting-deleted td.money { text-decoration: line-through; color: var(--muted); }
.accounting-table-wrap { padding: 8px; }
.accounting-event-totals, .accounting-contribution-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.accounting-contribution-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.accounting-event-totals > div, .accounting-contribution-totals > div { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.accounting-event-totals .muted, .accounting-contribution-totals .muted { font-size: 12px; }
.accounting-event-totals strong, .accounting-contribution-totals strong { margin-top: auto; font-size: 18px; }
.accounting-contribution-note { margin-top: 16px; }
.accounting-rent { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; gap: 32px; scroll-margin-top: 24px; }
.accounting-rent > div { min-width: 0; overflow-wrap: anywhere; }
.accounting-rent > div > .money { display: block; margin-bottom: 10px; white-space: normal; font-size: 24px; }
.accounting-rent h2 { margin-bottom: 12px; }
.accounting-rent-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.accounting-rent-form small { font-size: 12px; }
.accounting-journal-head { margin-bottom: 20px; }
.accounting-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 20px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.accounting-filters > label { flex: 1 1 180px; }
.accounting-filters > .checkbox { flex: 1 1 200px; }
.accounting-filters > .actions { flex: 0 1 auto; }
.accounting-journal-note { margin: 12px 0 20px; }
.accounting-form-note { max-width: 900px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.accounting-rates { max-width: 900px; scroll-margin-top: 24px; }
.accounting-rates > .form-grid { margin-top: 24px; }
.accounting-rate-history { margin-top: 24px; }
.accounting-rate-history table { min-width: 560px; }
.accounting-contributions, .accounting-events { scroll-margin-top: 24px; }
.event-finances { max-width: 900px; margin-top: 24px; scroll-margin-top: 24px; overflow-wrap: anywhere; }
.event-finances-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.event-finances-head > div { min-width: 0; flex: 1 1 260px; }
.event-finances-head h2 { margin-bottom: 8px; }
.event-finances-head p { margin: 0; }
.event-finances-form { max-width: 100%; }
.event-finances > .small { margin-top: 20px; }
.event-finances-delete-note { max-width: 900px; margin-top: 24px; }

/* Existing messaging and Telegram settings use the same controls and spacing. */
.message-cell { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 560px; }
.broadcast-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 24px; }
.telegram-preview, .support-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.telegram-preview { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--field); }
.preview-button { display: block; margin-top: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stats-grid .card { display: grid; gap: 8px; padding: 16px; }
.stats-grid strong { font-size: 24px; }
.broadcast-note { margin-top: 20px; }
.support-note { margin-bottom: 24px; max-width: 900px; }
.support-history { max-width: 900px; display: grid; gap: 16px; }
.support-message { width: min(720px, 92%); min-width: 0; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.support-message.outgoing { margin-left: auto; background: #edf2e8; }
.support-meta { margin-bottom: 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.feedback-compose { max-width: 900px; margin-bottom: 24px; }
.media-badge { margin-bottom: 8px; font-weight: 600; }
.settings-check-result { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.settings-check-result.ok { background: #f0f7eb; border-color: #d3e4c7; }
.settings-check-result.error { background: #fff3f1; border-color: #edceca; color: #8b3026; }
.settings-meta { max-width: 900px; display: flex; flex-wrap: wrap; gap: 16px 24px; margin-top: 24px; overflow-wrap: anywhere; }
.settings-restart { max-width: 900px; }

@media (max-width: 1200px) {
  .topbar nav { order: 3; flex-basis: 100%; }
  .accounting-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-summary .accounting-closing { grid-column: 1 / -1; }
  .admin-row { grid-template-columns: minmax(0, 1fr); }
  .admin-actions { max-width: 720px; }
}
@media (max-width: 900px) {
  .broadcast-layout { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .accounting-breakdown, .accounting-rent { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .accounting-contribution-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-event-totals { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-month-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .accounting-month-switch { width: 100%; }
  .accounting-month-picker { grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
}
@media (max-width: 680px) {
  .container { padding: 24px 16px 36px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .account { max-width: calc(100% - 110px); }
  .topbar nav { gap: 4px 0; }
  .topbar nav a { padding: 8px; font-size: 13px; }
  .card { padding: 20px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .form-actions { padding-top: 20px; }
  .form-actions > .button, .form-actions > button, .actions > form, .actions > form > button { width: 100%; }
  .form-actions > .muted { flex-basis: 100%; }
  .inline-form, .admin-actions, .password-form { grid-template-columns: minmax(0, 1fr); }
  .admin-actions > form > button, .password-form > button { width: 100%; }
  .page-head > div:first-child, .registration-summary > div, .event-finances-head > div { flex-basis: 100%; }
  .page-head > .button, .registration-summary > .button, .event-finances-head > .button { width: 100%; }
  .page-head > .actions { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .accounting-month-nav { padding: 16px; }
  .accounting-filters { padding: 16px; }
  .accounting-filters > label, .accounting-filters > .checkbox, .accounting-filters > .actions { flex-basis: 100%; }
  .accounting-filters .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-filters .actions > :only-child { grid-column: 1 / -1; }
  .accounting-table-wrap { padding: 8px; }
  .accounting-rent-form .actions > button { flex: 1 1 140px; }
  .cooperative-cancel button { width: 100%; }
  .search-form input, .search-form select { flex-basis: 100%; }
  .search-form > button, .search-form > .button { flex: 1 1 120px; }
  .calendar-nav .button { flex: 1 1 100px; }
}
@media (max-width: 440px) {
  .card { padding: 16px; }
  .accounting-summary, .accounting-contribution-totals { grid-template-columns: minmax(0, 1fr); }
  .accounting-summary .card { gap: 12px; }
  .accounting-table-wrap { padding: 6px; }
  .accounting-month-switch { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 8px; }
  .accounting-month-switch h2 { font-size: 16px; }
  .accounting-month-picker { grid-template-columns: minmax(0, 1fr); }
  .accounting-month-picker > label { grid-column: auto; }
  .accounting-month-picker > button { width: 100%; }
  .accounting-rent-form .actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cooperative-person summary strong { flex-basis: calc(100% - 36px); }
  .cooperative-person summary .status { margin-left: 36px; }
  .stats-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-card { padding: 24px; }
}

/* Public registration reuses the same controls; no admin navigation or data. */
.public-page { width: 100%; max-width: 688px; margin: 0 auto; padding: 40px 20px 56px; display: grid; gap: 24px; }
.public-brand { display: grid; gap: 4px; padding: 0 4px; }
.public-brand strong { font-size: 24px; letter-spacing: -.04em; }
.public-brand span { font-size: 13px; color: var(--muted); }
.public-event { display: grid; gap: 24px; padding: 32px; }
.public-event > *, .public-event-head > *, .public-signup > *, .public-payment > * { margin: 0; }
.public-event-head { display: grid; gap: 12px; }
.public-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.public-signup { display: grid; gap: 12px; }
.public-signup > button { margin-top: 4px; width: 100%; }
.public-payment { display: grid; gap: 12px; border-block: 1px solid var(--border); padding-block: 20px; }
.public-payment button, .public-event > form > button { width: 100%; }
.public-donation { display: grid; grid-template-columns: minmax(0, 1fr) 168px; align-items: start; gap: 24px; }
.public-donation h2 { margin-bottom: 12px; }
.public-donation .button { margin-top: 16px; }
.public-donation figure { margin: 0; text-align: center; }
.public-donation img { display: block; width: 100%; height: auto; background: #fff; }
.public-donation figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }
.public-share { display: grid; gap: 16px; max-width: 900px; margin-top: 24px; }
.public-share > * { margin: 0; }
.public-share-content { display: grid; grid-template-columns: minmax(0, 1fr) 192px; align-items: start; gap: 24px; }
.public-share-links { display: grid; gap: 16px; min-width: 0; }
.public-share-qr { display: grid; gap: 12px; margin: 0; width: 192px; max-width: 100%; }
.public-share-qr img { display: block; width: 100%; height: auto; background: #fff; }
.public-share-qr .button { width: 100%; }
.public-day { display: grid; gap: 16px; min-width: 0; }
.public-day > h2 { margin: 0; font-size: 17px; color: var(--muted); }
.schedule-event { gap: 20px; }
.schedule-event h3 { margin: 0; font-size: 22px; line-height: 1.3; }
.schedule-event > .button { justify-self: start; }
.participant-contact { max-width: 28ch; overflow-wrap: anywhere; }
.ticket-qr { display: grid; gap: 12px; width: 240px; max-width: 100%; margin-inline: auto; }
.ticket-qr img { display: block; width: 100%; height: auto; background: #fff; }
.ticket-inline { display: grid; gap: 16px; text-align: center; padding-block: 20px; border-block: 1px solid var(--border); }
.ticket-inline > * { margin-block: 0; }
.ticket-card { text-align: center; }
.checkin-page { display: grid; gap: 20px; width: 100%; max-width: 640px; margin-inline: auto; }
.checkin-card { display: grid; gap: 20px; }
.checkin-card > * { margin: 0; }
.checkin-card > h2 { font-size: 22px; }
.checkin-count { border-radius: var(--radius); padding: 16px; background: var(--field); font-size: 22px; }
.checkin-card form button { width: 100%; }
.checkin-corrections { border-top: 1px solid var(--border); padding-top: 16px; }
.checkin-corrections summary { min-height: var(--control-height); cursor: pointer; padding-block: 12px; font-weight: 600; }
.checkin-corrections form { margin-top: 20px; }
.participant-checkin { margin-bottom: 10px; width: 100%; }
.participant-actions { display: grid; gap: 10px; min-width: 160px; }
.participant-actions button { width: 100%; }
@media (max-width: 680px) {
  .public-share-content { grid-template-columns: minmax(0, 1fr); }
  .public-share-qr { justify-self: center; }
}
@media (max-width: 540px) {
  .public-page { padding: 24px 16px 40px; gap: 20px; }
  .public-event { padding: 24px 20px; }
  .public-donation { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .public-donation figure { width: 168px; justify-self: center; }
  .public-donation .button, .public-share .actions > *, .schedule-event > .button { width: 100%; }
}

/* Payment and party forms use the existing single-column controls at every width. */
.public-event .stack, .public-payment .stack { display: grid; gap: 14px; min-width: 0; }
.public-event .stack > *, .public-payment .stack > * { margin: 0; min-width: 0; }
.public-event input, .public-event select, .public-payment input { width: 100%; min-width: 0; max-width: 100%; }
.public-payment summary { cursor: pointer; padding-block: 12px; }
.payment-edit { margin-top: 16px; }
.public-payment .button, .public-payment button { white-space: normal; text-align: center; }
