/* Wine, gold and parchment are the Cenacolari site palette, not data states. */
:root {
  color-scheme: dark;
  --bg: #171513;
  --surface: #211e1a;
  --surface-raised: #29251f;
  --surface-soft: #1d1a17;
  --text: #f3eee4;
  --muted: #c1b7a7;
  --faint: #a99d8c;
  --border: #443c32;
  --accent: #d6b874;
  --wine: #722f37;
  --primary: #a74b59;
  --primary-hover: #bd5a69;
  --primary-text: #fff;
  --green: #99cfb0;
  --green-bg: #203c2c;
  --red: #f0a9ab;
  --red-bg: #46272a;
  --gold-bg: #423724;
  --focus: #efce80;
  --shadow: 0 22px 70px #0004;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0e8;
  --surface: #fffdf8;
  --surface-raised: #fff;
  --surface-soft: #eee8dd;
  --text: #2a211b;
  --muted: #665b4d;
  --faint: #726657;
  --border: #d7cebf;
  --accent: #79591e;
  --primary: #722f37;
  --primary-hover: #57212a;
  --green: #265f40;
  --green-bg: #e2efe5;
  --red: #942f38;
  --red-bg: #f9e6e6;
  --gold-bg: #f1e6cc;
  --focus: #722f37;
  --shadow: 0 22px 60px #3c2b1614;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 0.9375rem; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .6; }
a { color: inherit; text-underline-offset: 3px; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 550; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 3vw, 3rem); margin-bottom: 12px; }
h2 { font-size: 1.35rem; margin-bottom: 8px; }
h3 { font-size: 1.1rem; margin-bottom: 8px; }
svg.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; z-index: 200; left: 16px; top: 12px; padding: 12px 20px; background: var(--surface); color: var(--text); border: 2px solid var(--focus); transform: translateY(-180%); border-radius: 8px; }
.skip-link:focus { transform: none; }
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 20px 24px; display: flex; flex-direction: column; background: var(--surface-soft); border-right: 1px solid var(--border); }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 0 4px 28px; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 1.3125rem; font-weight: 500; line-height: 1.1; }
.brand small { display: block; font-size: 0.75rem; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
.sidebar-caption { font-size: 0.75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 0 12px; margin: 10px 0 16px; }
.main-nav { display: flex; flex-direction: column; gap: 7px; }
.main-nav a { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 12px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 0.8125rem; font-weight: 550; }
.main-nav a:hover { background: var(--surface-raised); color: var(--text); }
.main-nav a[aria-current="page"] { background: var(--wine); color: #fff; box-shadow: 0 5px 15px #0001; }
.nav-icon { display: inline-flex; }
.nav-count { font-size: 0.75rem; border: 1px solid currentColor; border-radius: 5px; padding: 0 4px; margin-left: auto; opacity: .95; }
.sidebar-bottom { margin-top: auto; display: flex; gap: 9px; padding: 28px 8px 0; color: var(--muted); border-top: 1px solid var(--border); }
.sidebar-bottom strong { font-size: 0.75rem; color: var(--text); }
.sidebar-bottom p { font-size: 0.75rem; margin: 5px 0 0; line-height: 1.7; }
.privacy-dot { width: 7px; height: 7px; background: var(--green); border-radius: 100%; flex: 0 0 auto; margin-top: 8px; }
.app-body { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 92px; padding: 20px 42px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.topbar-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eyebrow { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; font-weight: 650; letter-spacing: .16em; margin: 0 0 12px; }
.topbar-title .eyebrow { font-size: 0.75rem; margin: 0; color: var(--faint); }
#section-label { font-size: 0.8125rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar { border: 1px solid var(--border); color: var(--accent); background: var(--surface-raised); width: 34px; height: 34px; border-radius: 100%; display: grid; place-items: center; font-family: Georgia, serif; }
.user-chip strong { display: block; max-width: 190px; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { font-size: 0.75rem; color: var(--muted); }
main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 40px 42px 48px; flex: 1; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading .subtitle { color: var(--muted); max-width: 680px; margin-bottom: 0; font-size: 0.875rem; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 17px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text); font-size: 0.75rem; font-weight: 600; text-decoration: none; line-height: 1.5; white-space: nowrap; }
.button-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.button-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button-secondary { background: var(--surface); border-color: var(--border); }
.button-secondary:hover { background: var(--surface-raised); border-color: var(--faint); }
.button-quiet { color: var(--muted); padding: 9px 10px; }
.button-quiet:hover { color: var(--text); background: var(--surface-raised); }
.button-danger { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.button-small { min-height: 44px; padding: 8px 11px; font-size: 0.75rem; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); border-radius: 9px; }
.icon-button:hover { color: var(--text); background: var(--surface-raised); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); padding: 22px; border-radius: var(--radius); min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.75rem; margin-bottom: 14px; }
.stat-label svg { width: 16px; height: 16px; }
.stat-value { font-size: clamp(1.5rem, 2vw, 2.15rem); letter-spacing: -.04em; font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-note { display: block; color: var(--faint); font-size: 0.75rem; margin-top: 8px; }
.stat-card.income .stat-value { color: var(--green); }
.stat-card.expense .stat-value { color: var(--red); }
.stat-card.balance { border-top: 2px solid var(--accent); }
.two-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 22px; margin-bottom: 24px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 23px 24px; border-bottom: 1px solid var(--border); }
.panel-heading h2 { font-size: 1rem; margin: 0; }
.panel-content { padding: 24px; }
.panel-heading .button { margin: -8px 0; }
.section-heading { margin: 32px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 1.125rem; }
.empty-state { text-align: center; padding: 48px 22px; color: var(--muted); }
.empty-state > svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: 12px; }
.empty-state h2, .empty-state h3 { color: var(--text); font-size: 1.125rem; }
.empty-state p { font-size: 0.8125rem; max-width: 420px; margin: 0 auto 20px; }
.empty-state .button { margin-top: 2px; }
.notice { border: 1px solid var(--border); border-radius: 9px; padding: 15px 18px; color: var(--muted); font-size: 0.75rem; margin-bottom: 22px; overflow-wrap: anywhere; }
.notice strong { color: var(--text); }
.notice-error { color: var(--red); background: var(--red-bg); border-color: var(--red); }
.notice-error strong { color: var(--red); }
.notice-subtle { background: var(--surface-soft); line-height: 1.75; }
.notice-success { color: var(--green); background: var(--green-bg); border-color: var(--green); }
.toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.toolbar .field { flex: 1 1 180px; margin: 0; }
.toolbar .field.search-field { flex-grow: 2; min-width: 220px; }
.toolbar .field label { font-size: 0.75rem; color: var(--muted); }
.toolbar input, .toolbar select { min-height: 44px; padding: 10px 12px; font-size: 0.75rem; }
.result-count { color: var(--muted); font-size: 0.75rem; margin: -9px 0 18px; }
.archive-order-note { margin: 0 0 16px; }
.menu-results > .result-count { margin: 0 0 18px; }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.event-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.event-cover { height: 210px; display: flex; align-items: center; justify-content: center; background: var(--surface-soft); border-bottom: 1px solid var(--border); padding: 18px; color: var(--accent); position: relative; }
.event-cover img { width: 100%; height: 100%; object-fit: contain; }
.cover-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: Georgia, serif; font-size: 1.0625rem; color: var(--faint); }
.cover-placeholder > svg { width: 40px; height: 40px; color: var(--accent); }
.cover-placeholder small { font: .75rem -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.event-cover .badge { position: absolute; left: 15px; top: 15px; box-shadow: 0 2px 7px #0002; }
.event-card-body { padding: 21px; flex: 1; display: flex; flex-direction: column; }
.event-date { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 650; margin-bottom: 7px; }
.event-card h2, .event-card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.event-location { color: var(--muted); font-size: 0.75rem; display: flex; align-items: flex-start; gap: 6px; margin-bottom: 16px; }
.event-location svg { width: 14px; height: 14px; margin-top: 2px; }
.event-card-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: auto; }
.event-card-totals dt { font-size: 0.75rem; color: var(--muted); }
.event-card-totals dd { margin: 3px 0 0; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.event-card .button { margin-top: 18px; width: 100%; }
.badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 5px; padding: 3px 8px; font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-raised); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.open, .badge.settled, .badge.approved { background: var(--green-bg); color: var(--green); border-color: transparent; }
.badge.draft, .badge.planned { background: var(--gold-bg); color: var(--accent); border-color: transparent; }
.badge.closed { background: var(--surface-soft); }
.badge.void { background: var(--red-bg); color: var(--red); border-color: transparent; }
.text-income { color: var(--green); }
.text-expense { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 0.75rem; }
.back-button { margin: -6px 0 19px -10px; }
.detail-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.detail-intro h1 { font-size: clamp(1.8rem, 3vw, 2.65rem); }
.detail-metadata { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 0.75rem; }
.detail-metadata span { display: inline-flex; align-items: center; gap: 6px; }
.detail-metadata svg { width: 15px; height: 15px; }
.detail-menu { display: flex; gap: 20px; align-items: center; }
.detail-menu .menu-preview { flex: 0 0 90px; width: 90px; height: 120px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; display: grid; place-items: center; color: var(--accent); }
.detail-menu .menu-preview img { width: 100%; height: 100%; object-fit: contain; }
.detail-menu h3 { font-size: 0.9375rem; overflow-wrap: anywhere; }
.detail-menu p { margin-bottom: 8px; }
.table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 0.75rem; }
th { padding: 12px 18px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; background: var(--surface-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 15px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.table-main { font-weight: 550; display: block; min-width: 145px; max-width: 360px; overflow-wrap: anywhere; }
.table-sub { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 3px; max-width: 340px; overflow-wrap: anywhere; }
.amount-cell { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.voided-row { color: var(--muted); }
.voided-row .amount-cell { text-decoration: line-through; color: var(--muted); }
.row-actions { text-align: right; white-space: nowrap; }
.compact-list { list-style: none; padding: 0; margin: 0; }
.compact-list li + li { border-top: 1px solid var(--border); }
.compact-item { display: flex; align-items: center; gap: 14px; padding: 17px 24px; }
.compact-item .compact-content { min-width: 0; flex: 1; }
.compact-item h3 { font-size: 0.8125rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.compact-item p { font-size: 0.75rem; color: var(--muted); margin: 0; }
.compact-date { display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); width: 44px; height: 50px; flex: 0 0 auto; color: var(--accent); font-size: 1.1875rem; line-height: 1.2; }
.compact-date small { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.compact-item .button { flex: 0 0 auto; }
.menu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.menu-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.menu-card .menu-image { height: 215px; padding: 17px; background: var(--surface-soft); border-bottom: 1px solid var(--border); display: grid; place-items: center; }
.menu-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.menu-card-body { padding: 17px; display: flex; flex: 1; flex-direction: column; }
.menu-card h2 { font-size: 0.8125rem; line-height: 1.5; margin: 0 0 8px; overflow-wrap: anywhere; }
.menu-card p { font-size: 0.75rem; color: var(--muted); margin-bottom: 12px; }
.menu-card .menu-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.menu-buttons .button { padding-left: 10px; padding-right: 10px; }
.menu-card .associate-button { margin-top: 8px; justify-content: flex-start; }
.meeting-list { display: grid; gap: 14px; }
.meeting-card { display: flex; gap: 20px; align-items: flex-start; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.meeting-card .compact-date { width: 54px; height: 60px; font-size: 1.4375rem; }
.meeting-card-main { flex: 1; min-width: 0; }
.meeting-card-heading { display: flex; justify-content: space-between; gap: 16px; }
.meeting-card h2 { font-size: 1.125rem; margin: 0 0 8px; }
.meeting-card p { margin: 9px 0 0; font-size: 0.75rem; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.meeting-card .meeting-actions { display: flex; align-items: center; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.text-block { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8125rem; color: var(--muted); margin: 0; }
.attachment-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 17px; }
.attachment-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface-soft); min-width: 0; }
.attachment-item > svg { flex: 0 0 auto; color: var(--accent); }
.attachment-item a { font-size: 0.75rem; overflow-wrap: anywhere; }
.attachment-item small { font-size: 0.75rem; color: var(--muted); margin-left: auto; flex: 0 0 auto; }
.audio-player { width: 100%; margin-top: 12px; }
.form-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-shadow: var(--shadow); }
.form-dialog-wide { width: min(900px, calc(100vw - 32px)); }
.form-dialog-small { width: min(520px, calc(100vw - 32px)); }
.form-dialog::backdrop { background: #080706bf; backdrop-filter: blur(4px); }
.form-dialog form { padding: 28px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-heading h2 { font-size: 1.5625rem; margin-bottom: 0; }
.dialog-heading .eyebrow { margin-bottom: 8px; }
.dialog-heading .icon-button { margin: -5px -5px 0 0; }
.form-intro { color: var(--muted); font-size: 0.8125rem; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 19px; min-width: 0; }
.span-2 { grid-column: span 2; }
.field label { font-size: 0.75rem; font-weight: 600; color: var(--text); }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 12px 13px; min-height: 46px; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
textarea { resize: vertical; line-height: 1.65; }
select { cursor: pointer; }
.field-help { color: var(--muted); font-size: 0.75rem; line-height: 1.65; margin: 0; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 14px; top: 12px; color: var(--muted); }
.input-affix input { padding-left: 34px; }
.dialog-actions { border-top: 1px solid var(--border); padding-top: 20px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); border-radius: 8px; font-size: 0.75rem; padding: 13px 15px; margin-bottom: 18px; }
.editor-section { margin: 8px 0 22px; border: 1px solid var(--border); border-radius: 9px; }
.editor-section summary { cursor: pointer; min-height: 48px; padding: 14px 17px; font-weight: 600; font-size: 0.8125rem; }
.editor-section summary svg { margin: 0 7px -5px 0; }
.editor-section-body { padding: 5px 18px 18px; }
.editor-section-body > .button { margin-bottom: 18px; }
.editor-section-body.form-grid { padding-top: 14px; }
.editor-section-body .notice { margin-bottom: 14px; }
.upload-dropzone { border: 1px dashed var(--faint); background: var(--surface-soft); border-radius: 12px; padding: 25px; text-align: center; margin: 15px 0 21px; }
.upload-illustration { display: block; color: var(--accent); margin: 2px auto 10px; }
.upload-illustration svg { width: 32px; height: 32px; }
.upload-dropzone label { display: block; font-size: 0.875rem; font-weight: 550; margin-bottom: 16px; }
.upload-dropzone input { font-size: 0.75rem; background: var(--surface); }
.upload-dropzone .field-help { margin-top: 13px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 90px 20px; font-size: 0.8125rem; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 100%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 24px; right: 24px; max-width: min(460px, calc(100vw - 40px)); background: var(--text); color: var(--bg); padding: 15px 20px; border-radius: 10px; box-shadow: var(--shadow); z-index: 80; font-size: 0.8125rem; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 42px; padding: 19px 0 23px; border-top: 1px solid var(--border); color: var(--faint); font-size: 0.75rem; }
.app-footer a { padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center; gap: 5px; }
.readonly-note { font-size: 0.75rem; color: var(--muted); padding: 16px 20px; border-left: 2px solid var(--accent); background: var(--surface); margin: 20px 0; }
.form-saving { cursor: progress; opacity: .65; }
.saving-notice { padding: 12px 18px; margin: 0; color: var(--text); background: var(--surface); border-bottom: 1px solid var(--border); }
.form-saving .dialog-actions button { pointer-events: none; }
.login-page { min-height: 100svh; display: grid; place-items: center; padding: 32px 20px; background: radial-gradient(ellipse at 50% 0%, var(--gold-bg), transparent 68%), var(--bg); }
main.login-card { width: min(100%, 470px); max-width: 470px; padding: 35px 38px; border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.login-card > img { display: block; width: 72px; height: 72px; object-fit: contain; margin: 0 auto 24px; }
.login-card h1 { font-family: Georgia, serif; font-size: clamp(1.6875rem, 5vw, 2.125rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.2; }
.login-card > p { font-size: 0.75rem; color: var(--muted); line-height: 1.75; }
.login-card > .eyebrow { color: var(--accent); font-size: 0.75rem; letter-spacing: .13em; margin-bottom: 12px; }
.login-card form { text-align: left; margin: 25px 0 20px; }
.login-card label { display: block; font-size: 0.75rem; font-weight: 600; margin: 0 0 7px; }
.login-card input:not([type="hidden"]) { margin-bottom: 18px; min-height: 48px; }
.login-card button[type="submit"] { display: block; width: 100%; min-height: 48px; color: #fff; background: var(--primary); border: 1px solid var(--primary); border-radius: 8px; font-size: 0.8125rem; font-weight: 600; padding: 12px 16px; margin-top: 5px; }
.login-card button[type="submit"]:hover { background: var(--primary-hover); }
.login-card > a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px; font-size: 0.75rem; color: var(--accent); text-decoration: underline; }
.login-card > p:last-child { font-size: 0.75rem; margin: 16px 0 0; padding-top: 17px; border-top: 1px solid var(--border); }
.login-card [role="alert"] { padding: 12px 15px; border: 1px solid var(--red); color: var(--red); border-radius: 8px; background: var(--red-bg); }
@media (min-width: 1600px) { .event-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1240px) {
  .app-shell { grid-template-columns: 222px minmax(0, 1fr); }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .main-nav a { font-size: 0.75rem; gap: 9px; padding-left: 10px; padding-right: 10px; }
  main { padding: 32px 28px 40px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .app-footer { margin-left: 28px; margin-right: 28px; }
  .stats-grid { gap: 11px; }
  .stat-card { padding: 18px; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-columns { grid-template-columns: 1fr; }
  .page-heading { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px 22px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 0 18px; }
  .brand img { width: 42px; height: 42px; }
  .brand strong { font-size: 1.3125rem; }
  .sidebar-caption, .sidebar-bottom { display: none; }
  .main-nav { flex-direction: row; gap: 5px; flex-wrap: wrap; }
  .main-nav a { flex: 1 1 auto; min-height: 44px; padding: 9px 12px; font-size: 0.75rem; justify-content: center; }
  .nav-count { margin-left: 0; }
  .topbar { height: 76px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.6875rem; }
  .event-cover { height: 230px; }
}
@media (max-width: 600px) {
  body { font-size: 0.875rem; }
  .sidebar { padding: 16px 16px 10px; }
  .brand { padding-bottom: 15px; }
  .main-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .main-nav a { justify-content: flex-start; padding: 9px 10px; font-size: 0.75rem; min-width: 0; }
  .main-nav svg { width: 17px; height: 17px; }
  .nav-count { margin-left: auto; font-size: 0.75rem; }
  .topbar { padding: 12px 16px; height: auto; min-height: 72px; gap: 8px; }
  .topbar-title .eyebrow { display: none; }
  .topbar-title { max-width: 100px; }
  #section-label { font-size: 0.75rem; }
  .topbar-actions { gap: 7px; }
  .topbar-actions { flex-shrink: 0; }
  .user-chip { gap: 6px; }
  .user-chip strong { font-size: 0.75rem; max-width: 88px; }
  .user-chip small { font-size: 0.75rem; }
  .user-avatar { display: none; }
  #logout-button { padding: 9px; min-width: 44px; }
  #logout-button > span:last-child { display: none; }
  main { padding: 28px 16px 32px; }
  h1 { font-size: 2rem; }
  .page-heading { gap: 14px; margin-bottom: 24px; }
  .page-heading .subtitle { font-size: 0.75rem; }
  .heading-actions { width: 100%; gap: 8px; }
  .heading-actions .button { flex: 1; white-space: normal; }
  .button { font-size: 0.75rem; padding: 10px 12px; }
  .stats-grid { gap: 9px; margin-bottom: 20px; }
  .stat-card { padding: 15px 13px; border-radius: 12px; }
  .stat-label { font-size: 0.75rem; gap: 5px; margin-bottom: 10px; align-items: flex-start; }
  .stat-label svg { width: 14px; height: 14px; }
  .stat-value { font-size: 1.5rem; }
  .stat-note { font-size: 0.75rem; }
  .two-columns { gap: 18px; }
  .panel-heading { padding: 19px 17px; }
  .panel-heading h2 { font-size: 0.9375rem; }
  .panel-content { padding: 18px; }
  .event-grid { grid-template-columns: 1fr; gap: 17px; }
  .event-cover { height: 235px; }
  .event-card-body { padding: 20px; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .menu-card .menu-image { height: 175px; padding: 10px; }
  .menu-card-body { padding: 13px 10px; }
  .menu-card h2 { font-size: 0.75rem; }
  .menu-card p { font-size: 0.75rem; }
  .menu-card .button { width: 100%; font-size: 0.75rem; }
  .menu-buttons { width: 100%; }
  .menu-grid .cover-placeholder { font-size: 0.8125rem; }
  .menu-grid .cover-placeholder small { font-size: 0.75rem; }
  .toolbar { gap: 10px; }
  .toolbar .field { flex-basis: calc(50% - 10px); }
  .toolbar .field.search-field { flex-basis: 100%; }
  .detail-intro { flex-direction: column; }
  .detail-intro .heading-actions { padding-top: 0; }
  .detail-metadata { gap: 10px; font-size: 0.75rem; }
  .detail-menu { gap: 13px; }
  .detail-menu .menu-preview { flex-basis: 70px; width: 70px; height: 100px; }
  .detail-menu .button { font-size: 0.75rem; padding: 9px; }
  .compact-item { padding: 16px; gap: 10px; }
  .compact-item .button { font-size: 0.75rem; padding: 8px; }
  .compact-date { width: 39px; height: 47px; }
  .meeting-card { padding: 18px 15px; gap: 13px; }
  .meeting-card .compact-date { width: 42px; height: 52px; font-size: 1.25rem; }
  .meeting-card-heading { flex-wrap: wrap; gap: 3px; }
  .meeting-card h2 { font-size: 1rem; }
  .meeting-card p { font-size: 0.75rem; }
  .form-dialog { max-height: calc(100dvh - 24px); width: calc(100vw - 20px); border-radius: 13px; }
  .form-dialog form { padding: 22px 17px; }
  .dialog-heading { gap: 10px; }
  .dialog-heading h2 { font-size: 1.4375rem; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .dialog-actions { gap: 8px; }
  .dialog-actions .button { flex: 1; padding: 11px 9px; font-size: 0.75rem; white-space: normal; }
  input:not([type="checkbox"]), select, textarea { font-size: 1rem; }
  .toolbar input, .toolbar select { font-size: 1rem; }
  .editor-section-body { padding: 5px 12px 15px; }
  .editor-section summary { padding: 14px 12px; font-size: 0.75rem; }
  .attachment-item { flex-wrap: wrap; }
  .attachment-item small { margin-left: 30px; }
  .upload-dropzone { padding: 20px 15px; }
  .app-footer { margin: 0 16px; padding-top: 17px; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 0.75rem; }
  .toast { right: 14px; bottom: 14px; padding: 14px 17px; font-size: 0.75rem; }
  td { padding: 13px 14px; }
  th { padding: 12px 14px; }
  .notice { padding: 13px 15px; font-size: 0.75rem; }
  .login-page { padding: 22px 13px; }
  main.login-card { padding: 28px 23px; border-radius: 13px; }
  .login-card h1 { font-size: 1.875rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .spinner { border-color: var(--accent); }
}


/* A quiet workspace; text sizes follow the root and never use CSS zoom. */
:root { font-size: 100%; --radius: 8px; --shadow: 0 8px 28px #0001; }
:root[data-font-size="125"] { font-size: 125%; }
:root[data-font-size="150"] { font-size: 150%; }
:root[data-font-size="175"] { font-size: 175%; }
:root[data-font-size="200"] { font-size: 200%; }
:root[data-theme="light"] {
  --bg: #f5f5f3; --surface: #fff; --surface-raised: #f3f3f1;
  --surface-soft: #f0f0ed; --text: #262725; --muted: #5b5e59;
  --faint: #646760; --border: #d4d6cf; --accent: #6d343c;
  --gold-bg: #f3eddc; --shadow: 0 8px 28px #2426200d;
}
body { font-size: 1rem; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.text-size-controls { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; max-width: 100%; }
.text-size-label { margin-right: 4px; font-size: .8125rem; color: var(--muted); }
.text-size-button { min-width: 44px; min-height: 44px; padding: 7px 9px; font-size: .875rem; font-weight: 600; line-height: 1.5; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; }
.text-size-button:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-soft); }
.text-size-reset { font-variant-numeric: tabular-nums; }
.sidebar { padding: 24px 16px; overflow-y: auto; }
.brand { padding-bottom: 24px; }
.brand strong { font-family: inherit; font-size: 1.25rem; font-weight: 650; }
.brand small { font-size: .75rem; letter-spacing: 0; }
.main-nav a { font-size: .875rem; }
.main-nav a[aria-current="page"] { box-shadow: none; }
.sidebar-bottom { padding-top: 18px; }
.topbar { height: auto; min-height: 84px; padding: 16px 28px; flex-wrap: wrap; }
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; flex: 1 1 auto; gap: 10px; min-width: 0; }
.topbar-title { max-width: none; }
.topbar-title .eyebrow { display: none; }
#section-label { font-size: .9375rem; }
.user-chip { min-width: 0; max-width: 100%; }
.user-chip strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: .8125rem; }
.user-chip small { font-size: .75rem; }
.user-avatar { display: none; }
main { padding: 30px 28px 38px; }
h1 { font-size: 1.75rem; letter-spacing: -.025em; }
.page-heading { flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-heading > div, .heading-actions, .detail-intro > div { min-width: 0; max-width: 100%; }
.page-heading .subtitle { font-size: 1rem; }
.button { white-space: normal; overflow-wrap: anywhere; font-size: .875rem; text-align: center; max-width: 100%; }
.icon-button { flex: 0 0 auto; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.stat-card { padding: 18px; }
.stat-label, .stat-note { font-size: .8125rem; }
.stat-value { font-size: 1.75rem; }
.stat-card.balance { border-top: 1px solid var(--border); }
.two-columns { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 20px; }
.panel { overflow: visible; }
.panel-heading { padding: 18px 20px; flex-wrap: wrap; }
.panel-heading h2 { font-size: 1.125rem; }
.panel-heading .button { margin: 0; }
.panel-content { padding: 20px; }
.eyebrow { letter-spacing: .05em; }
.notice, .form-intro, .field label, .toolbar .field label { font-size: .875rem; }
.field-help, .table-sub, .stat-note, .result-count, .small { font-size: .8125rem; }
.empty-state { padding: 28px 20px; }
.empty-state > svg { display: none; }
.empty-state p { font-size: .875rem; }
.empty-state h2, .empty-state h3 { font-size: 1.125rem; }
.toolbar .field, .toolbar .field.search-field { min-width: 0; flex: 1 1 13rem; }
.toolbar input, .toolbar select { font-size: 1rem; }
.event-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.menu-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.menu-card h2 { font-size: .9375rem; }
.menu-card p, .event-date, .event-location { font-size: .8125rem; }
.menu-card .button, .detail-menu .button, .compact-item .button { font-size: .875rem; }
.event-card h2, .event-card h3 { font-size: 1.25rem; }
.badge { white-space: normal; font-size: .75rem; letter-spacing: 0; text-transform: none; }
.event-cover .badge { max-width: calc(100% - 30px); }
.event-card-totals { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.event-card-totals dt { font-size: .8125rem; }
.event-card-totals dd { font-size: 1rem; overflow-wrap: anywhere; }
.detail-intro { flex-wrap: wrap; }
.detail-intro h1 { font-size: 1.75rem; }
.detail-menu { flex-wrap: wrap; }
.detail-menu > div { min-width: 0; max-width: 100%; }
.detail-metadata { font-size: .875rem; }
table { font-size: .875rem; }
th { font-size: .75rem; }
.table-scroll { min-width: 0; border-radius: var(--radius); }
.table-main { min-width: min(145px, 40vw); }
.compact-item { flex-wrap: wrap; padding: 16px 20px; }
.compact-item .compact-content { flex-basis: 9rem; }
.compact-item h3 { font-size: .9375rem; }
.compact-item p { font-size: .8125rem; }
.compact-date { height: auto; min-height: 50px; padding: 5px; font-size: 1.125rem; }
.compact-date small { font-size: .75rem; }
.meeting-card { flex-wrap: wrap; padding: 20px; }
.meeting-card-heading { flex-wrap: wrap; }
.meeting-card-main { flex-basis: 12rem; }
.meeting-card h2 { font-size: 1.125rem; }
.meeting-card p { font-size: .875rem; }
.meeting-card .compact-date { height: auto; min-height: 54px; font-size: 1.25rem; }
.form-dialog { width: min(44rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; overflow-x: hidden; border-radius: 8px; }
.form-dialog-wide { width: min(58rem, calc(100vw - 24px)); }
.form-dialog-small { width: min(34rem, calc(100vw - 24px)); }
.form-dialog form { padding: 24px; min-width: 0; }
.dialog-heading h2 { font-size: 1.5rem; }
.dialog-heading .eyebrow { display: none; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.span-2 { grid-column: 1 / -1; }
.dialog-actions { flex-wrap: wrap; }
.dialog-actions .button { font-size: .875rem; }
input:not([type="checkbox"]), select, textarea { font-size: 1rem; max-width: 100%; }
.input-affix > span { top: 12px; }
.input-affix input { padding-left: 2em; }
.editor-section summary { font-size: .9375rem; }
.attachment-item { flex-wrap: wrap; }
.attachment-item a { font-size: .875rem; min-width: 0; }
.attachment-item small { font-size: .8125rem; margin-left: 0; }
.app-footer { flex-wrap: wrap; font-size: .75rem; margin: 0 28px; }
.login-page { background: var(--bg); }
main.login-card { width: min(100%, 32rem); max-width: 32rem; padding: 28px; border-top-width: 1px; border-radius: 8px; box-shadow: none; }
.login-card > img { width: 54px; height: 54px; margin-bottom: 18px; }
.login-card h1 { font-family: inherit; font-size: 1.75rem; font-weight: 600; letter-spacing: -.025em; }
.login-card > p, .login-card label, .login-card > a { font-size: .875rem; }
.login-card button[type="submit"] { font-size: 1rem; }
.login-card .text-size-controls { margin: 4px 0 0; }
:root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .app-shell { grid-template-columns: 1fr; }
:root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
:root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .sidebar-bottom { display: none; }
:root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .main-nav { flex-direction: row; flex-wrap: wrap; }
:root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .main-nav a { flex: 1 1 12rem; }
@media (max-width: 600px) {
  .sidebar { padding: 16px; }
  .topbar { padding: 12px 16px; align-items: flex-start; }
  .topbar-title { flex: 1 0 100%; }
  .topbar-actions { justify-content: flex-start; flex: 1 1 100%; width: 100%; }
  .text-size-controls { justify-content: flex-start; }
  main { padding: 24px 16px 30px; }
  .stats-grid, .two-columns, .event-grid, .menu-grid { grid-template-columns: 1fr; }
  .main-nav { grid-template-columns: 1fr; }
  .main-nav a { font-size: .875rem; }
  #logout-button > span:last-child { display: inline; }
  .form-dialog form { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-actions .button { flex: 1 1 100%; }
  .panel-heading, .panel-content { padding: 16px; }
  .panel-heading .button { width: 100%; }
  .app-footer { margin: 0 16px; font-size: .75rem; }
  main.login-card { padding: 24px 18px; }
}
@media (max-width: 600px) {
  :root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .dialog-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  :root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .dialog-heading > .icon-button { grid-row: 1; justify-self: end; margin: 0; }
  :root:is([data-font-size="150"], [data-font-size="175"], [data-font-size="200"]) .dialog-heading > div { grid-row: 2; min-width: 0; }
}


/* Explanations stay available beside the task, without crowding the register. */
.context-help { margin: 0 0 20px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.context-help > summary { cursor: pointer; min-height: 44px; padding: 11px 14px; color: var(--text); font-weight: 550; }
.context-help > .context-help-body, .context-help > p { margin: 0; padding: 0 14px 14px; }
.context-help-body p { margin: 0 0 10px; }
.context-help-body p:last-child { margin-bottom: 0; }
.context-help-body ul { padding-left: 1.25em; margin: 0 0 14px; }
.context-help-body li + li { margin-top: 7px; }
.field > .context-help { margin: 0; }
.status-note { font-size: .875rem; color: var(--muted); margin-bottom: 20px; }
.login-card > .context-help { margin: 16px 0 4px; text-align: left; }
.page-heading h1 { margin-bottom: 0; }
.stat-label { margin-bottom: 10px; }
.empty-state { padding: 24px 18px; }
.empty-state h2, .empty-state h3 { margin-bottom: 0; }
.empty-state p { margin: 8px auto 0; }
.empty-state .button { margin-top: 16px; }

/* Member records stay compact; financial columns scroll inside their own panel. */
.member-list { list-style: none; margin: 0; padding: 0; }
.member-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 18px; }
.member-list > .member-row + .member-row { border-top: 1px solid var(--border); }
.member-copy { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.member-contacts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.member-contacts a { min-width: 0; overflow-wrap: anywhere; }
.member-row > .button { margin-left: auto; }
.event-members { min-width: 0; margin-bottom: 28px; }
.event-members > .context-help, .event-members > .notice { margin-top: 14px; }
.member-balances td:first-child { min-width: 12rem; max-width: 24rem; white-space: normal; overflow-wrap: anywhere; }
.member-balances .row-actions { min-width: 13rem; white-space: normal; }
.member-balances .row-actions .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; margin-bottom: 4px; }
.member-balances .table-sub { display: block; white-space: normal; }
.reimbursement-choice { padding: 24px; display: grid; gap: 12px; min-width: 0; }
.reimbursement-choice h2 { font-size: 1.5rem; margin: 0 0 8px; }
.reimbursement-choice .button { white-space: normal; overflow-wrap: anywhere; text-align: left; }
@media (max-width: 600px) {
  .member-row { align-items: flex-start; padding: 14px; }
  .member-copy { flex-basis: 100%; }
  .member-row > .button { margin-left: 0; }
  .event-members .section-heading > .button { width: 100%; }
  .reimbursement-choice { padding: 20px 16px; }
}

/* Keep wide financial tables inside the panel at every text size. */
.panel.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; overscroll-behavior-x: contain; }

/* Net balances and statistics share the same compact, reflowing controls. */
.event-quota-note { width: 100%; color: var(--muted); font-size: .9375rem; margin: 10px 0 0; }
.preset-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.settlement-preview { padding: 16px; background: var(--surface-soft); border-radius: 8px; margin: 0 0 20px; }
.settlement-definitions { margin: 0; }
.settlement-definitions > div, .metric-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.settlement-definitions > div:last-child, .metric-row:last-child { border-bottom: 0; }
.settlement-definitions dt { color: var(--muted); overflow-wrap: anywhere; }
.settlement-definitions dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric-row > span { min-width: 0; overflow-wrap: anywhere; }
.metric-row > strong { font-variant-numeric: tabular-nums; }
.stats-table { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.stats-table td:first-child { white-space: normal; min-width: 12rem; overflow-wrap: anywhere; }
.stats-table .table-sub { display: block; max-width: 22rem; white-space: normal; }
.panel > .toolbar-field { padding: 0 18px 16px; }
.category-metric + .category-metric { margin-top: 16px; }
.category-metric .metric-row { border: 0; }
.cost-meter { display: block; width: 100%; height: 12px; accent-color: var(--primary); }
.cost-meter::-webkit-meter-bar { background: var(--surface-soft); border: 0; border-radius: 20px; }
.cost-meter::-webkit-meter-optimum-value { background: var(--primary); border-radius: 20px; }
.partial-balances { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) {
  .settlement-preview { padding: 12px; }
  .metric-row, .settlement-definitions > div { gap: 4px 12px; }
  .preset-actions .button { flex: 1 1 auto; }
}

/* Touch controls and compact registries for the devices used at the table. */
button, .button, .main-nav a, .icon-button { touch-action: manipulation; }
button, .button, .main-nav a { min-height: 44px; }
.registry-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.registry-tabs .button { flex: 0 1 auto; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.member-contacts a { display: inline-flex; align-items: center; min-height: 44px; }
.founder-tag { display: inline-flex; align-items: center; margin: 4px 0 0 10px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 20px; color: var(--accent); background: var(--gold-bg); font-size: .75rem; font-weight: 600; vertical-align: middle; }
.meeting-registers { margin: -12px 0 18px; }
.meeting-registers .button { color: var(--muted); }
.form-dialog { max-width: calc(100vw - 12px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding-block: 20px 6rem; }
.form-dialog input, .form-dialog select, .form-dialog textarea { min-width: 0; }
.dialog-actions { position: sticky; bottom: -24px; padding-top: 14px; padding-bottom: 12px; background: var(--surface); z-index: 2; border-top: 1px solid var(--border); }
.welcome-toast { position: fixed; top: max(20px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 24px); padding: 12px 12px 12px 18px; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); color: var(--text); background: var(--surface); animation: welcome-arrive .22s ease-out; }
.welcome-toast strong { font-size: 1rem; min-width: 0; }
.welcome-emblem { display: inline-flex; color: var(--accent); }
@keyframes welcome-arrive { from { opacity: 0; margin-top: -8px; } to { opacity: 1; margin-top: 0; } }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 20px 10px; overflow: visible; min-width: 0; }
  .brand { padding-bottom: 12px; gap: 12px; }
  .brand img { width: 38px; height: 38px; }
  .brand strong { font-size: 1rem; }
  .brand small { font-size: .6875rem; }
  .sidebar-bottom, .sidebar-caption { display: none; }
  .main-nav { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 5px; width: 100%; min-width: 0; overflow-x: auto; padding-bottom: 4px; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
  .main-nav a { flex: 0 0 auto; padding: 10px 12px; white-space: nowrap; min-height: 46px; }
  .topbar { min-height: 64px; padding: 12px 20px; }
  .app-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .sidebar { padding: 12px 12px 6px; }
  .brand { padding-bottom: 8px; }
  .brand small { display: none; }
  .main-nav a { font-size: .8125rem; gap: 7px; padding: 9px 11px; }
  .main-nav .nav-count { margin-left: 3px; }
  .topbar { padding: 10px 12px; gap: 6px; }
  .topbar-title { display: none; }
  .topbar-actions { gap: 6px; justify-content: flex-start; }
  .topbar-actions .user-chip { order: -1; flex: 1 0 100%; }
  .user-chip > span:not(.user-avatar) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .user-chip strong { font-size: .75rem; max-width: none; }
  .user-chip small { display: inline; margin-left: 0; font-size: .75rem; }
  .text-size-label { display: none; }
  .text-size-controls { gap: 3px; }
  .text-size-button { min-width: 44px; padding-inline: 6px; }
  #logout-button > span:last-child { display: none; }
  #logout-button, .theme-toggle, #refresh-state { min-width: 44px; min-height: 44px; }
  main { padding: 20px 12px 26px; }
  .page-heading { margin-bottom: 18px; }
  .registry-tabs .button { flex: 1 1 8rem; }
  .member-row { gap: 8px; }
  .member-actions { width: 100%; margin-left: 0; }
  .member-actions .button { flex: 1 1 auto; }
  .member-contacts { gap: 0 14px; }
  .founder-tag { margin-left: 8px; }
  .form-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .form-dialog form { padding: 18px 14px; }
  .dialog-actions { bottom: -18px; }
  .welcome-toast { gap: 8px; padding-left: 12px; }
  .welcome-toast strong { font-size: .9375rem; }
}
@media (prefers-reduced-motion: reduce) { .welcome-toast { animation: none; } }
