/* =========================================================
   FAMILY CENTRAL DASHBOARD
   Consolidated stylesheet
   - Duplicate rules merged
   - Later winning declarations preserved
   - Breakpoints reduced to:
       1) min-width: 1000px
       2) max-width: 400px
========================================================= */

/* ---------------------------------
   Shared content blocks
--------------------------------- */

.child-chore-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 227, 239, 0.7);
  border-radius: clamp(16px, 1vw, 22px);
  padding: clamp(12px, 0.9vw, 18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  min-width: 0;
}

.child-chore-panel__head {
  margin-bottom: clamp(10px, 0.75vw, 16px);
  min-width: 0;
}

.child-badge {
  display: inline-flex;
  align-items: center;
  min-height: clamp(30px, 1.8vw, 42px);
  padding: clamp(6px, 0.5vw, 10px) clamp(10px, 0.8vw, 14px);
  border-radius: 999px;
  background: var(--child-color, #e8efff);
  font-weight: 700;
  font-size: clamp(0.8rem, 0.3vw + 0.76rem, 1rem);
  line-height: 1.1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.55vw, 12px);
  min-width: 0;
}

.task-row {
  width: 100%;
  display: flex;
  gap: clamp(8px, 0.7vw, 14px);
  align-items: flex-start;
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  box-shadow: 0 6px 14px rgba(34, 55, 94, 0.04);
  min-width: 0;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

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

.task-row input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #44b368;
}

.task-row__text {
  display: inline-block;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: clamp(0.82rem, 0.28vw + 0.76rem, 1rem);
  line-height: 1.2;
  color: #24344d;
  overflow-wrap: anywhere;
}

.task-row--normal {
  background: var(--task-normal);
}

.task-row--completed {
  background: var(--task-complete);
}

.task-row--overdue-1 {
  background: var(--task-overdue-1);
}

.task-row--overdue-2 {
  background: var(--task-overdue-2);
}

.task-row--overdue-3 {
  background: var(--task-overdue-3);
}

.task-row.is-open {
  background: rgba(220, 76, 76, 0.14);
  border-color: rgba(220, 76, 76, 0.28);
  box-shadow: 0 6px 14px rgba(160, 40, 40, 0.08);
}

.task-row.is-complete {
  background: rgba(68, 179, 104, 0.16);
  border-color: rgba(68, 179, 104, 0.3);
  box-shadow: 0 6px 14px rgba(36, 120, 62, 0.08);
}

.task-row.is-complete .task-row__text {
  text-decoration: line-through;
  opacity: 0.78;
}

.menu-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(12px, 0.85vw, 18px);
}

.menu-preview--has-substitutions .menu-day[data-day="substitutions"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(249, 251, 255, 0.95) 100%);
}

.menu-preview--has-substitutions .menu-day[data-day="substitutions"] h3 {
  color: #415267;
}

.menu-day {
  background: rgba(255, 255, 255, 0.72);
  border-radius: clamp(16px, 1vw, 22px);
  padding: clamp(12px, 0.9vw, 18px);
  border: 1px solid rgba(219, 227, 239, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  min-width: 0;
  /*min-height: clamp(170px, 13vh, 250px);*/
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.55vw, 12px);
}

.menu-day h3 {
  margin: 0 0 clamp(6px, 0.45vw, 10px);
  font-size: clamp(1rem, 0.32vw + 0.94rem, 1.28rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.card-expand-btn {
  font-size: clamp(16px, 0.9vw, 22px);
  transition: transform 0.25s ease;
  flex: 0 0 auto;
}

.card-expanded .card-expand-btn {
  transform: rotate(180deg);
}

.card__header-actions--quicknav {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.5vw, 10px);
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

/* ---------------------------------
   Dashboard structure
--------------------------------- */

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 1vw, 28px);
  min-width: 0;
}

.summary-strip {
  width: 100%;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(14px, 0.8vw, 22px);
}

.summary-pill {
  border-radius: clamp(18px, 1vw, 24px);
  padding: clamp(16px, 1vw, 22px);
  min-height: clamp(96px, 6vw, 128px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.summary-pill__label {
  color: #526173;
  font-size: clamp(0.78rem, 0.2vw + 0.76rem, 0.92rem);
  margin-bottom: 8px;
  font-weight: 700;
}

.summary-pill__value {
  font-size: clamp(1.1rem, 0.7vw + 0.95rem, 1.8rem);
  line-height: 1.1;
}

.summary-pill--chores {
  background: var(--summary-chores);
}

.summary-pill--events {
  background: var(--summary-events);
}

.summary-pill--meals {
  background: var(--summary-meals);
}

/* Picture placeholder styling */

.card-grid > .card:nth-child(2) .empty-state,
.card-grid > .card:nth-child(2) .loading-state,
.picture-placeholder,
.photos-placeholder {
  min-height: clamp(180px, 14vh, 300px);
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: clamp(16px, 1vw, 22px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(246, 249, 255, 0.92) 100%);
  border: 1px dashed rgba(157, 176, 208, 0.9);
}

.picture-placeholder::before,
.photos-placeholder::before {
  content: "Pictures";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(230, 241, 255, 0.95);
  color: #35527c;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ---------------------------------
   Admin-related styles
--------------------------------- */

.admin-page .card__body {
  background: #fbfcff;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(16px, 0.9vw, 22px);
  align-items: start;
}

.admin-tool-card {
  min-width: 0;
}

.admin-action-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-mini-preview {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(219, 227, 239, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.admin-stat-grid {
  display: grid;
  gap: 12px;
}

.admin-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(219, 227, 239, 0.85);
  box-shadow: 0 5px 14px rgba(34, 55, 94, 0.05);
}

.admin-stat__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-stat__value {
  font-size: 20px;
  line-height: 1;
}

.admin-list-mini {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(219, 227, 239, 0.85);
  box-shadow: 0 5px 14px rgba(34, 55, 94, 0.05);
}

/* ---------------------------------
   Recipe modal
--------------------------------- */

.recipe-card {
  display: grid;
  gap: clamp(10px, 1.8vw, 14px);
}

.recipe-card__section {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 227, 239, 0.8);
  border-radius: clamp(12px, 1.8vw, 16px);
  padding: clamp(10px, 1.8vw, 14px);
}

.recipe-card__section label {
  display: block;
  font-size: clamp(12px, 1.3vw, 13px);
  font-weight: 700;
  color: #415267;
  margin-bottom: clamp(6px, 1.2vw, 8px);
}

.recipe-card__text {
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: clamp(12px, 1.3vw, 14px);
}

.recipe-card__title {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ---------------------------------
   Legacy modal styles
--------------------------------- */

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row > label {
  font-size: 13px;
  font-weight: 700;
  color: #415267;
}

.form-row--split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ======================================
   Family Central modals
====================================== */

.fc-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
}

.fc-modal.is-open {
  display: block;
}

.fc-modal__backdrop {
  position: absolute;
  inset: 0;
}

html.fc-modal-open,
body.fc-modal-open {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
}

.fc-modal__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: min(96vw, 920px);
  max-height: min(90dvh, 960px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fbff;
  border: 1px solid #c7d4e6;
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(24, 40, 72, 0.24);
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
}

.fc-modal__dialog--xl {
  width: min(96vw, 1180px);
}

.fc-modal__dialog--md {
  width: min(94vw, 680px);
}

.fc-modal--nested {
  z-index: 5100;
}

.fc-modal__header,
.fc-modal__body,
.fc-modal__actions,
.chores-admin,
.chores-admin__panel,
.chores-settings,
.common-task-form,
.common-task-card,
.chore-admin-card {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
}

.fc-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #d3ddea;
  background: #f7fbff;
  flex: 0 0 auto;
}

.fc-modal__title-wrap {
  min-width: 0;
}

.fc-modal__title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 800;
  color: #20334f;
}

.fc-modal__subtitle {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: #5f728f;
}

.fc-modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.fc-modal__gear-btn,
.fc-modal__close-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(180, 198, 221, 0.9);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 14px rgba(30, 52, 88, 0.08);
  font-size: 1.05rem;
}

.fc-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 24px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  background: #f8fbff;
}

/* ======================================
   Common form styles
====================================== */

.fc-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

.fc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

.fc-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334863;
}

.fc-field input,
.fc-field select,
.fc-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(181, 198, 222, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #243850;
  padding: 12px 14px;
  font: inherit;
  box-sizing: border-box;
}

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

.fc-field input:focus,
.fc-field select:focus,
.fc-field textarea:focus {
  outline: none;
  border-color: rgba(107, 146, 212, 0.95);
  box-shadow: 0 0 0 3px rgba(107, 146, 212, 0.16);
}

.fc-btn {
  border: 0;
  border-radius: 16px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.fc-btn--primary {
  background: linear-gradient(180deg, #5e8df2, #4779e8);
  color: #fff;
  box-shadow: 0 10px 22px rgba(69, 109, 198, 0.24);
}

.fc-btn--soft {
  background: #e8effb;
  color: #28415f;
  border: 1px solid #cbd9ec;
}

.fc-btn--danger {
  background: rgba(255, 230, 230, 0.96);
  color: #8d2a2a;
  border: 1px solid rgba(235, 180, 180, 0.95);
}

.fc-btn--sm {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}

/* ======================================
   Chores admin
====================================== */

.chores-admin {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

.chores-admin__panel {
  background: #ffffff;
  border: 1px solid #d4dfec;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(32, 48, 78, 0.08);
  min-width: 0;
}

.chores-admin__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chores-admin__panel-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #233955;
}

.chores-admin-form__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.chores-admin-list-wrap,
.chores-settings__list-wrap {
  max-height: none;
  overflow: visible;
  padding-right: 4px;
}

.chores-admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chore-member-group {
  border: 1px solid #d4dfec;
  border-radius: 22px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(30, 46, 76, 0.06);
}

.chore-member-group__head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212, 223, 236, 0.9);
}

.chore-member-group__badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--member-color, #dfe9f7) 34%, white);
  border: 1px solid color-mix(in srgb, var(--member-color, #dfe9f7) 58%, rgba(86, 107, 138, 0.22));
  color: #233955;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.1;
}

.chore-member-group__list,
.common-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chore-member-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(189, 203, 224, 0.45);
}

.chore-member-item__main {
  flex: 1 1 auto;
  min-width: 0;
}

.chore-member-item__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chore-member-item__title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #213750;
  line-height: 1.2;
  word-break: break-word;
}

.chore-member-item__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 24px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.chore-member-item__status.is-open {
  background: rgba(220, 76, 76, 0.14);
  color: #a63232;
  border: 1px solid rgba(220, 76, 76, 0.24);
}

.chore-member-item__status.is-complete {
  background: rgba(68, 179, 104, 0.16);
  color: #2d7f47;
  border: 1px solid rgba(68, 179, 104, 0.24);
}

.chore-member-item__meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chore-member-item__actions,
.common-task-card__actions,
.chores-admin__panel-actions,
.common-task-form__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chore-member-item__actions {
  flex: 0 0 auto;
}

.chore-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(228, 236, 248, 0.92);
  color: #324762;
  font-size: 0.84rem;
  font-weight: 700;
}

/* ======================================
   Settings modal
====================================== */

.chores-settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.common-task-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #d4dfec;
  border-radius: 22px;
  padding: 16px;
}

.common-task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d4dfec;
  border-radius: 18px;
  background: #f7faff;
  padding: 12px 14px;
}

.common-task-card__label {
  min-width: 0;
  font-weight: 700;
  color: #233955;
  word-break: break-word;
}

.fc-empty {
  border: 1px dashed rgba(184, 201, 225, 0.95);
  border-radius: 18px;
  background: rgba(246, 249, 255, 0.9);
  padding: 18px;
  text-align: center;
  color: #647994;
  font-weight: 600;
}

/* ======================================
   Assign-to avatar picker
====================================== */

.chore-member-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.chore-member-tile {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 10px 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 122px;
  position: relative;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
  box-shadow: 0 8px 18px rgba(28, 46, 78, 0.08);
}

.chore-member-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(28, 46, 78, 0.14);
}

.chore-member-tile:focus-visible {
  outline: 3px solid rgba(66, 133, 244, 0.55);
  outline-offset: 2px;
}

.chore-member-tile.is-selected {
  background: rgba(237, 246, 255, 0.98);
  box-shadow:
    0 0 0 3px rgba(66, 133, 244, 0.26),
    0 14px 28px rgba(28, 46, 78, 0.18);
  transform: translateY(-1px) scale(1.02);
}

.chore-member-tile.is-selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2f80ed;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(47, 128, 237, 0.35);
}

.chore-member-avatar {
  width: 66px;
  height: 66px;
  border-radius: 999px;
  overflow: hidden;
  border: 5px solid var(--member-color, #c8d2e1);
  background: #eef3f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.chore-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chore-member-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.55)),
    linear-gradient(180deg, rgba(212, 223, 239, 0.95), rgba(192, 205, 224, 0.95));
  color: #385072;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chore-member-name {
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.15;
  font-weight: 700;
  color: #24344d;
  max-width: 100%;
  word-break: break-word;
}

.chore-member-role {
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.1;
  color: #6d7b90;
  font-weight: 600;
}

.chore-member-tile.is-selected .chore-member-avatar {
  box-shadow:
    0 0 0 4px rgba(66, 133, 244, 0.18),
    0 10px 18px rgba(33, 65, 111, 0.18);
}

.chore-member-tile.is-family .chore-member-avatar {
  border-color: #8f9fb8;
}

/* ---------------------------------
   Quick links placeholder card
--------------------------------- */

.card--quicklinks {
  background: linear-gradient(
    180deg,
    rgba(248, 242, 255, 0.98) 0%,
    rgba(240, 247, 255, 0.98) 100%
  );
}

.card--quicklinks .card__header-actions {
  gap: 8px;
}

.card--quicklinks .card__body {
  padding: 10px;
}

.quick-links-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-links-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

.quick-link-tile {
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 5px;
  border: 1px solid rgba(192, 204, 226, 0.85);
  box-shadow: 0 4px 10px rgba(41, 58, 95, 0.08);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.quick-link-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(41, 58, 95, 0.12);
}

.quick-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 15px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.7);
  color: #31445f;
}

.quick-link-label {
  display: block;
  max-width: 100%;
  font-size: 10px;
  line-height: 1.05;
  font-weight: 800;
  color: #31445f;
  overflow-wrap: anywhere;
}

.quick-link-tile:nth-child(1) { background: rgba(255, 235, 242, 0.96); }
.quick-link-tile:nth-child(2) { background: rgba(235, 244, 255, 0.96); }
.quick-link-tile:nth-child(3) { background: rgba(236, 252, 241, 0.96); }
.quick-link-tile:nth-child(4) { background: rgba(255, 247, 231, 0.96); }
.quick-link-tile:nth-child(5) { background: rgba(243, 238, 255, 0.96); }
.quick-link-tile:nth-child(6) { background: rgba(235, 249, 255, 0.96); }

.card-refresh-btn.is-spinning {
  animation: quick-links-spin 0.65s linear;
}

@keyframes quick-links-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------------------------------
   Desktop layout
--------------------------------- */

@media (min-width: 1000px) {
	
.icon-btn {
    width: 28px;
    height: 28px;

}	

  .card-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.93fr) minmax(0, 1.07fr);
    grid-template-rows: 95px 185px auto 195px;
    gap: 6px;
    align-items: stretch;
  }

  .card-grid > .card {
    min-width: 0;
  }

  .card-grid > [data-card="calendar"] {
    grid-column: 1;
    grid-row: 1 / span 3;
    min-height: 0;
  }

  .card-grid > [data-card="quicklinks"] {
    grid-column: 2;
    grid-row: 1;
    height: 100px;
  }

  .card-grid > [data-card="menu"] {
    grid-column: 2;
    grid-row: 2;
    min-height: 185px;
  }

  .card-grid > [data-card="whiteboard"] {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
  }

  .card-grid > [data-card="chores"] {
    grid-column: 1 / span 2;
    grid-row: 4;
    height: 195px;
  }

  .card-grid .card__header {
    padding: 14px 20px;
    height: 30px;
  }

  .card-grid .card__body {
    min-width: 0;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
  }

  .card-grid > [data-card="calendar"] .card__header {
    padding: 12px 16px;
  }

  .card-grid > [data-card="calendar"] .calendar-month-title,
  .card-grid > [data-card="calendar"] .calendar-month-subtitle {
    font-size: 0.92em;
  }

  .card-grid > [data-card="calendar"] .calendar-weekday {
    font-size: 11px;
  }

  .card-grid > [data-card="calendar"] .calendar-day {
    min-height: 56px;
    padding: 6px;
  }

  .card-grid > [data-card="calendar"] .calendar-day__num {
    font-size: 12px;
  }

  .card-grid > [data-card="calendar"] .calendar-day__weather,
  .card-grid > [data-card="calendar"] .calendar-day__dots,
  .card-grid > [data-card="calendar"] .dot {
    transform: scale(0.92);
    transform-origin: center;
  }

  .card-grid > [data-card="calendar"] .card__body {
    padding-inline: 8px;
  }

  .card-grid .card__title,
  .card-grid h2,
  .card-grid h3 {
    font-size: 18px;
    line-height: 1.1;
  }

  .card-grid,
  .card-grid p,
  .card-grid li,
  .card-grid .muted,
  .card-grid .btn,
  .card-grid .btn-mini,
  .card-grid .btn-soft,
  .card-grid input,
  .card-grid select,
  .card-grid textarea {
    font-size: 12px;
    line-height: 1.1;
  }

  .summary-strip {
    display: none;
  }

  .summary-pill__value {
    font-size: 12px;
  }

  .child-chore-columns {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    height: 160px;
    align-items: stretch;
  }

  .child-chore-panel {
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: scroll;
  }

  .child-chore-panel__head {
    margin-bottom: 8px;
  }

  .child-badge {
    font-size: 12px;
    line-height: 1.1;
    padding: 8px 12px;
  }

  .task-list {
    display: grid;
    gap: 2px;
    min-height: 0;
  }

  .task-row {
    gap: 8px;
    padding: 2px 10px;
    min-width: 0;
    align-items: center;
  }

  .task-row input[type="checkbox"] {
    margin-right: 20px;
    margin-top: 0;
    flex: 0 0 auto;
  }

  .task-row__text {
    display: block;
    font-size: 12px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  [data-card="quicklinks"] .card__body {
    height: 100%;
    padding: 8px 10px 10px;
  }

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

  .quick-link-tile {
    aspect-ratio: 1 / 1;
    height: 40px;
    padding: 6px 4px;
    border-radius: 5px;
  }

  .quick-link-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
    border-radius: 6px;
  }

  .quick-link-label {
    font-size: 9px;
    line-height: 1.05;
  }

  .quick-link-tile__sub {
    font-size: 9px;
  }

[data-card="menu"] .card__body {
  height: 100%;
  overflow: hidden;
  padding: 10px 12px 12px;
}

[data-card="menu"] .menu-dashboard-strip {
  height: 100%;
  min-height: 0;
}

[data-card="menu"] .menu-preview {
  height: 100%;
  min-height: 0;
}

[data-card="menu"] .menu-day {
  padding: 10px 10px 10px 16px;
  border-radius: 16px;
}

[data-card="menu"] .menu-day h3 {
  margin: 0 0 -4px;
  font-size: 14px;
  line-height: 1.1;
}
}

/* ---------------------------------
   Small phones
---------------------------------*/ 

@media (max-width: 640px) {
  .card__title {
    margin: 0;
    font-size: clamp(17px, 2.1vw, 2.5rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
  }

  .child-chore-columns,
  .menu-preview,
  .task-list,{
    gap: 8px;
  }

  .child-chore-panel,
  .menu-day,{
    border-radius: 12px;
    padding: 8px;
  }

  .task-row {
    border-radius: 10px;
    padding: 8px;
  }

  .task-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
  }

  .child-badge {
    border-radius: 999px;
    min-height: 26px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .summary-strip {
    display: none;
  }

  .summary-pill__value {
    font-size: 75%;
  }

  .summary-pill__label {
    font-size: 59%;
  }

  .fc-modal__dialog,
  .fc-modal__dialog--xl,
  .fc-modal__dialog--md {
    width: 96vw;
    max-height: 92dvh;
    border-radius: 22px;
  }

  .fc-modal__header,
  .fc-modal__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chore-member-item {
    flex-direction: column;
  }

  .chore-member-item__actions {
    width: 100%;
  }

  .chore-member-item__actions .fc-btn {
    flex: 1 1 auto;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions > * {
    width: 100%;
  }

  .btn {
    font-size: 8px;
  }

  .task-row__actions {
    width: 100%;
    margin-left: 0 !important;
  }

  .task-row__actions > * {
    flex: 1 1 auto;
  }

  .task-row__text,
  .meal-chip,{
    font-size: 12px;
  }

  .menu-day h3 {
    font-size: 14px;
  }

  .meal-chip {
    border-radius: 10px;
    padding: 7px 8px;
  }

  .meal-chip__text {
    font-size: 12px;
  }

  .recipe-pill-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .admin-action-stack {
    flex-direction: column;
  }

  .admin-action-stack .btn,
  .admin-action-stack .btn-soft {
    width: 100%;
  }

  .cards-grid,
  .dashboard-grid,
  .admin-grid,
  .hub-grid,
  .card-grid {
    grid-template-columns: 1fr !important;
  }

  .quick-links-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .quick-link-tile {
    border-radius: 5px;
    padding: 8px 6px;
  }

  .quick-link-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .quick-link-label {
    font-size: 10px;
  }

  .quick-link-tile__title {
    font-size: 11px;
  }

  .quick-link-tile__sub {
    font-size: 10px;
  }

  .card-grid > [data-card="quicklinks"] {
    order: -100 !important;
  }
  
  .quick-link-tile {
    min-width: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    text-decoration: none;
    padding: 6px 4px;
    border-radius: 5px;
    border: 1px solid rgba(192, 204, 226, 0.85);
    box-shadow: 0 4px 10px rgba(41, 58, 95, 0.08);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.quick-links-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    align-items: start;
    grid-auto-flow: column;
  
}

@media (max-width: 640px) {
  .card-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
  }

  .card-grid > [data-card="quicklinks"] {
    order: -100 !important;
  }

  .card-grid > [data-card="calendar"] {
    order: 1 !important;
  }

  .card-grid > [data-card="menu"] {
    order: 2 !important;
  }

  .card-grid > [data-card="whiteboard"] {
    order: 4 !important;
  }

  .card-grid > [data-card="chores"] {
    order: 3 !important;
  }
}

/* Dynamic Quick Links image icons */
.quick-link-icon--image {
  overflow: hidden;
}

.quick-link-icon--image img,
.quick-link-icon img {
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.quick-link-tile.is-placeholder {
  cursor: default;
  opacity: 0.72;
}
