:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #eef1f5;
  --hover: #e6eaf0;
  --line: #dde2ea;
  --text: #14171c;
  --dim: #586172;
  --accent: #157a45;
  --accent-ink: #ffffff;
  --accent-soft: #dff3e8;
  --accent-text: #125f37;
  --track: #b9c1cf;
  --gold-bg: #fbefd5;
  --gold-ink: #7a4d00;
  --gold-line: #e8cf95;
  --red: #b3261e;
  --red-soft: #fbe4e1;
  --red-ink: #8c1d16;
  --discord: #4752c4;
  --focus: #2f6fbf;
  --side: #ffffff;
  --shadow: 0 10px 30px rgba(20, 23, 28, 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101318;
    --panel: #181c23;
    --panel-2: #20252e;
    --hover: #262c36;
    --line: #2b313c;
    --text: #eceff3;
    --dim: #a3abb8;
    --accent: #5ccb8a;
    --accent-ink: #0d1a12;
    --accent-soft: #1c3a2a;
    --accent-text: #8fe0b5;
    --track: #3a4250;
    --gold-bg: #2a2414;
    --gold-ink: #e9b949;
    --gold-line: #4a3f1f;
    --red: #ff8a80;
    --red-soft: #3d1f1d;
    --red-ink: #ffb4ab;
    --discord: #7b85f0;
    --focus: #8ab4ff;
    --side: #14171d;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101318;
  --panel: #181c23;
  --panel-2: #20252e;
  --hover: #262c36;
  --line: #2b313c;
  --text: #eceff3;
  --dim: #a3abb8;
  --accent: #5ccb8a;
  --accent-ink: #0d1a12;
  --accent-soft: #1c3a2a;
  --accent-text: #8fe0b5;
  --track: #3a4250;
  --gold-bg: #2a2414;
  --gold-ink: #e9b949;
  --gold-line: #4a3f1f;
  --red: #ff8a80;
  --red-soft: #3d1f1d;
  --red-ink: #ffb4ab;
  --discord: #7b85f0;
  --focus: #8ab4ff;
  --side: #14171d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  min-height: 100vh; padding-top: env(safe-area-inset-top, 0px);
}
a { color: var(--accent-text); }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.06); }
.btn-discord { background: var(--discord); border-color: var(--discord); color: #ffffff; font-weight: 700; min-height: 52px; font-size: 15px; width: 100%; border-radius: 12px; }
.btn-discord:hover { background: var(--discord); color: #ffffff; filter: brightness(1.08); }
.btn-danger { border-color: var(--red); color: var(--red); background: var(--panel); font-weight: 700; }
.btn-danger:hover { background: var(--red-soft); color: var(--red-ink); }
.icon-btn { width: 42px; min-height: 42px; padding: 0; border-radius: 12px; color: var(--dim); }
.icon-btn svg { width: 20px; height: 20px; }
.btn svg { flex: none; }
.btn-discord svg { width: 22px; height: 22px; }

/* 화면 색 아이콘: 지금 설정에 맞는 것만 */
.theme-menu .i-sys, .theme-menu .i-light, .theme-menu .i-dark { display: none; }
:root:not([data-theme]) .theme-menu .i-sys { display: block; }
:root[data-theme="light"] .theme-menu .i-light { display: block; }
:root[data-theme="dark"] .theme-menu .i-dark { display: block; }

/* 펼침 메뉴 (화면 색, 내 계정) */
.pop { position: relative; }
.pop summary { list-style: none; cursor: pointer; }
.pop summary::-webkit-details-marker { display: none; }
.pop[open] > summary { background: var(--hover); color: var(--text); }
.user-menu summary {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 5px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13.5px;
}
.user-menu summary img { width: 32px; height: 32px; border-radius: 50%; }
.pop .menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; width: 100%; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--hover); }
.menu-pop .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--dim); }
.menu-pop .who b { display: block; color: var(--text); font-size: 14px; }
.theme-menu .menu-pop { min-width: 200px; }
.theme-menu .menu-pop button { justify-content: space-between; gap: 12px; }
.menu-pop .check { width: 18px; height: 18px; color: var(--accent-text); visibility: hidden; }
.menu-pop [aria-checked="true"] { font-weight: 700; }
.menu-pop [aria-checked="true"] .check { visibility: visible; }

/* 로고 */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 900; font-size: 15px; }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 900; flex: none; }

/* 서버 밖 화면 (서버 선택, 계정 보안): 위쪽 바 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  min-height: 64px; padding: 10px 20px; background: var(--side); border-bottom: 1px solid var(--line);
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.page { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--dim); max-width: 62ch; }

/* 서버 화면: 시안 레이아웃 (왼쪽 메뉴 + 본문) */
.layout { display: flex; min-height: 100vh; }
.side {
  flex: 0 0 252px; background: var(--side); border-right: 1px solid var(--line); padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 2px 10px 14px; }
.srvcard {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; color: var(--text);
}
.srvcard:hover { background: var(--hover); color: var(--text); }
.srvtext { display: flex; flex-direction: column; min-width: 0; }
.sname { font-size: 14px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.smeta { font-size: 11.5px; color: var(--dim); margin-top: 3px; display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; }
.smeta span { white-space: nowrap; }
.chev { width: 16px; height: 16px; margin-left: auto; color: var(--dim); flex: none; }
.tag { padding: 1px 7px; border-radius: 999px; background: var(--gold-bg); color: var(--gold-ink); font-size: 10.5px; font-weight: 700; border: 1px solid var(--gold-line); line-height: 18px; white-space: nowrap; }
.tag-plain { background: var(--panel-2); color: var(--dim); border-color: var(--line); }
.grp { font-size: 11.5px; color: var(--dim); padding: 12px 12px 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .soon-item {
  min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px; border-radius: 10px; text-decoration: none; white-space: nowrap; font-size: 14px; color: var(--text);
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--panel-2); font-weight: 700; }
.soon-item { color: var(--dim); cursor: default; }
.soon { font-size: 11px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; line-height: 18px; }

.main { flex: 1 1 auto; min-width: 0; max-width: 1180px; padding: 18px 36px 80px; display: flex; flex-direction: column; gap: 18px; }
.main-pad { padding-bottom: 150px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.crumb { font-size: 13px; color: var(--dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 500; }
.actions { display: flex; align-items: center; gap: 10px; flex: none; }
.main h1 { margin: 0; font-size: 28px; font-weight: 900; }
.main .sub { margin: 6px 0 0; font-size: 14px; color: var(--dim); line-height: 1.55; max-width: 660px; }
.count { margin: 8px 0 0; font-size: 13.5px; color: var(--dim); }
.count b { color: var(--text); }

/* 서버 아이콘 */
.g-icon { width: 38px; height: 38px; border-radius: 11px; flex: none; object-fit: cover; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text); }
.g-icon.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; line-height: 20px; }
.badge-gold { background: var(--gold-bg); color: var(--gold-ink); border-color: var(--gold-line); }
.badge-plain { background: var(--panel-2); color: var(--dim); border-color: var(--line); }
.badge-green { background: var(--accent-soft); color: var(--accent-text); }

/* 카드, 목록 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.panel .sub, .page .sub { margin: 0; color: var(--dim); font-size: 13.5px; }
.server-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.server-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.server-list li:first-child { border-top: 0; }
.server-list .name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.server-list .name b { font-size: 15px; overflow-wrap: anywhere; }
.server-list .name span { font-size: 13px; color: var(--dim); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 13px; color: var(--dim); }
.stat .value { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.stat .note { font-size: 12.5px; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { padding: 6px 12px; border-radius: 999px; background: var(--panel-2); font-size: 13px; }
.guild-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.guild-head .meta { display: flex; flex-direction: column; gap: 4px; }
.guild-head .meta h1 { overflow-wrap: anywhere; }
.guild-head .meta p { margin: 0; color: var(--dim); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); color: var(--text); font-size: 14px; }
.notice.ok { background: var(--accent-soft); color: var(--accent-text); }
.notice.err { background: var(--red-soft); color: var(--red-ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--dim); background: var(--panel-2); padding: 10px 14px; }
td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.result-ok { color: var(--accent-text); font-weight: 700; }
.result-bad { color: var(--red); font-weight: 700; }
.empty { text-align: center; padding: 28px 16px; color: var(--dim); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty b { color: var(--text); font-size: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1 1 auto; }

/* 기능 켜기·끄기 (시안) */
.bulk { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fcard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px 6px; }
.fcard h2 { margin: 14px 0 4px; font-size: 16px; font-weight: 700; }
.frow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 8px 10px;
  margin: 0 -10px; border-bottom: 1px solid var(--panel-2); border-radius: 10px; cursor: pointer; scroll-margin-top: 90px;
}
.frow:last-child { border-bottom: 0; }
.frow:target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.frow.is-locked, .frow.is-fixed { cursor: default; }
.frow.is-locked .nm { color: var(--dim); }
.ftext { display: flex; flex-direction: column; min-width: 0; }
.nm { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.desc { font-size: 12px; color: var(--dim); margin-top: 2px; }
.fixed-state { font-size: 13px; color: var(--dim); white-space: nowrap; }
.sw { position: relative; display: inline-block; width: 56px; height: 32px; flex: none; }
.sw input { position: absolute; inset: 0; width: 56px; height: 32px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.sw input:disabled { cursor: not-allowed; }
.sw span { position: absolute; inset: 0; border-radius: 999px; background: var(--track); transition: background 0.15s; }
.sw span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.sw input:checked + span { background: var(--accent); }
.sw input:checked + span::after { transform: translateX(24px); }
.sw input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.sw input:disabled + span { opacity: 0.45; }

.save {
  position: fixed; left: 252px; right: 0; bottom: 0; z-index: 15; background: var(--side); border-top: 1px solid var(--line);
  padding: 12px 36px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: transform 0.22s ease;
}
.js .save:not(.on) { transform: translateY(110%); visibility: hidden; }
.save-text { font-size: 13.5px; color: var(--dim); }
.save.on .save-text { color: var(--text); font-weight: 700; }
.sbtns { display: flex; gap: 10px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px); background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all 0.2s;
  max-width: calc(100vw - 32px); text-align: center; z-index: 40;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 로그인 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px 26px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.login-card .brand-mark { width: 52px; height: 52px; border-radius: 16px; font-size: 24px; }
.login-card h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.01em; }
.login-card p { margin: 0; color: var(--dim); }
.login-card .fine { font-size: 12.5px; line-height: 1.7; }
.login-top { position: fixed; top: 12px; right: 12px; }

/* 오류 */
.error-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.error-card { width: min(460px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.error-card .code { font-size: 64px; font-weight: 900; color: var(--dim); line-height: 1; }
.error-card h1 { margin: 0; font-size: 22px; }
.error-card p { margin: 0; color: var(--dim); }

/* 좁은 화면 */
@media (max-width: 1100px) { .fgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side {
    flex: none; position: static; height: auto; flex-direction: row; align-items: center; align-self: stretch;
    width: 100%; max-width: 100%; gap: 8px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .side .brand { padding: 0 8px 0 0; flex: none; }
  .side .brand b, .srvcard, .grp, .soon-item { display: none; }
  .nav { flex-direction: row; gap: 8px; }
  .nav a { border: 1px solid var(--line); border-radius: 999px; min-height: 40px; }
  .main { padding: 16px 20px 80px; }
  .main-pad { padding-bottom: 150px; }
  .save { left: 0; padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 480px) {
  .main h1 { font-size: 24px; }
  .main { padding: 14px 14px 80px; }
  .main-pad { padding-bottom: 170px; }
  .user-name { display: none; }
  .user-menu summary { padding: 0 5px; }
  .save { padding-left: 14px; padding-right: 14px; flex-direction: column; align-items: stretch; gap: 8px; }
  .sbtns .btn { flex: 1; min-height: 48px; }
  .save-text { text-align: center; }
  .frow { min-height: 62px; }
  .topbar { padding: 8px 12px; }
  .brand-text { display: none; }
  .page { padding: 20px 14px 56px; }
  .page-head h1, .guild-head .meta h1 { font-size: 22px; }
  .server-list .btn { width: 100%; }
}

/* 설정 (시안) */
.settings-head h1 { margin: 0; }
form[data-track-form] { display: flex; flex-direction: column; gap: 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); text-decoration: none; font-size: 14px; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.tab .lock { width: 15px; height: 15px; color: var(--dim); }
.set-card h2 { font-size: 18px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 500; }
.field .unit { color: var(--dim); font-weight: 400; }
.field input, .field textarea, .cell {
  min-height: 44px; box-sizing: border-box; padding: 0 12px; border-radius: 10px; border: 1px solid var(--track);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px; width: 100%;
}
.field textarea { padding: 10px 12px; min-height: 88px; resize: vertical; }
.field input:disabled, .field textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"], .cell[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.hint { font-size: 12px; color: var(--dim); }
.err { font-size: 12.5px; color: var(--red); font-weight: 700; }
.cell { width: 120px; min-height: 40px; }
.fish-table td { vertical-align: middle; }
.lock-card h2 { font-size: 18px; }
.later { margin-top: 8px; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }

/* 로그 채널 (시안) */
.lrow { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--panel-2); scroll-margin-top: 90px; }
.lrow:last-child { border-bottom: 0; }
.lrow:target { background: var(--accent-soft); border-radius: 10px; padding-left: 10px; padding-right: 10px; margin: 0 -10px; }
.lname { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lrow select {
  min-height: 44px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--track);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
.lrow select:disabled { opacity: 0.5; cursor: not-allowed; }
.lrow select[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.lrow.is-locked .lname { color: var(--dim); }

/* 로그 보기 (시안) */
.logfilter { gap: 10px; }
.fwrap > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 40px; }
.fwrap > summary::-webkit-details-marker { display: none; }
.fwrap > summary .sub { margin: 0; }
.fbody { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.typeset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.typeset legend { font-size: 12.5px; color: var(--dim); padding: 0 0 6px; width: 100%; }
.chipbox { position: relative; display: inline-flex; }
.chipbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipbox span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; color: var(--dim); }
.chipbox input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.chipbox input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.inputs select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--track); background: var(--bg); color: var(--text); font: inherit; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--panel-2); color: var(--text); text-decoration: none; font-size: 13px; }
.pill:hover { background: var(--hover); color: var(--text); }
.rhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 14px; }
.rhead .sub { margin: 0; font-size: 12.5px; }
.loglist { padding: 4px 0; gap: 0; }
.logrow { border-bottom: 1px solid var(--panel-2); }
.logrow:last-child { border-bottom: 0; }
.logrow > summary { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 12px 20px; cursor: pointer; min-height: 52px; }
.logrow > summary::-webkit-details-marker { display: none; }
.logrow > summary:hover { background: var(--hover); }
.logrow[open] > summary { background: var(--panel-2); }
.ltime { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.ltag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.ltitle { font-size: 14.5px; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.luser { font-size: 13px; color: var(--dim); }
.lamt { font-weight: 700; font-size: 14px; color: var(--accent-text); white-space: nowrap; }
.lamt.neg { color: var(--red); }
.ldetail { margin: 0; padding: 4px 20px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.ldetail div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ldetail dt { font-size: 12px; color: var(--dim); }
.ldetail dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.morebar { display: flex; justify-content: center; }
.more { border-style: dashed; color: var(--dim); }
.setup-card .sub { margin: 0; }
.setup-card form { margin: 0; }

/* 관리자 · 권한 / 블랙리스트 (시안) */
.admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.arow { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 10px; text-decoration: none; color: var(--text); }
a.arow:hover { background: var(--hover); color: var(--text); }
.arow.on { background: var(--panel-2); font-weight: 700; }
.ainit { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.aname { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.addrow { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.addrow .field { flex: 1 1 220px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.picker { position: relative; }
.picker input[type="search"], .field input[type="text"], .find { min-height: 44px; box-sizing: border-box; padding: 0 12px; border-radius: 10px; border: 1px solid var(--track); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; width: 100%; }
.find { flex: 1 1 200px; width: auto; }
.sug { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 25; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.sug button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sug button:hover, .sug button:focus-visible { background: var(--hover); }
.sug .hint { padding: 10px; }
.sug .uname-sub { color: var(--dim); font-size: 12.5px; }
.presets, .permset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.presets legend, .permset legend { font-size: 13px; color: var(--dim); padding: 0 0 6px; }
.preset { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.preset > span { display: flex; flex-direction: column; gap: 2px; }
.preset input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.preset:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.preset.is-locked { opacity: 0.55; cursor: not-allowed; }
.perm { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.perm input { width: 18px; height: 18px; accent-color: var(--accent); }
.permset:disabled, .presets:disabled { opacity: 0.7; }
.seg { display: inline-flex; gap: 4px; padding: 3px; background: var(--panel-2); border-radius: 10px; }
.seg a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--dim); font-size: 13px; }
.seg a.on { background: var(--panel); color: var(--text); font-weight: 700; }
.ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 14px; }

/* 자판기 · 유저 관리 · 랭킹 제외 */
.actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions-cell form { margin: 0; }
tr.editing td { background: var(--accent-soft); }
.field select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--track); background: var(--bg); color: var(--text); font: inherit; width: 100%; }
.ainit.lg { width: 56px; height: 56px; font-size: 22px; }
.seg label { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.seg label:has(input:checked) { background: var(--panel); font-weight: 700; }
.pickscope > summary { list-style: none; display: inline-flex; }
.pickscope > summary::-webkit-details-marker { display: none; }
.pickscope[open] > summary { background: var(--hover); }
.pickscope .typeset { margin: 12px 0; }
.rk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rk li { display: flex; align-items: center; gap: 12px; min-height: 40px; border-bottom: 1px solid var(--panel-2); }
.rk li.out { color: var(--dim); text-decoration: line-through; }
.rkn { width: 28px; text-align: right; font-weight: 700; }
.rkname { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.rkv { font-variant-numeric: tabular-nums; }

/* 경제 현황 · 공지 · 프리미엄 잠금 */
.seg-lock { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; font-size: 13px; color: var(--dim); opacity: 0.7; }
.chart-wrap { overflow-x: auto; }
.flow { width: 100%; min-width: 520px; height: auto; display: block; }
.flow .axis { stroke: var(--line); stroke-width: 1; }
.flow .up { fill: var(--accent); }
.flow .down { fill: var(--red); }
.flow text { fill: var(--dim); font-size: 11px; font-family: inherit; }
.legend { font-size: 12.5px; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.lg-up { background: var(--accent); }
.lg-down { background: var(--red); }
.lockcard { border-style: dashed; }
.dc-preview { display: flex; border-radius: 8px; background: #2b2d31; color: #dbdee1; overflow: hidden; }
.dc-bar { width: 4px; background: #57f287; flex: none; }
.dc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dc-title { font-size: 17px; color: #f2f3f5; overflow-wrap: anywhere; }
.dc-text { white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }

/* 이벤트 예약 */
.evrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.evrow select, .evrow input, .field input[type="datetime-local"] { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--track); background: var(--bg); color: var(--text); font: inherit; width: 100%; box-sizing: border-box; }
@media (max-width: 480px) { .evrow { grid-template-columns: 1fr; } }
/* 공지 미리 보기 (디스코드 모양) */
.dc-text h1, .dc-text h2, .dc-text h3 { margin: 4px 0; color: #f2f3f5; }
.dc-text h1 { font-size: 20px; } .dc-text h2 { font-size: 17px; } .dc-text h3 { font-size: 15px; }
.dc-text blockquote { margin: 2px 0; padding-left: 10px; border-left: 4px solid #4e5058; }
.dc-text code { background: #1e1f22; border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.dc-text pre { background: #1e1f22; border-radius: 6px; padding: 8px; margin: 4px 0; white-space: pre-wrap; }
.dc-text .sub-small { font-size: 12px; color: #949ba4; }
.dc-text a { color: #00a8fc; }
.dc-text ul { margin: 2px 0; padding-left: 20px; }
.dc-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dc-img { max-width: 100%; border-radius: 6px; margin-top: 6px; display: block; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border-radius: 6px; background: #4e5058; color: #fff; font-size: 14px; }

/* 라이센스 · 개인봇 */
.kv { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.kv div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
.kv dt { color: var(--dim); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.field input[type="password"] { min-height: 44px; box-sizing: border-box; padding: 0 12px; border-radius: 10px; border: 1px solid var(--track); background: var(--bg); color: var(--text); font: inherit; width: 100%; }

/* 백업 · 가져오기 */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); color: var(--dim); font-size: 13.5px; }
.steps li span { width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--text); }
.steps li.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.steps li.on span, .steps li.done span { background: var(--accent); color: var(--accent-ink); }
.panel h3 { margin: 6px 0 0; font-size: 15px; }
input[type="file"] { font: inherit; color: var(--text); }

/* 내 정보 */
.rankpill { min-width: 52px; text-align: center; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px; }
.pchart { width: 100%; min-width: 360px; height: auto; display: block; }
.pchart .zero { stroke: var(--line); stroke-dasharray: 4 4; }
.pchart polyline.up { stroke: var(--accent); stroke-width: 2.5; }
.pchart polyline.down { stroke: var(--red); stroke-width: 2.5; }
.pchart circle.up { fill: var(--accent); } .pchart circle.down { fill: var(--red); }
.pchart text { fill: var(--dim); font-size: 11px; font-family: inherit; }
.quests { display: flex; flex-direction: column; gap: 12px; }
.qrow { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.qbar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.qbar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.fishgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.fishgrid li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 13.5px; }
.fishgrid li.no { color: var(--dim); border-style: dashed; }
.fe { font-size: 20px; }
.heart-card p { margin: 0; }

/* 개발자 콘솔 */
.side-note { padding: 0 12px 8px; margin: 0; }
.codes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.codes code { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--panel-2); font-size: 15px; letter-spacing: 0.05em; user-select: all; }
pre.tb { margin: 0 20px 14px; padding: 10px; border-radius: 8px; background: var(--panel-2); font-size: 12px; overflow-x: auto; white-space: pre-wrap; }

.login-form { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.login-form .btn-discord { width: 100%; }
