
:root {
  --bg: #1e1f22; --surface: #2b2d31; --surface-2: #313338; --surface-3: #383a40;
  --border: #3f4147; --text: #dbdee1; --muted: #949ba4; --strong: #f2f3f5;
  --accent: #5865f2; --accent-hover: #4752c4; --danger: #ed4245; --success: #23a55a; --warning: #f0b232;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--strong); font-weight: 600; margin: 0; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { color: var(--strong); font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.me { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.me form { margin: 0; }

.container { max-width: 1160px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600;
}
.button:hover { background: var(--accent-hover); text-decoration: none; }
.button.secondary { background: var(--surface-3); color: var(--text); }
.button.secondary:hover { background: #4e5058; }
.button.small { padding: 4px 10px; font-size: 13px; }
.button.large { padding: 12px 24px; font-size: 16px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input, .filters select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px; font: inherit;
}
.filters input[type=search] { flex: 1 1 260px; min-width: 200px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card + .card { margin-top: 16px; }
.card-body { padding: 16px; }
.card-title { padding: 12px 16px; border-bottom: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text);
}
.badge.open { background: rgba(35,165,90,.18); color: #57d68d; }
.badge.closing { background: rgba(240,178,50,.18); color: var(--warning); }
.badge.closed { background: var(--surface-3); color: var(--muted); }
.badge.deleted { background: rgba(237,66,69,.16); color: #ff7b7e; }
.badge.bot { background: var(--accent); color: #fff; border-radius: 4px; padding: 0 5px; font-size: 10px; vertical-align: 2px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } .detail aside { order: -1; } }
dl.meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; }
dl.meta dt { color: var(--muted); font-size: 13px; }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }
.answer + .answer { margin-top: 14px; }
.answer h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.answer p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.messages { padding: 8px 0; }
.message { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 8px 16px; }
.message:hover { background: var(--surface-2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); object-fit: cover; }
.avatar.small { width: 24px; height: 24px; }
.avatar.letter { display: flex; align-items: center; justify-content: center; color: var(--strong); font-weight: 700; }
.message-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.author { color: var(--strong); font-weight: 600; }
.time { color: var(--muted); font-size: 12px; }
.content { white-space: pre-wrap; overflow-wrap: anywhere; }
.mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }

.embed {
  margin-top: 6px; max-width: 520px; padding: 10px 14px; background: var(--surface-2);
  border-left: 4px solid var(--border); border-radius: 4px;
}
.embed-author { font-size: 13px; font-weight: 600; color: var(--strong); }
.embed-title { font-weight: 700; color: var(--strong); }
.embed-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-top: 4px; }
.embed-field { margin-top: 8px; font-size: 14px; }
.embed-field-name { font-weight: 700; color: var(--strong); }
.embed-field-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.embed-footer { margin-top: 8px; font-size: 12px; color: var(--muted); }

.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.attachment-image img { display: block; max-width: 360px; max-height: 300px; border-radius: 6px; background: var(--surface-2); }
.attachment-file {
  display: inline-flex; flex-direction: column; padding: 10px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; min-width: 220px;
}
.attachment-file.missing { opacity: .7; }

.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.notice.warning { border-color: rgba(240,178,50,.5); }
.notice + .card, .notice + .notice { margin-top: 16px; }

.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 400px; padding: 32px; text-align: center; }
.login h1 { margin-bottom: 8px; }
.login p { margin: 0 0 24px; }
.error { color: #ff7b7e; margin-bottom: 16px; }
