/* ————————————————————————————————— Pentaport 2026 Crew ————————— */

:root {
  --bg: #0D0E12;
  --panel: #16171E;
  --panel-2: #1D1F29;
  --line: #262837;
  --text: #F4F5F7;
  --dim: #9DA3B4;
  --pink: #FF4D9D;
  --hot: #FF2D55;
  --orange: #FF8A3D;
  --yellow: #FFD84D;
  --green: #7ED04B;
  --blue: #4DA6FF;
  --red: #E8253D;
  --grad: linear-gradient(90deg, #FF4D9D, #FF8A3D);
  --poster-grad: linear-gradient(165deg, #F9A8CE 0%, #EFB3DD 35%, #92C6F2 100%);
  --gutter: 42px;
  --nav-h: 62px;
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
a { color: var(--blue); text-decoration: none; }
::selection { background: rgba(255, 77, 157, .4); }

#app {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ————— boot splash ————— */
.boot-splash {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  animation: fadein .4s ease;
}
.boot-star { font-size: 54px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: spin 2.4s linear infinite; }
.boot-name { font-weight: 900; letter-spacing: .12em; font-size: 20px; }
.boot-sub { color: var(--dim); font-size: 13px; letter-spacing: .3em; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }

/* ————— header ————— */
header.app-header {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(13, 14, 18, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 7px; margin-right: auto; min-width: 0; overflow: hidden; }
.brand .star { color: var(--pink); font-size: 19px; }
.brand .t1 { font-weight: 900; letter-spacing: .06em; font-size: 16px; white-space: nowrap; }
.brand .t2 { font-weight: 700; font-size: 11px; color: var(--dim); letter-spacing: .14em; white-space: nowrap; }
@media (max-width: 480px) {
  .brand .t2 { display: none; }
  .brand .t1 { font-size: 15px; }
  .lang-toggle button { padding: 5px 8px; font-size: 11px; }
}

/* inline svg icons */
.ic { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.13em; }
.og .ic { width: 14px; height: 14px; }
.chip .ic { width: 13px; height: 13px; margin-right: 2px; }
.dday .ic { width: 12px; height: 12px; }
.empty .big-ic { display: inline-block; margin-bottom: 6px; }
.empty .big-ic .ic { width: 34px; height: 34px; color: var(--dim); }
.info-sec .hd .ic { width: 19px; height: 19px; color: var(--pink); }
.allin .ic { width: 11px; height: 11px; }
.clash-tag .ic, .clash-line > .ic { width: 14px; height: 14px; color: #FF8A8A; flex: none; }

.lang-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  font-size: 12px; font-weight: 700; flex: none;
}
.lang-toggle button { padding: 5px 10px; color: var(--dim); }
.lang-toggle button.on { background: var(--grad); color: #fff; }

.me-chip {
  display: flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 5px;
  background: var(--panel); font-size: 12.5px; font-weight: 700; max-width: 130px;
}
.me-chip .av { width: 22px; height: 22px; flex: none; }
.me-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.av {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: rgba(0,0,0,.72);
  border: 1.5px solid rgba(255,255,255,.85);
  width: 24px; height: 24px; flex: none;
}

/* ————— main / nav ————— */
main#view {
  flex: 1;
  padding: 12px 12px calc(var(--nav-h) + env(safe-area-inset-bottom) + 22px);
}

nav.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 680px; z-index: 70;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(16, 17, 23, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0 3px; color: var(--dim); font-size: 10.5px; font-weight: 700;
  border-radius: 12px;
}
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button.on { color: #fff; }
.tabbar button.on .ico {
  background: var(--grad); border-radius: 10px; box-shadow: 0 3px 12px rgba(255, 77, 157, .35);
}
.tabbar .ico { padding: 3px 12px; display: flex; }

/* ————— shared bits ————— */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.h-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--dim); }
.small { font-size: 12px; }

.pills { display: flex; gap: 6px; margin-bottom: 10px; }
.pill {
  flex: 1; text-align: center; padding: 9px 4px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  font-weight: 800; font-size: 13px; color: var(--dim);
}
.pill.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(255, 77, 157, .3); }
.pill .sub { display: block; font-size: 10px; font-weight: 700; opacity: .8; }

.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700;
}
.chip.on { color: #fff; border-color: var(--pink); background: rgba(255, 77, 157, .16); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.dday {
  font-size: 11px; font-weight: 900; letter-spacing: .05em;
  background: rgba(255, 45, 85, .16); color: #FF7A94;
  padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255, 45, 85, .35);
}

/* ————— ongoing strip ————— */
.ongoing {
  display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px;
  scrollbar-width: none;
}
.ongoing::-webkit-scrollbar { display: none; }
.ongoing .og {
  flex: none; display: flex; align-items: center; gap: 7px;
  border-radius: 12px; padding: 7px 11px; font-size: 12px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--line); color: var(--dim);
}
.og .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.og.live { color: #fff; border-color: rgba(255,45,85,.5); }
.og.live .dot { background: var(--hot); animation: pulse 1.6s infinite; }
.og.now-strip { color: #fff; border-color: rgba(77,166,255,.45); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,45,85,.5)} 50% { box-shadow: 0 0 0 5px rgba(255,45,85,0)} }

/* ————— timetable (poster style) ————— */
.tt-frame {
  background: var(--poster-grad);
  border-radius: 20px; padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.tt-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px 10px; color: #fff;
}
.tt-title .l { font-weight: 900; font-style: italic; letter-spacing: .04em; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tt-title .r { font-weight: 800; font-size: 11.5px; background: rgba(255,255,255,.28); border: 1.5px solid #fff; padding: 3px 10px; border-radius: 999px; }

.tt-card { background: #fff; border-radius: 14px; color: #10233F; overflow: hidden; }
/* Stage header sits OUTSIDE the scroller, so it's permanently pinned. */
.tt-head {
  display: grid; grid-template-columns: var(--gutter) repeat(3, 1fr);
  gap: 4px; padding: 8px 8px 6px;
  background: #fff; border-radius: 14px 14px 0 0;
  box-shadow: 0 4px 10px -7px rgba(16, 35, 63, .3);
}

/* Only the grid scrolls — the page itself stays put. */
.tt-scroll {
  position: relative;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: 58dvh; /* JS refines this to the exact free space */
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 35, 63, .28) transparent;
}
.tt-scroll::-webkit-scrollbar { width: 7px; }
.tt-scroll::-webkit-scrollbar-track { background: transparent; }
.tt-scroll::-webkit-scrollbar-thumb {
  background: rgba(16, 35, 63, .25); border-radius: 4px;
  border: 2px solid transparent; background-clip: content-box;
}
.tt-scroll::-webkit-scrollbar-thumb:hover { background: rgba(16, 35, 63, .4); background-clip: content-box; }
.tt-stagechip {
  border-radius: 8px; font-weight: 800; font-size: 9.5px; line-height: 1.15;
  text-align: center; padding: 6px 3px; letter-spacing: .01em;
  display: flex; align-items: center; justify-content: center; min-height: 34px;
}
.tt-gatebar {
  position: absolute; top: 3px; left: var(--gutter); right: 2px; height: 28px;
  background: var(--red); color: #fff; border-radius: 7px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11.5px; letter-spacing: .03em;
}
.tt-body { position: relative; margin: 4px 8px 16px 8px; }
.tt-grid { position: absolute; inset: 0; left: var(--gutter); }
.tt-line { position: absolute; left: 0; right: 0; border-top: 1.5px solid #A6C6E4; }
.tt-line.half { border-top: 1.5px dotted #C3DAF0; }
.tt-hour {
  position: absolute; left: 0; width: calc(var(--gutter) - 8px);
  transform: translateY(-55%); text-align: right;
  font-weight: 900; font-size: 15px; color: #17324F;
}
.tt-hour.half { font-size: 10.5px; color: #7FA3C4; font-weight: 800; }

.tt-col { position: absolute; top: 0; bottom: 0; }
.tt-block {
  position: absolute; left: 2px; right: 2px;
  border-radius: 8px; padding: 4px 6px;
  overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none;
  box-shadow: 0 1px 2px rgba(16, 35, 63, .12);
  transition: transform .08s ease;
}
.tt-block:active { transform: scale(.97); }
.tt-block .nm {
  font-weight: 800; font-size: 11.5px; line-height: 1.18; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word; overflow-wrap: anywhere;
}
.tt-block .tm { font-size: 9px; font-weight: 700; opacity: .72; margin-top: 1px; }
.tt-block .cur {
  font-size: 8px; font-weight: 800; background: rgba(0,0,0,.78); color: #fff;
  border-radius: 4px; padding: 1px 5px; display: inline-block; margin-bottom: 2px;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tt-block.compact { padding: 2px 6px; display: flex; align-items: center; gap: 5px; }
.tt-block.compact .nm { font-size: 10.5px; -webkit-line-clamp: 1; }
.tt-block.compact .tm { margin: 0; flex: none; }

.tt-block.program { background: #FF67B3; color: #fff; }
.tt-block.ceremony {
  left: 2px !important; right: 2px !important;
  background: var(--red); color: #fff; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 6px;
}
.tt-block.ceremony .nm { font-size: 9px; -webkit-line-clamp: 1; }
.tt-block.ceremony .tm { font-size: 8.5px; opacity: .9; margin: 0; }

.tt-block.live { outline: 2.5px solid var(--hot); box-shadow: 0 0 14px rgba(255, 45, 85, .5); }
.tt-block.dim { opacity: .45; }

.tt-badge {
  position: absolute; top: 3px; right: 3px; z-index: 2;
  background: #fff; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  font-size: 9.5px; line-height: 1; padding: 3px 5px; font-weight: 900;
}
.tt-badge.must { color: #C77800; }
.tt-badge.maybe { color: #1B6FD8; }
.tt-clash {
  position: absolute; bottom: 3px; left: 4px; z-index: 2;
  background: var(--red); color: #fff; border-radius: 999px;
  font-size: 8.5px; font-weight: 900; padding: 1px 5.5px;
}
.crewdots { position: absolute; bottom: 3px; right: 4px; display: flex; z-index: 2; }
.crewdots i {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid #fff; margin-left: -3px; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.crewdots b {
  font-size: 8px; font-weight: 900; color: #10233F; background: #fff;
  border-radius: 999px; padding: 1px 3px; margin-left: 1px; border: 1px solid rgba(0,0,0,.15);
}

.now-line { position: absolute; left: calc(var(--gutter) - 10px); right: 0; z-index: 30; pointer-events: none; }
.now-line .bar { border-top: 2.5px solid var(--hot); box-shadow: 0 0 8px rgba(255,45,85,.7); }
.now-line .dot {
  position: absolute; left: -3px; top: -5.5px; width: 9px; height: 9px;
  background: var(--hot); border-radius: 50%; animation: pulse 1.6s infinite;
}
.now-line .tag {
  position: absolute; right: 2px; top: -9px;
  background: var(--hot); color: #fff; font-size: 9.5px; font-weight: 900;
  padding: 1.5px 7px; border-radius: 999px;
}

/* desktop: poster side lists */
.tt-wrap { display: grid; grid-template-columns: 1fr; gap: 12px; }
.stage-lists { display: none; }
@media (min-width: 1000px) {
  #app, nav.tabbar { max-width: 1080px; }
  .tt-wrap { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .stage-lists {
    display: block;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }
  .stage-lists::-webkit-scrollbar { width: 7px; }
  .stage-lists::-webkit-scrollbar-track { background: transparent; }
  .stage-lists::-webkit-scrollbar-thumb {
    background: var(--line); border-radius: 4px;
    border: 2px solid transparent; background-clip: content-box;
  }
  .sl-sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
  .sl-head { font-weight: 900; font-size: 13px; padding: 9px 14px; letter-spacing: .02em; }
  .sl-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--line); font-size: 13px; cursor: pointer; }
  .sl-row:hover { background: var(--panel-2); }
  .sl-row .t { color: var(--dim); font-weight: 600; white-space: nowrap; }
}

/* ————— list view ————— */
.act-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
}
.act-card .time { width: 52px; flex: none; text-align: center; }
.act-card .time .s { font-weight: 900; font-size: 14.5px; display: block; }
.act-card .time .e { font-size: 11px; color: var(--dim); }
.act-card .mid { flex: 1; min-width: 0; }
.act-card .nm { font-weight: 800; font-size: 15px; }
.act-card .meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.stage-tag { font-size: 10px; font-weight: 900; border-radius: 5px; padding: 2px 6px; letter-spacing: .02em; }
.act-card.live { border-color: rgba(255,45,85,.55); box-shadow: 0 0 12px rgba(255,45,85,.18); }
.live-tag { color: var(--hot); font-size: 10.5px; font-weight: 900; }
.clash-tag { color: #FF8A8A; font-size: 10.5px; font-weight: 800; }

.pickbtns { display: flex; flex-direction: column; gap: 5px; flex: none; }
.pk {
  border: 1.5px solid var(--line); border-radius: 9px; padding: 4px 9px;
  font-size: 11.5px; font-weight: 800; color: var(--dim); display: flex; gap: 4px; align-items: center;
}
.pk.on-must { background: rgba(255, 216, 77, .16); border-color: #E5B93C; color: #FFD84D; }
.pk.on-maybe { background: rgba(77, 166, 255, .14); border-color: #3E86D1; color: #7CBDFF; }

.avrow { display: flex; align-items: center; margin-top: 6px; }
.avrow .av { width: 20px; height: 20px; font-size: 9.5px; margin-right: -5px; }
.avrow .more { font-size: 10.5px; color: var(--dim); margin-left: 9px; font-weight: 700; }

/* ————— crew ————— */
.members { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.members::-webkit-scrollbar { display: none; }
.member { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: 56px; }
.member .av { width: 40px; height: 40px; font-size: 16px; position: relative; }
.member .nm { font-size: 11px; font-weight: 700; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .on { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #34C759; border: 2px solid var(--bg); }
.member.me .av { box-shadow: 0 0 0 2px var(--pink); }

.rank-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.rank-row .n { width: 22px; text-align: center; font-weight: 900; color: var(--dim); font-size: 15px; flex: none; }
.rank-row .n.top { color: var(--yellow); }
.rank-row .n.tm { font-size: 12px; font-weight: 800; color: #CFD3DE; width: 40px; letter-spacing: -.02em; }
.rank-row .mid { flex: 1; min-width: 0; }
.rank-row .nm { font-weight: 800; font-size: 14.5px; }
.rank-row .sc { flex: none; text-align: right; }
.rank-row .sc .v { font-weight: 900; font-size: 16px; display: block; }
.rank-row .sc .l { font-size: 9.5px; color: var(--dim); font-weight: 700; }
.allin {
  font-size: 9.5px; font-weight: 900; letter-spacing: .04em;
  background: var(--grad); color: #fff; padding: 2px 7px; border-radius: 999px;
}
.split-card { border-color: rgba(255, 138, 61, .4); }
.split-vs { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.split-side { flex: 1; background: var(--panel-2); border-radius: 10px; padding: 8px 10px; }
.split-side .nm { font-weight: 800; font-size: 12.5px; }
.split-side .who { margin-top: 4px; display: flex; }
.split-side .who .av { width: 18px; height: 18px; font-size: 8.5px; margin-right: -4px; }
.vs { font-weight: 900; color: var(--dim); font-size: 11px; flex: none; }

/* ————— map ————— */
.amen-pin.zone { background: rgba(38, 80, 62, .92); }
.amen-pin.food { background: rgba(96, 66, 24, .92); }
.amen-pin.gate { background: rgba(120, 32, 44, .95); }
.amen-pin.transit { background: rgba(28, 60, 110, .95); }
.amen-pin.smoke { background: rgba(70, 70, 78, .95); }
/* ————— map tab ————— */
.map-hero { margin-bottom: 10px; }
.map-hero img { height: 235px; }

/* ————— docs ————— */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.doc-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); cursor: pointer; position: relative;
}
.doc-card img { width: 100%; height: 150px; object-fit: cover; object-position: top; display: block; }
.doc-card .cap { padding: 8px 10px; font-size: 12.5px; font-weight: 800; }
.doc-card .lang-note {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.65); color: #fff; font-size: 9.5px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px;
}

.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(5, 6, 9, .96);
  display: flex; flex-direction: column;
  animation: fadein .18s ease;
}
.lb-top {
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}
.lb-title { font-weight: 800; font-size: 14px; margin-right: auto; }
.lb-btn {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; padding: 6px 12px; font-size: 12.5px; font-weight: 800;
}
.lb-stage { flex: 1; overflow: hidden; position: relative; touch-action: none; }
.lb-stage img {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  max-width: none; user-select: none; -webkit-user-drag: none;
}
.lb-zoom { position: absolute; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.lb-zoom button {
  width: 42px; height: 42px; border-radius: 12px; font-size: 20px; font-weight: 800;
  background: rgba(20, 22, 30, .9); border: 1px solid var(--line); color: #fff;
}

/* ————— info ————— */
.info-sec { margin-bottom: 12px; }
.info-sec .hd { display: flex; gap: 9px; align-items: center; font-weight: 900; font-size: 15px; margin-bottom: 8px; }
.info-sec ul { margin: 0; padding-left: 18px; color: #CFD3DE; font-size: 13.5px; }
.info-sec li { margin-bottom: 5px; }
.info-links { display: flex; flex-direction: column; gap: 8px; }
.info-links a {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 11px 13px; border-radius: 11px; color: #fff; font-weight: 700; font-size: 13.5px;
}
.info-links a span:last-child { color: var(--dim); }

/* ————— sheet ————— */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 150; animation: fadein .15s ease; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 151;
  width: 100%; max-width: 680px;
  background: var(--panel); border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  animation: sheetup .22s cubic-bezier(.2, .9, .3, 1);
  max-height: 82dvh; overflow-y: auto;
}
@keyframes sheetup { from { transform: translate(-50%, 40px); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }

/* On anything desktop-sized, the act panel is a centered dialog rather than
   a bottom sheet — a thumb-reach pattern makes no sense with a mouse. */
@media (min-width: 700px) {
  .sheet {
    top: 50%; bottom: auto;
    transform: translate(-50%, -50%);
    max-width: 520px;
    max-height: 78dvh;
    border-radius: 20px;
    border: 1px solid var(--line);
    padding: 20px 22px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    animation: sheetpop .2s cubic-bezier(.2, .9, .3, 1);
  }
  .sheet .grab { display: none; }
}
@keyframes sheetpop {
  from { transform: translate(-50%, calc(-50% + 16px)) scale(.98); opacity: 0 }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1 }
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 2px auto 12px; }
.sheet .s-name { font-weight: 900; font-size: 21px; line-height: 1.2; }
.sheet .s-alt { color: var(--dim); font-weight: 700; font-size: 13.5px; margin-top: 2px; }
.sheet .s-meta { display: flex; gap: 8px; align-items: center; margin: 10px 0 14px; flex-wrap: wrap; font-size: 13px; }
.bigpicks { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 14px; }
.bigpick {
  border: 1.5px solid var(--line); border-radius: 13px; padding: 12px;
  font-weight: 800; font-size: 14.5px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel-2);
}
.bigpick.on-must { background: rgba(255, 216, 77, .14); border-color: #E5B93C; color: #FFD84D; }
.bigpick.on-maybe { background: rgba(77, 166, 255, .13); border-color: #3E86D1; color: #7CBDFF; }
.s-sec { margin-bottom: 12px; }
.s-sec .t { font-size: 11.5px; font-weight: 900; letter-spacing: .06em; color: var(--dim); text-transform: uppercase; margin-bottom: 7px; }
.who-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who-tag {
  display: flex; align-items: center; gap: 6px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 4px;
  font-size: 12.5px; font-weight: 700;
}
.who-tag .av { width: 21px; height: 21px; font-size: 10px; }
.clash-line {
  display: flex; gap: 8px; align-items: center; font-size: 13px;
  background: rgba(232, 37, 61, .12); border: 1px solid rgba(232, 37, 61, .35);
  padding: 9px 11px; border-radius: 11px; margin-bottom: 6px; cursor: pointer;
}

/* ————— modal (join / profile) ————— */
.modal-back {
  position: fixed; inset: 0; z-index: 180; background: rgba(5, 6, 9, .8);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein .18s ease;
}
.modal {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 22px;
}
.modal h2 { margin: 0 0 4px; font-size: 20px; font-weight: 900; }
.modal .sub { color: var(--dim); font-size: 13px; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11.5px; font-weight: 900; letter-spacing: .05em; color: var(--dim); text-transform: uppercase; margin-bottom: 7px; }
.field input[type="text"] {
  width: 100%; background: var(--panel-2); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 11px 13px; color: #fff; font-size: 15px; outline: none;
}
.field input[type="text"]:focus { border-color: var(--pink); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch { aspect-ratio: 1; border-radius: 50%; border: 2.5px solid transparent; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--pink); }
.emojis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.emoji-opt { font-size: 21px; padding: 5px 0; border-radius: 10px; border: 1.5px solid transparent; }
.emoji-opt.on { background: var(--panel-2); border-color: var(--pink); }
.btn-primary {
  width: 100%; background: var(--grad); color: #fff; font-weight: 900; font-size: 15px;
  border-radius: 13px; padding: 13px; margin-top: 6px;
  box-shadow: 0 6px 18px rgba(255, 77, 157, .35);
}
.btn-primary:disabled { opacity: .5; box-shadow: none; }

/* ————— identity picker / account actions ————— */
.pick-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pick-who {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--panel-2); border: 1.5px solid var(--line);
  border-radius: 13px; padding: 11px 13px; text-align: left;
}
.pick-who:hover { border-color: var(--pink); background: rgba(255, 77, 157, .08); }
.pick-who:disabled { opacity: .5; }
.pick-who .av { width: 32px; height: 32px; font-size: 14px; }
.pick-who .nm { flex: 1; font-weight: 800; font-size: 15px; }
.pick-who .ic { width: 16px; height: 16px; color: var(--dim); }
.pick-who .on-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #34C759; flex: none;
}

.btn-ghost {
  width: 100%; margin-top: 8px; padding: 11px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-weight: 800; font-size: 14px; color: var(--dim);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-ghost:hover { color: #fff; border-color: #3a3d52; }
.btn-ghost .ic { width: 16px; height: 16px; }

.acct-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.btn-danger {
  width: 100%; margin-top: 8px; padding: 11px;
  border: 1.5px solid rgba(232, 37, 61, .45); border-radius: 12px;
  font-weight: 800; font-size: 14px; color: #FF7A8F; background: rgba(232, 37, 61, .08);
}
.btn-danger:hover { background: rgba(232, 37, 61, .16); }
.btn-danger.solid {
  background: var(--red); color: #fff; border-color: transparent; margin-top: 4px;
  box-shadow: 0 6px 18px rgba(232, 37, 61, .3);
}
.btn-danger:disabled { opacity: .55; }
.del-summary {
  display: flex; align-items: center; gap: 11px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px; margin-bottom: 16px;
}
.del-summary .av { width: 34px; height: 34px; font-size: 15px; }

/* ————— toast ————— */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(24, 26, 35, .96); border: 1px solid var(--line);
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,.5); animation: toastin .2s ease;
  max-width: 90vw; text-align: center;
}
@keyframes toastin { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.empty { text-align: center; color: var(--dim); padding: 28px 10px; font-size: 13.5px; }
.empty .big { font-size: 30px; margin-bottom: 8px; }
