.empty { color: var(--muted); line-height: 1.6; }
.panel { padding: clamp(24px, 3vw, 40px); }
.panelHead {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(83, 70, 50, .22);
}
.panelHead::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 78px;
  height: 2px;
  background: var(--dancheong-red);
}
.panelHead input {
  width: 280px; max-width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 12px 13px;
}
.days, .terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.day, .term {
  border: 1px solid var(--line); border-radius: 0; padding: 16px;
  background: var(--hanji); min-height: 88px;
}
.day b, .term b { display: block; margin: 6px 0; }
.term p { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }
.tag { display: inline-flex; border-radius: 999px; padding: 4px 8px; background: var(--green-2); color: var(--green); font-size: 12px; font-weight: 800; }

.calendarPanel {
  min-height: calc(100vh - 326px);
  border-radius: 0;
}
.calendarHead {
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding-bottom: 0;
  border-bottom: 0;
}
.calendarHead::after { content: none; }
.monthNav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(83, 70, 50, .16);
  border-radius: 18px;
  background: rgba(255, 250, 240, .82);
  box-shadow: 0 8px 20px rgba(42, 34, 22, .07);
}
.monthNav .ghost {
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: transparent;
  border-radius: 14px;
  background: transparent;
  line-height: 1;
  transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.monthNav .ghost:hover,
.monthNav .ghost:focus-visible {
  border-color: rgba(40, 96, 74, .12);
  background: rgba(40, 96, 74, .10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.42);
}
.monthNav .ghost:active { transform: scale(.94); }
.monthNav .ghost .bootstrapIcon {
  width: 15px;
  height: 15px;
  filter: invert(30%) sepia(23%) saturate(947%) hue-rotate(105deg) brightness(89%) contrast(88%);
}
.monthNav strong {
  min-width: 118px;
  padding: 0 8px;
  color: #3f382d;
  text-align: center;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .02em;
}
.calendarLayout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.monthGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: white;
}
.weekday {
  padding: 10px;
  background: linear-gradient(180deg, var(--wood), var(--wood-dark));
  color: #fff8e8;
  font-weight: 900;
  text-align: center;
  font-size: 13px;
}
.weekday.sun { background: linear-gradient(180deg, #ba5a4b, #8f392f); }
.weekday.sat { background: var(--blue); }
.calendarDays { display: contents; }
.calDay {
  min-height: 76px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  background: #fffaf0;
}
.calDay:nth-child(7n) { border-right: 0; }
.calDay.dim { background: #f2e7d4; color: #a29380; }
.calDay[role="button"] { cursor: pointer; }
.calDay[role="button"]:hover { background: #fff6e5; }
.calDay[role="button"]:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.calDay.selected { background: var(--green-2); }
.calDay.today { box-shadow: inset 0 0 0 2px var(--green); }
.dateNum { font-weight: 900; font-size: 13px; }
.calItems {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  margin-top: 9px;
}
.calDot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #7b817b;
  box-shadow: 0 1px 2px rgba(42, 34, 22, .18);
}
.calDot.red { background: #b74848; }
.calDot.pink { background: var(--pink); }
.calDot.blue { background: var(--blue); }
.calDot.green { background: var(--green); }
.calDot.gray { background: #7b817b; }
.calEventLabels {
  display: none;
}
@media (min-width: 1281px) {
  .calDay {
    min-height: 104px;
  }
  .calItems {
    display: none;
  }
  .calEventLabels {
    min-width: 0;
    display: grid;
    gap: 3px;
    margin-top: 7px;
  }
  .calEventLabel {
    min-width: 0;
    overflow: hidden;
    padding: 3px 6px;
    border-left: 3px solid #7b817b;
    border-radius: 5px;
    background: rgba(123, 129, 123, .10);
    color: #403b33;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .calEventLabel.red { border-left-color: #b74848; background: rgba(183, 72, 72, .09); }
  .calEventLabel.pink { border-left-color: var(--pink); background: rgba(199, 72, 114, .09); }
  .calEventLabel.blue { border-left-color: var(--blue); background: rgba(49, 95, 134, .09); }
  .calEventLabel.green { border-left-color: var(--green); background: rgba(40, 96, 74, .09); }
  .calEventMore {
    padding-left: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
  }
}
.monthEvents {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 248, 232, .88);
  box-shadow: 0 8px 22px rgba(42, 34, 22, .06);
}
.monthEventsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 5px;
}
.monthEventsHead .eyebrow { margin: 0; font-weight: 900; }
.monthEventsHead .ghost {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.eventItem {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.eventItem:last-child { border-bottom: 0; }
.eventDay { font-weight: 900; color: var(--green); }
.eventTitle { font-weight: 900; }
.eventMeta { color: var(--muted); font-size: 12px; margin-top: 2px; }

.ceremonyPanel { min-height: calc(100vh - 326px); }
.familyInfoTabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid rgba(83, 70, 50, .16);
  border-radius: 999px;
  background: rgba(255, 248, 232, .72);
  scrollbar-width: none;
}
.familyInfoTabs::-webkit-scrollbar { display: none; }
.familyInfoTabs button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: #5b5144;
  font-size: 13px;
  font-weight: 900;
}
.familyInfoTabs button.active {
  background: var(--green);
  color: #fff8e8;
  box-shadow: 0 6px 16px rgba(40, 96, 74, .18);
}
.familyInfoPane {
  display: none;
}
.familyInfoPane.active {
  display: grid;
  gap: 14px;
}
.familyInfoPaneHead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.familyInfoPaneHead h3,
.profileAppSettings h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}
.familyInfoPaneHead input {
  width: min(360px, 100%);
}
.familyInfoSubtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.familyInfoSubtabs::-webkit-scrollbar { display: none; }
.familyInfoSubtabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(83, 70, 50, .18);
  border-radius: 11px;
  background: rgba(255, 250, 240, .76);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.familyInfoSubtabs button.active {
  border-color: rgba(40, 96, 74, .30);
  background: var(--green-2);
  color: var(--green);
}
.familyInfoGuideCallout {
  width: 100%;
  min-width: 0;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(40, 96, 74, .22);
  border-radius: 14px;
  background: var(--green-2);
  color: var(--text);
  text-align: left;
}
.familyInfoGuideCallout span { min-width: 0; }
.familyInfoGuideCallout b,
.familyInfoGuideCallout small { display: block; }
.familyInfoGuideCallout small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.familyInfoGuideCallout img { flex: 0 0 auto; width: 15px; height: 15px; }
.familyInfoList {
  overflow: hidden;
  border: 1px solid rgba(83, 70, 50, .16);
  border-radius: 18px;
  background: rgba(255, 250, 240, .78);
  box-shadow: 0 10px 28px rgba(42, 34, 22, .06);
}
.familyInfoListItem {
  width: 100%;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid rgba(83, 70, 50, .13);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.familyInfoListItem:last-child { border-bottom: 0; }
.familyInfoListItem:hover,
.familyInfoListItem:focus-visible { background: rgba(226, 234, 216, .55); }
.familyInfoListItem > span:first-child { min-width: 0; }
.familyInfoListItem b {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.35;
}
.familyInfoListItem small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.familyInfoListMeta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.familyInfoListMeta img,
.familyInfoCloseBtn img { width: 14px; height: 14px; }
.familyInfoEmpty { padding: 24px 18px; }
.familyInfoDetailView {
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  padding: 0;
  border: 1px solid rgba(83, 70, 50, .16);
  border-radius: 20px;
  background: rgba(255, 250, 240, .96);
  box-shadow: 0 28px 70px rgba(32, 27, 21, .28);
  animation: familyInfoPushIn .18s ease-out;
  overflow: hidden;
}
.familyInfoDetailView::backdrop {
  background: rgba(23, 25, 19, .46);
  backdrop-filter: blur(2px);
}
/* The dialog itself never scrolls -- Safari doesn't reliably keep a
   position:sticky child pinned inside a native <dialog>'s own scrollport, so
   scrolling happens on this plain wrapper div instead. */
.familyInfoDetailModal {
  max-height: min(86vh, 820px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(18px, 3vw, 32px);
}
.familyInfoDetailHeader {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 56px;
  margin-bottom: 18px;
  padding: 4px 0 6px;
  border-bottom: 1px solid rgba(83, 70, 50, .16);
  background: var(--surface);
  box-shadow: 0 10px 16px -16px rgba(42, 34, 22, .42);
}
.familyInfoDetailHeading { min-width: 0; }
.familyInfoDetailHeader h3 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.familyInfoCloseBtn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}
.familyInfoCloseBtn img { width: 20px; height: 20px; }
.familyInfoCloseBtn:hover,
.familyInfoCloseBtn:focus-visible { background: var(--green-2); }
.familyInfoTableScroll {
  overflow-x: auto;
  margin: 10px 0;
}
.familyInfoTableScroll table { margin: 0; }
@keyframes familyInfoPushIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
.ceremonyBody {
  color: #46372b;
  line-height: 1.7;
}
.ceremonyBody h4 { margin: 16px 0 6px; color: var(--green); }
.ceremonyBody h4:first-child { margin-top: 0; }
.ceremonyBody ul, .ceremonyBody ol { padding-left: 20px; margin: 8px 0; }
.ceremonyBody li { margin: 5px 0; }
.ceremonyBody table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  background: white;
  table-layout: fixed;
}
.ceremonyBody th, .ceremonyBody td {
  border: 1px solid var(--line);
  padding: 8px 9px;
  vertical-align: top;
  word-break: keep-all;
}
.ceremonyBody th { background: #eadbc1; color: var(--wood-dark); }
.ceremonyBody .note {
  border-left: 3px solid var(--wood);
  background: #f6ecd9;
  padding: 10px 12px;
  border-radius: 0;
  color: #5f4b3a;
}
.termDetailBody {
  display: grid;
  gap: 10px;
}
.termDetailBody section {
  padding: 14px 16px;
  border: 1px solid rgba(83, 70, 50, .13);
  border-radius: 14px;
  background: rgba(255, 255, 255, .52);
}
.termDetailBody span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.termDetailBody b,
.termDetailBody p { margin: 0; line-height: 1.6; }
#termDetailTag { margin-bottom: 4px; }
.businessTermCount {
  margin: -4px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.businessTermListItem { max-width: 100%; overflow: hidden; }
.businessTermListItem > span:first-child { overflow: hidden; }
.businessTermListItem b { letter-spacing: -.01em; }
.businessTermListItem small {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.familyInfoLoadMore {
  min-height: 54px;
  padding: 18px 10px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.familyInfoLoadMore[hidden] { display: none; }
#businessTermDetailTag { margin-bottom: 4px; }
.businessTermExample {
  border-color: rgba(40, 96, 74, .20) !important;
  background: var(--green-2) !important;
}
.businessTermExample p { color: var(--green); font-weight: 750; }
.ceremony-diagram {
  display: grid;
  gap: 8px;
  border: 1px solid #cfb68f;
  background: #fff8ec;
  border-radius: 0;
  padding: 14px;
}
.diagram-title { text-align: center; font-weight: 900; color: #7a5630; }
.jibang-sample {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 10px 0 14px;
}
.jibang-sample span {
  width: 72px;
  min-height: 170px;
  border: 1px solid #d8d1bf;
  border-radius: 4px;
  background: #fffdf6;
  padding: 12px 8px;
  writing-mode: vertical-rl;
  text-align: center;
  font-weight: 800;
}

.profilePanel {
  min-height: calc(100vh - 326px);
  display: flex;
  flex-direction: column;
  border-radius: 0;
}
.profileLayout {
  display: grid;
  gap: 14px;
}
.profileSummary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(40, 96, 74, .16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.20)),
    rgba(255, 248, 232, .78);
}
.profileAvatarButton {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(40, 96, 74, .20);
  border-radius: 22px;
  background: var(--hanji);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(42, 34, 22, .10);
}
.profileAvatarButton img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profileSummaryText {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.profileSummaryText strong {
  font-size: 26px;
  line-height: 1.15;
}
.profileSummaryText small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profileSettingsGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.profileInfoCard,
.profileAppSettings {
  border: 1px solid rgba(83, 70, 50, .16);
  border-radius: 18px;
  background: rgba(255, 250, 240, .74);
  padding: 16px;
}
.profileInfoCard {
  display: grid;
  gap: 6px;
}
.profileInfoCard span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.profileInfoCard label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.profileInfoCard select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(83, 70, 50, .18);
  border-radius: 13px;
  background: rgba(255, 255, 255, .72);
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
}
.profileInfoCard b {
  color: var(--green);
  font-size: 20px;
}
.profileAppSettings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.profileDevTools {
  display: grid;
  align-items: stretch;
}
.profileDevTools[hidden] {
  display: none;
}
.profileLogoutArea {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 10px;
  margin-left: auto;
  margin-top: auto;
  padding-top: 28px;
}
.profileLogoutArea .ghost {
  min-width: 0;
  border-radius: 14px;
  color: #8f392f;
}
.profileLogoutArea .ghost:hover,
.profileLogoutArea .ghost:focus-visible {
  border-color: rgba(183, 72, 72, .28);
  background: rgba(183, 72, 72, .08);
}
.profileDeleteBtn {
  min-width: 0;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
}
