:root {
  color-scheme: light;
  --ink: #122945;
  --text: #39443d;
  --paper: #f7f5ee;
  --line: #ded7c9;
  --green: #4f7f45;
  --blue: #216e9e;
  --red: #ad4033;
  --soft-green: #e9f0e3;
  --soft-blue: #e1eff6;
  --white: #fff;
  --shadow: 0 16px 40px rgba(18, 41, 69, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
  color-scheme: light;
}

input::placeholder,
textarea::placeholder {
  color: #737a73;
  opacity: 1;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 780px);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 26px;
}

.brand-mark {
  width: 76px;
  height: 76px;
  display: block;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--white);
}

.header-logo {
  width: 52px;
  height: 52px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.header-wordmark {
  display: block;
  width: min(58vw, 220px);
  max-height: 48px;
  object-fit: contain;
  object-position: right center;
}

.hero-title {
  margin: 10px 0 4px;
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-wordmark {
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.brand-wordmark span:first-child {
  font-weight: 900;
}

.brand-wordmark span:last-child {
  font-weight: 400;
}

.subtle {
  color: #6f756f;
  font-weight: 700;
}

.panel,
.post-card,
.empty-card,
.calendar-box,
.compose-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 16px;
  box-shadow: var(--shadow);
}

.field-stack {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--ink);
  background: #fffdf9;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.primary-button,
.icon-button,
.pill-button,
.file-button {
  border: 0;
  border-radius: 7px;
  font-weight: 950;
}

.primary-button {
  width: 100%;
  padding: 14px;
  color: var(--white);
  background: var(--ink);
}

.primary-button:disabled {
  cursor: not-allowed;
  color: var(--white);
  background: #8b8f8a;
}

.error {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.success,
.backend-note {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px 20px 8px;
  background: rgba(247, 245, 238, 0.96);
  backdrop-filter: blur(18px);
}

.header-row,
.meta-row,
.feed-heading,
.composer-row,
.agenda-head,
.messages-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-row {
  align-items: center;
}

.header-title {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.header-copy {
  margin: 5px 0 0;
  font-size: 14px;
}

.spacer {
  flex: 1;
}

.badge,
.audience-pill,
.urgent-pill,
.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 950;
}

.badge {
  color: var(--white);
  background: var(--blue);
}

.badge.manager {
  background: var(--green);
}

.badge.user {
  background: #705ea3;
}

.audience-pill {
  color: var(--green);
  background: var(--soft-green);
}

.urgent-pill {
  color: var(--red);
  background: #f9dfd8;
}

.connection {
  overflow: hidden;
  max-width: 135px;
  color: var(--green);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.connection.offline {
  color: var(--red);
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  color: var(--white);
  background: var(--ink);
}

.icon-button.compact {
  min-width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px;
}

.icon-button.danger {
  background: var(--red);
}

.header-settings {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--white);
  font-size: 12px;
  font-weight: 950;
}

.see-as-trigger.active {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.see-as-panel {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.see-as-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.see-as-row span {
  min-width: 76px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.see-as-row button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 950;
}

.see-as-row button.active {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.see-as-row.departments button.active {
  background: var(--green);
  border-color: var(--green);
}

.see-as-note {
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 950;
}

.user-row {
  margin-top: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  background: var(--blue);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 950;
}

.avatar.manager {
  background: var(--green);
}

.avatar.user {
  background: #705ea3;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 12px;
}

.tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
  font-size: 12px;
  font-weight: 950;
}

.tabs button.active {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.content {
  padding: 0 20px 30px;
}

.pull-refresh {
  position: sticky;
  top: 72px;
  z-index: 4;
  width: fit-content;
  margin: 0 auto 10px;
  transform: translateY(calc(var(--pull, 0px) - 42px));
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 950;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.pull-refresh.visible {
  opacity: 1;
}

.feed-list {
  display: grid;
  gap: 14px;
}

.load-more-sentinel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.load-more-sentinel span {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(18, 41, 69, 0.18);
  border-top-color: var(--green);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.initial-loading-card {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px 18px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(18, 41, 69, 0.18);
  border-top-color: var(--green);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.initial-loading-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.feed-heading {
  margin: 0 0 14px;
}

.feed-heading h2,
.compose-title,
.calendar-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 950;
}

.count-pill {
  min-width: 44px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--green);
  background: var(--white);
  text-align: center;
  font-weight: 950;
}

.post-card {
  padding: 16px;
}

.post-card.urgent {
  border-color: var(--red);
  border-width: 2px;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-manage {
  display: flex;
  gap: 6px;
}

.author-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.post-meta,
.attachment-sub,
.calendar-sub {
  color: #747a74;
  font-size: 12px;
  font-weight: 800;
}

.kind-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 950;
}

.post-audience {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.post-title {
  margin: 13px 0 6px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.18;
  font-weight: 950;
}

.post-body {
  margin: 0;
  line-height: 1.42;
  font-weight: 600;
}

.event-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 7px;
  color: var(--blue);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 950;
}

.calendar-add-button {
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--white);
  background: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.poll-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.poll-option {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  padding: 0;
  min-height: 46px;
  background: var(--paper);
  text-align: left;
}

.poll-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: var(--soft-green);
}

.poll-option.selected .poll-fill {
  background: var(--soft-blue);
}

.poll-label {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.attachments {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.photo-mosaic {
  display: grid;
  gap: 6px;
}

.photo-main,
.photo-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.photo-main {
  min-height: 245px;
}

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

.photo-tile {
  min-height: 130px;
}

.photo-main img,
.photo-tile img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
}

.photo-fallback {
  min-height: inherit;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 34px;
  font-weight: 950;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
}

.file-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  color: var(--white);
  background: linear-gradient(135deg, var(--ink), var(--blue));
  font-size: 22px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.action-button {
  border: 0;
  border-radius: 7px;
  padding: 9px 10px;
  color: #6f756f;
  background: var(--paper);
  font-size: 12px;
  font-weight: 950;
}

.action-button.active {
  color: var(--ink);
  background: var(--soft-green);
}

.private-replies {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 11px;
  border-radius: 8px;
  background: var(--soft-blue);
}

.private-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.reply-list {
  display: grid;
  gap: 8px;
}

.reply-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.reply-card span span {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.reply-input {
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px;
  color: var(--ink);
  resize: vertical;
}

.reply-send {
  padding: 11px;
}

.compose-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.messages-head {
  margin-bottom: 14px;
}

.message-search {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.message-search label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.message-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--ink);
  background: #fffdf9;
}

.message-suggestions {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.message-suggestions button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.message-suggestions button:last-child {
  border-bottom: 0;
}

.message-suggestions strong,
.message-suggestions small {
  display: block;
}

.message-suggestions strong {
  font-size: 12px;
  font-weight: 950;
}

.message-suggestions small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.suggest-arrow {
  color: var(--green);
  font-weight: 950;
}

.dept-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.dept-chips button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 950;
}

.dept-chips button.active {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.inbox-section {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inbox-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 950;
}

.inbox-head span {
  display: block;
  margin-top: 2px;
  color: #6f756f;
  font-size: 12px;
  font-weight: 750;
}

.inbox-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(74px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.inbox-filter button {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 950;
}

.inbox-filter button:last-child {
  border-right: 0;
}

.inbox-filter button.active {
  color: var(--white);
  background: var(--ink);
}

.message-users {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.message-threads {
  display: grid;
  gap: 8px;
}

.message-thread {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  color: var(--text);
  background: var(--white);
  text-align: left;
}

.message-thread.active {
  border-color: var(--blue);
  border-width: 2px;
  background: var(--soft-blue);
}

.message-thread-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.message-thread-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.message-thread-top strong,
.message-thread-preview,
.message-thread-main small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-thread-top strong {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.message-thread-top time {
  flex: 0 0 auto;
  color: #747a74;
  font-size: 11px;
  font-weight: 800;
}

.message-thread-preview {
  color: #747a74;
  font-size: 12px;
  font-weight: 800;
}

.message-thread-preview.unread {
  color: var(--ink);
  font-weight: 950;
}

.message-thread-main small {
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}

.message-user {
  width: 148px;
  min-width: 148px;
  height: 152px;
  display: grid;
  align-content: start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  color: var(--text);
  background: var(--white);
  text-align: left;
}

.message-user.active {
  border-color: var(--blue);
  border-width: 2px;
  background: var(--soft-blue);
}

.message-user-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.message-user strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-user span,
.message-user em,
.message-user small {
  overflow: hidden;
  color: #747a74;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-user em {
  color: var(--green);
  font-weight: 950;
}

.message-user small {
  display: -webkit-box;
  margin-top: 4px;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.unread-badge {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--white) !important;
  background: var(--red);
  font-size: 11px;
  font-weight: 950;
}

.conversation-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.conversation-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conversation-head strong,
.conversation-head span span {
  display: block;
}

.conversation-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.conversation-head span span {
  color: #747a74;
  font-size: 12px;
  font-weight: 800;
}

.message-list {
  display: grid;
  gap: 8px;
}

.conversation-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
}

.conversation-empty strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.conversation-empty span {
  color: #747a74;
  font-size: 12px;
  font-weight: 800;
}

.message-bubble-row {
  display: flex;
  justify-content: flex-start;
}

.message-bubble-row.mine {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(78%, 430px);
  display: grid;
  gap: 4px;
}

.message-bubble p {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.36;
}

.message-bubble-row.mine p {
  color: var(--white);
  background: var(--blue);
}

.message-bubble span {
  color: #747a74;
  font-size: 11px;
  font-weight: 800;
}

.message-bubble-row.mine span {
  text-align: right;
}

.message-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.message-compose textarea {
  min-height: 42px;
  max-height: 130px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fffdf9;
  resize: vertical;
}

.message-compose .icon-button:disabled {
  cursor: not-allowed;
  color: var(--white);
  background: #8b8f8a;
}

.settings-screen {
  display: grid;
  gap: 14px;
}

.settings-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.settings-card h3 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.settings-row,
.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 7px;
  background: var(--paper);
}

.settings-row span,
.settings-toggle span,
.settings-note {
  color: #747a74;
  font-size: 12px;
  font-weight: 900;
}

.settings-row strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-align: right;
}

.settings-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.settings-signout {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 13px;
  color: var(--white);
  background: var(--red);
  font-weight: 950;
}

.backend-screen {
  display: grid;
  gap: 14px;
}

.backend-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.backend-metric {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.backend-metric strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.backend-metric span,
.backend-row small,
.backend-user-form small {
  color: #747a74;
  font-size: 11px;
  font-weight: 800;
}

.backend-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.backend-tabs button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 10px 8px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 950;
}

.backend-tabs button:last-child {
  border-right: 0;
}

.backend-tabs button.active {
  color: var(--white);
  background: var(--ink);
}

.backend-panel {
  display: grid;
  gap: 12px;
}

.backend-panel h3 {
  margin-bottom: 0;
}

.backend-form,
.backend-list,
.backend-users {
  display: grid;
  gap: 8px;
}

.backend-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.backend-form textarea,
.backend-grid input,
.backend-grid select,
.backend-user-form input,
.backend-user-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fffdf9;
}

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

.backend-grid .primary-button,
.backend-grid .backend-note,
.backend-user-form .ghost-button,
.backend-user-form > div {
  grid-column: 1 / -1;
}

.backend-active {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.backend-active input {
  width: auto;
  flex: 0 0 auto;
}

.backend-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 7px;
  background: var(--paper);
}

.backend-row strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.backend-row span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.quiet-time-box {
  display: grid;
  gap: 10px;
}

.quiet-time-box .settings-toggle {
  margin: 0;
}

.quiet-time-box small {
  display: block;
  margin-top: 2px;
  color: #747a74;
  font-size: 11px;
  font-weight: 800;
}

.quiet-time-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiet-time-times label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.quiet-time-times input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fffdf9;
}

.quiet-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.quiet-days button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 4px;
  color: var(--ink);
  background: var(--paper);
  font-size: 11px;
  font-weight: 950;
}

.quiet-days button.active {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.compose-toggle {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-green);
}

.compose-toggle span {
  display: grid;
  gap: 2px;
}

.compose-toggle strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.compose-toggle small {
  color: #747a74;
  font-size: 12px;
  font-weight: 800;
}

.settings-note {
  padding: 10px;
  border-radius: 7px;
  background: var(--soft-blue);
  color: var(--ink);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.segmented button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 5px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 950;
}

.segmented button.active {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.event-when-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 8px;
}

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

.attach-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-button {
  display: block;
  padding: 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
}

.file-button input {
  display: none;
}

.draft-list {
  display: grid;
  gap: 8px;
}

.draft-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 7px;
  background: var(--paper);
}

.draft-thumb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-weight: 950;
}

.draft-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-button {
  border: 0;
  color: #727772;
  background: transparent;
  font-size: 22px;
  font-weight: 950;
}

.calendar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-tools button,
.calendar-tools select {
  border: 0;
  border-radius: 7px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--white);
  font-size: 12px;
  font-weight: 950;
}

.calendar-tools select {
  max-width: 156px;
  border: 1px solid var(--line);
}

.repeat-line {
  margin-top: 2px;
  color: var(--green);
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.summary-pill {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
}

.calendar-box {
  padding: 10px;
  margin-top: 14px;
}

.weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekdays {
  margin-bottom: 8px;
  color: #777d76;
  text-align: center;
  font-size: 11px;
  font-weight: 950;
}

.day-cell {
  border: 0;
  min-height: 50px;
  padding: 5px 2px;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 950;
}

.day-cell.has-events {
  background: var(--paper);
}

.day-cell.outside {
  color: rgba(115, 122, 115, 0.55);
}

.day-cell.selected .day-number {
  color: var(--white);
  background: var(--ink);
}

.day-cell.today:not(.selected) .day-number {
  background: var(--soft-blue);
}

.day-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border-radius: 6px;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  height: 8px;
  margin-top: 5px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.agenda {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.agenda-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.agenda-card .calendar-add-button {
  margin-top: 8px;
}

.agenda-thumb {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
}

.time-stack {
  width: 58px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.time-stack span {
  display: block;
  margin-top: 4px;
  color: #747a74;
  font-size: 11px;
}

.agenda-bar {
  width: 4px;
  min-height: 54px;
  border-radius: 3px;
  background: var(--blue);
}

.empty-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(18, 41, 69, 0.58);
}

.modal.open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(100%, 760px);
  max-height: 88vh;
  overflow: auto;
  border-radius: 8px;
  background: var(--white);
}

.modal-card img,
.modal-card iframe {
  width: 100%;
  display: block;
  border: 0;
}

.modal-card iframe {
  height: 78vh;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border: 0;
  border-radius: 7px;
  width: 36px;
  height: 36px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.62);
  font-size: 20px;
}

.reaction-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(18, 41, 69, 0.42);
}

.reaction-modal.open {
  display: flex;
}

.reaction-card {
  position: relative;
  width: min(100%, 420px);
  max-height: 72vh;
  overflow: auto;
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.reaction-card h3 {
  margin: 0 44px 14px 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.reaction-close {
  color: var(--white);
  background: var(--ink);
}

.reaction-list {
  display: grid;
  gap: 8px;
}

.reaction-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.reaction-user strong,
.reaction-user small {
  display: block;
}

.reaction-user strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.reaction-user small {
  margin-top: 2px;
  color: #747a74;
  font-size: 11px;
  font-weight: 800;
}

@media (min-width: 900px) {
  .app-shell {
    margin-top: 18px;
    margin-bottom: 18px;
    min-height: calc(100vh - 36px);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
}

@media (max-width: 520px) {
  .header-title {
    font-size: 30px;
  }

  .connection {
    display: none;
  }

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

  .audience-grid {
    grid-template-columns: 1fr;
  }

  .quiet-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

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

  .backend-tabs button:nth-child(2) {
    border-right: 0;
  }

  .backend-tabs button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}
