/* 보스 일정 대시보드 — 라이트/다크 테마 토큰 기반 */

:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-glow: #fde7c8;
  --surface: #ffffff;
  --surface-2: #f3efe8;
  --surface-3: #e9e3d9;
  --text: #1f1c17;
  --text-2: #4a453c;
  --muted: #7a7366;
  --border: #e6dfd3;
  --border-strong: #d5ccbd;
  --brand: #c2410c;
  --brand-hover: #a3360a;
  --brand-soft: #fff1e6;
  --brand-text: #ffffff;
  --brand-ink: #9a3412;
  --ok: #15803d;
  --ok-soft: #e6f6ec;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fde8e8;
  --info: #4f46e5;
  --info-soft: #eef0ff;
  --bar: #f59e0b;
  --bar-full: #16a34a;
  --shadow: 0 1px 2px rgb(31 28 23 / 6%), 0 4px 16px rgb(31 28 23 / 5%);
  --shadow-lg: 0 10px 40px rgb(31 28 23 / 12%);
  --radius: 16px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgb(194 65 12 / 30%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121418;
    --bg-glow: #2a1d10;
    --surface: #1a1d23;
    --surface-2: #22262e;
    --surface-3: #2c313b;
    --text: #eceae6;
    --text-2: #c9c5bd;
    --muted: #979287;
    --border: #2d323b;
    --border-strong: #3b414c;
    --brand: #fb923c;
    --brand-hover: #fdba74;
    --brand-soft: #2e1e10;
    --brand-text: #1a0e04;
    --brand-ink: #fdba74;
    --ok: #4ade80;
    --ok-soft: #12291b;
    --warn: #fbbf24;
    --warn-soft: #2d2410;
    --bad: #f87171;
    --bad-soft: #2f1717;
    --info: #a5b4fc;
    --info-soft: #1d2140;
    --bar: #f59e0b;
    --bar-full: #22c55e;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 50%);
    --focus: 0 0 0 3px rgb(251 146 60 / 35%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121418;
  --bg-glow: #2a1d10;
  --surface: #1a1d23;
  --surface-2: #22262e;
  --surface-3: #2c313b;
  --text: #eceae6;
  --text-2: #c9c5bd;
  --muted: #979287;
  --border: #2d323b;
  --border-strong: #3b414c;
  --brand: #fb923c;
  --brand-hover: #fdba74;
  --brand-soft: #2e1e10;
  --brand-text: #1a0e04;
  --brand-ink: #fdba74;
  --ok: #4ade80;
  --ok-soft: #12291b;
  --warn: #fbbf24;
  --warn-soft: #2d2410;
  --bad: #f87171;
  --bad-soft: #2f1717;
  --info: #a5b4fc;
  --info-soft: #1d2140;
  --bar: #f59e0b;
  --bar-full: #22c55e;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / 50%);
  --focus: 0 0 0 3px rgb(251 146 60 / 35%);
}

/* ---- 기본 ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  color: var(--text);
  background:
    radial-gradient(900px 400px at 85% -120px, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color .2s ease, color .2s ease;
}
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.3; text-wrap: balance; }
a { color: var(--brand-ink); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.i { display: inline-flex; width: 18px; height: 18px; flex: none; }
.i svg { width: 100%; height: 100%; }

/* ---- 상단 바 -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 18px;
  background: linear-gradient(135deg, #fb923c, #c2410c); box-shadow: 0 4px 12px rgb(194 65 12 / 35%);
}
.brand-text { font-weight: 800; font-size: 17px; }
.tabs { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin: 0 auto; }
.tabs button {
  display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted);
  font-weight: 650; font-size: 14px; padding: 7px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.me { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.me img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.me .name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 레이아웃 -------------------------------------------------------------- */
main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 96px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.view-head h1 { font-size: 24px; margin: 0; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 750; margin: 0 0 10px; color: var(--text); }
.section-title .count { color: var(--muted); font-weight: 600; }
.stack > * + * { margin-top: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card + .card { margin-top: 14px; }
.muted { color: var(--muted); font-size: 13.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---- 버튼 / 입력 ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 650; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .i { width: 16px; height: 16px; }

input, select {
  font-size: 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; min-width: 0; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--brand); }
input::placeholder { color: var(--muted); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.select-pill select { border-radius: 999px; padding: 8px 34px 8px 14px; font-weight: 650; }

/* ---- 배지 / 칩 ------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge.open { background: var(--info-soft); color: var(--info); }
.badge.proposed { background: var(--warn-soft); color: var(--warn); }
.badge.failed { background: var(--bad-soft); color: var(--bad); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}

/* ---- 로그인 --------------------------------------------------------------- */
.login { padding: 48px 0 24px; }
.login-hero { text-align: center; max-width: 560px; margin: 0 auto; }
.login-mark {
  display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; font-size: 38px;
  background: linear-gradient(135deg, #fb923c, #c2410c); box-shadow: 0 12px 32px rgb(194 65 12 / 35%);
}
.login h1 { font-size: clamp(26px, 6vw, 40px); margin: 22px 0 10px; }
.login h1 em { font-style: normal; color: var(--brand-ink); }
.login-hero p { color: var(--text-2); font-size: 16px; margin: 0 0 28px; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; border-color: #4752c4; }
.btn.discord svg { width: 22px; height: 22px; }
.features {
  list-style: none; padding: 0; margin: 48px auto 0; max-width: 860px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
}
.features li {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.features span { color: var(--muted); font-size: 14px; }

/* ---- 내 일정 -------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 22px; color: #fff;
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 55%, #7c2d12 100%);
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: "🍁"; position: absolute; right: -10px; bottom: -34px; font-size: 140px; opacity: .14; transform: rotate(-18deg);
}
.hero .eyebrow { font-size: 13px; font-weight: 700; opacity: .85; letter-spacing: .02em; }
.hero h2 { font-size: 26px; margin: 4px 0 2px; }
.hero .when { font-size: 16px; font-weight: 600; opacity: .95; }
.hero .countdown { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero .countdown div {
  min-width: 64px; padding: 8px 10px; border-radius: 12px; text-align: center;
  background: rgb(255 255 255 / 16%); backdrop-filter: blur(4px);
}
.hero .countdown b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.hero .countdown span { font-size: 11.5px; opacity: .85; }
.hero.empty-hero { background: linear-gradient(135deg, #57534e, #292524); }

.pending { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.pending:first-of-type { border-top: 0; padding-top: 0; }
.pending .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); flex: none; }

.timeline { display: flex; flex-direction: column; gap: 18px; }
.day-label { font-size: 13px; font-weight: 750; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.day-label.today { color: var(--brand-ink); }
.event-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid transparent;
}
.event-row + .event-row { margin-top: 8px; }
.event-row .time { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 58px; }
.event-row .rel { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---- 파티 ----------------------------------------------------------------- */
.party { padding: 0; overflow: hidden; }
.party + .party { margin-top: 18px; }
.party-head { padding: 18px 18px 14px; display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.party-head h2 { margin: 0 0 6px; font-size: 20px; }
.party-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 18px; }
.party-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.members { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.member {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); min-width: 0;
}
.member .avatar { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-3); overflow: hidden; font-size: 18px; }
.member .avatar img { width: 100%; height: 100%; object-fit: cover; }
.member .avatar.char img { object-fit: cover; image-rendering: pixelated; transform: scale(3); transform-origin: 50% 54%; }
.member .who { min-width: 0; }
.member .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .who span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .power { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--brand-ink); white-space: nowrap; }
.member.me-tile { border-color: var(--brand); }

.panel { border-top: 1px solid var(--border); padding-top: 16px; }

/* 조율 그리드: 날짜별 행 × 시간 칩 */
.poll-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.reco {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  background: var(--brand-soft); color: var(--text-2); font-size: 13.5px; margin-bottom: 12px;
}
.proposal { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); margin-bottom: 12px; font-weight: 600; }
.days { display: flex; flex-direction: column; gap: 8px; }
.day { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: start; }
.day-name { padding-top: 9px; font-weight: 750; font-size: 14px; }
.day-name small { display: block; font-size: 11.5px; color: var(--bad); font-weight: 650; }
.times { display: flex; gap: 6px; flex-wrap: wrap; }
.slot {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 104px; padding: 8px 10px 9px;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); cursor: default; user-select: none;
  transition: border-color .15s, background-color .15s;
}
.slot.editable { cursor: pointer; }
.slot.editable:hover { border-color: var(--border-strong); }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.slot:has(input:focus-visible) { box-shadow: var(--focus); }
.slot .top { display: flex; align-items: center; gap: 6px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot { min-width: 104px; }
.slot .top .n { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.slot .tick {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none;
}
.slot .tick svg { width: 12px; height: 12px; opacity: 0; color: var(--brand-text); }
.slot:has(input:checked) .tick { background: var(--brand); border-color: var(--brand); }
.slot:has(input:checked) .tick svg { opacity: 1; }
.slot .bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.slot .bar i { display: block; height: 100%; border-radius: 99px; background: var(--bar); }
.slot.full .bar i { background: var(--bar-full); }
.slot.full { border-color: color-mix(in srgb, var(--bar-full) 55%, var(--border)); }
.slot.proposed { border-color: var(--warn); }
.slot .star { color: #f59e0b; font-size: 12px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.poll-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.waiting { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); margin-top: 12px; }

.clear-table { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.clear-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.clear-row .marks { font-size: 16px; letter-spacing: 2px; }
.clear-banner { padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }

details.settings-box summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-2);
}
details.settings-box summary::-webkit-details-marker { display: none; }
details.settings-box summary::after { content: "▾"; margin-left: auto; transition: transform .2s; color: var(--muted); }
details.settings-box[open] summary::after { transform: rotate(180deg); }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.settings label:not(.check) { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.settings .full { grid-column: 1 / -1; }

/* ---- 캐릭터 --------------------------------------------------------------- */
.register { margin-bottom: 18px; }
.register-main { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.register-main input[name=name] { flex: 1 1 220px; font-size: 15px; padding: 11px 14px; }
.register-manual { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.register-manual input { flex: 1 1 140px; }
.hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.char-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin: 0 !important; }
.char-art {
  position: relative; height: 132px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 70%, var(--brand-soft), var(--surface-2) 70%);
}
/* 넥슨 이미지는 300×300 투명 캔버스 가운데 아래쪽에 캐릭터가 있어 영역을 채우고 그 부분만 보여준다 */
.char-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 56%; image-rendering: pixelated; }
.char-art .placeholder { font-size: 48px; opacity: .6; }
.char-art .world { position: absolute; top: 10px; left: 10px; z-index: 1; }
.char-art .main-badge { position: absolute; top: 10px; right: 10px; z-index: 1; }
.char-art .drag-handle { position: absolute; bottom: 8px; left: 8px; z-index: 1; color: var(--muted); cursor: grab; opacity: .7; }
.char-card[draggable="true"] { cursor: grab; }
.char-card.dragging { opacity: .45; }
.char-card.drop-target { outline: 2px dashed var(--brand); outline-offset: 2px; }
.order-btns { margin-left: auto; display: inline-flex; gap: 4px; }
.order-btns .btn[disabled] { opacity: .35; }
.char-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.char-info h3 { margin: 0; font-size: 18px; }
.char-info .job { color: var(--text-2); font-size: 13.5px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.stat span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 650; }
.stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.exp { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.exp i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #ea580c); }
.char-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.char-actions .btn.danger { margin-left: auto; }
.manual-form { display: flex; gap: 6px; flex-wrap: wrap; }
.manual-form input { flex: 1 1 90px; padding: 7px 10px; }

/* ---- 공통 상태 ------------------------------------------------------------ */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.h1 { height: 150px; }
.skeleton.h2 { height: 220px; margin-top: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toast-in .2s ease;
}
.toast.error { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---- 모바일 ---------------------------------------------------------------- */
.bottom-nav { display: none; }
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .tabs { display: none; }
  .me .name { display: none; }
  main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .bottom-nav[hidden] { display: none !important; }
  .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none;
    color: var(--muted); font-size: 11.5px; font-weight: 650; padding: 6px 0; border-radius: 10px; cursor: pointer;
  }
  .bottom-nav button .i { width: 22px; height: 22px; }
  .bottom-nav button.active { color: var(--brand-ink); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .day { grid-template-columns: 1fr; gap: 6px; }
  .day-name { padding-top: 0; display: flex; gap: 8px; align-items: baseline; }
  .slot { min-width: 0; flex: 1 1 calc(50% - 6px); }
  .hero h2 { font-size: 22px; }
  .view-head h1 { font-size: 21px; }
  .member .power { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- 패치노트 / 시트 ---- */
.ver-btn {
  position: relative; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 650; padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.ver-btn:hover { color: var(--text); border-color: var(--brand); }
.new-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--bg); }
dialog.sheet {
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  width: min(640px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0; border: 1px solid var(--border);
  border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: rgb(0 0 0 / .45); }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 1; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-body { padding: 6px 18px 18px; }
.release { padding: 14px 0; border-bottom: 1px solid var(--border); }
.release:last-child { border-bottom: 0; }
.release header { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.release h4 { margin: 12px 0 4px; font-size: 13px; color: var(--text-2); }
.release ul { margin: 4px 0 0; padding-left: 18px; line-height: 1.6; font-size: 14px; }
.release code { font-size: 12.5px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); }

/* ---- 파티원 관리 / 요청함 ---- */
.inbox { margin-bottom: 14px; }
.manage-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.manage-row:first-child { border-top: 0; }
.sub-title { margin: 14px 0 2px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.invite-form { display: flex; gap: 8px; margin-top: 10px; }
.invite-form input { flex: 1; min-width: 0; }
.invite-results { margin-top: 4px; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.manual-schedule { margin-top: 10px; font-size: 14px; }
.manual-schedule summary { cursor: pointer; color: var(--text-2); }
.manual-schedule form { margin-top: 8px; gap: 8px; flex-wrap: wrap; }
.view-head .row { gap: 8px; flex-wrap: wrap; }
dialog .settings { padding-top: 14px; }
summary .count { margin-left: 6px; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }

/* ---- 서버 멤버 / 캐릭터 상세 ---- */
.pill-input { border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 999px; min-width: 0; width: 220px; }
.roster-card { text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--border); }
.roster-card:hover { border-color: var(--brand); }
.roster-card .char-art { height: 120px; }
.char-art .rank { position: absolute; top: 10px; right: 10px; z-index: 1; }
.owner { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.owner .power { margin-left: auto; color: var(--brand); font-size: 13px; }
dialog.sheet.wide { width: min(920px, calc(100vw - 32px)); max-height: min(88vh, 960px); }
.char-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.char-tab { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; flex: none; text-align: left; }
.char-tab[aria-selected="true"] { border-color: var(--brand); background: var(--brand-soft); }
.char-tab small { display: block; color: var(--muted); font-size: 11.5px; }
.char-tab .avatar { width: 36px; height: 36px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: var(--surface-3); }
.char-tab .avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transform: scale(3); transform-origin: 50% 54%; }
.detail-hero { display: flex; gap: 16px; margin-top: 14px; align-items: stretch; flex-wrap: wrap; }
.detail-hero .char-art { width: 180px; height: 180px; border-radius: 14px; flex: none; }
.detail-hero h3 { margin: 0; font-size: 22px; }
.detail-hero .job { color: var(--text-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.facts span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 650; }
.facts b { font-size: 14px; }
.detail-sec { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.detail-sec summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.equip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 12px; }
.equip { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 13.5px; }
.equip img, .equip-ph { width: 32px; height: 32px; flex: none; image-rendering: pixelated; object-fit: contain; }
.star-n { color: #e6a700; font-weight: 700; font-size: 12.5px; }
.pot, .pot-lines div { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.grade { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 10.5px; font-weight: 800; margin-right: 4px; color: #fff; background: #888; vertical-align: 1px; }
.grade.g-legend { background: #3fa34d; }
.grade.g-unique { background: #d9a400; }
.grade.g-epic { background: #8c4fd8; }
.grade.g-rare { background: #2d8fd8; }
.symbol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.symbol { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 10px; background: var(--surface-2); font-size: 12px; text-align: center; }
.symbol img { width: 36px; height: 36px; image-rendering: pixelated; }
@media (max-width: 560px) {
  .pill-input { width: 100%; }
  .detail-hero .char-art { width: 100%; height: 150px; }
  .equip-list { grid-template-columns: 1fr; }
}
.detail-hero .char-art img { transform: scale(2); transform-origin: 50% 56%; }

/* ---- 보스 선택 ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.boss-picker { display: flex; flex-direction: column; gap: 10px; }
.boss-selected { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.chip-x { border: 0; background: none; color: inherit; font: inherit; font-size: 15px; line-height: 1; margin-left: 4px; padding: 0 2px; cursor: pointer; opacity: .7; }
.chip-x:hover { opacity: 1; }
.boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 360px; overflow-y: auto; padding: 2px; }
.boss-tile { display: grid; grid-template-columns: 32px 1fr; gap: 3px 9px; align-items: center; padding: 7px 9px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); }
.boss-tile.on { border-color: var(--brand); background: var(--brand-soft); }
.boss-tile[hidden] { display: none; }
.boss-icon { grid-row: span 2; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 55% 48%), hsl(calc(var(--h) + 40) 60% 32%)); box-shadow: inset 0 -2px 0 rgb(0 0 0 / .2); }
.boss-meta { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.boss-meta b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boss-meta .muted { font-size: 11.5px; }
.diffs { display: flex; flex-wrap: wrap; gap: 4px; }
.diff { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.diff:hover { color: var(--text); }
.diff.on { color: #fff; border-color: transparent; background: var(--dc); }
.d-easy { --dc: #3d9a6a; } .d-normal { --dc: #3b7dd8; } .d-hard { --dc: #d9483b; } .d-chaos { --dc: #8a4fd6; } .d-extreme { --dc: #b3122b; }
.boss-chip.d-easy, .boss-chip.d-normal, .boss-chip.d-hard, .boss-chip.d-chaos, .boss-chip.d-extreme { border-left: 3px solid var(--dc); }
.boss-custom { display: flex; gap: 8px; }
.boss-custom input { flex: 1; min-width: 0; }
.boss-search { width: 100%; }
.event-row select { margin-left: auto; }
@media (max-width: 560px) { .event-row { flex-wrap: wrap; } }

/* ---- 파티 목록 ---- */
.party-row { margin-bottom: 10px !important; }
.party-row .party-head { align-items: center; }
.party-row .party-head[data-party-link] { cursor: pointer; }
.party-row h2 a { color: inherit; text-decoration: none; }
.party-row.mine:hover { border-color: var(--brand); }
.party-row h2 { display: flex; align-items: center; gap: 6px; font-size: 17px; margin: 0 0 6px; }
.party-row .caret { color: var(--muted); display: inline-flex; }
.party-row.mine { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }

.party-row .chips { margin-bottom: 6px; }
.event-row .grow { min-width: 0; }
@media (max-width: 560px) {
  .party-row .party-head { flex-wrap: wrap; }
  .party-row .party-head > .grow { flex: 1 1 100%; min-width: 0; }
  .party-row .party-head > .row { width: 100%; }
  .event-row .grow { flex: 1 1 auto; min-width: 110px; }
}
.stat small { display: block; font-size: 11px; margin-top: 2px; }

/* ---- 사용자 메뉴 ---- */
.top-actions { position: relative; }
.me-btn { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; color: var(--text); font: inherit; font-weight: 600; padding: 3px 8px 3px 3px; border-radius: 999px; cursor: pointer; }
.me-btn:hover, .me-btn[aria-expanded="true"] { border-color: var(--border); background: var(--surface); }
.me-btn .i { width: 16px; height: 16px; color: var(--muted); }
.me-initial { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.user-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; padding: 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); z-index: 50; display: flex; flex-direction: column; }
.user-menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.user-menu button:hover { background: var(--surface-2); }
.user-menu button.danger { color: var(--danger, #d9483b); }
.user-menu .muted { margin-left: auto; font-size: 12px; }
@media (max-width: 560px) { .me-btn .name { display: none; } }

.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-weight: 650; margin: 4px 0 12px; }
.back-link:hover { color: var(--text); }
.notice-card { display: flex; align-items: center; gap: 10px; color: var(--text-2); margin-top: 10px; }
.slot-name { display: inline-flex; flex-direction: column; line-height: 1.15; }
.slot-name small, .event-row .time small { font-size: 11px; font-weight: 600; color: var(--muted); }
.event-row .time small { display: block; }
