:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #6b6f76;
  --surface: #ffffff;
  --soft: #f1f3f4;
  --line: #d9dde1;
  --accent: #a8127d;
  --accent-soft: #f3d9ea;
  --cyan: #1489aa;
  --green: #247b53;
  --red: #bd2f3e;
  --amber: #ad6814;
  --header: #252525;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(32, 33, 36, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
[data-theme="cyan"] { --accent: #087f9d; --accent-soft: #d5eef4; }
[data-theme="green"] { --accent: #267a4a; --accent-soft: #d9eee2; }
[data-theme="mono"] { --accent: #444; --accent-soft: #e2e2e2; }

* { box-sizing: border-box; }
html { min-height: 100%; background: #f7f8f9; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: #f7f8f9; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.is-login { background: var(--header); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #252525 0 55%, #a8127d 55%); }
.login-panel { width: min(100%, 430px); background: var(--surface); padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow); }
.login-logo { width: 118px; height: 118px; object-fit: contain; display: block; margin: 0 auto 24px; }
.login-panel h1 { margin: 4px 0 8px; font-size: 2rem; }
.login-form { display: grid; gap: 16px; margin: 28px 0 20px; }
.password-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.legal { display: block; text-align: center; color: var(--muted); font-size: .9rem; }

.app-header { position: sticky; top: 0; z-index: 50; min-height: 72px; display: grid; grid-template-columns: 190px minmax(0, 1fr) 44px; align-items: center; gap: 16px; padding: 8px max(16px, calc((100vw - 1360px)/2)); color: white; background: var(--header); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 750; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.main-nav { display: grid; grid-template-columns: repeat(6, minmax(72px, 1fr)); height: 56px; }
.main-nav button { position: relative; border: 0; color: #d7d7d7; background: transparent; display: grid; grid-template-columns: 28px auto; align-items: center; justify-content: center; gap: 7px; padding: 5px 8px; border-radius: 6px; }
.main-nav button:hover { background: rgba(255,255,255,.08); }
.main-nav button.active { color: white; background: rgba(168,18,125,.78); }
.main-nav img { width: 28px; height: 28px; object-fit: contain; }
.main-nav b { position: absolute; top: 3px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e73f50; color: white; font-size: 11px; line-height: 18px; text-align: center; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; font-size: 1.35rem; }
.app-header > .icon-button { color: white; background: transparent; border-color: rgba(255,255,255,.25); }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-actions .icon-button { color: white; background: transparent; border-color: rgba(255,255,255,.25); }
#account-button img { width: 26px; height: 26px; object-fit: contain; }
#network-status { display: flex; align-items: center; gap: 4px; color: #ffb9bd; font-size: .75rem; }
#network-status img { width: 24px; height: 24px; object-fit: contain; }

.workspace { width: min(100%, 1120px); margin: 0 auto; padding: 34px 28px 120px; }
.module { display: none; min-height: calc(100vh - 140px); }
.module.active { display: block; animation: reveal .16s ease-out; }
@keyframes reveal { from { opacity: .5; transform: translateY(3px); } }
.module-head { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.module-head h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); margin: 0; line-height: 1.1; }
.module-head > div { flex: 1; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.muted { color: var(--muted); }
.loading-state { min-height: 180px; display: grid; place-items: center; color: #7f858b; }
.loading-state::before { content: ""; width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

label { display: grid; gap: 6px; font-size: .88rem; color: var(--muted); font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,18,125,.12); }
textarea { resize: vertical; min-height: 92px; }
.primary, .secondary, .ghost, .danger { min-height: 40px; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 700; }
.primary { background: var(--accent); color: white; }
.secondary { background: var(--cyan); color: white; }
.ghost { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.danger { background: var(--red); color: white; }
.wide { width: 100%; }
.centered { display: block; margin: 18px auto; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.icon-label { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.icon-label > img { width: 25px; height: 25px; object-fit: contain; }
.alert { padding: 11px 13px; border-radius: 6px; margin: 14px 0; }
.alert.error { background: #fee8ea; color: #8d1724; }
.alert.success { background: #e1f2e8; color: #155c3a; }

.overview-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.overview-item { grid-column: span 4; min-height: 140px; border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: 20px; text-align: left; color: inherit; }
.overview-item:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(32,33,36,.08); }
.overview-item.wide { grid-column: span 8; }
.overview-item.full { grid-column: 1 / -1; }
.overview-item small { display: block; color: var(--muted); margin-bottom: 10px; }
.overview-item strong { display: block; font-size: 1.35rem; margin-bottom: 5px; }
.overview-item.chat { border-left-color: var(--cyan); }
.overview-item.finance { border-left-color: var(--green); }
.overview-item.notes { border-left-color: var(--amber); }
.overview-item.website { display: none; border-left-color: var(--cyan); text-decoration: none; }
.admin-log { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

.avatar { width: 34px; height: 42px; object-fit: contain; vertical-align: middle; flex: 0 0 auto; }
.avatar.small { width: 26px; height: 32px; }
.avatar.large { width: 46px; height: 58px; }
.avatar-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; }
.avatar-button { border: 0; padding: 0; background: transparent; border-radius: 4px; }
.avatar-button.selected { outline: 2px solid var(--accent); outline-offset: 1px; }

#chat-pinned { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.chat-conversation-toolbar { display: flex; align-items: center; gap: 8px; margin: -8px 0 14px; }
.conversation-list { min-width: 0; flex: 1; display: flex; gap: 7px; overflow-x: auto; padding: 3px 1px 8px; scrollbar-width: thin; }
.conversation { position: relative; flex: 0 0 auto; display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 6px; min-height: 42px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 22px; background: white; color: var(--ink); }
.conversation.active { border-color: var(--accent); background: var(--accent-soft); }
.conversation b { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: white; font-size: .7rem; line-height: 19px; }
.conversation small { grid-column: 2 / -1; color: var(--muted); font-size: .64rem; line-height: .7; }
.member-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.member-picker .avatar-button { width: 86px; min-height: 76px; display: grid; justify-items: center; gap: 3px; padding: 5px; color: var(--ink); font-size: .7rem; }
.member-picker .avatar-button:disabled { cursor: default; opacity: 1; }
.conversation-icons button { border: 1px solid transparent; border-radius: 6px; background: var(--soft); font-size: 1.35rem; }
.conversation-icons button.selected { border-color: var(--accent); background: var(--accent-soft); }
.pinned { flex: 0 0 min(300px, 82vw); display: grid; grid-template-columns: minmax(0,1fr) auto; border: 1px solid var(--line); background: var(--soft); border-radius: 6px; overflow: hidden; }
.pinned button { min-width: 0; border: 0; background: transparent; padding: 8px 10px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pinned .unpin { width: 34px; padding: 0; text-align: center; font-size: 1.15rem; }
.chat-list { display: flex; flex-direction: column; gap: 10px; min-height: 360px; padding: 18px 2px; }
.system-message { align-self: center; max-width: 90%; padding: 5px 10px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: .78rem; text-align: center; }
.message-row { position: relative; display: flex; align-items: flex-end; gap: 8px; width: 100%; max-width: 100%; }
.message-row.has-readers { padding-right: 74px; }
.message-row.mine { justify-content: flex-end; }
.message-row.theirs { align-self: flex-start; }
.message-row.mine .message-actions { order: 1; }
.message-row.mine .message-bubble { order: 2; }
.message-row.mine > .avatar { order: 3; }
.message-bubble { position: relative; min-width: 105px; max-width: 650px; padding: 10px 12px 7px; border-radius: 8px; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.mine .message-bubble { background: var(--accent-soft); }
.message-author { font-size: .75rem; color: var(--accent); font-weight: 750; margin-bottom: 4px; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.message-time { text-align: right; color: var(--muted); font-size: .7rem; margin-top: 4px; }
.message-actions { display: flex; gap: 4px; opacity: .25; transition: opacity .15s; }
.message-row:hover .message-actions, .message-actions:focus-within { opacity: 1; }
.message-row.flash .message-bubble { animation: message-flash .9s ease; }
@keyframes message-flash { 50% { filter: brightness(1.3); box-shadow: 0 0 0 3px var(--accent); } }
.message-actions button { width: 34px; height: 34px; display: grid; place-items: center; padding: 4px; border: 0; border-radius: 50%; background: #35383c; }
.message-actions img { width: 24px; height: 24px; object-fit: contain; }
.message-actions [data-action="reply"] img { width: 28px; height: 28px; }
.reply-preview { border-left: 3px solid var(--accent); background: rgba(0,0,0,.05); padding: 6px 8px; margin-bottom: 7px; font-size: .78rem; color: var(--muted); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 2px 7px; }
.reaction.mine { border-color: var(--accent); }
.readers { position: absolute; right: 0; bottom: 4px; display: flex; justify-content: flex-end; gap: 0; max-width: 70px; border: 0; background: transparent; padding: 0; }
.readers .avatar + .avatar { margin-left: -7px; }
.attachment-link { display: block; color: inherit; }
.attachment-image { display: block; width: min(420px, 68vw); max-height: 420px; object-fit: cover; border-radius: 5px; cursor: zoom-in; }
.attachment-link.missing { pointer-events: none; cursor: default; }
.attachment-image.missing { cursor: default; }
.attachment-file { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 650; }
.typing { width: max-content; display: flex; align-items: center; gap: 7px; padding: 6px 10px; color: var(--muted); background: var(--soft); border-radius: 12px; font-size: .82rem; }
.typing img { width: 34px; height: 20px; object-fit: cover; border-radius: 8px; }
.chat-composer { position: sticky; bottom: 8px; z-index: 20; display: grid; grid-template-columns: auto auto auto minmax(100px,1fr) auto; align-items: end; gap: 8px; background: rgba(247,248,249,.94); backdrop-filter: blur(10px); padding: 10px 0; }
.chat-composer textarea { min-height: 44px; max-height: 150px; resize: none; }
.chat-composer .send { display: flex; align-items: center; justify-content: center; gap: 5px; }
.chat-composer .send img { width: 24px; height: 24px; object-fit: contain; }
.icon-upload { min-width: 58px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); cursor: pointer; }
.icon-upload input { display: none; }
.reply-composer { border-left: 3px solid var(--accent); background: var(--soft); padding: 8px 12px; }

.poll-list, .movement-list, .event-list { display: grid; gap: 14px; }
.poll { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.poll-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.poll h2, .poll-option strong { white-space: pre-wrap; }
.poll h2 { margin: 0 0 4px; font-size: 1.15rem; }
.poll-instruction { display: block; margin-top: 14px; }
.poll-actions { flex-wrap: nowrap; gap: 5px; }
.poll-action { width: 38px; height: 38px; min-height: 38px; padding: 5px; border: 0; background: transparent; }
.poll-action:hover, .poll-action:focus-visible { background: var(--soft); }
.poll-action img { display: block; width: 100%; height: 100%; object-fit: contain; }
.poll-archive { display: grid; gap: 8px; margin-top: 24px; }
.poll-archive > h2 { margin: 0 0 4px; font-size: 1rem; color: var(--muted); }
.archived-poll { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; }
.archived-poll summary { display: block; overflow: hidden; padding: 12px 15px; cursor: pointer; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }
.archived-poll summary::-webkit-details-marker { display: none; }
.archived-poll summary::after { content: '›'; float: right; margin-left: 10px; color: var(--muted); }
.archived-poll[open] summary::after { transform: rotate(90deg); }
.archived-poll-results { padding: 0 15px 10px; border-top: 1px solid var(--line); }
.poll-option { display: grid; grid-template-columns: minmax(120px, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf0f2; }
.poll-option:last-child { border-bottom: 0; }
.vote-controls { display: flex; gap: 5px; }
.vote-controls button { min-width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.vote-controls button.selected { color: white; background: var(--accent); border-color: var(--accent); }
.single-vote { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); padding: 8px 12px; text-align: left; }
.single-vote.selected { color: white; background: var(--accent); border-color: var(--accent); }
.vote-summary { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.calendar-toolbar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.weekday { text-align: center; color: var(--muted); padding: 7px; font-size: .8rem; }
.calendar-actions { display: flex; justify-content: flex-end; margin: -16px 0 12px; }
.calendar-day { position: relative; min-height: 92px; border: 1px solid #edf0f2; border-radius: 6px; background: rgba(255,255,255,.74); padding: 7px; text-align: left; }
.calendar-day.outside { opacity: .35; }
.calendar-day.selected { outline: 2px solid var(--accent); background: var(--accent-soft); }
.calendar-day.has-events .day-number { font-weight: 800; }
.day-number { display: block; margin-bottom: 5px; }
.event-dot { display: inline-block; width: 7px; height: 17px; border-radius: 4px; margin-right: 3px; background: var(--accent); }
.day-detail { margin-top: 28px; }
.event-row, .movement { display: grid; grid-template-columns: 5px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.event-color { align-self: stretch; border-radius: 3px; background: var(--accent); }
.event-row h3, .movement h3 { margin: 0 0 3px; font-size: 1rem; }
.event-action > img { display: none; }
.floating-add { margin-top: 18px; }
.login-log-section + .login-log-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.login-log-section > h3 { margin: 0 0 12px; font-size: 1rem; }
.login-user-list { display: grid; gap: 6px; }
.login-user-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.login-user-row time { color: var(--muted); font-size: .86rem; text-align: right; white-space: nowrap; }

.notes-top { display: grid; gap: 18px; margin-bottom: 20px; }
.note-sheet { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.note-sheet h2 { margin-top: 0; }
.note-block { display: block; margin-top: 18px; }
.note-block #note-course { min-height: 400px; overflow-y: hidden; resize: none; font-weight: 400; }
.draft-label { color: var(--red); }
.attendance { display: grid; gap: 10px; padding: 14px; background: var(--soft); border-radius: 6px; }
.attendance-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; min-height: 46px; }
.tasks { display: grid; gap: 8px; }
.task-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.task-row textarea { min-height: 58px; }
.missing-notes { display: flex; flex-wrap: wrap; gap: 7px; }
.missing-note { border: 1px solid var(--line); border-radius: 5px; background: white; padding: 6px 9px; }

.finance-status { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 18px; border-left: 5px solid var(--green); background: white; border-radius: var(--radius); }
.finance-status.debt { border-left-color: var(--red); }
.finance-status-copy small, .finance-status-copy strong { display: block; }
.finance-status-copy strong { margin-top: 5px; font-size: 1.4rem; }
.finance-status-icon { width: 82px; height: 64px; object-fit: contain; }
.finance-categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0 28px; }
.finance-category { position: relative; padding: 16px; border: 1px solid var(--line); background: white; border-radius: 6px; }
.finance-category.clickable { cursor: pointer; }
.finance-category.clickable:hover { border-color: var(--accent); }
.finance-category h3 { margin: 0 0 10px; font-size: 1rem; }
.finance-qr-icon { position: absolute; right: 12px; bottom: 10px; width: 28px; height: 28px; object-fit: contain; }
.amount.positive { color: var(--green); }
.amount.negative { color: var(--red); }
.rate { float: right; color: var(--muted); font-size: .78rem; }
.movement { grid-template-columns: minmax(0,1fr) auto auto; }
.movement .amount { font-weight: 800; white-space: nowrap; }
.finance-member { display: grid; gap: 13px; padding: 15px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.finance-member-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.finance-member-head h3 { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; }
.finance-member-head > .muted { flex: 0 0 auto; text-align: right; }
.membership-label-short { display: none; }
.finance-member-statuses { display: flex; width: 100%; gap: 8px; }
.finance-member-statuses .amount { flex: 1 1 0; min-width: 0; display: grid; gap: 3px; padding: 10px; border-radius: 5px; background: var(--soft); white-space: normal; }
.finance-member-statuses small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 10px 0 18px; }
.switch { display: inline-flex; align-items: center; gap: 8px; }
.switch input { width: 42px; height: 22px; accent-color: var(--accent); }
.theme-row { display: flex; gap: 10px; margin: 0 0 20px; }
.theme-swatch { width: 32px; height: 32px; padding: 0; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.theme-swatch[data-theme="rose"] { background: #a81472; }
.theme-swatch[data-theme="cyan"] { background: #087f9d; }
.theme-swatch[data-theme="green"] { background: #267a4a; }
.theme-swatch[data-theme="mono"] { background: #333; }
.theme-swatch.selected { box-shadow: 0 0 0 2px var(--accent); }
.notification-settings { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 20px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.notification-settings div { display: grid; gap: 3px; }
.notification-settings small { color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20,20,20,.55); }
.modal { width: min(100%, 680px); max-height: min(88vh, 900px); overflow: auto; background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.modal.wide-modal { width: min(100%, 960px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { margin: 0; }
.close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.menu-actions { margin-top: 16px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; margin-top: 12px; }
.emoji-grid button { min-height: 44px; border: 0; border-radius: 5px; background: var(--soft); font-size: 1.45rem; }
.image-lightbox img { max-height: 82vh; object-fit: contain; }
.payment-qr { display: grid; justify-items: center; gap: 12px; text-align: center; }
.payment-qr img { width: min(320px, 74vw); image-rendering: pixelated; }

#toast { position: fixed; z-index: 150; left: 50%; bottom: 24px; transform: translate(-50%, 18px); max-width: min(92vw, 520px); padding: 11px 16px; border-radius: 6px; background: #252525; color: white; opacity: 0; pointer-events: none; transition: .18s; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .app-header { grid-template-columns: 48px 1fr 40px; padding: 6px 12px; gap: 8px; }
  .brand span { display: none; }
  .main-nav button { grid-template-columns: 28px; }
  .main-nav span { display: none; }
  .workspace { padding: 24px 18px 110px; }
  .overview-item, .overview-item.wide { grid-column: span 6; }
  .overview-item.full { grid-column: span 6; }
  .overview-grid [data-go="kalendar"] { order: 1; }
  .overview-grid [data-go="chat"] { order: 2; }
  .overview-grid [data-go="prispevky"] { order: 3; }
  .overview-grid [data-go="hlasovani"] { order: 4; }
  .overview-grid [data-go="zapisy"] { order: 5; }
  .overview-grid .website { order: 6; }
}

@media (max-width: 620px) {
  html { font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  .app-header { min-height: 64px; grid-template-columns: 1fr 40px; }
  .brand { display: none; }
  .main-nav { width: 100%; height: 52px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .main-nav button { min-width: 0; padding: 4px; }
  .main-nav img { width: 27px; height: 27px; }
  .header-actions { position: relative; min-width: 0; justify-content: flex-end; }
  #network-status { position: absolute; right: 36px; font-size: 0; }
  .workspace { padding: 20px 12px 100px; }
  .module-head { margin-bottom: 16px; }
  .module-head h1 { font-size: 1.55rem; }
  .overview-grid { gap: 9px; }
  .overview-item, .overview-item.wide { grid-column: span 12; min-height: 88px; padding: 10px 16px; }
  .overview-item.full { grid-column: span 12; }
  .overview-item.website { display: block; }
  .message-row.has-readers { padding-right: 62px; }
  .message-actions { opacity: .75; }
  .message-row > .avatar.small { width: 32px; height: 40px; }
  .message-actions button { width: 28px; height: 28px; padding: 3px; }
  .message-actions img { width: 18px; height: 18px; }
  .message-actions [data-action="reply"] img { width: 20px; height: 20px; }
  .chat-composer { grid-template-columns: 42px 42px 42px minmax(74px, 1fr) 52px; gap: 4px; }
  .chat-conversation-toolbar { align-items: stretch; flex-wrap: wrap; }
  .conversation-list { flex-basis: 100%; }
  .chat-composer .send { overflow: hidden; padding: 8px 4px; font-size: .78rem; }
  .chat-composer .send span { display: none; }
  .icon-upload { min-width: 42px; font-size: .68rem; }
  .calendar-day { min-height: 40px; padding: 2px 4px; font-size: .78rem; }
  .day-number { margin-bottom: 2px; }
  .weekday { padding: 4px 0; }
  .event-dot { width: 4px; height: 9px; margin-right: 1px; }
  .finance-categories, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .attendance-row { grid-template-columns: 1fr; }
  .poll-option { grid-template-columns: 1fr; }
  .poll-actions { flex-direction: column; gap: 6px; }
  .poll-actions .poll-action { width: 34px; height: 34px; min-height: 34px; padding: 3px; }
  .event-actions { flex-direction: column; gap: 5px; }
  .event-actions .event-action { width: 32px; height: 32px; min-height: 32px; padding: 3px; border: 0; background: transparent; }
  .event-action:hover, .event-action:focus-visible { background: var(--soft); }
  .event-action > img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .event-action > span { display: none; }
  .finance-last-movement { font-size: .72rem; }
  .membership-since { font-size: .72rem; }
  .membership-label-full { display: none; }
  .membership-label-short { display: inline; }
  .notification-settings { align-items: stretch; flex-direction: column; }
  .note-sheet .module-head h2 { font-size: 1.05rem; }
  .finance-member-head { align-items: flex-start; }
  .finance-member-statuses { flex-wrap: wrap; }
  .finance-member-statuses .amount { flex-basis: calc(50% - 4px); }
  .login-user-row { grid-template-columns: auto minmax(0,1fr); }
  .login-user-row time { grid-column: 2; text-align: left; }
  .finance-status-icon { width: 66px; height: 52px; }
  .primary, .secondary, .ghost, .danger { padding: 8px 11px; }
  .login-panel { padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
