:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --ink: #17201c;
  --muted: #5c6963;
  --line: rgba(23, 32, 28, 0.15);
  --surface: rgba(255, 255, 252, 0.9);
  --green: #1f5b45;
  --green-strong: #153f31;
  --gold: #b87b26;
  --blue: #2b5f8f;
  --white: #fffef9;
  --shadow: 0 24px 80px rgba(22, 44, 36, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(20px, 5vw, 64px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 10px 32px rgba(22, 44, 36, 0.16);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: var(--white);
  background: var(--green);
}

.button-primary:hover {
  background: var(--green-strong);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 252, 0.72);
  backdrop-filter: blur(18px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(115deg, rgba(245, 247, 244, 0.98) 0%, rgba(245, 247, 244, 0.9) 48%, rgba(245, 247, 244, 0.64) 100%),
    radial-gradient(circle at 82% 42%, rgba(43, 95, 143, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(31, 91, 69, 0.08), rgba(184, 123, 38, 0.1));
}

.hero::after {
  position: absolute;
  right: clamp(20px, 7vw, 96px);
  bottom: 74px;
  width: min(58vw, 720px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(23, 32, 28, 0.28), transparent);
  content: "";
}

.hero-content {
  align-self: center;
  width: min(680px, calc(100% - 40px));
  margin-left: clamp(20px, 7vw, 88px);
  padding-top: 78px;
  padding-bottom: 104px;
}

.hero-visual {
  display: grid;
  place-items: center;
  padding: 110px clamp(24px, 6vw, 92px) 72px 0;
}

.hero-visual img {
  width: min(38vw, 420px);
  min-width: 260px;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 26px 54px rgba(22, 44, 36, 0.2));
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 9vw, 122px);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 36px;
}

.text-link {
  color: var(--green-strong);
  font-size: 14px;
  font-weight: 800;
  text-decoration-color: rgba(31, 91, 69, 0.32);
  text-underline-offset: 6px;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 5vw, 64px);
  color: rgba(23, 32, 28, 0.72);
  font-size: 13px;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  background:
    linear-gradient(rgba(245, 247, 244, 0.9), rgba(245, 247, 244, 0.9)),
    url("assets/m218-logo.png") center / min(72vmin, 720px) no-repeat fixed;
}

.private-page {
  min-height: 100vh;
  background: var(--bg);
}

.auth-shell,
.private-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 104px 20px 40px;
}

.auth-panel,
.private-panel {
  width: min(100%, 460px);
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid rgba(255, 255, 252, 0.72);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.private-panel {
  width: min(100%, 680px);
}

.auth-panel h1,
.private-panel h1 {
  max-width: none;
  font-size: clamp(46px, 7vw, 78px);
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.auth-copy {
  margin-top: 24px;
  font-size: 17px;
}

.family-dashboard {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 112px clamp(18px, 4vw, 44px) 44px;
}

.dashboard-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-hero h1 {
  max-width: none;
  font-size: clamp(46px, 6vw, 88px);
}

.status-pill {
  min-width: 112px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-strong);
  background: rgba(255, 255, 252, 0.72);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(23, 32, 28, 0.14);
}

.tab-button {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0 18px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}

.tab-button.is-active {
  color: #2564cf;
  border-bottom-color: #2564cf;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.calendar-panel,
.tool-panel,
.todo-panel,
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.86);
  box-shadow: 0 14px 44px rgba(22, 44, 36, 0.08);
}

.calendar-panel {
  min-height: 760px;
  padding: 0;
  overflow: hidden;
}

.side-panel {
  display: grid;
  gap: 20px;
}

.tool-panel,
.todo-panel {
  padding: 22px;
}

.todo-panel,
.settings-panel {
  margin-top: 20px;
}

.settings-panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-heading.compact {
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 500;
  letter-spacing: 0;
}

.panel-heading.compact h2 {
  font-size: 28px;
}

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

.segmented-control {
  display: inline-flex;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 28, 0.14);
  border-radius: 6px;
  background: #ffffff;
}

.segmented-control button {
  border: 0;
  border-right: 1px solid rgba(23, 32, 28, 0.1);
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.is-active {
  color: #ffffff;
  background: #2564cf;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 252, 0.78);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.calendar-panel .panel-heading {
  align-items: center;
  margin: 0;
  padding: 22px clamp(18px, 2.5vw, 28px);
  border-bottom: 1px solid rgba(23, 32, 28, 0.1);
  background: rgba(255, 255, 252, 0.92);
}

.calendar-panel .panel-heading h2 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 800;
}

.outlook-calendar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 676px;
}

.month-surface {
  min-width: 0;
  border-right: 1px solid rgba(23, 32, 28, 0.1);
  background: #ffffff;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid rgba(23, 32, 28, 0.1);
  color: #53606b;
  font-size: 12px;
  font-weight: 800;
}

.calendar-weekdays span {
  padding: 11px 12px;
  border-right: 1px solid rgba(23, 32, 28, 0.08);
  text-align: right;
}

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

.calendar-grid.is-week-view {
  grid-auto-rows: minmax(560px, 1fr);
}

.calendar-day {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  min-height: 104px;
  border: 0;
  border-right: 1px solid rgba(23, 32, 28, 0.08);
  border-bottom: 1px solid rgba(23, 32, 28, 0.08);
  border-radius: 0;
  padding: 8px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.calendar-day:hover {
  background: #f6f9fc;
}

.calendar-day.is-muted {
  color: #9aa3aa;
  background: #fbfbfa;
}

.calendar-day.is-today {
  background: #fffaf0;
}

.calendar-day.is-selected {
  background: #eef6ff;
  box-shadow: inset 0 0 0 2px #2564cf;
}

.calendar-day.is-week-day {
  gap: 12px;
  padding: 12px;
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.day-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-left: auto;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.week-day-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-day.is-today .day-number {
  color: #ffffff;
  background: #2564cf;
}

.day-count {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #2564cf;
  background: #deecff;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.day-events {
  display: grid;
  gap: 4px;
  overflow: hidden;
}

.calendar-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 4px;
  color: #ffffff;
  background: #2564cf;
  font-size: 12px;
  line-height: 1.2;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.28);
}

.event-time {
  font-size: 11px;
  font-weight: 850;
  opacity: 0.92;
}

.event-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.day-agenda {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  background: #f8fafc;
}

.agenda-heading {
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(23, 32, 28, 0.1);
}

.agenda-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.agenda-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.agenda-event {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 100, 207, 0.14);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 100, 207, 0.08);
}

.agenda-time {
  color: #2564cf;
  font-size: 12px;
  font-weight: 850;
}

.agenda-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.agenda-body strong {
  overflow-wrap: anywhere;
}

.agenda-body span,
.agenda-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.agenda-body button {
  justify-self: start;
  border: 0;
  padding: 0;
  color: #8d3128;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.stack-form,
.todo-form {
  display: grid;
  gap: 14px;
}

.stack-form label,
.form-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 252, 0.82);
  font: inherit;
  font-size: 15px;
}

textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(184, 123, 38, 0.2);
  border-color: rgba(184, 123, 38, 0.72);
}

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

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.member-chip {
  padding: 7px 10px;
  border: 1px solid rgba(31, 91, 69, 0.22);
  border-radius: 999px;
  color: var(--green-strong);
  background: rgba(31, 91, 69, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.member-list-large {
  margin-top: 22px;
}

.member-list-large .member-chip {
  padding: 10px 13px;
  font-size: 14px;
}

.todo-form {
  grid-template-columns: minmax(220px, 1fr) 180px 170px auto;
  margin-bottom: 20px;
}

.todo-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.todo-column {
  min-height: 180px;
  border: 1px solid rgba(23, 32, 28, 0.12);
  border-radius: 8px;
  padding: 16px;
  background: rgba(245, 247, 244, 0.68);
}

.todo-column h3 {
  margin: 0 0 12px;
  color: var(--green-strong);
  font-size: 17px;
}

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

.todo-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(23, 32, 28, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 252, 0.82);
}

.todo-item.is-done {
  opacity: 0.62;
}

.todo-item.is-done .todo-check span {
  text-decoration: line-through;
}

.todo-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-weight: 800;
}

.todo-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.todo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.todo-meta button {
  border: 0;
  padding: 0;
  color: #8d3128;
  background: transparent;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

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

.modal-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 24, 32, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.event-modal {
  width: min(100%, 560px);
  border: 1px solid rgba(255, 255, 252, 0.8);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(14, 24, 32, 0.32);
}

.modal-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(23, 32, 28, 0.1);
}

.modal-heading h2 {
  margin: 0;
  font-size: 28px;
}

.wizard-form {
  display: grid;
  gap: 18px;
  padding: 22px 24px 24px;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.wizard-steps span {
  display: grid;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f5;
  font-weight: 850;
}

.wizard-steps span.is-active {
  color: #ffffff;
  background: #2564cf;
}

.wizard-step {
  display: none;
  gap: 14px;
}

.wizard-step.is-active {
  display: grid;
}

.wizard-step label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.wizard-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(37, 100, 207, 0.16);
  border-radius: 8px;
  background: #f4f8ff;
}

.wizard-summary span {
  color: var(--muted);
  font-size: 14px;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-content {
    align-self: end;
  }

  .hero-visual {
    position: absolute;
    right: -40px;
    bottom: 34px;
    z-index: -1;
    padding: 0;
    opacity: 0.18;
  }

  .hero-visual img {
    width: min(74vw, 390px);
    min-width: 240px;
  }

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

  .side-panel {
    grid-template-columns: 1fr;
  }

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

  .calendar-grid.is-week-view {
    grid-auto-rows: minmax(220px, auto);
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 16px 18px;
  }

  .brand {
    font-size: 14px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .button {
    min-height: 40px;
    padding: 0 14px;
  }

  .hero {
    min-height: 100svh;
  }

  .hero-content {
    width: calc(100% - 36px);
    margin: 0 18px;
    padding-top: 96px;
  }

  h1 {
    font-size: clamp(52px, 18vw, 76px);
  }

  .lead {
    font-size: 17px;
  }

  .site-footer {
    position: static;
    padding: 20px 18px;
    background: var(--bg);
  }

  .family-dashboard {
    padding: 92px 14px 28px;
  }

  .dashboard-hero {
    align-items: start;
    flex-direction: column;
  }

  .dashboard-tabs {
    overflow-x: auto;
  }

  .tab-button {
    flex: 0 0 auto;
  }

  .calendar-panel {
    min-height: auto;
    padding: 0;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-actions {
    justify-content: space-between;
  }

  .outlook-calendar {
    grid-template-columns: 1fr;
  }

  .month-surface {
    border-right: 0;
  }

  .calendar-grid {
    grid-auto-rows: minmax(92px, auto);
  }

  .calendar-grid.is-week-view {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .calendar-day {
    min-height: 92px;
    padding: 5px;
  }

  .calendar-day.is-week-day {
    min-height: 128px;
  }

  .calendar-event {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    padding: 4px 5px;
    font-size: 10px;
  }

  .event-time {
    display: none;
  }

  .day-agenda {
    border-top: 1px solid rgba(23, 32, 28, 0.1);
  }

  .form-row,
  .inline-form,
  .todo-form {
    grid-template-columns: 1fr;
  }

  .event-modal {
    align-self: end;
  }

  .wizard-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
