/* Apple 기기에서는 시스템 서체(SF Pro · Apple SD 산돌고딕 Neo)를 쓰고,
   그 밖의 기기에서만 같은 인상의 Pretendard를 내려받는다. */
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url("/fonts/Pretendard-Regular.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 500; font-display: swap; src: url("/fonts/Pretendard-Medium.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-display: swap; src: url("/fonts/Pretendard-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url("/fonts/Pretendard-Bold.woff2") format("woff2"); }

/* ── iOS 시스템 색 ── */
:root {
  --bg: #f2f2f7;                         /* systemGroupedBackground */
  --surface: #ffffff;                    /* secondarySystemGroupedBackground */
  --fill: rgba(118, 118, 128, 0.12);     /* tertiarySystemFill */
  --fill-press: rgba(118, 118, 128, 0.22);
  --line: rgba(60, 60, 67, 0.16);        /* separator */
  --ink: #000000;                        /* label */
  --ink-2: rgba(60, 60, 67, 0.86);
  --ink-3: rgba(60, 60, 67, 0.62);       /* secondaryLabel */
  --tint: #e4002b;                       /* 앱 틴트: F45 레드 */
  --tint-press: #c20025;
  --tint-soft: rgba(228, 0, 43, 0.1);
  --green: #34c759;
  --green-text: #1d8a3c;
  --green-soft: rgba(52, 199, 89, 0.14);
  --orange-text: #b25000;
  --orange-soft: rgba(255, 149, 0, 0.16);
  --blue: #007aff;
  --bar: rgba(249, 249, 249, 0.8);
  --sheet: #ffffff;
  --r-card: 18px;
  --r-ctl: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-press: rgba(118, 118, 128, 0.36);
    --line: rgba(84, 84, 88, 0.6);
    --ink: #ffffff;
    --ink-2: rgba(235, 235, 245, 0.86);
    --ink-3: rgba(235, 235, 245, 0.62);
    --tint: #ff375f;
    --tint-press: #e02a50;
    --tint-soft: rgba(255, 55, 95, 0.18);
    --green: #30d158;
    --green-text: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --orange-text: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.18);
    --blue: #0a84ff;
    --bar: rgba(22, 22, 24, 0.8);
    --sheet: #1c1c1e;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overscroll-behavior-y: none;
}
body.lock { overflow: hidden; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 700; }   /* Large Title */
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.025em; font-weight: 600; }  /* Title 3 */
h3 { font-size: 13px; line-height: 1.4; font-weight: 400; color: var(--ink-3); letter-spacing: -0.005em; } /* 섹션 머리말 */
b { font-weight: 600; }
button, input, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
svg { flex: none; display: block; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 2px; }

/* ── 내비게이션 바 ── */
.appbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  min-height: calc(44px + var(--safe-t));
  padding: var(--safe-t) 20px 0;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.500px 0 var(--line);
}
.appbar > div { display: flex; align-items: baseline; gap: 8px; }
.logo { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; }
.logo .f45 { height: 20px; width: auto; }
.appbar > div { align-items: center; }
.appbar .sub { font-size: 13px; color: var(--ink-3); }

/* ── 로그인 ── */
.hero { padding: calc(56px + var(--safe-t)) 24px 28px; text-align: center; }
.herologo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 13px; font-weight: 700; letter-spacing: 0.42em; text-indent: 0.42em; animation: logoin 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.herologo .f45 { height: 46px; width: auto; }
@keyframes logoin { from { opacity: 0; transform: translateY(8px) scale(0.96); } }
main.auth .card { animation: cardin 0.5s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes cardin { from { opacity: 0; transform: translateY(14px); } }
.hero h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.hero p { margin-top: 6px; font-size: 15px; color: var(--ink-3); }

main { max-width: 560px; margin: 0 auto; padding: 0 16px calc(32px + var(--safe-b)); }
main.withnav { padding-bottom: calc(96px + var(--safe-b)); }
main.admin { max-width: 920px; padding-top: 8px; }
main.auth { max-width: 420px; }
main.auth .foot { margin-top: 20px; }
.invited { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin-bottom: 14px; padding: 16px; border-radius: 18px; background: var(--tint-soft); animation: cardin 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.invited b { margin-top: 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.3; }
.invited span:not(.tag) { font-size: 14px; color: var(--ink-2); }
.invited p { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
/* 초대 링크로 들어온 행사 카드를 잠깐 강조 */
.event.spot { animation: spot 1.800s ease-out 0.2s both; }
@keyframes spot { 0%, 55% { box-shadow: 0 0 0 3px var(--tint); } 100% { box-shadow: 0 0 0 3px transparent; } }
.footlink { display: block; width: max-content; margin: 6px auto 0; padding: 12px 16px; font-size: 13px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.footlink:active { opacity: 0.5; }

/* ── 카드(그룹) ── */
.card { background: var(--surface); border-radius: var(--r-card); padding: 18px; margin-bottom: 14px; }
.card > * + * { margin-top: 16px; }
.card.lift { padding: 24px 20px 20px; border-radius: 22px; }
.card.lift h1 { font-size: 22px; letter-spacing: -0.025em; line-height: 1.3; text-align: center; }
.card.lift .hint { text-align: center; margin-top: 6px; }
.card.form > h2 + * { margin-top: 20px; }
.hint { color: var(--ink-3); font-size: 15px; line-height: 1.45; }
.fine { color: var(--ink-3); font-size: 13px; line-height: 1.45; letter-spacing: -0.005em; }
.fine.pad { padding: 0 16px 4px; margin: -6px 0 0; }
.center { text-align: center; }
.desc { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--tint); }
.eyebrow + h2 { margin-top: 2px; font-size: 22px; font-weight: 700; }

.hello { padding: 22px 4px 16px; }
.hello p { color: var(--ink-3); font-size: 15px; margin-bottom: 2px; }
.hello h1 { font-size: 30px; }
.hello h1 b { color: var(--tint); font-weight: 700; }
.group { margin-top: 22px; }
.hello + .group { margin-top: 6px; }
.group h3, h3.label { display: flex; align-items: center; gap: 5px; margin: 0 16px 7px; }
h3.label { margin-top: 26px; }
.group h3 em { font-style: normal; }
main.admin > h3 { margin: 26px 16px 7px; }

.empty { text-align: center; padding: 72px 16px; color: var(--ink); font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.emptyico { margin: 0 auto 14px; color: var(--ink-3); width: 56px; height: 56px; display: grid; place-items: center; }
.emptyico svg { width: 52px; height: 52px; stroke-width: 1.300; }
.empty .fine { margin-top: 6px; font-size: 15px; font-weight: 400; }
.empty .btn { margin: 20px auto 0; }

/* ── 입력 ── */
form > * + * { margin-top: 18px; }
label { display: block; font-size: 13px; color: var(--ink-3); letter-spacing: -0.005em; }
label > input, label > textarea, label > select, label > .pinbox { margin-top: 7px; }
.opt { margin-left: 2px; opacity: 0.85; }
input, textarea, select {
  display: block; width: 100%;
  padding: 12px 14px; min-height: 50px;
  border: 0; border-radius: var(--r-ctl);
  background: var(--fill);
  font-size: 17px; /* 16px 미만이면 iOS가 화면을 확대한다 */
  -webkit-appearance: none; appearance: none;
  transition: box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 0.8; }
textarea { resize: none; min-height: 100px; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 32%, transparent); }
select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' fill='none' stroke='%238e8e93' stroke-width='1.800' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.500 6L6 2.500 9.500 6M2.500 10L6 13.500 9.500 10'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
label.check { display: flex; align-items: center; gap: 10px; min-height: 50px; align-self: end; color: var(--ink); font-size: 17px; }
label.check input { -webkit-appearance: auto; appearance: auto; width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; accent-color: var(--tint); }
.grid2 { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* 핀번호 네 칸 */
.pinlabel { text-align: center; }
.pinbox { position: relative; display: block; max-width: 280px; margin-left: auto; margin-right: auto; }
.pinbox input { position: absolute; inset: 0; margin: 0; min-height: 0; height: 100%; opacity: 0; caret-color: transparent; z-index: 1; }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cells i { height: 58px; border-radius: 14px; background: var(--fill); display: grid; place-items: center; transition: box-shadow 0.15s; }
.cells i::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); opacity: 0; transform: scale(0.4); transition: opacity 0.12s, transform 0.12s; }
.cells i.on::after { opacity: 1; transform: scale(1); }
.pinbox:focus-within .cells i.on + i:not(.on),
.pinbox:focus-within .cells i:first-child:not(.on) { box-shadow: 0 0 0 2px var(--tint); }

/* ── 버튼 (iOS Filled · Gray · Plain) ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 50px; padding: 0 20px;
  border: 0; border-radius: 14px;
  font-size: 17px; font-weight: 600; white-space: nowrap;
  transition: opacity 0.12s, background 0.12s;
}
.btn:active:not(:disabled) { opacity: 0.7; }
/* 다크 모드에서도 흰 글자 대비(4.5:1 이상)가 나오도록 채움색은 고정 */
.btn.primary, .btn.danger { background: #e4002b; color: #fff; }
.btn.primary:disabled { background: var(--fill); color: var(--ink-3); }
.btn:disabled { cursor: default; }
.btn.ghost, .btn.soft { background: var(--fill); color: var(--tint); }
.btn.quiet { color: var(--ink-3); }
.btn.sm { width: auto; min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 18px; }
.actions .btn.sm, .card > .btn.sm, .empty .btn.sm { min-height: 44px; border-radius: 12px; }
.btn.block { margin-bottom: 14px; }
.link, .textbtn { display: block; background: none; border: 0; min-height: 44px; padding: 0 12px; font-size: 17px; color: var(--tint); }
.link:active, .textbtn:active, .more:active, .rowbtn:active { opacity: 0.5; }
form .link, form .textbtn { margin: 6px auto 0; }
.appbar .link { margin-right: -12px; }
.mini { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 0; background: var(--fill); color: var(--tint); font-size: 14px; font-weight: 600; white-space: nowrap; }
.mini:active { opacity: 0.6; }
.mini.quiet { color: var(--ink-3); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.row.between { align-items: center; justify-content: space-between; }
.row.between > * { flex: none; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn { width: 100%; }
@media (min-width: 640px) { .actions { grid-template-columns: repeat(4, 1fr); } }

/* ── 태그 ── */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--fill); color: var(--ink-3); font-size: 12px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; }
.tag.accent { background: var(--tint-soft); color: var(--tint); }
.tag.ok { background: var(--green-soft); color: var(--green-text); }
.tag.warn { background: var(--orange-soft); color: var(--orange-text); }
.tag.ink { background: var(--ink); color: var(--bg); }

/* ── 행사 카드 ── */
.event .head { display: flex; gap: 14px; align-items: center; }
.event .ttl { flex: 1; min-width: 0; }
.event .ttl h2 { margin-top: 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }
/* 캘린더 아이콘처럼: 빨간 월, 큰 날짜 */
.tile { position: relative; flex: none; width: 58px; height: 62px; border-radius: 14px; background: var(--fill); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.tile span { font-size: 11px; font-weight: 600; color: var(--tint); letter-spacing: 0; }
.tile b { font-size: 28px; font-weight: 500; letter-spacing: -0.04em; margin-top: 4px; }
.tile small { display: none; }
.tile.blank { color: var(--ink-3); }
.tile.blank svg { width: 26px; height: 26px; stroke-width: 1.500; }
.tilecheck { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2.500px var(--surface); }
.tilecheck svg { width: 12px; height: 12px; stroke-width: 3.400; }
.info { display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.info li, .meta li, .attrow { display: flex; gap: 8px; align-items: flex-start; }
.info svg, .meta svg, .attrow svg { width: 17px; height: 17px; margin-top: 2.500px; color: var(--ink-3); stroke-width: 1.700; }
.meta { display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.descwrap, .att { padding-top: 14px; box-shadow: 0 -0.500px 0 var(--line); }
.desc.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.more { background: none; border: 0; padding: 0; margin-top: 4px; min-height: 32px; font-size: 15px; color: var(--tint); }
.attrow { font-size: 15px; color: var(--ink-3); }
.attrow b { color: var(--ink); }
.bar { height: 4px; margin-top: 10px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--tint); min-width: 4px; }
.foot > * + * { margin-top: 10px; }
.deadline { text-align: center; font-size: 13px; color: var(--ink-3); letter-spacing: -0.005em; }
.status { display: flex; gap: 12px; align-items: center; min-height: 60px; padding: 10px 12px 10px 14px; border-radius: 14px; background: var(--fill); }
.status > div { flex: 1; min-width: 0; }
.status b { display: block; font-size: 16px; font-weight: 600; }
.status span { display: block; font-size: 13px; color: var(--ink-3); letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.ok { background: var(--green-soft); }
.status .btn.soft { background: var(--surface); }
.tick { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.tick svg { width: 16px; height: 16px; stroke-width: 2.800; }
.tick.mute { background: none; color: var(--ink-3); width: 24px; }
.tick.mute svg { width: 24px; height: 24px; stroke-width: 1.600; }
.event.closed .tile b, .event.closed .ttl h2 { color: var(--ink-3); }
.event.closed .tile span { color: var(--ink-3); }
.stat { flex: none; text-align: right; line-height: 1.1; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.stat span { font-size: 12px; color: var(--ink-3); }

/* ── 메세지 ── */
.msgtop, .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-3); }
.msg > * + * { margin-top: 8px; }
.msg h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.022em; display: flex; align-items: baseline; gap: 8px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); transform: translateY(-1px); }
.msg .row.between { padding-top: 12px; box-shadow: 0 -0.500px 0 var(--line); margin-top: 14px; }

/* ── 내 정보 (설정 앱처럼) ── */
.profile { display: flex; align-items: center; gap: 14px; padding: 16px 4px 2px; }
.avatar { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #a8adb8, #868b97); color: #fff; font-size: 20px; font-weight: 600; }
.profile h1 { font-size: 26px; }
.profile p { margin-top: 2px; color: var(--ink-3); font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list { padding: 0 0 0 16px; border-radius: 12px; }
.list > * { margin: 0 !important; }
.list > div, .rowbtn { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 46px; padding: 8px 16px 8px 0; box-shadow: 0 0.500px 0 var(--line); font-size: 17px; }
.list > :last-child { box-shadow: none; }
.list span { flex: none; }
.list b { font-weight: 400; color: var(--ink-3); text-align: right; }
.rowbtn { width: 100%; background: none; border: 0; text-align: left; }
.rowbtn i { font-style: normal; color: var(--ink-3); opacity: 0.6; font-size: 22px; line-height: 1; }

/* ── 탭 바 ── */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  padding: 0 12px var(--safe-b);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.500px 0 var(--line);
}
.navin { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 480px; }
/* 선택한 탭 뒤에서 미끄러지는 캡슐 */
.navpill { position: absolute; top: 5px; left: 0; width: calc(100% / 3); height: 32px; transform: translateX(calc(var(--i) * 100%)); transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1); pointer-events: none; }
.navpill::before { content: ""; position: absolute; top: 0; left: 50%; width: 64px; height: 32px; margin-left: -32px; border-radius: 16px; background: var(--tint-soft); }
.bottomnav button { position: relative; transition: color 0.2s; }
.bottomnav button.pop .ico { animation: pop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1); }
.bottomnav button:active .ico { transform: scale(0.88); transition: transform 0.1s; }
@keyframes pop { 0% { transform: scale(0.78); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.badge { animation: pop 0.4s 0.15s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
/* 탭을 바꾸면 화면이 이동 방향에서 들어온다 */
main.fwd > *, main.back > * { animation: pagein 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
main.fwd { --dx: 22px; }
main.back { --dx: -22px; }
main.fwd > :nth-child(2), main.back > :nth-child(2) { animation-delay: 0.04s; }
main.fwd > :nth-child(n + 3), main.back > :nth-child(n + 3) { animation-delay: 0.08s; }
@keyframes pagein { from { opacity: 0; transform: translateX(var(--dx)); } }
.bottomnav button {
  min-height: 52px; padding-top: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--ink-3); font-size: 10px; font-weight: 500; letter-spacing: 0;
}
.bottomnav button[aria-selected="true"] { color: var(--tint); }
.bottomnav svg { width: 26px; height: 26px; stroke-width: 1.700; }
.ico { position: relative; display: block; height: 26px; }
.badge { position: absolute; top: -4px; left: 15px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 12px; font-style: normal; font-weight: 500; line-height: 18px; text-align: center; }

/* ── 운영자 ── */
.seg { position: relative; display: flex; gap: 0; max-width: 888px; width: calc(100% - 32px); margin: 10px auto 6px; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg button { flex: 1; min-height: 36px; border: 0; border-radius: 7px; background: none; color: var(--ink); font-size: 14px; font-weight: 500; }
.seg button { position: relative; }
.seg button[aria-selected="true"] { font-weight: 600; }
.segthumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / 3); border-radius: 7px; background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); transform: translateX(calc(var(--i) * 100%)); transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1); }
@media (prefers-color-scheme: dark) { .segthumb { background: #636366; } }
.seg em { font-style: normal; margin-left: 4px; color: var(--ink-3); font-weight: 400; }
.invite { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--fill); }
.inviteurl { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite .mini { background: var(--surface); min-height: 34px; }
.panel .invite { margin-top: 18px; }
.panel .invite .inviteurl { font-size: 15px; color: var(--ink); user-select: all; -webkit-user-select: all; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stats div { background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.stats b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.stats span { font-size: 12px; color: var(--ink-3); letter-spacing: -0.005em; }

/* 표 (좁은 화면에서는 한 사람씩 쌓는다) */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; white-space: nowrap; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 0.500px solid var(--line); }
th { color: var(--ink-3); font-size: 12px; font-weight: 400; }
td { color: var(--ink-2); }
td b { color: var(--ink); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tr.cancelled td, tr.cancelled td b { color: var(--ink-3); }
tr.cancelled td b { text-decoration: line-through; font-weight: 400; }
td a { color: var(--blue); text-decoration: none; }
@media (max-width: 720px) {
  table.stack, table.stack tbody { display: block; white-space: normal; }
  table.stack thead { display: none; }
  table.stack tr { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 5px; padding: 14px 0; box-shadow: 0 0.500px 0 var(--line); }
  table.stack tr:first-child { padding-top: 2px; }
  table.stack tr:last-child { box-shadow: none; }
  table.stack td { display: flex; justify-content: space-between; gap: 16px; padding: 0; border: 0; grid-column: 1 / -1; text-align: right; }
  table.stack td:empty { display: none; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--ink-3); flex: none; }
  table.stack td.num { grid-column: 1; color: var(--ink-3); align-items: center; }
  table.stack td.name { grid-column: 2; font-size: 17px; text-align: left; margin-bottom: 2px; }
  table.stack tr > td.name:first-child { grid-column: 1 / -1; }
  table.stack td.act { margin-top: 8px; }
  table.stack td.act .mini { flex: 1; min-height: 40px; border-radius: 10px; font-size: 15px; }
}

/* ── 시트 ── */
#sheet { display: none; }
#sheet.on { display: block; position: fixed; inset: 0; z-index: 30; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); animation: fade 0.25s ease-out; }
.panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto; max-height: 92dvh; overflow-y: auto;
  padding: 6px 20px calc(20px + var(--safe-b));
  background: var(--sheet); border-radius: 22px 22px 0 0;
  animation: rise 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}
.panel > * + * { margin-top: 8px; }
.panel > form, .panel > .row { margin-top: 22px; }
.panel h2 { font-size: 22px; font-weight: 700; }
.grab { width: 36px; height: 5px; border-radius: 2.500px; background: var(--fill-press); margin: 0 auto 18px; }
@media (min-width: 640px) {
  .panel { bottom: auto; top: 50%; transform: translateY(-50%); max-width: 420px; border-radius: 22px; animation: fade 0.2s ease-out; padding: 24px; }
  .grab { display: none; }
}
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ── 토스트 · 로딩 ── */
#toast {
  position: fixed; left: 50%; bottom: calc(76px + var(--safe-b)); transform: translate(-50%, 10px);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 22px;
  background: rgba(40, 40, 44, 0.88); color: #fff;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  font-size: 15px; font-weight: 500; text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 40;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: rgba(215, 0, 40, 0.94); }
.skel { height: 240px; margin-top: 96px; background: linear-gradient(100deg, var(--surface) 30%, var(--bg) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.300s linear infinite; }
.skel.short { height: 140px; margin-top: 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
