:root {
  --bg: #f4efe6;
  --bg-panel: rgba(255, 251, 245, 0.88);
  --ink: #1f2a1f;
  --muted: #5f6b61;
  --line: rgba(31, 42, 31, 0.12);
  --accent: #d65a31;
  --accent-strong: #b8451f;
  --danger: #8a2f16;
  --shadow: 0 20px 60px rgba(65, 49, 35, 0.12);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(214, 90, 49, 0.15), transparent 28%),
    linear-gradient(160deg, #f8f1e6 0%, #efe6d8 55%, #e9dcc8 100%);
  color: var(--ink);
}

body.modalOpen {
  overflow: hidden;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.toolbarSection,
.contentLayout {
  display: grid;
  gap: 20px;
}

.toolbarSection {
  justify-content: end;
  margin-bottom: 24px;
}

.contentLayout {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 20px;
}

.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.appointmentsPanel {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  font-size: 12px;
}

h2 {
  margin-top: 0;
}

.panel p,
.status,
label span {
  color: var(--muted);
}

.button,
button,
input {
  font: inherit;
}

.button,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-radius: 999px;
  border: none;
  padding: 0 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.button,
button[type="submit"] {
  background: var(--accent);
  color: #fff8f2;
}

.ghost {
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.9);
}

.heroActions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plusButton,
.iconButton {
  width: 52px;
  min-width: 52px;
  padding: 0;
  font-size: 30px;
  line-height: 1;
}

.iconButton {
  width: 44px;
  min-width: 44px;
  font-size: 28px;
}

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

input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 31, 0.14);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

label {
  display: grid;
  gap: 6px;
}

.panelHeader,
.providerHeader,
.modalHeader,
.eventCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.modalHeader,
.eventCardHeader {
  align-items: start;
}

.rangeControls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filterToggleButton {
  background: linear-gradient(135deg, rgba(214, 90, 49, 0.18), rgba(214, 90, 49, 0.08));
  border: 1px solid rgba(184, 69, 31, 0.28);
  box-shadow: 0 10px 24px rgba(214, 90, 49, 0.12);
  color: var(--accent-strong);
  justify-content: space-between;
  min-width: 220px;
  font-weight: 600;
}

.filterToggleButton:hover {
  background: linear-gradient(135deg, rgba(214, 90, 49, 0.26), rgba(214, 90, 49, 0.12));
  border-color: rgba(184, 69, 31, 0.42);
}

.filterToggleButton[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(214, 90, 49, 0.9), rgba(184, 69, 31, 0.92));
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(184, 69, 31, 0.24);
  color: #fff8f2;
}

.filterSummary {
  color: inherit;
  font-size: 14px;
  opacity: 0.9;
}

.filtersSection {
  margin-bottom: 12px;
}

.customRange {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.customRange label {
  min-width: 160px;
}

.events {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.eventCard {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.event-reminder-30 {
  border-color: rgba(212, 133, 54, 0.9);
  box-shadow: 0 0 0 1px rgba(212, 133, 54, 0.14), 0 0 24px rgba(212, 133, 54, 0.2);
  animation: reminderPulse30 1.6s ease-in-out infinite;
}

.event-reminder-15 {
  border-color: rgba(214, 90, 49, 0.95);
  box-shadow: 0 0 0 1px rgba(214, 90, 49, 0.22), 0 0 28px rgba(214, 90, 49, 0.26);
  animation: reminderPulse15 1.15s ease-in-out infinite;
}

.event-reminder-5 {
  border-color: rgba(181, 41, 41, 1);
  box-shadow: 0 0 0 1px rgba(181, 41, 41, 0.28), 0 0 34px rgba(181, 41, 41, 0.34);
  animation: reminderPulse5 0.72s ease-in-out infinite;
}

.eventActions {
  display: flex;
  gap: 10px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.eventSource {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tag {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(214, 90, 49, 0.12);
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.dangerButton {
  color: var(--danger);
  border: 1px solid rgba(138, 47, 22, 0.16);
}

.dangerButton:hover {
  background: rgba(214, 90, 49, 0.12);
}

.buttonIcon {
  width: 30px;
  height: 30px;
  fill: currentColor;
  flex: 0 0 auto;
}

.inlineButtonIcon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 31, 0.36);
  backdrop-filter: blur(8px);
}

.modalCard {
  position: relative;
  width: min(520px, 100%);
  background: rgba(255, 251, 245, 0.96);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 26px 90px rgba(40, 30, 20, 0.22);
}

.modalCardCompact {
  width: min(460px, 100%);
}

.modalMessage {
  margin: 0 0 20px;
  color: var(--muted);
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes reminderPulse30 {
  0%, 100% {
    border-color: rgba(212, 133, 54, 0.55);
    box-shadow: 0 0 0 1px rgba(212, 133, 54, 0.1), 0 0 10px rgba(212, 133, 54, 0.12);
  }

  50% {
    border-color: rgba(212, 133, 54, 0.95);
    box-shadow: 0 0 0 2px rgba(212, 133, 54, 0.18), 0 0 26px rgba(212, 133, 54, 0.24);
  }
}

@keyframes reminderPulse15 {
  0%, 100% {
    border-color: rgba(214, 90, 49, 0.62);
    box-shadow: 0 0 0 1px rgba(214, 90, 49, 0.12), 0 0 12px rgba(214, 90, 49, 0.16);
  }

  50% {
    border-color: rgba(214, 90, 49, 1);
    box-shadow: 0 0 0 2px rgba(214, 90, 49, 0.2), 0 0 30px rgba(214, 90, 49, 0.28);
  }
}

@keyframes reminderPulse5 {
  0%, 100% {
    border-color: rgba(181, 41, 41, 0.72);
    box-shadow: 0 0 0 1px rgba(181, 41, 41, 0.14), 0 0 14px rgba(181, 41, 41, 0.18);
  }

  50% {
    border-color: rgba(181, 41, 41, 1);
    box-shadow: 0 0 0 2px rgba(181, 41, 41, 0.22), 0 0 36px rgba(181, 41, 41, 0.32);
  }
}

.dangerSolidButton {
  background: var(--danger);
  color: #fff8f2;
}

.dangerSolidButton:hover {
  background: #6e2210;
}

@media (max-width: 900px) {
  .panelHeader,
  .providerHeader,
  .modalHeader,
  .eventCardHeader,
  .modalActions {
    flex-direction: column;
    align-items: stretch;
  }

  .heroActions {
    justify-content: space-between;
  }

  .rangeControls,
  .customRange {
    width: 100%;
  }
}
