:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #667282;
  --line: #d9e0e8;
  --panel: #ffffff;
  --panel-soft: #f4f7fa;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b42318;
  --gold: #b7791f;
  --blue: #1d4ed8;
  --cyan: #0891b2;
  --green: #15803d;
  --red: #c2410c;
  --violet: #7c3aed;
  --rose: #be123c;
  --amber: #d97706;
  --sky-soft: #e0f2fe;
  --mint-soft: #dcfce7;
  --sun-soft: #fef3c7;
  --rose-soft: #ffe4e6;
  --violet-soft: #ede9fe;
  --shadow: 0 22px 70px rgba(20, 32, 43, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, #e0f2fe 0%, #f0fdfa 34%, #fff7ed 68%, #fdf2f8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
  width: min(1440px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(239, 246, 255, 0.96) 58%, rgba(255, 247, 237, 0.92));
  border-right: 1px solid var(--line);
  min-height: 100vh;
}

.brand,
.section-title,
.chat-header,
.notice-band,
.stats-row,
.compose-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.24);
}

.brand h1,
.brand p,
.chat-header h2,
.eyebrow,
.section-title h2,
.notice-band p {
  margin: 0;
}

.brand h1 {
  font-size: 1.1rem;
}

.brand p,
.channel small,
.resident small,
.eyebrow,
.stats-row span,
.notice-band p {
  color: var(--muted);
}

.search-panel label,
.section-title h2 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #465464;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 12px;
  min-height: 44px;
  border: 2px solid #c7e7e3;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(8, 145, 178, 0.08);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.channel-list {
  display: grid;
  gap: 12px;
}

.channel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 12px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.channel:hover,
.channel.is-active {
  border-color: #5eead4;
  background: linear-gradient(135deg, #ccfbf1, #e0f2fe);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.13);
}

.channel-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.channel strong,
.channel small {
  display: block;
}

.channel em {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.resident-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  justify-content: space-between;
}

.section-title span {
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf2f7;
  color: var(--muted);
  font-weight: 800;
}

.resident-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
  max-height: calc(100vh - 420px);
}

.resident {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
}

.resident:hover {
  background: var(--panel);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.status.online {
  background: #0f9f6e;
}

.chat-area {
  display: grid;
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
}

.chat-header {
  justify-content: space-between;
  padding: 24px 28px 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 253, 250, 0.86));
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.group-alias-pill {
  display: inline-flex;
  align-items: center;
  max-width: min(420px, 78vw);
  min-height: 30px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 2px solid #99f6e4;
  border-radius: 999px;
  background: linear-gradient(135deg, #ccfbf1, #eff6ff);
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-alias-pill[hidden] {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-pill {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 9px 11px;
  border: 2px solid #b8d8d4;
  border-radius: 999px;
  background: #f0fdfa;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.install-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.18);
}

.install-button[hidden] {
  display: none;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--ink);
  font-weight: 900;
}

.icon-button.is-on {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--warn);
}

.settings-menu {
  position: relative;
}

.settings-menu[hidden] {
  display: none;
}

.settings-menu summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  list-style: none;
  cursor: pointer;
  border: 2px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 900;
}

.settings-menu summary::-webkit-details-marker {
  display: none;
}

.settings-menu-body {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 32px));
  padding: 14px;
  border: 2px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
}

.settings-menu-body strong,
.settings-menu-body p {
  margin: 0;
}

.settings-menu-body p {
  color: var(--muted);
}

.settings-menu-body .install-button {
  width: 100%;
}

.notice-band {
  justify-content: space-between;
  gap: 16px;
  margin: 18px 28px 0;
  padding: 16px;
  border-left: 7px solid var(--amber);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.12);
}

.notice-band span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: white;
  color: var(--accent-dark);
  font-weight: 800;
}

.notice-band[hidden],
.search-panel[hidden],
.composer-tools[hidden] {
  display: none;
}

.notice-band button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.stats-row {
  gap: 12px;
  padding: 16px 28px 4px;
}

.stats-row article {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.stats-row article:nth-child(1) {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.stats-row article:nth-child(2) {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.stats-row article:nth-child(3) {
  border-color: #fed7aa;
  background: #fff7ed;
}

.stats-row span,
.stats-row strong {
  display: block;
}

.stats-row strong {
  margin-top: 4px;
  font-size: 1.55rem;
}

.push-panel {
  margin: 0 28px 18px;
  padding: 14px;
  border: 2px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.push-panel summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 900;
}

.push-panel-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.push-panel[hidden],
.push-panel button[hidden],
.stats-row[hidden] {
  display: none;
}

.push-panel strong,
.push-panel p {
  margin: 0;
}

.push-panel p {
  color: var(--muted);
}

.push-panel button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: white;
  font-weight: 900;
}

.dining-shell {
  margin: 16px 28px 0;
  padding: 20px;
  border: 2px solid #99f6e4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.96), rgba(239, 246, 255, 0.96) 58%, rgba(255, 247, 237, 0.92));
  box-shadow: 0 18px 50px rgba(15, 118, 110, 0.15);
}

.dining-shell[hidden] {
  display: none;
}

.dining-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.dining-toolbar h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1.55rem;
}

.day-picker input,
.stats-filter input,
.menu-editor textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.day-picker {
  display: grid;
  grid-template-columns: 42px minmax(150px, 220px) 42px;
  gap: 8px;
  align-items: stretch;
}

.day-picker button {
  border: 2px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: var(--blue);
  font-size: 1.45rem;
  font-weight: 900;
}

.day-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 82px;
  padding: 12px 14px;
  border: 2px solid #5eead4;
  border-radius: 8px;
  background: linear-gradient(135deg, #ccfbf1, #ecfeff);
  box-shadow: 0 12px 28px rgba(8, 145, 178, 0.14);
}

.day-card span,
.day-card em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.day-card span {
  font-size: 0.82rem;
}

.day-card strong {
  grid-row: span 2;
  color: var(--accent-dark);
  font-size: 2.35rem;
  line-height: 1;
}

.day-card em {
  font-size: 0.9rem;
  text-transform: none;
}

.day-picker input {
  grid-column: 1 / -1;
  height: 40px;
  padding: 0 12px;
  border: 2px solid #bfdbfe;
  color: var(--blue);
  font-weight: 800;
}

.dining-panel[hidden] {
  display: none;
}

.menu-grid,
.dashboard-grid,
.ops-lists,
.admin-tables {
  display: grid;
  gap: 12px;
}

.menu-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.menu-grid article,
.dashboard-grid article,
.ops-lists article,
.admin-tables article {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.menu-grid article:nth-child(1) {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
}

.menu-grid article:nth-child(2) {
  border-color: #c4b5fd;
  background: linear-gradient(135deg, #f5f3ff, #eef2ff);
}

.menu-grid article.is-published {
  border-color: #86efac;
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  box-shadow: 0 14px 32px rgba(22, 163, 74, 0.12);
}

.menu-grid span,
.dashboard-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.menu-grid span {
  color: var(--ink);
  text-transform: uppercase;
}

.menu-grid p {
  margin: 6px 0 0;
  line-height: 1.45;
  color: #273447;
  font-weight: 700;
}

.meal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meal-form label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px;
  border: 2px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.meal-form label:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.meal-form input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.meal-form button,
.menu-editor button,
.stats-filter button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: white;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.2);
}

.menu-editor button.is-blocked {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: none;
}

.meal-form small,
.menu-editor small {
  align-self: center;
  color: var(--accent-dark);
  font-weight: 800;
}

.menu-editor {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

.menu-editor label,
.stats-filter label {
  color: #465464;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.menu-editor textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #dbeafe;
  background: #ffffff;
  resize: vertical;
}

.menu-editor textarea.is-published {
  border-color: #22c55e;
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
  box-shadow: inset 4px 0 0 #22c55e;
}

.menu-editor textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  outline: 0;
}

.dashboard-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}

.dashboard-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.65rem;
}

.dashboard-grid .metric {
  position: relative;
  overflow: hidden;
  border-width: 2px;
}

.dashboard-grid .metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
}

.metric-base {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.metric-base::before {
  background: var(--blue);
}

.metric-base strong {
  color: var(--blue);
}

.metric-alert {
  border-color: #fed7aa;
  background: #fff7ed;
}

.metric-alert::before {
  background: var(--red);
}

.metric-alert strong {
  color: var(--red);
}

.metric-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.metric-ok::before {
  background: var(--green);
}

.metric-ok strong {
  color: var(--green);
}

.ops-lists {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.ops-lists h4,
.admin-tables h4 {
  margin: 0 0 10px;
}

.ops-lists article {
  border-width: 2px;
}

.ops-absent-lunch {
  border-color: #fed7aa;
  background: #fff7ed;
}

.ops-absent-dinner {
  border-color: #fecdd3;
  background: #fff1f2;
}

.ops-late {
  border-color: #fde68a;
  background: #fffbeb;
}

.ops-lunch {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.ops-dinner {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.ops-absent-lunch h4 {
  color: #c2410c;
}

.ops-absent-dinner h4 {
  color: #be123c;
}

.ops-late h4 {
  color: #92400e;
}

.ops-lunch h4 {
  color: var(--cyan);
}

.ops-dinner h4 {
  color: #6d28d9;
}

.ops-lists ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ops-lists li,
.table-list div {
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(102, 114, 130, 0.12);
}

.ops-lists li span,
.table-list span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.stats-filter {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 2px solid #c4b5fd;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5f3ff, #eef2ff);
}

.export-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.18);
}

.stats-filter input {
  display: block;
  height: 42px;
  margin-top: 5px;
  padding: 0 10px;
}

.admin-tables {
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 12px;
  margin-top: 12px;
}

.analysis-grid article {
  padding: 14px;
  border: 2px solid #bae6fd;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
}

.analysis-grid article:nth-child(2) {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
}

.analysis-grid h4 {
  margin: 0 0 10px;
  color: var(--ink);
}

.analysis-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  max-height: 320px;
}

.analysis-list div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(102, 114, 130, 0.12);
}

.analysis-list strong,
.analysis-list span {
  display: block;
}

.analysis-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.group-admin-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 2px solid rgba(245, 158, 11, 0.32);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7ed, #eff6ff);
}

.group-admin-panel span,
.group-admin-panel small {
  color: var(--muted);
  font-weight: 800;
}

.group-admin-panel strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
}

.group-admin-panel form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.group-admin-panel input {
  min-height: 44px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.group-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 900;
}

.group-option input {
  min-height: auto;
  width: 18px;
  height: 18px;
  padding: 0;
}

.group-admin-panel button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 14px;
  background: linear-gradient(135deg, #ea580c, #0f766e);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.table-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  max-height: 300px;
}

.messages {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(860px, 72vh);
  min-height: 340px;
  padding: 24px 28px 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(239, 246, 255, 0.42));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.day-divider {
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.message {
  display: grid;
  grid-template-columns: 42px minmax(0, 780px);
  gap: 10px;
  align-items: start;
}

.message.mine {
  grid-template-columns: minmax(0, 780px) 42px;
  justify-content: end;
}

.message.mine .bubble {
  grid-column: 1;
  grid-row: 1;
  background: #ecfdf5;
  border-color: #86efac;
}

.message.mine .avatar {
  grid-column: 2;
}

.bubble {
  padding: 12px 14px;
  border: 2px solid #e0e7ff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.06);
}

.reply-button {
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  cursor: pointer;
}

.private-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 900;
}

.floating-notices {
  display: grid;
  gap: 12px;
  margin: 16px 28px 0;
}

.floating-notices[hidden] {
  display: none;
}

.floating-notices article {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 2px solid rgba(20, 184, 166, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfeff, #fff7ed);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.floating-notices strong {
  color: var(--teal);
  font-size: 1.05rem;
}

.floating-notices p {
  margin: 5px 0 0;
  color: var(--ink);
  line-height: 1.4;
}

.floating-notices button,
.notice-admin-panel button,
.reply-target button {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.notice-admin-panel {
  margin: 16px 28px 0;
  padding: 18px;
  border: 2px solid rgba(20, 184, 166, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.92), rgba(239, 246, 255, 0.92));
}

.notice-admin-panel[hidden] {
  display: none;
}

.notice-admin-panel h3 {
  margin: 0 0 12px;
  color: var(--teal);
}

.notice-admin-panel form {
  display: grid;
  gap: 10px;
}

.notice-admin-panel input,
.notice-admin-panel textarea {
  width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px;
  font: inherit;
}

.notice-days,
.notice-targets,
.floor-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-days label,
.notice-targets label,
.floor-filter label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.notice-days span {
  align-self: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.notice-form-actions,
.notice-repository-heading,
.notice-repository-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notice-repository {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 118, 110, 0.2);
}

.notice-repository-heading {
  justify-content: space-between;
  margin-bottom: 10px;
}

.notice-repository-heading h4 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1rem;
}

.notice-repository-list {
  display: grid;
  gap: 10px;
}

.notice-repository-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-left: 6px solid #14b8a6;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.notice-repository-item.is-inactive {
  border-left-color: #94a3b8;
  opacity: 0.78;
}

.notice-repository-item strong {
  color: var(--ink);
}

.notice-repository-item p {
  margin: 4px 0;
  color: var(--muted);
}

.notice-repository-item small {
  color: var(--accent-dark);
  font-weight: 900;
}

.secondary-button,
.notice-admin-panel .secondary-button,
.notice-repository-actions button {
  border: 1px solid #bfdbfe;
  background: white;
  color: var(--accent-dark);
}

.floor-filter label {
  min-width: 48px;
  justify-content: center;
  border: 1px solid #99f6e4;
  background: #ccfbf1;
  color: var(--accent-dark);
}

.room-recipient-picker {
  display: grid;
  gap: 10px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.room-recipient-picker[hidden] {
  display: none;
}

.room-recipient-picker summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 900;
}

.room-recipient-picker[open] summary {
  margin-bottom: 10px;
}

.room-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.room-list label {
  display: grid;
  grid-template-columns: auto 44px 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 9px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.room-list span {
  color: var(--accent-dark);
  font-weight: 900;
}

.reply-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 2px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 900;
}

.reply-target[hidden] {
  display: none;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.message-meta strong {
  color: var(--ink);
}

.bubble p {
  margin: 0;
  line-height: 1.45;
}

.urgent {
  border-color: #fecaca;
  background: #fff5f5;
}

.urgent .message-meta::after {
  content: "Urgente";
  padding: 2px 7px;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--warn);
  font-weight: 800;
}

.composer {
  margin: 0 28px 28px;
  padding: 20px;
  border: 2px solid #5eead4;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f0fdfa);
  box-shadow: 0 20px 54px rgba(15, 118, 110, 0.2);
}

.composer label {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.composer-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.composer-tools button,
.compose-row button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.composer-tools button {
  padding: 10px 12px;
  background: #ccfbf1;
  color: var(--accent-dark);
  border: 1px solid #99f6e4;
}

.compose-row {
  gap: 12px;
}

.compose-row input {
  flex: 1;
  min-width: 0;
  height: 64px;
  padding: 0 18px;
  border: 2px solid #5eead4;
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
  font-size: 1.05rem;
}

.compose-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.compose-row button {
  min-width: 132px;
  height: 64px;
  padding: 0 26px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  color: white;
  font-size: 1.02rem;
  box-shadow: 0 14px 30px rgba(21, 128, 61, 0.24);
}

.compose-row .urgent-toggle {
  min-width: 112px;
  border: 2px solid #fecaca;
  background: #fff7ed;
  color: #991b1b;
  box-shadow: none;
}

.compose-row .urgent-toggle.is-on {
  background: linear-gradient(135deg, #dc2626, #f97316);
  color: white;
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.2);
}

.empty-state {
  margin: auto;
  max-width: 420px;
  text-align: center;
  color: var(--muted);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.22), transparent 36%),
    linear-gradient(315deg, rgba(29, 78, 216, 0.16), transparent 30%),
    rgba(238, 243, 247, 0.96);
}

.login-screen.is-visible {
  display: grid;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h2,
.login-card p {
  margin: 0;
}

.login-card h2 {
  font-size: 1.6rem;
}

.login-card p,
.login-card small {
  color: var(--muted);
}

.login-card label {
  margin-top: 8px;
  color: #465464;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-card input {
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.login-card button {
  height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.login-card small {
  min-height: 18px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .channel-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-area {
    min-height: 720px;
  }

  .dashboard-grid,
  .ops-lists,
  .admin-tables,
  .analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .channel {
    grid-template-columns: 28px minmax(0, 1fr) 24px;
    gap: 6px;
    padding: 10px 8px;
  }

  .channel-icon {
    width: 28px;
    height: 28px;
  }

  .channel > span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .channel em {
    grid-column: 3;
    grid-row: 1;
  }

  .sidebar,
  .chat-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .composer {
    margin: 0 16px 18px;
  }

  .notice-band,
  .stats-row,
  .push-panel,
  .messages,
  .dining-shell,
  .floating-notices,
  .notice-admin-panel {
    margin-left: 16px;
    margin-right: 16px;
  }

  .notice-band,
  .stats-row,
  .push-panel,
  .dining-shell {
    padding-left: 0;
    padding-right: 0;
  }

  .messages {
    max-height: 760px;
    min-height: 300px;
    padding: 16px 0 22px;
  }

  .floating-notices article {
    flex-direction: column;
  }

  .notice-repository-item {
    grid-template-columns: 1fr;
  }

  .notice-repository-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-band,
  .stats-row,
  .push-panel,
  .compose-row,
  .dining-toolbar,
  .stats-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .day-picker {
    grid-template-columns: 42px 1fr 42px;
  }

  .menu-grid,
  .meal-form,
  .dashboard-grid,
  .ops-lists,
  .admin-tables,
  .analysis-grid,
  .group-admin-panel form {
    grid-template-columns: 1fr;
  }

  .message,
  .message.mine {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .message.mine {
    justify-content: stretch;
  }

  .message.mine .avatar {
    grid-column: 1;
  }

  .message.mine .bubble {
    grid-column: 2;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .user-pill {
    max-width: 140px;
  }
}
