:root {
  --ink: #2f2218;
  --muted: #7a6652;
  --line: #e2d2bd;
  --paper: #f7f1e7;
  --panel: #fffdf8;
  --forest: #4a2f1d;
  --teal: #8a5a24;
  --gold: #d9a441;
  --red: #9f3f2f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
.top { min-height: 72px; padding: 16px 24px; background: var(--forest); color: white; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top a { color: white; text-decoration: none; margin-left: 14px; font-weight: 700; }
.top button { min-height: 34px; margin-left: 14px; padding: 6px 10px; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.12); }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-left: 0 !important; font-size: clamp(1rem, 2.2vw, 1.35rem); }
.top .brand img { width: 44px !important; height: 44px !important; max-width: 44px; max-height: 44px; flex: 0 0 auto; object-fit: contain; }
.main-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
.main-nav > a, .main-nav > button { margin-left: 0; }
.nav-group { position: relative; }
.nav-group summary { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(255,255,255,.1); color: white; font-weight: 850; cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "▾"; font-size: .82rem; line-height: 1; opacity: .85; }
.nav-group[open] summary { background: rgba(255,255,255,.18); }
.nav-group-menu { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; min-width: 210px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 18px 40px rgba(47,34,24,.24); }
.nav-group-menu a, .nav-group-menu button { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: flex-start; margin: 0; padding: 8px 10px; border-radius: 8px; color: var(--forest); background: transparent; text-align: left; font-weight: 850; text-decoration: none; }
.nav-group-menu a:hover, .nav-group-menu button:hover { background: #f3e4c8; }
main { padding: 24px; }
.auth, .admin-form, .card, .kiosk-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, button { font: inherit; min-height: 42px; border-radius: 8px; border: 1px solid var(--line); padding: 8px 10px; }
button { background: var(--teal); color: white; font-weight: 800; cursor: pointer; }
.audience-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; }
.audience-picker legend { padding: 0 6px; color: var(--forest); font-weight: 800; }
.audience-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-weight: 800; }
.audience-option input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.push-repeat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.material-symbols-outlined { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; letter-spacing: 0; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; }
.toolbar button { width: 42px; min-width: 42px; min-height: 42px; display: inline-grid; place-items: center; padding: 6px; background: #fff7e8; color: var(--forest); }
.color-tool, .format-tool { min-height: 42px; display: inline-flex; grid-auto-flow: column; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; color: var(--forest); font-weight: 800; }
.color-tool input { width: 34px; min-height: 30px; padding: 0; border: 0; background: transparent; }
.format-tool select { min-height: 30px; padding: 3px 8px; background: white; color: var(--forest); }
.toolbar-menu { position: relative; display: inline-flex; }
.toolbar-menu-panel { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; display: grid; grid-template-columns: repeat(4, 42px); gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 12px 24px rgba(47,34,24,.18); }
.toolbar-menu-panel[hidden] { display: none; }
.editor { min-height: 180px; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tabs { display: grid; max-width: 420px; gap: 0; margin-bottom: 18px; padding-right: 28px; }
.tab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 4px; min-height: 54px; margin-top: -8px; padding: 12px 18px; border-radius: 8px; background: var(--teal); color: white; text-decoration: none; font-weight: 800; box-shadow: 0 10px 22px rgba(74,47,29,.16); }
.tab-icon { width: 1.4em; min-width: 1.4em; height: 1.4em; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.18); font-weight: 900; }
.tab-label { min-width: 0; overflow-wrap: anywhere; }
.tab-count { min-width: 2.1em; min-height: 2.1em; display: inline-grid; place-items: center; justify-self: end; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.22); color: inherit; font-size: .84rem; font-weight: 900; line-height: 1; }
.tab:first-child { margin-top: 0; }
.tab.active { background: var(--gold); color: var(--forest); transform: translateX(12px); }
.tab.cat-0 { background: #4a2f1d; }
.tab.cat-1 { background: #8a5a24; }
.tab.cat-2 { background: #a96f2d; }
.tab.cat-3 { background: #6f3f24; }
.tab.cat-4 { background: #9f3f2f; }
.tab.cat-5 { background: #6d5632; }
.tab.cat-6 { background: #7f672e; }
.tab.cat-7 { background: #73513a; }
.tab.cat-8 { background: #b7832f; color: #25170d; }
.tab.cat-9 { background: #5d4632; }
.tab.cat-10 { background: #3f3326; }
.tab.active { background: var(--gold); color: var(--forest); }
.cards, .kiosk-list { display: grid; gap: 14px; }
.daily-info { display: grid; gap: 14px; margin-bottom: 18px; padding: 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.daily-date { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; color: var(--forest); }
.daily-date span, .daily-date strong { font-size: clamp(1.45rem, 5vw, 2.25rem); line-height: 1; font-weight: 900; }
.daily-details { display: grid; gap: 10px; }
.daily-details p, .daily-details .month-celebrations, .daily-details .monitor-liber { margin: 0; display: grid; gap: 6px; }
.daily-details b { color: var(--teal); }
.daily-details span, .daily-details ul { color: var(--ink); }
.daily-details ul { margin: 0; padding-left: 1.35rem; list-style-position: outside; }
.celebration-carousel { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 8px; margin-bottom: 4px; }
.celebration-carousel a { min-height: 38px; display: inline-grid; place-items: center; border-radius: 8px; background: #f3e4c8; color: var(--forest); text-decoration: none; font-size: 1.35rem; font-weight: 950; line-height: 1; }
.celebration-carousel b { justify-self: center; color: var(--forest); font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0; }
.liber-carousel { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px auto; align-items: center; gap: 8px; margin-bottom: 4px; }
.liber-carousel a { min-height: 38px; display: inline-grid; place-items: center; border-radius: 8px; background: #f3e4c8; color: var(--forest); text-decoration: none; font-size: 1.35rem; font-weight: 950; line-height: 1; }
.liber-carousel b { justify-self: center; color: var(--forest); font-size: 1.05rem; letter-spacing: 0; }
.liber-carousel .today-link { padding: 0 12px; font-size: .9rem; }
.daily-details .month-celebrations ul { color: var(--ink); }
.daily-details .month-celebrations li { margin: 2px 0; color: var(--ink); }
.daily-details .monitor-liber ul, .daily-details .monitor-liber li { color: var(--ink); }
.daily-details .monitor-liber span { color: var(--ink); }
.important-today-strip { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; }
.important-today-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 14px; }
.important-today-head h2 { margin: 0; color: var(--forest); font-size: 1.18rem; }
.important-today-head a, .important-today-mini a { color: var(--teal); font-weight: 900; text-decoration: none; }
.important-today-mini-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.important-today-mini { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-left: 7px solid var(--gold); border-radius: 8px; background: var(--panel); }
.important-today-mini.priority-urgent, .important-today-card.priority-urgent { border-left-color: var(--red); }
.important-today-mini div { display: grid; gap: 4px; }
.important-today-mini span { width: fit-content; min-height: 24px; display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: rgba(217,164,65,.18); color: var(--teal); font-size: .78rem; font-weight: 950; }
.important-today-mini.priority-urgent span { background: rgba(159,63,47,.14); color: var(--red); }
.important-today-mini strong { min-width: 0; color: var(--forest); overflow-wrap: anywhere; }
.important-today-mini p { margin: 0; color: var(--muted); line-height: 1.4; }
.important-today-card { border-left: 8px solid var(--gold); }
.message-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -4px 0 10px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.message-meta b { color: var(--teal); }
.read-receipt { width: fit-content; margin: 0 0 12px; padding: 6px 10px; border-radius: 999px; background: #f3e4c8; color: var(--forest); font-size: .86rem; font-weight: 900; }
.read-receipt strong { color: var(--teal); }
.read-receipt a { margin-left: 8px; color: var(--teal); font-weight: 950; text-decoration: none; }
.read-receipt-done { background: rgba(79,157,90,.16); color: #36713d; }
.read-receipt-form { display: inline-flex; width: fit-content; margin: 0 0 12px; }
.read-receipt-form button { min-height: 34px; padding: 6px 10px; background: var(--forest); font-size: .88rem; }
.kiosk-card .message-meta { color: rgba(255,255,255,.7); }
.kiosk-card .message-meta b { color: var(--gold); }
.rich { line-height: 1.55; overflow-wrap: anywhere; }
.rich ul, .rich ol { padding-left: 1.3em; }
.editor table { width: 100%; border-collapse: collapse; margin: 10px 0; table-layout: fixed; }
.rich table { width: auto; max-width: 100%; border-collapse: collapse; margin: 10px 0; table-layout: auto; background: var(--panel); color: var(--ink); }
.editor td, .editor th, .rich td, .rich th { border: 1px solid var(--line); padding: 8px; vertical-align: top; }
.editor th, .rich th { background: #f3e4c8; color: var(--forest); }
.editor td:empty::before, .editor th:empty::before { content: attr(data-placeholder); color: var(--muted); font-weight: 500; opacity: .72; }
.editor table { display: table; overflow-wrap: anywhere; }
.rich table { display: inline-table; overflow-wrap: normal; }
.rich { overflow-x: auto; }
.attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.attachment { display: inline-flex; margin: 8px 8px 0 0; padding: 8px 10px; background: #f3e4c8; border-radius: 8px; color: var(--forest); font-weight: 800; text-decoration: none; }
.attachment-tile { width: clamp(132px, 42vw, 170px); min-width: 0; display: grid; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; overflow: hidden; }
.attachment-thumb { min-height: 112px; display: grid; grid-template-rows: 82px auto; gap: 7px; place-items: stretch; margin: 0; color: var(--forest); text-align: left; font-size: .82rem; line-height: 1.15; font-weight: 800; overflow: hidden; }
.attachment-thumb img { width: 100%; height: 82px; object-fit: cover; border-radius: 6px; background: white; }
.attachment-thumb .pdf-thumb { object-position: top center; border: 1px solid var(--line); }
.attachment-thumb span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.attachment-thumb-pdf, .attachment-thumb-file { grid-template-rows: 82px auto; }
.pdf-mark { display: grid; place-items: center; border-radius: 6px; background: var(--red); color: white; font-size: 1.2rem; letter-spacing: 0; }
.file-mark { display: grid; place-items: center; border-radius: 6px; background: #f3e4c8; color: var(--forest); font-size: 1rem; letter-spacing: 0; }
.attachment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.attachment-actions-single { grid-template-columns: 1fr; }
.attachment-actions button, .attachment-actions a { min-width: 0; min-height: 34px; display: inline-grid; place-items: center; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--teal); color: white; font: inherit; font-size: .78rem; font-weight: 900; text-decoration: none; line-height: 1; cursor: pointer; overflow-wrap: anywhere; }
.attachment-actions a { background: #f3e4c8; color: var(--forest); }
.attachment-actions button:disabled { opacity: .72; cursor: wait; }
.attachment-manage-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.attachment-manage-item { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.attachment-manage-item label { display: grid; grid-template-columns: auto 64px minmax(0, 1fr); grid-template-rows: auto auto; gap: 6px 10px; align-items: center; }
.attachment-manage-item input[type="checkbox"] { grid-row: 1 / span 2; min-height: 0; width: 18px; height: 18px; padding: 0; }
.attachment-manage-item img, .attachment-manage-item .pdf-mark, .attachment-manage-item .file-mark { width: 64px; height: 48px; display: grid; place-items: center; border-radius: 6px; object-fit: cover; }
.attachment-manage-item .pdf-thumb-small { object-position: top center; border: 1px solid var(--line); background: white; }
.attachment-manage-item .file-mark { background: #f3e4c8; color: var(--forest); font-weight: 900; }
.attachment-manage-item strong { min-width: 0; overflow-wrap: anywhere; }
.attachment-manage-item small { grid-column: 3; color: var(--muted); font-weight: 800; }
.attachment-preview-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(47,34,24,.78); }
.attachment-preview-panel { width: min(1100px, 100%); height: min(900px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr); border-radius: 8px; background: var(--panel); box-shadow: 0 18px 60px rgba(0,0,0,.34); overflow: hidden; }
.attachment-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--forest); }
.attachment-preview-bar strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview-bar button { min-height: 36px; padding: 6px 10px; }
.attachment-preview-tools { flex: 0 0 auto; display: inline-grid; grid-template-columns: 36px minmax(54px, auto) 36px; align-items: center; gap: 6px; }
.attachment-preview-tools button { min-width: 36px; min-height: 36px; padding: 4px; }
.attachment-preview-tools span { text-align: center; font-weight: 900; color: var(--forest); }
.attachment-preview-body { min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: none; padding: 10px; background: #20140d; }
.attachment-preview-content { width: 100%; height: 100%; display: grid; place-items: center; margin: auto; }
.attachment-preview-content img { width: 100%; height: 100%; object-fit: contain; }
.attachment-preview-content iframe { width: 100%; height: 100%; border: 0; background: white; }
.pdf-preview { display: block; width: 100%; height: min(52vh, 620px); border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; background: white; }
.image-preview { display: block; max-width: 100%; max-height: min(56vh, 720px); object-fit: contain; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; background: white; }
.kiosk { background: #2b1a10; color: white; border-radius: 8px; padding: 24px; min-height: calc(100vh - 120px); }
.kiosk .tab { font-size: 1.05rem; }
.monitor-layout { display: grid; gap: 22px; align-items: start; }
.monitor-top { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.monitor-side { display: grid; gap: 16px; align-content: start; }
.monitor-side .tabs { margin: 0; max-width: none; }
.monitor-main { min-width: 0; display: grid; gap: 16px; }
.monitor-footer { display: flex; justify-content: flex-end; }
.monitor-footer a { color: rgba(255,255,255,.72); font-weight: 800; text-decoration: none; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); }
.monitor-footer a:hover { color: white; background: rgba(255,255,255,.08); }
.monitor-header { min-height: 280px; display: grid; gap: 16px; align-content: space-between; padding: 20px; border-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); overflow: hidden; position: relative; }
.monitor-header::after { content: ""; position: absolute; inset: auto -40px -80px auto; width: 210px; height: 210px; border-radius: 999px; background: rgba(217,164,65,.2); }
.monitor-day-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; position: relative; z-index: 1; }
.monitor-widgets { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.monitor-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 18px; position: relative; z-index: 1; }
.monitor-date span { display: inline-block; color: white; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; font-weight: 900; text-transform: none; }
.monitor-date strong { display: inline-block; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; margin-top: 0; }
.monitor-weather { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; max-width: 280px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.12); color: white; }
.monitor-weather-icon { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; }
.monitor-weather div { display: grid; gap: 2px; }
.monitor-weather strong { color: white; font-size: clamp(1.45rem, 3vw, 2.2rem); line-height: 1; }
.monitor-weather span { color: rgba(255,255,255,.92); font-weight: 800; }
.monitor-weather small { color: rgba(255,255,255,.68); font-size: .78rem; font-weight: 700; }
.monitor-clock { flex: 0 0 auto; min-height: 78px; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.12); color: white; }
.monitor-clock-icon { color: var(--gold); font-size: 2rem; line-height: 1; }
.monitor-clock time { min-width: 5ch; color: white; font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-variant-numeric: tabular-nums; font-weight: 900; line-height: 1; letter-spacing: .02em; }
.monitor-clock-separator { display: inline-block; animation: monitor-clock-blink 2s steps(1, end) infinite; }
@keyframes monitor-clock-blink { 0%, 49.999% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .monitor-clock-separator { animation: none; } }
.monitor-celebrations { display: grid; gap: 10px; position: relative; z-index: 1; }
.monitor-celebrations p { margin: 0; display: grid; gap: 3px; }
.monitor-celebrations b { color: var(--gold); }
.monitor-celebrations span { color: rgba(255,255,255,.86); }
.monitor-celebrations .month-celebrations { display: grid; gap: 6px; }
.monitor-celebrations .celebration-carousel a { background: rgba(255,255,255,.14); color: white; border: 1px solid rgba(255,255,255,.18); }
.monitor-celebrations .celebration-carousel b { color: white; }
.monitor-celebrations .liber-carousel a { background: rgba(255,255,255,.14); color: white; border: 1px solid rgba(255,255,255,.18); }
.monitor-celebrations .liber-carousel b { color: white; }
.monitor-celebrations .month-celebrations ul { margin: 0; padding-left: 1.35rem; list-style-position: outside; color: rgba(255,255,255,.86); }
.monitor-celebrations .month-celebrations li { margin: 2px 0; color: rgba(255,255,255,.86); }
.monitor-liber { display: grid; gap: 5px; }
.monitor-liber ul { margin: 0; padding-left: 1.35rem; list-style-position: outside; color: rgba(255,255,255,.86); }
.monitor-liber li { margin: 2px 0; }
.monitor-graphic { min-height: 110px; display: grid; align-content: end; justify-items: start; position: relative; z-index: 1; }
.monitor-graphic span { font-size: clamp(3rem, 8vw, 6rem); line-height: .9; color: var(--gold); }
.monitor-graphic strong { font-size: clamp(1.1rem, 2vw, 1.55rem); }
.category-visual-0 { background: linear-gradient(145deg, rgba(74,47,29,.92), rgba(142,90,36,.72)); }
.category-visual-1 { background: linear-gradient(145deg, rgba(138,90,36,.9), rgba(217,164,65,.46)); }
.category-visual-2 { background: linear-gradient(145deg, rgba(100,54,36,.92), rgba(159,63,47,.52)); }
.category-visual-3 { background: linear-gradient(145deg, rgba(95,70,50,.92), rgba(31,111,178,.36)); }
.category-visual-4 { background: linear-gradient(145deg, rgba(109,86,50,.92), rgba(183,131,47,.42)); }
.category-visual-5 { background: linear-gradient(145deg, rgba(127,103,46,.92), rgba(31,111,178,.32)); }
.category-visual-6 { background: linear-gradient(145deg, rgba(115,81,58,.92), rgba(217,164,65,.34)); }
.category-visual-7 { background: linear-gradient(145deg, rgba(169,111,45,.86), rgba(74,47,29,.76)); }
.category-visual-8 { background: linear-gradient(145deg, rgba(93,70,50,.92), rgba(122,102,82,.52)); }
.category-visual-9 { background: linear-gradient(145deg, rgba(74,47,29,.92), rgba(31,111,178,.34)); }
.category-visual-10 { background: linear-gradient(145deg, rgba(63,51,38,.94), rgba(217,164,65,.28)); }
.kiosk-card { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: white; }
.kiosk-card .rich { color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 2vw, 1.35rem); }
.attachments-monitor { display: grid; grid-template-columns: 1fr; gap: 18px; width: 100%; margin-top: 18px; }
.monitor-attachment { width: 100%; min-width: 0; margin: 0; padding: 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,253,248,.96); color: var(--forest); }
.monitor-attachment figcaption { margin-top: 8px; color: var(--forest); font-size: .95rem; font-weight: 900; overflow-wrap: anywhere; }
.monitor-attachment .pdf-preview { width: 100%; height: clamp(760px, 76vh, 1400px); margin: 0; border-color: var(--line); background: white; }
.monitor-attachment .image-preview { width: 100%; height: auto; max-width: 100%; max-height: none; margin: 0 auto; border-color: var(--line); object-fit: contain; }
.error { color: var(--red); font-weight: 800; }
.notice { color: var(--teal); font-weight: 800; }
.form-hint { margin: 0; padding: 10px 12px; border-radius: 8px; background: #f3e4c8; color: var(--forest); font-weight: 700; }
.inline-form { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; margin-bottom: 18px; }
.admin-list { margin-top: 22px; }
.filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; align-items: center; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; }
.bulk-actions label { display: inline-flex; grid-auto-flow: column; align-items: center; gap: 8px; color: var(--forest); }
.bulk-actions input, table input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; padding: 0; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.health-grid-wide { align-items: start; }
.health-card { min-width: 0; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.health-card h2 { margin: 0; color: var(--forest); font-size: 1.15rem; }
.health-list, .health-counters { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.health-list li { display: grid; grid-template-columns: 12px minmax(110px, auto) minmax(0, 1fr); gap: 8px; align-items: start; color: var(--muted); }
.health-list strong, .health-counters strong { color: var(--forest); }
.health-list span:last-child, .health-counters span { min-width: 0; overflow-wrap: anywhere; }
.health-counters li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.health-counters li:last-child { border-bottom: 0; }
.health-dot { width: 10px; height: 10px; margin-top: .45em; border-radius: 999px; background: var(--muted); }
.health-dot.ok, .health-badge.ok { background: #4f9d5a; }
.health-dot.warn, .health-badge.warn { background: var(--gold); }
.health-dot.bad, .health-badge.bad { background: var(--red); }
.health-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 999px; color: white; font-size: .78rem; font-weight: 900; }
.notification-list { display: grid; gap: 12px; margin-top: 18px; }
.notification-item { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.notification-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; align-items: baseline; }
.notification-top strong { min-width: 0; color: var(--forest); font-size: 1.12rem; overflow-wrap: anywhere; }
.notification-top time { color: var(--muted); font-size: .9rem; font-weight: 800; }
.notification-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.notification-meta span { min-height: 26px; display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: #f3e4c8; color: var(--forest); font-size: .82rem; font-weight: 900; }
.notification-meta .notification-state { background: #e9dfd0; color: var(--muted); }
.notification-meta .notification-state.active { background: rgba(79,157,90,.16); color: #36713d; }
.notification-item p { margin: 0; color: var(--ink); line-height: 1.45; }
.export-list { display: grid; gap: 12px; margin: 18px 0; }
.export-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.export-item h2 { margin: 0 0 4px; color: var(--forest); font-size: 1.12rem; }
.export-item p { margin: 0; color: var(--muted); line-height: 1.4; }
.read-report-message { margin: 0 0 14px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.read-report-message h2 { margin: 4px 0 12px; }
.read-report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; }
.read-report-summary article { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; }
.read-report-summary span { color: var(--muted); font-weight: 850; }
.read-report-summary strong { color: var(--teal); font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1; }
.read-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 16px 0; }
.read-report-grid article { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.read-report-grid h2 { margin-top: 0; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 520px; }
.revision-list { display: grid; gap: 12px; margin: 12px 0 18px; }
.revision-item { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.revision-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; color: var(--muted); }
.revision-top strong { color: var(--forest); }
.revision-item dl { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.revision-item dt { color: var(--teal); font-weight: 900; }
.revision-item dd { min-width: 0; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.revision-item details { border-top: 1px solid var(--line); padding-top: 8px; }
.revision-item summary { color: var(--forest); font-weight: 900; cursor: pointer; }
.revision-body { max-height: 260px; margin-top: 10px; padding: 10px; border-radius: 8px; background: #fff7e8; overflow: auto; }
.edit-link { display: inline-flex; align-items: center; min-height: 34px; margin: 4px 0 12px; padding: 6px 10px; border-radius: 8px; background: #f3e4c8; color: var(--forest); font-weight: 800; text-decoration: none; }
.admin-actions, .table-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.delete-form, .delete-user-form, .archive-form { display: inline-flex; }
.delete-form button, .delete-user-form button, .archive-form button { min-height: 34px; padding: 6px 10px; }
.delete-form button, .delete-user-form button, .danger-button { background: var(--red); }
.archive-form button { background: var(--forest); }
table { width: 100%; border-collapse: collapse; background: white; }
td, th { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
th { color: var(--muted); font-size: .86rem; }
.calendar-wrap { display: grid; gap: 18px; }
.calendar-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.calendar-head h1 { margin: 0; text-align: center; font-size: clamp(1.3rem, 4vw, 2rem); }
.calendar-head a { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 8px; background: var(--forest); color: white; text-decoration: none; font-weight: 800; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-weekday { color: var(--muted); font-size: .86rem; font-weight: 800; text-align: center; }
.calendar-empty, .calendar-day { min-height: clamp(48px, 12vw, 92px); border-radius: 8px; }
.calendar-day { position: relative; display: grid; align-content: space-between; padding: 9px; background: white; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 800; }
.calendar-dot { width: 5px; height: 5px; justify-self: end; align-self: end; border-radius: 999px; background: #1f6fb2; box-shadow: 0 0 0 2px rgba(31,111,178,.16); }
.calendar-day .calendar-urgent { position: absolute; top: 5px; right: 7px; color: #c9362b; font-size: 1.08rem; line-height: 1; font-weight: 950; }
.calendar-counts { display: flex; justify-content: flex-end; gap: 4px; }
.calendar-counts strong { min-width: 24px; min-height: 24px; display: inline-grid; place-items: center; border-radius: 999px; color: white; font-size: .82rem; }
.calendar-counts .count-total, .kiosk .calendar-counts .count-total { background: #1f6fb2; color: white; }
.calendar-day.has-events { border-color: var(--teal); box-shadow: inset 0 0 0 2px rgba(20,108,99,.12); }
.calendar-day.selected { background: var(--gold); border-color: var(--gold); color: var(--forest); }
.calendar-category { margin: 0 0 6px; color: var(--muted); font-size: .86rem; font-weight: 800; }
.day-events { display: grid; gap: 12px; }
.day-events h2 { margin: 4px 0; }
.day-events .card, .day-events .kiosk-card { margin: 0; }
.empty-state { margin: 0; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-weight: 700; }
.kiosk .calendar-head a { background: rgba(255,255,255,.14); }
.kiosk .calendar-weekday { color: rgba(255,255,255,.68); }
.kiosk .calendar-day { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: white; }
.kiosk .calendar-day.selected { background: var(--gold); color: var(--forest); }
.kiosk .calendar-day .calendar-urgent { color: #ff4b3e; }
.kiosk .empty-state { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: rgba(255,255,255,.75); }
.table-check { display: inline-flex; grid-auto-flow: column; align-items: center; gap: 8px; font-weight: 800; }
.table-check input { min-height: 0; width: 18px; height: 18px; padding: 0; }
.meal-attendance { display: grid; gap: 14px; }
.meal-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.meal-head h1 { margin: 0; font-size: clamp(1.35rem, 4vw, 2.2rem); }
.meal-head strong { color: var(--teal); font-size: clamp(1rem, 3vw, 1.3rem); }
.meal-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.meal-table { min-width: 560px; background: white; }
.meal-table th, .meal-table td { vertical-align: middle; }
.meal-table thead th { background: #f3e4c8; color: var(--forest); font-size: .95rem; }
.meal-table thead th:not(:first-child) { text-align: center; }
.meal-table tbody th { width: 28%; color: var(--forest); font-size: 1rem; }
.meal-options { display: flex; justify-content: center; }
.meal-options input { display: none; }
.meal-square { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #d8d0c5; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.meal-square.meal-state-none { background: #d8d0c5; border-color: var(--line); }
.meal-square.meal-state-normal { background: #70b66a; border-color: #70b66a; }
.meal-square.meal-state-special { background: #f0d05c; border-color: #f0d05c; }
.meal-square:disabled, .meal-guest-input:disabled { opacity: .78; cursor: not-allowed; }
.meal-guest-input { width: 100%; text-align: center; font-weight: 900; }
.meal-guest-pair, .meal-total { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; }
.meal-guest-field { display: block; min-width: 0; }
.meal-guest-field-normal .meal-guest-input { background: #70b66a; border-color: #70b66a; color: #173b18; }
.meal-guest-field-special .meal-guest-input { background: #f0d05c; border-color: #d9b63f; color: #3f2f08; }
.meal-total span { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; border-radius: 8px; padding: 4px 6px; }
.meal-total-normal { background: rgba(112,182,106,.24); color: #f1fff0; }
.meal-total-special { background: rgba(240,208,92,.3); color: #fff8d3; }
.meal-guests th, .meal-guests td { background: #fff7e8; }
.meal-summary th, .meal-summary td { background: var(--forest); color: white; font-size: 1.08rem; font-weight: 950; }
.meal-submit { justify-self: end; min-width: 180px; }
.meal-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff7e8; color: var(--forest); font-weight: 800; }
.meal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend-square { width: 20px; height: 20px; display: inline-block; border-radius: 6px; border: 1px solid var(--line); background: #d8d0c5; }
.legend-normal { background: #70b66a; border-color: #70b66a; }
.legend-special { background: #f0d05c; border-color: #f0d05c; }
.legend-empty { background: #d8d0c5; }
.kiosk .meal-table-wrap { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); }
.kiosk .meal-table { background: rgba(255,255,255,.06); color: white; }
.kiosk .meal-table thead th { background: rgba(217,164,65,.88); color: var(--forest); }
.kiosk .meal-table tbody th { color: white; }
.kiosk .meal-table tbody tr:not(.meal-guests):not(.meal-summary) > th { font-size: calc(1rem + 4px); line-height: 1; white-space: nowrap; }
.kiosk .meal-square.meal-state-none { background: rgba(255,255,255,.42); border-color: rgba(255,255,255,.52); }
.kiosk .meal-square.meal-state-normal { background: #70b66a; border-color: #70b66a; }
.kiosk .meal-square.meal-state-special { background: #f0d05c; border-color: #f0d05c; }
.kiosk .meal-legend { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: rgba(255,255,255,.88); }
.kiosk .meal-guests th, .kiosk .meal-guests td { background: rgba(255,255,255,.1); }
.kiosk .meal-summary th, .kiosk .meal-summary td { background: rgba(217,164,65,.92); color: var(--forest); }
.kiosk .meal-total-normal { background: rgba(112,182,106,.92); color: white; }
.kiosk .meal-total-special { background: rgba(240,208,92,.96); color: var(--forest); }
.meal-attendance .meal-table thead th:nth-child(n+2),
.kiosk .meal-attendance .meal-table thead th:nth-child(n+2) { text-align: center !important; }
@media (orientation: portrait) {
  main { padding: 14px; }
  .top { align-items: center; flex-direction: column; padding: 20px 16px; text-align: center; }
  .top nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; }
  .top a { margin: 0; display: inline-block; }
  .top button { margin: 0; }
  .nav-group { position: static; }
  .nav-group summary { min-width: 138px; justify-content: center; }
  .nav-group-menu { position: static; width: 100%; min-width: 0; margin-top: 6px; box-shadow: none; }
  .tabs { max-width: 420px; }
  .monitor-header { min-height: 220px; }
  .kiosk-list { grid-template-columns: 1fr; }
  .calendar-head { grid-template-columns: 1fr 1fr; }
  .calendar-head h1 { grid-column: 1 / -1; grid-row: 1; }
  .calendar-grid { gap: 4px; }
  .calendar-day { padding: 7px; }
  .meal-table { min-width: 520px; }
}
@media (max-width: 760px) {
  .brand { width: 100%; display: inline-flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
  .top .brand img { width: 64px !important; height: 64px !important; max-width: 64px; max-height: 64px; }
  .brand strong { max-width: 15rem; display: block; font-size: 1.15rem; line-height: 1.15; }
  .main-nav { width: 100%; justify-content: center; gap: 8px; }
  .nav-group { flex: 1 1 145px; max-width: 220px; }
  .nav-group summary { width: 100%; }
  .monitor-top { grid-template-columns: 1fr; }
  .monitor-day-top { flex-direction: column; }
  .monitor-widgets { width: 100%; justify-content: flex-start; }
  .monitor-weather { max-width: 100%; }
  .attachments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .attachment-tile { width: 100%; }
  .attachment-actions { grid-template-columns: 1fr; }
  .attachment-actions button, .attachment-actions a { width: 100%; min-height: 38px; font-size: .86rem; }
  .attachment-preview-modal { padding: 8px; }
  .attachment-preview-bar { flex-wrap: wrap; }
  .attachment-preview-bar strong { flex: 1 1 100%; }
  .attachment-preview-tools { order: 2; }
  .liber-carousel { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .liber-carousel .today-link { grid-column: 1 / -1; }
  .meal-square { width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
  .meal-submit { justify-self: stretch; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  .page-app main { max-width: 1040px; margin: 0 auto; padding: 22px; }
  .page-app .top { flex-direction: row; align-items: center; text-align: left; padding: 14px 22px; }
  .page-app .top nav { justify-content: flex-end; gap: 8px 12px; }
  .page-app .top a, .page-app .top button { margin-left: 0; }
  .page-app .brand { width: auto; flex-direction: row; text-align: left; }
  .page-app .top .brand img { width: 52px !important; height: 52px !important; max-width: 52px; max-height: 52px; }
  .page-app .tabs { max-width: min(620px, 100%); padding-right: 34px; }
  .page-app .tab { min-height: 58px; padding: 13px 18px; }
  .page-app .daily-info { grid-template-columns: minmax(190px, .72fr) minmax(0, 1.28fr); align-items: start; gap: 18px; }
  .page-app .daily-date { display: grid; gap: 8px; }
  .page-app .daily-date span, .page-app .daily-date strong { font-size: 2rem; }
  .page-app .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .page-app .calendar-wrap { gap: 20px; }
  .page-app .calendar-head { grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr); }
  .page-app .calendar-head h1 { grid-column: auto; grid-row: auto; }
  .page-app .calendar-grid { gap: 7px; }
  .page-app .calendar-empty, .page-app .calendar-day { min-height: 78px; }
  .page-app .calendar-day { padding: 10px; }
  .page-app .day-events { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .page-app .day-events h2, .page-app .day-events .empty-state { grid-column: 1 / -1; }
}
