:root {
  --bg: #f6f2ec;
  --bg-accent: #efe9df;
  --surface: #fbf8f3;
  --surface-strong: #ffffff;
  --surface-alt: #f1ebe2;
  --line: #e6dfd5;
  --line-strong: #d8cfbf;
  --text: #221932;
  --muted: #877a99;
  --muted-strong: #4a3d5e;
  --accent: #6f4ad8;
  --accent-strong: #5a39bd;
  --accent-soft: #ede5fa;
  --accent-ink: #3a2685;
  --success: #4f7a4a;
  --warning: #b56a2b;
  --warning-soft: #f5e7d4;
  --danger: #8a3340;
  --danger-soft: #f5e1e4;
  --shadow-sm: 0 1px 0 rgba(34, 25, 50, 0.04);
  --shadow: 0 1px 2px rgba(34, 25, 50, 0.04), 0 12px 24px -16px rgba(34, 25, 50, 0.18);
  --shadow-lg: 0 1px 2px rgba(34, 25, 50, 0.04), 0 30px 60px -28px rgba(34, 25, 50, 0.28);
  --section-rose: #ddc5bf;
  --section-mint: #cfdac7;
  --section-peach: #e9d5bd;
  --section-lilac: #cbbce9;
  --section-sky: #d9c6f2;
  --section-blush: #e3d4dc;
  --section-cream: #dfd3c1;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 74px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.password-toggle:hover {
  opacity: 0.78;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  padding: 28px 22px;
  background: var(--surface);
  color: var(--text);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  z-index: 6;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-close-button {
  display: none;
  margin-left: auto;
  margin-bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.brand-logo {
  display: block;
  width: min(100%, 274px);
  height: auto;
  object-fit: contain;
  opacity: 0.96;
  margin-bottom: 10px;
}

.brand-collapsed-icon {
  display: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 12px;
}

.brand-logo-top {
  margin-bottom: 2px;
}

.brand {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-setup-card strong,
#accountName {
  color: var(--accent-ink);
}

.auth-link-button {
  justify-content: center;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.main {
  padding: 28px;
  position: relative;
  z-index: 1;
}

.install-banner {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

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

.install-banner-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  min-width: 0;
}

.install-banner strong,
.install-banner span {
  font-weight: 700;
  font-size: 0.8rem;
}

.install-banner p {
  margin: 6px 0 0 68px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.74rem;
}

.install-banner-control {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.install-banner-dismiss {
  font-size: 0.98rem;
}

.install-divider {
  display: inline-block;
  margin: 0 6px;
  opacity: 0.7;
}

.install-banner-stub {
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  align-self: flex-start;
}

.hero,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) auto;
  align-items: end;
  gap: 28px;
  padding: 22px 26px;
  border-radius: 22px;
  margin-bottom: 22px;
}

.hero-content {
  max-width: 36rem;
}

.hero h2 {
  margin: 8px 0 10px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.9rem, 2.6vw, 2.8rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  max-width: 15ch;
}

.hero-copy {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  align-items: center;
  align-self: center;
  justify-self: end;
}

.app-status {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  line-height: 1.5;
}

.app-status-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-status-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  margin-left: auto;
}

.app-status-close:hover {
  opacity: 0.72;
}

.app-status.is-success {
  border-color: rgba(79, 122, 74, 0.22);
  background: rgba(79, 122, 74, 0.08);
}

.app-status.is-info {
  border-color: rgba(111, 74, 216, 0.22);
  background: rgba(237, 229, 250, 0.72);
}

.app-status.is-error {
  border-color: rgba(138, 51, 64, 0.24);
  background: rgba(245, 225, 228, 0.86);
}

.dashboard-grid,
.content-grid {
  display: grid;
  gap: 22px;
  margin-bottom: 22px;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.content-grid {
  grid-template-columns: minmax(340px, 1.05fr) minmax(0, 0.95fr);
}

.panel {
  position: relative;
  border-radius: 20px;
  padding: 20px;
  overflow: visible;
}

.panel.has-open-combo {
  z-index: 25;
}

.sidebar-panel {
  background: var(--surface-strong);
  border-color: var(--line);
  box-shadow: none;
}

.shortcut-drawer {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  overflow: hidden;
}

.shortcut-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  color: var(--text);
  background: rgba(241, 235, 226, 0.65);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.shortcut-summary::after {
  content: "+";
  font-size: 1.1rem;
  margin-left: auto;
}

.shortcut-summary-icon {
  width: 22px;
  min-width: 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 1.02rem;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.12));
}

.shortcut-summary-icon.is-account {
  color: var(--accent);
}

.shortcut-summary-icon.is-people {
  color: var(--warning);
}

.shortcut-summary-icon.is-navigation {
  color: var(--muted-strong);
}

.shortcut-summary-icon.is-summary {
  color: var(--accent-ink);
}

.shortcut-summary-icon.is-notifications {
  color: var(--accent);
}

.required-marker {
  color: var(--accent);
  font-weight: 800;
}

.shortcut-summary-label {
  min-width: 0;
}

.shortcut-drawer[open] .shortcut-summary::after {
  content: "-";
}

.shortcut-nav {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.shortcut-link {
  display: block;
  padding: 10px 11px;
  border-radius: 12px;
  color: var(--muted-strong);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.shortcut-link:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
  border-color: rgba(111, 74, 216, 0.18);
  color: var(--accent-ink);
}

.setup-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.auth-setup-card {
  margin-bottom: 14px;
}

.supabase-drawer {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.supabase-drawer summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}

.supabase-drawer summary::-webkit-details-marker {
  display: none;
}

.supabase-drawer summary::after {
  content: "+";
  float: right;
}

.supabase-drawer[open] summary::after {
  content: "-";
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.calendar-heading-actions {
  width: 100%;
  justify-content: space-between;
  margin-top: 10px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-heading h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 6px rgba(237, 229, 250, 0.9);
  flex: 0 0 10px;
}

.panel-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex: 0 0 auto;
}

#guidanceSection.needs-attention {
  border-color: rgba(181, 106, 43, 0.36);
  box-shadow: 0 14px 28px rgba(181, 106, 43, 0.08);
}

#guidanceSection.needs-attention .panel-heading h2::before {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(245, 231, 212, 0.9);
}

.panel-inline-control {
  margin-bottom: 12px;
}

.people-list,
.stack {
  display: grid;
  gap: 12px;
}

.person-card,
.summary-card,
.insight-card,
.history-card,
.upcoming-card,
.advice-card,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.person-card {
  padding: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.person-card:hover,
.person-card.is-active {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.person-card strong,
.summary-card strong,
.insight-card strong,
.history-card strong,
.upcoming-card strong,
.advice-card strong {
  display: block;
}

.person-meta,
.summary-meta,
.card-copy,
.mini-copy {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.42;
}

.sidebar .person-meta,
.sidebar .mini-copy {
  color: var(--muted);
}

.stats-panel {
  display: grid;
  gap: 14px;
}

.drawer-panel {
  margin-top: 0;
}

#relationshipSection,
#signalsSection,
#memorySection,
#guidanceSection,
#historySection,
#upcomingSection,
#calendarSection {
  border-top-width: 3px;
}

#relationshipSection {
  border-top-color: var(--section-rose);
}

#signalsSection {
  border-top-color: var(--section-mint);
}

#memorySection {
  border-top-color: var(--section-peach);
}

#guidanceSection {
  border-top-color: var(--section-lilac);
}

#historySection {
  border-top-color: var(--section-sky);
}

#upcomingSection {
  border-top-color: var(--section-blush);
}

#calendarSection {
  border-top-color: var(--section-cream);
}

#relationshipSection .panel-heading h2::before {
  background: var(--section-rose);
  box-shadow: 0 0 0 6px rgba(221, 197, 191, 0.22);
}

#signalsSection .panel-heading h2::before {
  background: var(--section-mint);
  box-shadow: 0 0 0 6px rgba(207, 218, 199, 0.28);
}

#memorySection .panel-heading h2::before {
  background: var(--section-peach);
  box-shadow: 0 0 0 6px rgba(233, 213, 189, 0.3);
}

#guidanceSection .panel-heading h2::before {
  background: var(--section-lilac);
  box-shadow: 0 0 0 6px rgba(203, 188, 233, 0.26);
}

#historySection .panel-heading h2::before {
  background: var(--section-sky);
  box-shadow: 0 0 0 6px rgba(217, 198, 242, 0.28);
}

#upcomingSection .panel-heading h2::before {
  background: var(--section-blush);
  box-shadow: 0 0 0 6px rgba(227, 212, 220, 0.28);
}

#calendarSection .panel-heading h2::before {
  background: var(--section-cream);
  box-shadow: 0 0 0 6px rgba(223, 211, 193, 0.3);
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}

.stat-button {
  width: 100%;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.stat-button:hover,
.stat-button.is-active {
  background: var(--accent-soft);
  border-color: rgba(111, 74, 216, 0.24);
}

.stat-label {
  color: var(--muted);
}

.spotlight-panel select {
  width: 100%;
  max-width: none;
}

.selected-summary {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
}

.spotlight-panel .panel-body {
  display: grid;
  align-content: start;
  gap: 12px;
}

#relationshipSection,
#memorySection {
  height: 100%;
}

.summary-card,
.insight-card,
.history-card,
.upcoming-card,
.advice-card {
  background: var(--surface-strong);
  padding: 14px 15px;
}

.insight-button {
  width: 100%;
  text-align: left;
  background: var(--surface-strong);
  color: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.insight-button:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 74, 216, 0.26);
  box-shadow: var(--shadow);
}

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

.summary-chip {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--line);
}

.summary-chip span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

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

.ai-input-grid {
  margin-bottom: 16px;
}

#followupPanel {
  padding-top: 4px;
}

.form-grid label {
  display: grid;
  gap: 7px;
}

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

.form-grid label span {
  font-size: 0.88rem;
  color: var(--muted);
}

.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.combo-field {
  position: relative;
  z-index: 1;
}

.combo-field:focus-within,
.combo-field.is-open {
  z-index: 40;
}

.combo-field input,
.combo-field select {
  padding-right: 42px;
}

.native-select-hidden {
  display: none;
}

.combo-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.92rem;
}

.combo-field-static .combo-toggle-static {
  pointer-events: none;
}

.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 6px;
}

.combo-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.combo-option:hover {
  background: var(--accent-soft);
}

.combo-option small {
  color: var(--muted);
  font-size: 0.78rem;
}

.combo-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(111, 74, 216, 0.14);
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.compact-actions {
  margin-top: 0;
  gap: 8px;
  justify-content: flex-end;
}

.edit-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(111, 74, 216, 0.16);
  color: var(--text);
  font-size: 0.92rem;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 0 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.ghost-button {
  padding: 0 14px;
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.danger-button {
  color: var(--danger);
  border-color: rgba(138, 51, 64, 0.2);
  background: var(--danger-soft);
}

.icon-button {
  width: 40px;
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-controls .icon-button {
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
  font-size: 1rem;
  line-height: 1;
}

.calendar-controls .icon-button:hover {
  background: transparent;
  transform: none;
  opacity: 0.78;
}

.calendar-controls .icon-button:focus-visible {
  outline: 2px solid rgba(111, 74, 216, 0.24);
  outline-offset: 4px;
  border-radius: 999px;
}

.month-label {
  min-width: 140px;
  text-align: center;
  font-weight: 700;
}

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

.calendar-weekday {
  padding: 2px 4px 4px;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted);
}

.calendar-day {
  min-height: 72px;
  padding: 5px;
  background: var(--surface-strong);
}

.calendar-day.is-muted {
  background: var(--surface);
}

.calendar-day.is-outside-month {
  background: rgba(239, 233, 223, 0.55);
}

.calendar-day.is-outside-month .calendar-day-number {
  color: rgba(135, 122, 153, 0.7);
}

.calendar-day-number {
  font-weight: 700;
  margin-bottom: 3px;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--text);
}

.calendar-event {
  display: block;
  margin-top: 3px;
  padding: 3px 5px;
  border-radius: 8px;
  font-size: 0.62rem;
  line-height: 1.2;
  background: var(--accent-soft);
  color: var(--accent-ink);
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.calendar-event.is-support {
  background: var(--warning-soft);
  color: #6b3a14;
}

.calendar-empty-state {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 14px 10px;
}

.advice-title {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.advice-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.advice-list li + li {
  margin-top: 6px;
}

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

.message-option {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  line-height: 1.55;
}

.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.empty-state.is-warning {
  color: var(--danger);
}

.guidance-empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.guidance-empty-state p {
  margin: 0;
}

.guidance-loading-card {
  border-style: dashed;
}

.guidance-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
}

.guidance-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(111, 74, 216, 0.14);
  border-top-color: var(--accent);
  animation: guidance-spin 0.8s linear infinite;
}

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

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(79, 122, 74, 0.12);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-chip.is-warm {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-chip.is-sample {
  background: var(--danger-soft);
  color: var(--danger);
}

.calendar-panel {
  margin-bottom: 22px;
  overflow-x: auto;
}

.notification-panel .panel-heading h2 {
  font-size: 0.96rem;
}

.notification-panel .stack {
  gap: 10px;
}

.notification-card {
  padding: 10px 12px;
}

.notification-card .card-copy {
  font-size: 0.86rem;
}

.notification-panel .ghost-button {
  min-height: 38px;
  padding: 0 12px;
}

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

.check-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.check-option input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.check-option span {
  font-size: 0.88rem;
  color: var(--muted-strong);
}

@media (max-width: 1120px) {
  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    width: 78px;
    padding: 14px 8px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    border-right: 1px solid var(--line);
    transition: width 220ms ease, padding 220ms ease;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar:focus-within,
  .sidebar:has(.shortcut-drawer[open]) {
    width: 320px;
    padding: 28px 22px;
  }

  .sidebar:focus-within .sidebar-close-button,
  .sidebar:has(.shortcut-drawer[open]) .sidebar-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar .brand {
    margin-bottom: 14px;
  }

  .sidebar .brand-collapsed-icon {
    display: block;
    margin: 0 auto 8px;
  }

  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .brand {
    pointer-events: auto;
  }

  .sidebar .brand-logo {
    display: none;
  }

  .sidebar .brand-copy,
  .sidebar .brand h1,
  .sidebar .brand .eyebrow {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    pointer-events: none;
    transition: opacity 140ms ease, max-height 180ms ease;
  }

  .sidebar:has(.shortcut-drawer[open]) .brand-copy,
  .sidebar:has(.shortcut-drawer[open]) .brand h1,
  .sidebar:has(.shortcut-drawer[open]) .brand .eyebrow,
  .sidebar:focus-within .brand-copy,
  .sidebar:focus-within .brand h1,
  .sidebar:focus-within .brand .eyebrow {
    opacity: 1;
    max-height: 220px;
    pointer-events: auto;
  }

  .sidebar:has(.shortcut-drawer[open]) .brand-logo,
  .sidebar:focus-within .brand-logo {
    display: block;
  }

  .sidebar:has(.shortcut-drawer[open]) .brand-collapsed-icon,
  .sidebar:focus-within .brand-collapsed-icon {
    display: none;
  }

  .sidebar:has(.shortcut-drawer[open]) .brand-logo-top,
  .sidebar:focus-within .brand-logo-top {
    width: min(100%, 248px);
  }

  .sidebar .shortcut-drawer {
    margin-bottom: 10px;
  }

  .sidebar .shortcut-summary {
    padding: 10px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    font-size: 0.86rem;
  }

  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .shortcut-summary {
    padding: 0;
    justify-content: center;
    min-height: 52px;
    border-radius: 16px;
  }

  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .shortcut-summary-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    font-size: 1rem;
  }

  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .shortcut-summary-label,
  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .shortcut-summary::after {
    display: none;
  }

  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .shortcut-drawer[open] > :not(summary) {
    display: none;
  }

  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .shortcut-drawer {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    margin-bottom: 8px;
  }

  .sidebar:not(:focus-within):not(:has(.shortcut-drawer[open])) .sidebar-close-button {
    display: none;
  }

  .sidebar .drawer-panel {
    margin-top: 0;
  }

  .main {
    padding: 22px;
  }

  .panel-toggle {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar {
    width: 72px;
    padding: 16px 8px;
  }

  .sidebar:focus-within,
  .sidebar:has(.shortcut-drawer[open]) {
    width: 280px;
    padding: 22px 18px;
  }

  .install-banner {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
  }

  .sidebar:focus-within .sidebar-close-button,
  .sidebar:has(.shortcut-drawer[open]) .sidebar-close-button {
    width: 34px;
    height: 34px;
    margin-bottom: 10px;
  }

  .hero {
    padding: 18px;
    border-radius: 18px;
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 16px;
  }

  .hero h2 {
    max-width: none;
    font-size: 2rem;
  }

  .hero-content,
  .hero-copy {
    max-width: none;
  }

  .hero-actions {
    justify-self: start;
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .panel-heading {
    margin-bottom: 12px;
    flex-wrap: wrap;
  }

  .panel-heading h2 {
    font-size: 0.95rem;
  }

  .panel-heading {
    gap: 10px;
  }

  .panel-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-heading-actions {
    margin-top: 4px;
  }

  .person-meta,
  .summary-meta,
  .card-copy,
  .mini-copy {
    font-size: 0.83rem;
  }

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

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(48px, 1fr));
    min-width: 360px;
    gap: 2px;
  }

  .calendar-weekday {
    font-size: 0.56rem;
    padding: 1px 2px 3px;
  }

  .calendar-day {
    min-height: 42px;
    padding: 3px;
  }

  .calendar-event {
    margin-top: 2px;
    padding: 2px 3px;
    font-size: 0.5rem;
    border-radius: 6px;
  }

  .calendar-day-number {
    font-size: 0.72rem;
  }

  .install-banner strong,
  .install-banner span {
    font-size: 0.74rem;
  }

  .install-banner p {
    margin-left: 0;
    font-size: 0.68rem;
  }

  .install-banner {
    width: 100%;
  }

  .install-banner-stub {
    font-size: 0.74rem;
  }
}
