/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --bg: #f5efe6;
  --surface: #fffdf9;
  --surface-strong: #fffaf2;
  --border: #decfb8;
  --text: #2f2419;
  --muted: #6e6152;
  --brand: #0f766e;
  --brand-deep: #115e59;
  --accent: #c2410c;
  --danger: #b42318;
  --warning: #b45309;
  --shadow: 0 18px 40px rgba(68, 47, 27, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(194, 65, 12, 0.12), transparent 24%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
}

body.mobile-menu-open {
  overflow: hidden;
}

a {
  color: var(--brand-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p, h1, h2, h3 {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(222, 207, 184, 0.8);
  background: rgba(255, 253, 249, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
}

.brand-mark__eyebrow,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

.brand-mark__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__menu-button,
.topbar__close-button {
  display: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.topbar__menu-button {
  width: 2.9rem;
  height: 2.9rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.topbar__menu-button span {
  display: block;
  width: 1.2rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.topbar__menu-button span + span {
  margin-top: 0.25rem;
}

.topbar__mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
}

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

.topbar__mobile-panel-inner {
  width: 100%;
  min-height: 100vh;
  background: #f7f1e8;
  padding: 1rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  transform: translateY(-1.5rem);
  transition: transform 220ms ease;
}

.topbar__mobile-panel.is-open .topbar__mobile-panel-inner {
  transform: translateY(0);
}

.topbar__mobile-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
}

.topbar__mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 1rem;
}

.nav-link--mobile {
  width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(222, 207, 184, 0.85);
  background: rgba(255, 253, 249, 0.84);
  box-shadow: 0 10px 24px rgba(68, 47, 27, 0.08);
}

.topbar__mobile-meta {
  margin-top: auto;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.topbar__mobile-logout,
.topbar__mobile-logout .button {
  width: 100%;
}

.topbar__close-button {
  position: relative;
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 auto;
}

.topbar__close-button span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.15rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.topbar__close-button span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.topbar__close-button span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.topbar__user {
  color: var(--muted);
  font-weight: 600;
}

.nav-link {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.nav-link--active,
.nav-link:hover {
  background: rgba(15, 118, 110, 0.1);
  color: var(--brand-deep);
  text-decoration: none;
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.beta-banner-wrap,
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.flash-stack {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 2rem;
}

.profile-calendar-subscription {
  padding-top: 1rem;
  border-top: 1px solid rgba(222, 207, 184, 0.85);
}

.copy-field {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.copy-field .input {
  flex: 1 1 24rem;
}

.field-help {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-calendar-subscription__help {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.beta-banner {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(194, 65, 12, 0.18);
  background: linear-gradient(180deg, #fff6eb 0%, #fffdf8 100%);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.beta-banner p {
  margin-top: 0.35rem;
  color: var(--muted);
}

.beta-banner__actions {
  display: flex;
  align-items: center;
}

.site-footer {
  margin-top: 2.5rem;
  padding: 0 0 2rem;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(222, 207, 184, 0.8);
  color: var(--muted);
}

.flash {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.flash-notice {
  background: #e3f5f2;
  color: var(--brand-deep);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.flash-alert {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.16);
}

.hero-card,
.panel,
.stat-card {
  background: var(--surface);
  border: 1px solid rgba(222, 207, 184, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.hero-card--narrow,
.panel--narrow {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-card h1,
.page-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.02;
  margin-top: 0.4rem;
}

.hero-card__body {
  max-width: 44rem;
  margin-top: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.hero-card__actions,
.page-header__actions,
.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-form--stacked {
  max-width: 24rem;
}

.stats-grid,
.grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.25rem 1.4rem;
}

.stat-card__label,
.mini-heading {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card__value {
  margin-top: 0.5rem;
  font-size: 2rem;
  font-weight: 700;
}

.panel {
  padding: 1.5rem;
}

.panel--danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff7f7;
}

.panel__title,
.section-heading h2,
.panel h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(222, 207, 184, 0.8);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-strong) 100%);
}

.item-row--card {
  box-shadow: 0 8px 20px rgba(68, 47, 27, 0.06);
}

.item-row__main,
.stack-lg,
.stack-md,
.stack-sm,
.stack-xs,
.action-stack {
  display: flex;
  flex-direction: column;
}

.stack-lg { gap: 1.5rem; }
.stack-md { gap: 1rem; }
.stack-sm { gap: 0.6rem; }
.stack-xs { gap: 0.35rem; }
.action-stack { gap: 0.7rem; }

.item-row__header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.item-row__title {
  font-size: 1.25rem;
  font-weight: 700;
}

.item-row__meta,
.item-row__body,
.item-row__alert,
.detail-pair__label,
.field label,
.field--checkbox span,
.error-list {
  color: var(--muted);
}

.item-row__body,
.detail-pair span,
.panel p {
  line-height: 1.6;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

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

.summary-chip {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.82);
  border: 1px solid rgba(222, 207, 184, 0.75);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.summary-chip__label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-row__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 110px;
}

.item-row--card .item-row__actions {
  min-width: 132px;
}

.item-row__alert {
  margin-top: 0.25rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #efe6d8;
  color: #644b2f;
}

.badge-success { background: #dff6ef; color: #0f5f58; }
.badge-muted { background: #ece8e2; color: #655c52; }
.badge-neutral { background: #e7e3dd; color: #5b5248; }
.badge-danger { background: #fde8e7; color: var(--danger); }
.badge-warning { background: #fff1da; color: var(--warning); }
.badge-info { background: #e3eefc; color: #1f4f90; }
.badge-event { background: #dff6ef; color: #0d766e; }
.badge-notice { background: #fff1da; color: #a45108; }
.badge-deadline { background: #fde8e7; color: var(--danger); }
.badge-audience { background: #efe7fb; color: #6943a7; }
.badge-reminder { background: #e6f4f1; color: #0b655f; }
.badge-featured { background: #ffe7c2; color: #a45a03; }

.button,
.button_to button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button--primary,
.button_to .button--primary {
  background: var(--brand);
  color: white;
}

.button--primary:hover,
.button_to .button--primary:hover {
  background: var(--brand-deep);
  text-decoration: none;
}

.button--secondary,
.button_to .button--secondary {
  background: #f2ebe0;
  color: var(--text);
}

.button--ghost,
.button_to .button--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(47, 36, 25, 0.15);
}

.button--compact {
  padding: 0.65rem 0.95rem;
}

.grid--main {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.95fr);
}

.grid--detail {
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
}

.grid--calendar {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  align-items: start;
}

.grid--preview {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  align-items: start;
}

.grid--weekly-preview {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  align-items: start;
}

.grid--ask {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  align-items: start;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field label {
  font-size: 0.92rem;
  font-weight: 700;
}

.field--span-2 {
  grid-column: span 2;
}

.input {
  width: 100%;
  padding: 0.82rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(47, 36, 25, 0.14);
  background: white;
  color: var(--text);
  font: inherit;
}

.input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--brand);
}

.input--search {
  min-width: min(28rem, 100%);
}

.input--textarea {
  min-height: 140px;
  resize: vertical;
}

.input--code {
  font-family: "SFMono-Regular", "Menlo", monospace;
  line-height: 1.5;
}

.input--short {
  min-height: 88px;
}

.field--checkbox label,
.choice-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.choice-pill {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(47, 36, 25, 0.12);
  background: #fffdfa;
  font-weight: 600;
}

.detail-pair {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(222, 207, 184, 0.7);
}

.detail-pair__label {
  font-weight: 700;
}

.error-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.calendar-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ask-shell {
  display: flex;
  flex-direction: column;
}

.empty-state {
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: #fffaf2;
  border: 1px dashed rgba(47, 36, 25, 0.16);
}

.ask-samples {
  padding-top: 0.35rem;
  border-top: 1px solid rgba(222, 207, 184, 0.75);
}

.ask-sample-button {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.ask-answer-card {
  padding: 1.3rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: linear-gradient(180deg, #f8fffd 0%, #f1fbf8 100%);
}

.ask-answer-card__question,
.ask-answer-card__grounding,
.ask-answer-card__hint {
  color: var(--muted);
}

.ask-answer-card__body {
  font-size: 1.1rem;
  line-height: 1.7;
}

.item-row--stacked {
  align-items: flex-start;
}

.calendar-filter-bar,
.calendar-family-bar,
.calendar-toolbar,
.calendar-detail__section,
.calendar-summary__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calendar-filter-bar {
  align-items: center;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 36, 25, 0.12);
  background: #fffdfa;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.filter-pill:hover,
.filter-pill--active {
  background: rgba(15, 118, 110, 0.11);
  border-color: rgba(15, 118, 110, 0.2);
  color: var(--brand-deep);
  text-decoration: none;
}

.filter-pill__meta {
  color: inherit;
  opacity: 0.8;
  font-size: 0.82rem;
}

.family-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.family-picker label {
  font-weight: 700;
  color: var(--muted);
}

.family-picker .input {
  width: auto;
  min-width: 220px;
}

.preview-filter-bar,
.preview-toolbar,
.preview-envelope__meta,
.email-card__row,
.digest-item__header,
.source-item__header,
.preview-context-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.preview-filter-bar {
  flex-wrap: wrap;
}

.preview-toolbar {
  align-items: flex-end;
  flex-wrap: wrap;
}

.preview-panel {
  min-height: 720px;
}

.email-preview {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(222, 207, 184, 0.82);
  background: linear-gradient(180deg, #fffdf8 0%, #fff8ef 100%);
}

.email-preview__section + .email-preview__section {
  padding-top: 1rem;
  border-top: 1px solid rgba(222, 207, 184, 0.75);
}

.preview-envelope__meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.preview-envelope__label strong {
  color: var(--text);
}

.preview-envelope__subject {
  padding: 1.2rem 1.35rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff7ec 0%, #fffdf9 100%);
  border: 1px solid rgba(222, 207, 184, 0.85);
}

.preview-envelope__subject h2 {
  margin-top: 0.4rem;
  font-size: 1.45rem;
  font-family: Georgia, "Times New Roman", serif;
}

.preview-envelope__subject p {
  margin-top: 0.45rem;
  color: var(--muted);
}

.email-card,
.digest-card,
.weekly-card,
.sms-context,
.source-item {
  border: 1px solid rgba(222, 207, 184, 0.82);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-strong) 100%);
}

.email-card,
.digest-card,
.weekly-card,
.sms-context {
  padding: 1.35rem;
}

.email-card h3,
.digest-card h3,
.weekly-card h3,
.sms-context h3,
.source-item h3 {
  font-size: 1.3rem;
  font-family: Georgia, "Times New Roman", serif;
  margin: 0.35rem 0 0;
}

.email-card__details {
  margin: 1.2rem 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(222, 207, 184, 0.8);
  border-bottom: 1px solid rgba(222, 207, 184, 0.8);
}

.email-card__row {
  align-items: baseline;
  padding: 0.45rem 0;
}

.email-card__row span {
  color: var(--muted);
  font-weight: 700;
}

.email-card__body {
  line-height: 1.7;
  color: var(--text);
}

.email-card__footer {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.digest-item,
.weekly-day,
.source-item {
  padding: 1rem 1.05rem;
}

.digest-item {
  border: 1px solid rgba(222, 207, 184, 0.74);
  border-radius: var(--radius-md);
  background: #fffdfa;
}

.digest-item h4 {
  margin: 0;
  font-size: 1.05rem;
}

.digest-item__header {
  align-items: flex-start;
}

.digest-item__header p {
  margin-top: 0.25rem;
}

.weekly-day {
  background: #fffdfa;
}

.weekly-day + .weekly-day {
  margin-top: 0.9rem;
}

.sms-frame {
  max-width: 100%;
}

.sms-bubble {
  max-width: 34rem;
  padding: 1.15rem 1.25rem;
  border-radius: 24px 24px 24px 10px;
  background: linear-gradient(180deg, #dff6ef 0%, #cbede5 100%);
  box-shadow: inset 0 -1px 0 rgba(15, 118, 110, 0.1);
}

.sms-bubble p {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.6;
}

.source-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.source-item__header {
  align-items: flex-start;
}

.preview-context-row {
  align-items: baseline;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(222, 207, 184, 0.7);
}

.preview-context-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.calendar-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calendar-toolbar {
  justify-content: space-between;
  align-items: center;
}

.calendar-toolbar__actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.section-heading__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.calendar-month-label {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-family: Georgia, "Times New Roman", serif;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.65rem;
}

.calendar-weekday {
  padding: 0.4rem 0.3rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.calendar-day {
  min-height: 148px;
  padding: 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(222, 207, 184, 0.8);
  background: linear-gradient(180deg, #fffdf8 0%, #fbf5ea 100%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.calendar-day--outside {
  opacity: 0.52;
}

.calendar-day--today {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.calendar-day--selected {
  border-color: rgba(180, 83, 9, 0.4);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.12);
}

.calendar-day__number {
  font-size: 0.95rem;
  font-weight: 700;
}

.calendar-day__events {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.calendar-event-chip {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 0.58rem 0.65rem;
  text-align: left;
  background: #eef7f6;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.calendar-event-chip:hover,
.calendar-event-chip--active {
  background: #dff2ef;
}

.calendar-event-chip:visited {
  color: var(--text);
}

.calendar-event-chip--notice {
  background: #fff3de;
}

.calendar-event-chip--deadline {
  background: #feeceb;
}

.calendar-event-chip--canceled {
  box-shadow: inset 0 0 0 1px rgba(190, 24, 93, 0.18);
  text-decoration: line-through;
}

.calendar-event-chip__time {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.calendar-event-chip__title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.calendar-more {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.calendar-empty-state {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: #fffaf2;
  border: 1px dashed rgba(47, 36, 25, 0.18);
  color: var(--muted);
  line-height: 1.6;
}

.calendar-mobile {
  display: none;
}

.calendar-mobile-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}

.calendar-mobile-day {
  min-height: 56px;
  width: 100%;
  border: 1px solid rgba(222, 207, 184, 0.8);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffdf8 0%, #fbf5ea 100%);
  color: var(--text);
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.45rem;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.calendar-mobile-day--outside {
  opacity: 0.48;
}

.calendar-mobile-day--today {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.calendar-mobile-day--selected {
  border-color: rgba(180, 83, 9, 0.4);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.12);
  background: linear-gradient(180deg, #fff8ed 0%, #f9efdf 100%);
}

.calendar-mobile-day__number {
  font-size: 0.95rem;
  font-weight: 700;
}

.calendar-mobile-day__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: #dff2ef;
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 700;
}

.calendar-mobile-agenda {
  border-top: 1px solid rgba(47, 36, 25, 0.1);
  padding-top: 1rem;
}

.calendar-mobile-agenda__meta {
  text-align: left;
}

.grid--family-calendar {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 1.25rem;
  align-items: start;
}

.family-dashboard-calendar {
  min-width: 0;
}

.family-dashboard-agenda {
  min-width: 0;
}

.family-dashboard-agenda__timeframe {
  text-align: right;
}

.family-dashboard-agenda__footer,
.family-dashboard-agenda__fallback {
  border-top: 1px solid rgba(47, 36, 25, 0.1);
  padding-top: 1rem;
}

.family-dashboard-agenda__actions {
  justify-content: flex-start;
}

.family-dashboard-mobile-agenda {
  display: none;
}

.family-dashboard-agenda--wide,
.family-dashboard-calendar--wide,
.family-dashboard-footer {
  width: 100%;
}

.family-dashboard-footer__body {
  max-width: 52rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.family-dashboard-footer__actions {
  justify-content: flex-start;
}

.family-filter-bar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.filter-pill--inactive {
  opacity: 0.58;
  background: #f6efe5;
}

.family-agenda-group__heading {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.item-row--agenda .item-row__header {
  align-items: flex-start;
}

.calendar-board--featured {
  gap: 1.35rem;
}

.calendar-board--featured .calendar-month-label {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

.calendar-board--featured .calendar-day {
  min-height: 162px;
}

@media (max-width: 900px) {
  .beta-banner,
  .site-footer__inner,
  .hero-card,
  .page-header,
  .item-row {
    flex-direction: column;
  }

  .stats-grid,
  .summary-strip,
  .summary-strip--compact,
  .grid--main,
  .grid--detail,
  .grid--calendar,
  .grid--family-calendar,
  .grid--preview,
  .grid--weekly-preview,
  .grid--ask,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .field--span-2 {
    grid-column: span 1;
  }

  .page-shell,
  .flash-stack,
  .beta-banner-wrap,
  .site-footer__inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .search-form,
  .hero-card__actions,
  .topbar__nav,
  .beta-banner__actions {
    width: 100%;
  }

  .family-dashboard-agenda__timeframe {
    text-align: left;
  }

  .input--search,
  .search-form .button,
  .beta-banner__actions .button {
    width: 100%;
  }

  .topbar {
    flex-direction: row;
    padding: 0.7rem 1rem;
  }

  .topbar__nav--desktop {
    display: none;
  }

  .topbar__menu-button,
  .topbar__close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .brand-mark {
    gap: 0.05rem;
  }

  .brand-mark__eyebrow {
    font-size: 0.64rem;
    letter-spacing: 0.11em;
  }

  .brand-mark__title {
    font-size: 1rem;
    line-height: 1.05;
  }

  .topbar__mobile-panel .brand-mark__title {
    font-size: 1.15rem;
  }

  .topbar__mobile-panel .button,
  .topbar__mobile-panel .button_to {
    width: 100%;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 0.45rem;
  }

  .calendar-day {
    min-height: 124px;
    padding: 0.65rem;
  }

  .preview-toolbar,
  .preview-envelope__meta,
  .email-card__row,
  .digest-item__header,
  .source-item__header,
  .preview-context-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  .calendar-weekdays,
  .calendar-grid {
    display: none;
  }

  .calendar-mobile {
    display: flex;
  }

  .calendar-mobile-grid {
    gap: 0.3rem;
  }

  .calendar-mobile-day {
    min-height: 60px;
  }

  .family-dashboard-mobile-agenda {
    display: flex;
  }

  .family-dashboard-agenda,
  .family-dashboard-desktop-calendar {
    display: none;
  }

  .family-dashboard-mobile-agenda .item-row {
    width: 100%;
  }

  .family-dashboard-mobile-agenda .item-row__header {
    gap: 0.75rem;
  }

  .family-dashboard-mobile-agenda .badge-row {
    gap: 0.4rem;
  }
}
