.family-hub-page {
  --family-ink: #302e2b;
  --family-muted: #807970;
  --family-line: rgba(104, 91, 78, 0.13);
  --family-paper: rgba(255, 253, 249, 0.92);
  --family-coral: #c65d68;
  --family-coral-soft: #f7e3e4;
  --family-blue: #5f7f9c;
  --family-blue-soft: #e7eff5;
  --family-green: #6f8b75;
  --family-green-soft: #e8f0e8;
  --family-yellow: #b48946;
  --family-yellow-soft: #f7eedb;
  --family-purple: #84749b;
  --family-purple-soft: #eee9f3;
}

.family-dashboard {
  padding: 92px 28px 34px !important;
  color: var(--family-ink);
}

.family-dashboard-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
}

.family-dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

#container .family-date {
  margin: 0 0 5px;
  color: var(--family-coral);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.family-dashboard-top h2 {
  margin: 0;
  color: var(--family-ink);
  font-size: clamp(27px, 2.3vw, 38px);
  font-weight: 780;
  letter-spacing: -1.7px;
  line-height: 1.2;
}

#container .family-greeting-copy {
  margin: 8px 0 0;
  color: var(--family-muted);
  font-size: 15px;
  font-weight: 540;
}

.family-dashboard-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.family-clock {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 134px;
  padding-right: 18px;
  border-right: 1px solid var(--family-line);
}

.family-clock strong {
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.family-clock span {
  color: var(--family-muted);
  font-size: 12px;
  font-weight: 750;
}

.family-display-button,
.family-display-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(198, 93, 104, 0.2);
  border-radius: 13px;
  background: #fff9f7;
  color: #a44350;
  font-weight: 760;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.family-display-button:hover,
.family-display-exit:hover {
  background: var(--family-coral-soft);
  transform: translateY(-1px);
}

.family-display-button i,
.family-display-exit i {
  font-size: 20px;
}

.family-glance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.family-glance > div {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  min-width: 0;
  padding: 11px 15px;
  border: 1px solid var(--family-line);
  border-radius: 15px;
  background: rgba(255, 253, 249, 0.74);
  box-shadow: 0 9px 24px rgba(83, 70, 58, 0.045);
}

.family-glance i {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--family-coral-soft);
  color: var(--family-coral);
  font-size: 18px;
}

.family-glance > div:nth-child(2) i {
  background: var(--family-yellow-soft);
  color: var(--family-yellow);
}

.family-glance > div:nth-child(3) i {
  background: var(--family-green-soft);
  color: var(--family-green);
}

.family-glance > div:nth-child(4) i {
  background: var(--family-blue-soft);
  color: var(--family-blue);
}

.family-glance span {
  overflow: hidden;
  color: var(--family-muted);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-glance strong {
  font-size: 19px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.family-dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.82fr);
  gap: 14px;
  min-height: 510px;
}

.family-memory-stage,
.family-schedule-panel,
.family-mini-panel,
.family-dashboard-note {
  border: 1px solid var(--family-line);
  background: var(--family-paper);
  box-shadow: 0 18px 48px rgba(83, 70, 58, 0.075);
}

.family-memory-stage,
.family-schedule-panel,
.family-mini-panel {
  border-radius: 22px;
}

.family-memory-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 17px;
}

.family-memory-heading,
.family-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.family-memory-heading {
  padding: 2px 3px 14px;
}

.family-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--family-coral);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.5px;
}

.family-memory-heading h3,
.family-panel-heading h3 {
  margin: 0;
  color: var(--family-ink);
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.8px;
}

.family-slide-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--family-muted);
  font-size: 11px;
  font-weight: 700;
}

.family-slide-status i {
  color: var(--family-coral);
  font-size: 18px;
}

.family-slideshow {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  border-radius: 17px;
  background: #d9d3ca;
  isolation: isolate;
}

.family-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.018);
  transition: opacity 0.75s ease, transform 4.8s ease;
  pointer-events: none;
}

.family-slide.is-active {
  z-index: 1;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.family-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 43%, rgba(25, 22, 19, 0.72) 100%);
}

.family-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.family-slide-backdrop {
  display: none;
}

.family-slide figcaption {
  position: absolute;
  right: 28px;
  bottom: 28px;
  left: 28px;
  z-index: 2;
  color: #fff;
}

.family-slide figcaption span {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 650;
}

.family-slide figcaption strong {
  display: block;
  font-size: clamp(23px, 2.2vw, 34px);
  font-weight: 780;
  letter-spacing: -1.2px;
}

#container .family-slide figcaption p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.83);
  font-size: 13px;
}

.family-slide-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.family-slide-controls > button,
.family-icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(32, 28, 24, 0.42);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.family-slide-controls > button i {
  font-size: 22px;
}

.family-slide-dots {
  display: flex;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 99px;
  background: rgba(32, 28, 24, 0.42);
  backdrop-filter: blur(8px);
}

.family-slide-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.family-slide-dots button.is-active {
  width: 20px;
  background: #fff;
}

.family-schedule-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px;
}

.family-round-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 37px;
  padding: 0 12px;
  border: 1px solid rgba(198, 93, 104, 0.18);
  border-radius: 11px;
  background: var(--family-coral-soft);
  color: #a44350;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.family-round-button i {
  font-size: 18px;
}

.family-schedule-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 18px 0 15px;
  padding: 4px;
  border-radius: 12px;
  background: #f2eee8;
}

.family-schedule-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--family-muted);
  font-size: 12px;
  font-weight: 730;
  cursor: pointer;
}

.family-schedule-tabs button.is-active {
  background: #fff;
  color: var(--family-ink);
  box-shadow: 0 3px 10px rgba(75, 64, 54, 0.08);
}

.family-schedule-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.family-schedule-list[hidden] {
  display: none;
}

.family-schedule-item {
  --tone: var(--family-blue);
  --tone-soft: var(--family-blue-soft);
  position: relative;
  display: grid;
  grid-template-columns: 53px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 11px 12px 11px 15px;
  overflow: hidden;
  border: 1px solid var(--family-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.family-schedule-item::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--tone);
}

.family-schedule-item.tone-coral { --tone: var(--family-coral); --tone-soft: var(--family-coral-soft); }
.family-schedule-item.tone-green { --tone: var(--family-green); --tone-soft: var(--family-green-soft); }
.family-schedule-item.tone-yellow { --tone: var(--family-yellow); --tone-soft: var(--family-yellow-soft); }
.family-schedule-item.tone-purple { --tone: var(--family-purple); --tone-soft: var(--family-purple-soft); }

.family-schedule-item time {
  color: var(--tone);
  font-size: 13px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.family-schedule-item > div {
  min-width: 0;
}

.family-schedule-item div strong,
.family-schedule-item div span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-schedule-item div strong {
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 760;
}

.family-schedule-item div span {
  color: var(--family-muted);
  font-size: 11px;
}

.family-owner {
  padding: 5px 8px;
  border-radius: 99px;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.family-schedule-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  margin-top: 10px;
  color: var(--family-muted);
  font-size: 12px;
  font-weight: 720;
}

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

.family-dashboard-lower[data-visible-panels="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.family-dashboard-lower[data-visible-panels="1"] { grid-template-columns: minmax(0, 1fr); }

.family-mini-panel {
  min-width: 0;
  padding: 19px;
}

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

.family-panel-heading.compact h3 {
  font-size: 17px;
}

.family-panel-heading.compact > i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--family-coral-soft);
  color: var(--family-coral);
  font-size: 20px;
}

.family-icon-button {
  border-color: var(--family-line);
  background: #f5f1eb;
  color: var(--family-muted);
  backdrop-filter: none;
}

.family-moment-list {
  display: grid;
  gap: 7px;
}

.family-moment-list > div {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 39px;
}

.family-moment-list strong {
  color: var(--family-coral);
  font-size: 12px;
}

.family-moment-list span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-moment-list small {
  color: var(--family-muted);
  font-size: 11px;
}

.family-moment-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.family-moment-heading-actions > span {
  color: var(--family-muted);
  font-size: 10px;
  font-weight: 700;
}

.family-moment-item {
  grid-template-columns: 48px minmax(0, 1fr) auto 30px !important;
}

.family-moment-item.is-today strong {
  color: #fff;
  padding: 4px 6px;
  border-radius: 8px;
  background: var(--family-coral);
  text-align: center;
}

.family-moment-edit {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #f4eee7;
  color: var(--family-muted);
  font-size: 15px;
  cursor: pointer;
}

.family-moment-birthday {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--family-yellow-soft);
  color: #aa7929;
  font-size: 14px;
}

.family-moment-empty {
  min-height: 108px !important;
  grid-template-columns: 1fr !important;
  place-content: center;
  color: var(--family-muted);
  font-size: 12px;
  text-align: center;
}

.family-moment-manage {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 9px;
  border: 0;
  border-radius: 11px;
  background: #f5f0e9;
  color: var(--family-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 740;
  cursor: pointer;
}

.family-member-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.family-member-row > div {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.family-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 7px;
  place-items: center;
  border-radius: 15px;
  background: var(--family-coral-soft);
  color: var(--family-coral);
  font-size: 14px;
  font-weight: 830;
}

.family-avatar.avatar-blue { background: var(--family-blue-soft); color: var(--family-blue); }
.family-avatar.avatar-yellow { background: var(--family-yellow-soft); color: var(--family-yellow); }
.family-avatar.avatar-green { background: var(--family-green-soft); color: var(--family-green); }

.family-member-row strong {
  font-size: 12px;
}

.family-member-row small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--family-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-task-count {
  padding: 6px 9px;
  border-radius: 99px;
  background: var(--family-green-soft);
  color: var(--family-green);
  font-size: 11px;
  font-weight: 760;
}
.family-task-heading-actions { display: flex; align-items: center; gap: 7px; }

.family-task-list {
  display: grid;
  gap: 5px;
}

.family-task-list label {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--family-ink);
  cursor: pointer;
}

.family-task-list input {
  width: 17px;
  height: 17px;
  accent-color: var(--family-green);
}

.family-task-list span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-task-list small {
  color: var(--family-muted);
  font-size: 10px;
}

.family-task-list label:has(input:checked) span {
  color: #aaa39c;
  text-decoration: line-through;
}

.family-dashboard-note {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 16px 20px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(115deg, rgba(249, 236, 232, 0.95), rgba(246, 241, 232, 0.96));
}

.family-dashboard-note i {
  color: var(--family-coral);
  font-size: 24px;
}

#container .family-dashboard-note p {
  margin: 0;
  flex: 1;
  color: #5e5550;
  font-size: 14px;
  font-weight: 680;
}

.family-dashboard-note span {
  color: var(--family-muted);
  font-size: 10px;
  font-weight: 700;
}

.family-display-exit {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 2000;
  display: none;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(32, 28, 24, 0.7);
  color: #fff;
  backdrop-filter: blur(12px);
}

.family-schedule-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 21px;
  background: #fffdf9;
  color: var(--family-ink);
  box-shadow: 0 32px 90px rgba(52, 44, 37, 0.28);
}

.family-schedule-dialog::backdrop {
  background: rgba(43, 37, 32, 0.38);
  backdrop-filter: blur(4px);
}

.family-schedule-dialog form {
  display: grid;
  gap: 14px;
  padding: 25px;
}

.family-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 3px;
}

.family-dialog-heading span {
  color: var(--family-coral);
  font-size: 11px;
  font-weight: 800;
}

.family-dialog-heading h3 {
  margin: 3px 0 0;
  font-size: 23px;
  letter-spacing: -0.8px;
}

.family-dialog-heading button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f2eee8;
  color: var(--family-muted);
  cursor: pointer;
}

.family-schedule-dialog label {
  display: grid;
  gap: 6px;
  color: #5d5650;
  font-size: 12px;
  font-weight: 750;
}

.family-schedule-dialog input,
.family-schedule-dialog select {
  width: 100%;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid var(--family-line);
  border-radius: 11px;
  background: #fff;
  color: var(--family-ink);
  font: inherit;
}

.family-schedule-dialog form > p {
  margin: 0;
  color: var(--family-muted);
  font-size: 11px;
}

.family-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
  margin-top: 5px;
}

.family-dialog-actions button {
  min-height: 44px;
  border-radius: 11px;
  font-weight: 760;
  cursor: pointer;
}

.family-dialog-cancel {
  border: 1px solid var(--family-line);
  background: #fff;
  color: var(--family-muted);
}

.family-dialog-submit {
  border: 0;
  background: var(--family-coral);
  color: #fff;
}

.family-anniversary-dialog {
  width: min(470px, calc(100vw - 24px));
  max-height: min(88vh, 760px);
  overflow: auto;
}

.family-checkbox-field {
  display: flex !important;
  min-height: 45px;
  align-items: center;
  grid-template-columns: none !important;
  flex-direction: row;
  gap: 9px !important;
  padding: 0 12px;
  border-radius: 11px;
  background: #f5f0e9;
  cursor: pointer;
}

.family-checkbox-field input {
  width: 18px !important;
  min-height: 18px !important;
  height: 18px;
  margin: 0;
  padding: 0 !important;
  accent-color: var(--family-coral);
}

.family-anniversary-actions {
  grid-template-columns: auto 1fr 1.3fr;
}

.family-dialog-delete {
  border: 1px solid #e8c4c8;
  background: #fff3f4;
  color: #a72c3e;
}

.family-dialog-delete[hidden] {
  display: none;
}

.family-anniversary-actions:has(.family-dialog-delete[hidden]) {
  grid-template-columns: 1fr 1.3fr;
}

.family-anniversary-saved {
  margin-top: 5px;
  padding-top: 16px;
  border-top: 1px solid var(--family-line);
}

.family-anniversary-saved > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.family-anniversary-saved > div:first-child strong {
  font-size: 13px;
}

.family-anniversary-saved > div:first-child span {
  color: var(--family-muted);
  font-size: 11px;
}

#family-anniversary-saved-list {
  display: grid;
  gap: 6px;
}

.family-anniversary-saved-empty {
  margin: 0;
  padding: 14px 10px;
  border-radius: 11px;
  background: #f7f3ed;
  color: var(--family-muted);
  font-size: 11px;
  text-align: center;
}

.family-anniversary-saved-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 11px;
  background: #f7f3ed;
}

.family-anniversary-saved-item > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.family-anniversary-saved-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-anniversary-saved-item small {
  color: var(--family-muted);
  font-size: 10px;
}

.family-anniversary-saved-item button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--family-line);
  border-radius: 9px;
  background: #fff;
  color: var(--family-muted);
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}

body.family-display-mode {
  overflow: auto;
  background: #f3eee7;
}

body.family-display-mode #util,
body.family-display-mode #header,
body.family-display-mode #footer {
  display: none !important;
}

body.family-display-mode #container.family-dashboard {
  width: 100% !important;
  min-height: 100vh;
  margin-left: 0 !important;
  padding: 18px !important;
}

body.family-display-mode .family-dashboard-shell {
  display: flex;
  min-height: calc(100vh - 36px);
  max-width: none;
  flex-direction: column;
}

body.family-display-mode .family-dashboard-top {
  margin-bottom: 12px;
}

body.family-display-mode .family-dashboard-main {
  min-height: 0;
  flex: 1;
}

body.family-display-mode .family-dashboard-lower {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.family-display-mode .family-dashboard-lower[data-visible-panels="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.family-display-mode .family-dashboard-lower[data-visible-panels="1"] { grid-template-columns: minmax(0, 1fr); }

body.family-display-mode .family-dashboard-note {
  display: none;
}

body.family-display-mode.family-display-private .family-schedule-item div span,
body.family-display-mode.family-display-private .family-owner,
body.family-display-mode.family-display-private .family-task-list small {
  display: none;
}

body.family-display-mode.family-night-dim #container.family-dashboard {
  filter: brightness(0.8) saturate(0.86);
}

body.family-display-mode .family-display-button {
  visibility: hidden;
}

body.family-display-mode .family-display-exit {
  display: inline-flex;
}

@media (min-width: 1700px) {
  .family-dashboard-main {
    min-height: 580px;
  }
}

@media (max-width: 1240px) {
  .family-dashboard-main {
    grid-template-columns: 1fr;
  }

  .family-memory-stage {
    min-height: 500px;
  }

  .family-schedule-list {
    max-height: 300px;
  }

  .family-dashboard-lower {
    grid-template-columns: 1fr 1fr;
  }

  .family-dashboard-lower > :last-child {
    grid-column: 1 / -1;
  }

  body.family-display-mode .family-dashboard-main {
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.75fr);
  }

  body.family-display-mode .family-memory-stage {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .family-dashboard {
    padding: 88px 18px 28px !important;
  }

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

  .family-dashboard-tools {
    width: 100%;
    justify-content: space-between;
  }

  .family-glance {
    grid-template-columns: 1fr 1fr;
  }

  .family-memory-stage {
    min-height: 440px;
  }

  body.family-display-mode .family-dashboard-main {
    grid-template-columns: 1fr;
  }

  body.family-display-mode .family-memory-stage {
    min-height: 52vh;
  }

  body.family-display-mode .family-dashboard-lower {
    grid-template-columns: 1fr 1fr;
  }

  body.family-display-mode .family-dashboard-lower > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .family-dashboard-top h2 {
    font-size: 26px;
  }

  .family-clock {
    display: none;
  }

  .family-display-button span,
  .family-display-exit span {
    display: none;
  }

  .family-display-button,
  .family-display-exit {
    width: 44px;
    padding: 0;
  }

  .family-glance > div {
    grid-template-columns: 34px 1fr;
  }

  .family-glance strong {
    grid-column: 2;
    font-size: 17px;
  }

  .family-memory-stage {
    min-height: 390px;
    padding: 11px;
    border-radius: 17px;
  }

  .family-memory-heading h3,
  .family-panel-heading h3 {
    font-size: 17px;
  }

  .family-slide-status {
    display: none;
  }

  .family-slide figcaption {
    right: 18px;
    bottom: 60px;
    left: 18px;
  }

  .family-slide figcaption strong {
    font-size: 23px;
  }

  .family-schedule-panel,
  .family-mini-panel {
    padding: 16px;
    border-radius: 17px;
  }

  .family-schedule-item {
    grid-template-columns: 45px minmax(0, 1fr);
  }

  .family-owner {
    display: none;
  }

  .family-dashboard-lower,
  body.family-display-mode .family-dashboard-lower {
    grid-template-columns: 1fr;
  }

  .family-dashboard-lower > :last-child,
  body.family-display-mode .family-dashboard-lower > :last-child {
    grid-column: auto;
  }

  .family-dashboard-note span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .family-slide,
  .family-display-button,
  .family-display-exit {
    transition: none;
  }
}

/* Family hub readability pass: 본문과 날짜는 12px 아래로 내려가지 않게 유지합니다. */
.family-hub-page .family-eyebrow,
.family-hub-page .family-slide-status { font-size: 13px; }
.family-hub-page .family-round-button,
.family-hub-page .family-schedule-tabs button,
.family-hub-page .family-schedule-more { font-size: 14px; }
.family-hub-page .family-schedule-item time { font-size: 15px; }
.family-hub-page .family-schedule-item div strong { font-size: 16px; }
.family-hub-page .family-schedule-item div span { font-size: 13px; }
.family-hub-page .family-owner { font-size: 12px; }
.family-hub-page .family-moment-list strong,
.family-hub-page .family-member-row strong,
.family-hub-page .family-task-list span { font-size: 14px; }
.family-hub-page .family-moment-list span { font-size: 15px; }
.family-hub-page .family-moment-list small,
.family-hub-page .family-member-row small,
.family-hub-page .family-task-list small,
.family-hub-page .family-task-count { font-size: 12px; }
.family-hub-page .family-schedule-dialog label { font-size: 13px; }
.family-hub-page .family-schedule-dialog input,
.family-hub-page .family-schedule-dialog select { font-size: 14px; }
.family-hub-page .family-schedule-dialog form > p { font-size: 12px; }

@media (max-width: 620px) {
  .family-hub-page .family-schedule-item time { font-size: 14px; }
  .family-hub-page .family-schedule-item div strong { font-size: 15px; }
  .family-hub-page .family-task-list span { font-size: 13px; }
}

/* Photo-only living and in-car display */
.family-display-info {
  display: none;
}

body.family-display-mode {
  overflow: hidden;
  background: #171411;
}

body.family-display-mode #container.family-dashboard {
  width: 100% !important;
  height: 100dvh;
  min-height: 100vh;
  padding: 0 !important;
  overflow: hidden;
  background: #171411 !important;
}

body.family-display-mode .family-dashboard-shell,
body.family-display-mode .family-dashboard-main {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

body.family-display-mode .family-dashboard-top,
body.family-display-mode .family-glance,
body.family-display-mode .family-schedule-panel,
body.family-display-mode .family-dashboard-lower,
body.family-display-mode .family-dashboard-note,
body.family-display-mode .family-memory-heading {
  display: none !important;
}

body.family-display-mode .family-memory-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #171411;
  box-shadow: none;
}

body.family-display-mode .family-slideshow {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

body.family-display-mode .family-slide {
  transition: opacity 1.05s ease, transform 8s ease;
  transform: scale(1.035);
}

body.family-display-mode .family-slide.is-active {
  transform: scale(1);
}

body.family-display-mode .family-slide::after {
  background:
    linear-gradient(180deg, rgba(15, 13, 11, 0.38) 0%, transparent 35%),
    linear-gradient(0deg, rgba(15, 13, 11, 0.76) 0%, transparent 48%),
    linear-gradient(270deg, rgba(15, 13, 11, 0.24), transparent 38%);
}

body.family-display-mode .family-slide figcaption {
  right: auto;
  bottom: clamp(86px, 11vh, 125px);
  left: clamp(24px, 5vw, 72px);
  max-width: min(680px, 64vw);
}

body.family-display-mode .family-slide figcaption span {
  margin-bottom: 7px;
  font-size: clamp(12px, 1.2vw, 17px);
}

body.family-display-mode .family-slide figcaption strong {
  font-size: clamp(29px, 4vw, 59px);
  line-height: 1.12;
}

body.family-display-mode #container .family-slide figcaption p {
  margin-top: 9px;
  font-size: clamp(13px, 1.35vw, 19px);
}

body.family-display-mode .family-slide-controls {
  right: clamp(22px, 3vw, 46px);
  bottom: clamp(22px, 3vw, 42px);
}

body.family-display-mode .family-slide-controls > button {
  width: 45px;
  height: 45px;
}

body.family-display-mode .family-slide-dots {
  padding: 10px 14px;
}

body.family-display-mode .family-display-info {
  position: absolute;
  z-index: 5;
  top: clamp(22px, 3vw, 46px);
  right: clamp(22px, 3vw, 46px);
  display: grid;
  width: min(330px, calc(100vw - 44px));
  gap: 10px;
  color: #fff;
}

.family-display-clock,
.family-display-weather {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(24, 21, 18, 0.42);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.family-display-clock {
  position: relative;
  padding: 18px 20px 16px;
  border-radius: 23px;
}

.family-display-clock > span {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
  font-weight: 680;
}

.family-display-clock > strong {
  display: inline-block;
  margin-top: 1px;
  font-size: clamp(48px, 5.7vw, 76px);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.07em;
  line-height: 1;
}

.family-display-clock > small {
  margin-left: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 750;
}

.family-display-weather {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr);
  align-items: center;
  gap: 6px 12px;
  padding: 16px 18px;
  border-radius: 23px;
}

.family-display-weather[hidden] {
  display: none !important;
}

.family-display-weather-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffe2a3;
  font-size: 34px;
}

.family-display-weather-main {
  min-width: 0;
}

.family-display-weather-main > span,
.family-display-weather-main > small {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-display-weather-main > strong {
  display: flex;
  align-items: flex-start;
  gap: 1px;
  margin: 1px 0;
  font-size: 38px;
  font-weight: 670;
  line-height: 1;
}

.family-display-weather-main > strong b { font: inherit; }
.family-display-weather-main > strong sup { margin-top: 2px; font-size: 17px; }

.family-display-weather dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 7px 0 0;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.family-display-weather dl div { display: grid; gap: 2px; text-align: center; }
.family-display-weather dl div + div { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.family-display-weather dt { color: rgba(255, 255, 255, 0.58); font-size: 10px; }
.family-display-weather dd { margin: 0; font-size: 13px; font-weight: 760; }

.family-weather-source {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  text-decoration: none;
}

.family-weather-source:hover {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: underline;
}

body.family-display-mode .family-display-exit {
  top: clamp(22px, 3vw, 46px);
  right: auto;
  left: clamp(22px, 3vw, 46px);
  z-index: 10;
  min-height: 45px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(24, 21, 18, 0.42);
  color: #fff;
  backdrop-filter: blur(16px);
}

@media (max-width: 700px) {
  body.family-display-mode .family-display-info {
    top: 18px;
    right: 18px;
    width: min(290px, calc(100vw - 88px));
    gap: 6px;
  }
  .family-display-clock { padding: 9px 14px 8px; border-radius: 17px; }
  .family-display-clock > span { font-size: 10px; }
  .family-display-clock > strong { font-size: 37px; }
  .family-display-clock > small { font-size: 10px; }
  .family-display-weather { position: relative; grid-template-columns: 38px minmax(0, 1fr); padding: 8px 12px 12px; border-radius: 17px; }
  .family-display-weather-icon { width: 37px; height: 37px; border-radius: 12px; font-size: 24px; }
  .family-display-weather-main > strong { font-size: 27px; }
  .family-display-weather-main > span,
  .family-display-weather-main > small { font-size: 10px; }
  .family-display-weather dl { display: none; }
  .family-weather-source { position: absolute; right: 11px; bottom: 5px; margin: 0; font-size: 7px; }
  body.family-display-mode .family-slide figcaption { bottom: 88px; left: 20px; max-width: calc(100vw - 40px); }
  body.family-display-mode .family-slide figcaption strong { font-size: clamp(26px, 8vw, 38px); }
  body.family-display-mode #container .family-slide figcaption p { font-size: 13px; }
  body.family-display-mode .family-slide-controls { right: 18px; bottom: 20px; }
  body.family-display-mode .family-display-exit { top: 18px; left: 18px; width: 45px; padding: 0; }
  body.family-display-mode .family-display-exit span { display: none; }
}

@media (max-width: 700px) and (orientation: portrait) {
  body.family-display-mode .family-slide {
    overflow: hidden;
    background: #201c18;
  }

  body.family-display-mode .family-slide-backdrop {
    position: absolute;
    z-index: 0;
    inset: -28px;
    display: block;
    width: calc(100% + 56px);
    height: calc(100% + 56px);
    object-fit: cover;
    filter: blur(22px) brightness(0.56) saturate(0.78);
    transform: scale(1.08);
  }

  body.family-display-mode .family-slide-photo {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.2));
  }

  body.family-display-mode .family-slide::after {
    z-index: 2;
    background:
      linear-gradient(180deg, rgba(17, 14, 12, 0.34) 0%, transparent 29%),
      linear-gradient(0deg, rgba(17, 14, 12, 0.78) 0%, transparent 31%);
  }

  body.family-display-mode .family-slide figcaption {
    z-index: 3;
  }
}

@media (orientation: landscape) and (max-height: 650px) {
  body.family-display-mode .family-display-info { top: 18px; right: 18px; width: 285px; gap: 7px; }
  .family-display-clock { padding: 11px 16px 9px; border-radius: 18px; }
  .family-display-clock > strong { font-size: 46px; }
  .family-display-weather { padding: 10px 14px; border-radius: 18px; }
  .family-display-weather-icon { width: 43px; height: 43px; font-size: 28px; }
  .family-display-weather-main > strong { font-size: 30px; }
  .family-display-weather dl { display: none; }
  body.family-display-mode .family-slide figcaption { bottom: 75px; }
  body.family-display-mode .family-slide figcaption strong { font-size: clamp(27px, 3.6vw, 44px); }
  body.family-display-mode .family-slide-controls { right: 20px; bottom: 18px; }
}
