:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --line: #d9dee7;
  --line-dark: #b8c0ce;
  --text: #20242c;
  --muted: #687386;
  --blue: #1f5fa8;
  --blue-dark: #174c86;
  --red: #d44848;
  --green: #14845a;
  --yellow: #f4c542;
  --chip: #eef3f9;
  --shadow: 0 2px 8px rgba(21, 33, 54, 0.08);
}

[data-theme="dark"] {
  --bg: #050505;
  --panel: #111111;
  --line: #2a2a2a;
  --line-dark: #3a3a3a;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --blue: #5d9cec;
  --blue-dark: #3f7fd0;
  --red: #f87171;
  --green: #34d399;
  --yellow: #facc15;
  --chip: #1b1b1b;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scrollbar-gutter: stable;
}

[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line-dark);
  box-shadow: var(--shadow);
}

.brand-row,
.board-nav,
.layout {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(180px, 270px) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--blue);
  color: #fff;
  border: 2px solid var(--blue-dark);
  border-radius: 6px;
  font-weight: 900;
  font-size: 24px;
}

.brand strong {
  display: block;
}

.brand strong {
  font-size: 22px;
  letter-spacing: 0;
}

.search-box {
  display: flex;
  min-width: 0;
  border: 2px solid var(--blue);
  background: #fff;
  height: 40px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0 12px;
  outline: 0;
}

.search-box button,
.primary-btn {
  border: 0;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.search-box button {
  width: 76px;
  flex: 0 0 auto;
}

.primary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 38px;
  min-height: 38px;
  padding: 1px 14px 0;
  border-radius: 4px;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.header-theme-toggle {
  display: inline-block;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.header-theme-toggle:hover {
  color: var(--blue);
}

.header-theme-toggle[aria-pressed="true"] {
  color: var(--blue);
}

.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.auth-menu-wrap {
  position: relative;
  display: grid;
  justify-items: end;
  gap: 2px;
}

.auth-user {
  display: inline-block;
  max-width: 120px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-user:hover,
.auth-user[aria-expanded="true"] {
  color: var(--blue);
}

.auth-alert-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.auth-alert-link.active {
  color: var(--red);
}

.notification-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  width: min(320px, calc(100vw - 24px));
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.notification-popup[hidden] {
  display: none;
}

.notification-popup-list {
  display: grid;
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 5px;
  list-style: none;
}

.notification-popup-list li + li {
  border-top: 1px solid var(--line);
}

.notification-popup-list a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 8px 6px;
  border-radius: 3px;
}

.notification-popup-list a:hover {
  background: #f1f5f9;
}

.notification-popup-list li.unread a {
  font-weight: 900;
}

.notification-popup-list strong {
  color: var(--blue-dark);
  font-size: 11px;
}

.notification-popup-list span {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-popup-list em,
.notification-popup-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.notification-popup-empty {
  padding: 12px;
}

.notification-popup-actions {
  display: flex;
  justify-content: flex-end;
  padding: 7px;
  border-top: 1px solid var(--line);
}

.notification-popup-actions button {
  height: 28px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: #364257;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
}

.notification-popup-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 132px;
  padding: 5px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.auth-menu[hidden] {
  display: none;
}

.auth-menu a,
.auth-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 9px;
  border-radius: 3px;
  color: #344155;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.auth-menu a:hover,
.auth-menu button:hover {
  background: #f1f5f9;
  color: var(--blue);
}

.menu-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  min-height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 8px 9px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #344155;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.theme-toggle:hover {
  background: #f1f5f9;
  color: var(--blue);
}

.theme-toggle span {
  min-width: 28px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: #344155;
  padding: 0 9px;
  font-weight: 800;
  font-size: 12px;
}

.auth-link.strong {
  border-color: var(--blue);
  color: var(--blue);
}

.board-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 38px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.board-nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  color: #273246;
  font-weight: 700;
  font-size: 13px;
}

.board-nav a.active,
.board-nav a:hover {
  background: var(--chip);
  color: var(--blue-dark);
}

.board-nav .all-boards-nav {
  margin-left: auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  overflow-x: hidden;
  padding: 16px 0 28px;
}

.content-panel,
.side-box,
.post-detail,
.write-panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#fbfcfe, #f0f3f8);
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mini-tabs button,
.mini-tabs a,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: #364257;
  padding: 1px 9px 0;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.mini-tabs .active,
.ghost-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.game-zone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  padding: 12px;
}

.game-card {
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
}

.game-card strong {
  color: var(--blue-dark);
  font-size: 17px;
}

.game-card span {
  color: var(--muted);
}

.game-actions {
  display: flex;
  gap: 8px;
  align-self: end;
  flex-wrap: wrap;
}

.game-actions button {
  border: 1px solid var(--line-dark);
  cursor: pointer;
}

.game-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: #344155;
  font-weight: 900;
  font-size: 12px;
}

.game-action.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.game-play-panel {
  overflow: hidden;
}

.all-board-list {
  display: grid;
  gap: 0;
  padding: 8px 12px 12px;
}

.all-board-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.all-board-row.without-count {
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
}

.all-board-row strong {
  color: #172033;
  font-size: 15px;
}

.all-board-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-board-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.all-board-row:hover strong {
  color: var(--blue);
}

.user-ranking-list {
  display: grid;
  gap: 0;
}

.ranking-criteria-panel {
  padding: 0 12px 12px;
}

.ranking-criteria-panel[hidden] {
  display: none;
}

.ranking-criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
}

.ranking-criteria-grid h2 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 14px;
}

.criteria-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.criteria-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.criteria-list li:first-child {
  border-top: 0;
}

.criteria-list strong {
  color: #172033;
  font-weight: 900;
  text-align: right;
}

.user-ranking-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.user-ranking-row:first-child {
  border-top: 0;
}

.user-ranking-rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--chip);
  color: #172033;
  font-weight: 900;
}

.game-room-panel {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.game-room-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
  color: #172033;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.game-room-toggle:hover,
.game-room-toggle:focus-visible {
  border-color: var(--blue);
}

.game-room-toggle > span:first-child {
  font-weight: 900;
}

.game-room-list-mount[hidden] {
  display: none;
}

.game-room-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.game-room-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.game-room-list strong,
.game-room-detail strong {
  color: #172033;
}

.game-room-list span,
.game-room-detail span,
.game-room-detail p {
  color: var(--muted);
  font-size: 12px;
}

.game-room-detail {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.game-room-seats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.game-room-seat {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chip);
}

.game-room-seat.ready {
  border-color: #246bfe;
  background: #eef4ff;
}

.game-room-seat.cho-seat.ready {
  border-color: #dc2626;
  background: #fff1f2;
}

.game-room-seat.selected {
  box-shadow: inset 0 0 0 1px #246bfe;
}

.game-room-seat.cho-seat.selected {
  box-shadow: inset 0 0 0 1px #dc2626;
}

.room-seat-button {
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
}

.game-room-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-room-chat {
  display: grid;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.game-room-chat-log {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 108px;
  max-height: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-y: auto;
}

.game-room-chat-log p {
  margin: 0;
  overflow-wrap: anywhere;
}

.game-room-chat-log b {
  color: #172033;
}

#gameRoomChatForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

#gameRoomChatForm input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}

.game-room-detail ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.game-room-detail li {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.game-room-detail .empty-slot {
  color: var(--muted);
  border-style: dashed;
}

.user-ranking-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.user-ranking-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-ranking-top a,
.user-ranking-top .ranking-author-link {
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-ranking-top .ranking-author-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.user-ranking-top span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.user-ranking-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 11px;
}

.user-ranking-score {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.user-ranking-score strong {
  color: var(--blue-dark);
  font-size: 15px;
}

.user-ranking-score b {
  color: #172033;
  font-size: 13px;
}

.user-ranking-score span {
  color: var(--muted);
  font-size: 11px;
}

.game-frame {
  display: block;
  width: 100%;
  height: min(720px, calc(100vh - 230px));
  min-height: 560px;
  border: 0;
  background: #304c3a;
}

.ranking-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.ranking-panel h2 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  font-size: 15px;
}

.ranking-page {
  margin: 12px;
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 6px 10px 10px;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 72px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid #eef1f5;
}

.ranking-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.medal {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.medal-img {
  display: block;
}

.rank-number {
  border-radius: 50%;
  background: #eef3f9;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.empty-ranking {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

.post-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.post-table th,
.post-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 7px;
  vertical-align: middle;
}

.post-table th {
  background: #f7f9fc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.post-table tr:hover td {
  background: #fbfdff;
}

.post-table tr.read-post .post-title {
  color: #7a8493;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--panel);
  color: #344155;
  font-weight: 900;
  font-size: 12px;
}

.pagination a.active,
.pagination a:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.pagination a.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pagination .page-step {
  min-width: 44px;
}

.board-search-form {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.board-search-form select,
.board-search-form input {
  min-height: 34px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
}

.col-board {
  width: 92px;
}

.col-stat {
  width: 42px;
  text-align: center;
  font-size: 12px;
}

.col-date {
  width: 58px;
  text-align: center;
  font-size: 12px;
}

.post-title-cell {
  min-width: 0;
}

.post-title {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  color: #1e2838;
  font-weight: 700;
}

.post-title span:first-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blacklisted-content {
  color: #8a93a3;
  font-weight: 800;
}

.blacklisted-row td {
  background: #f3f4f6;
}

.post-title.blacklisted-content {
  cursor: default;
}

.comment-count {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--chip);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.hot {
  background: #fff0dd;
  color: #b05b00;
}

.badge.notice {
  background: #eaf7f0;
  color: var(--green);
}

.board-badge-link {
  text-decoration: none;
  cursor: pointer;
}

.board-badge-link:hover {
  filter: brightness(0.96);
}

.meta-muted {
  color: var(--muted);
  font-size: 12px;
}

.author-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--blue-dark);
  font-weight: 800;
}

.author-link:hover {
  text-decoration: underline;
}

.author-menu {
  position: absolute;
  z-index: 45;
  display: grid;
  min-width: 132px;
  padding: 5px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.author-menu a,
.author-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 9px;
  border-radius: 3px;
  color: #344155;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.author-menu a:hover,
.author-menu button:hover {
  background: #f1f5f9;
  color: var(--blue);
}

.author-with-grade {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  vertical-align: baseline;
}

.author-grade {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 0 5px;
  border: 1px solid #d6e4f2;
  border-radius: 4px;
  background: #f2f7fc;
  color: #1f5fa8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.body-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sidebar {
  display: grid;
  gap: 12px;
  align-content: start;
}

.side-box {
  min-width: 0;
}

.side-box h2 {
  margin: 0;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  font-size: 14px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 6px 10px 10px;
}

.side-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 29px;
  border-bottom: 1px solid #eef1f5;
}

.rank {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 900;
}

.side-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-list {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fffef8;
}

.notice-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.notice-row a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.post-detail {
  min-width: 0;
  overflow-x: hidden;
}

.article-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: end;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.article-head > .badge,
.article-head > h1,
.article-head > .article-meta {
  grid-column: 1;
}

.article-head > .badge {
  justify-self: start;
  width: fit-content;
}

.article-head h1 {
  margin: 4px 0;
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.article-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.admin-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
}

.admin-actions .ghost-btn,
.admin-actions .danger-btn {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
}

.danger-btn,
.inline-danger {
  border: 1px solid #d44848;
  border-radius: 4px;
  background: #fff5f5;
  color: #b42323;
  font-weight: 900;
}

.danger-btn {
  min-height: 32px;
  padding: 0 10px;
}

.inline-danger {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

.article-body {
  min-height: 170px;
  padding: 20px 16px;
  font-family: "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.body-font-malgun {
  font-family: "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

.body-font-gulim {
  font-family: Gulim, "굴림", sans-serif;
}

.body-font-dotum {
  font-family: Dotum, "돋움", sans-serif;
}

.body-font-batang {
  font-family: Batang, "바탕", serif;
}

.body-size-13 {
  font-size: 13px;
}

.body-size-14 {
  font-size: 14px;
}

.body-size-16 {
  font-size: 16px;
}

.body-size-18 {
  font-size: 18px;
}

.body-size-24 {
  font-size: 24px;
}

.body-size-32 {
  font-size: 32px;
}

.body-line-compact {
  line-height: 1.35;
}

.body-line-normal {
  line-height: 1.6;
}

.body-line-relaxed {
  line-height: 1.9;
}

.body-line-loose {
  line-height: 2.25;
}

.body-weight-bold {
  font-weight: 800;
}

.body-align-center {
  text-align: center;
}

.post-links {
  display: grid;
  gap: 10px;
  padding: 18px 16px 0;
}

.post-attachments {
  display: grid;
  gap: 12px;
  padding: 18px 16px 0;
}

.attachment-item {
  margin: 0;
  display: grid;
  gap: 6px;
  max-width: 760px;
}

.attachment-item img,
.attachment-item video {
  display: block;
  width: 100%;
  max-height: 620px;
  border: 1px solid var(--line);
  background: #000;
  object-fit: contain;
}

.body-image {
  display: block;
  width: 100%;
  max-width: 760px;
  max-height: 620px;
  margin: 8px 0;
  border: 1px solid var(--line);
  background: #000;
  object-fit: contain;
}

.attachment-item figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.embed-wrap {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #000;
}

.embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.attached-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: underline;
}

.reaction-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px;
}

.post-activity-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 9px 12px;
}

.post-activity-toggle-row .ghost-btn {
  padding: 0 9px;
}

[data-theme="dark"] .post-activity-toggle-row .ghost-btn {
  border-color: #93c5fd;
  background: #1e3a5f;
  color: #eaf4ff;
}

[data-theme="dark"] .post-activity-toggle-row .ghost-btn:hover {
  border-color: #bfdbfe;
  background: #28527f;
  color: #fff;
}

.post-author-activity {
  padding: 0 12px 8px;
}

.hot-blocked-notice {
  margin: 0 12px 12px;
  padding: 4px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.post-author-activity[hidden] {
  display: none;
}

.post-author-activity-head {
  padding: 4px 0 6px;
  color: #172033;
  font-size: 12px;
}

.post-author-activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.post-author-activity-column {
  min-width: 0;
}

.post-author-activity-column h2 {
  margin: 0;
  padding: 3px 0;
  color: #172033;
  font-size: 12px;
}

.post-author-activity .profile-activity-list {
  max-height: 118px;
  overflow-y: auto;
}

.post-author-activity .profile-activity-list li {
  gap: 1px;
  padding: 3px 0;
}

.post-author-activity .profile-activity-list a {
  font-size: 11px;
}

.post-author-activity .profile-activity-list span,
.post-author-activity .empty-mini {
  font-size: 10px;
}

.post-author-activity .empty-mini {
  padding: 6px 0;
}

.scroll-tools {
  position: fixed;
  right: calc((100vw - 1180px) / 2 + 282px);
  bottom: 84px;
  display: grid;
  gap: 4px;
  z-index: 15;
}

.scroll-tools button {
  width: 28px;
  min-height: 28px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  color: #344155;
  box-shadow: 0 2px 8px rgba(21, 33, 54, 0.12);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.scroll-tools button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.reaction-btn {
  min-width: 88px;
  min-height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
  color: #364257;
  font-weight: 900;
}

.reaction-btn.up {
  border-color: #d3a837;
  background: #fff8df;
  color: #7a4b00;
}

.reaction-btn.down {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.reaction-btn.active.up {
  background: #f4c542;
  color: #412900;
}

.reaction-btn.active.down {
  background: #475569;
  border-color: #334155;
  color: #fff;
}

.reaction-btn.disabled,
.reaction-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.comment-section {
  border-top: 1px solid var(--line);
}

.comment-section h2 {
  margin: 0;
  padding: 10px 12px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.comment-list li.comment-highlight {
  animation: comment-flash 2.4s ease-out;
}

@keyframes comment-flash {
  0% {
    background: #fff4a8;
    box-shadow: inset 3px 0 0 #f4b400;
  }
  45% {
    background: #fff8cf;
    box-shadow: inset 3px 0 0 #f4b400;
  }
  100% {
    background: transparent;
    box-shadow: inset 3px 0 0 transparent;
  }
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.comment-meta-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.comment-body {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.deleted-comment {
  color: var(--muted);
}

.deleted-comment-body {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.blacklisted-comment {
  background: #f7f8fa;
}

.comment-reactions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.comment-actions .reaction-btn,
.reply-toggle,
.report-toggle {
  min-width: 0;
  min-height: 22px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: #364257;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
}

.report-toggle {
  border-color: #f1b7b7;
  color: var(--red);
}

.post-report-toggle {
  min-width: 46px;
  min-height: 30px;
}

.report-form {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcff;
}

.report-form[hidden] {
  display: none;
}

.report-form textarea {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 9px;
  resize: vertical;
  outline-color: var(--blue);
}

.report-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 10px 8px;
  list-style: none;
}

.report-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}

.report-select {
  margin: 3px 0 0;
}

.report-list a {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
}

.report-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-row-head strong {
  color: var(--red);
  font-size: 12px;
}

.report-row-head em,
.report-list small {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.report-list span {
  color: #172033;
  font-size: 12px;
  font-weight: 900;
}

.report-list span b {
  color: var(--muted);
}

.report-list p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.report-bulk-actions label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.report-bulk-actions .ghost-btn {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.post-detail.report-highlight {
  animation: comment-flash 2.4s ease-out;
}

.reply-list {
  list-style: none;
  margin: 10px 0 0 14px;
  padding: 0;
}

.reply-list li {
  padding: 9px 0;
  border-bottom: 1px solid #eef1f5;
}

.reply-list li:last-child {
  border-bottom: 0;
}

.reply-form {
  display: grid;
  gap: 6px;
  margin: 10px 0 0 14px;
  padding: 10px;
  background: #fbfcff;
}

.reply-form[hidden] {
  display: none;
}

.reply-form textarea {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 9px;
  resize: vertical;
  outline-color: var(--blue);
}

.reply-form .ghost-btn,
.reply-form .primary-btn {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
}

.comment-form,
.write-form {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.comment-form textarea,
.write-form textarea,
.write-form input,
.write-form select {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 10px;
  outline-color: var(--blue);
}

.comment-form textarea {
  min-height: 80px;
  resize: vertical;
}

.write-form textarea {
  min-height: 260px;
  resize: vertical;
}

.hot-blocked-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcff;
  color: var(--text);
}

.hot-blocked-option input {
  width: auto;
  margin-top: 3px;
}

.hot-blocked-option span {
  display: grid;
  gap: 2px;
}

.hot-blocked-option strong {
  font-size: 14px;
}

.hot-blocked-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.file-attach-box {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcff;
}

.file-attach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-attach-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.file-attach-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-attach-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.attachment-preview {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.attachment-preview span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.auth-form-panel {
  max-width: 460px;
  margin: 0 auto;
}

.compact-settings-form {
  max-width: 560px;
}

.profile-overview {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-summary-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcff;
}

.profile-summary-card strong {
  display: block;
  color: #172033;
  font-size: 15px;
}

.profile-summary-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-level-summary {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.profile-level-summary b {
  color: var(--blue-dark);
  font-size: 13px;
}

.profile-level-summary strong {
  color: #172033;
  font-size: 16px;
}

.profile-level-summary span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.profile-summary-card p {
  max-height: 96px;
  margin: 0;
  overflow: auto;
  color: #344155;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.profile-setting-state {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.public-posts-hidden {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px;
  padding: 18px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.profile-activity-panel {
  display: grid;
  gap: 12px;
}

.activity-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.activity-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  color: #344155;
  font-size: 13px;
  font-weight: 900;
}

.activity-tabs a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e2e8f0;
  color: #344155;
  font-size: 11px;
  line-height: 1;
}

.activity-tabs a + a {
  border-left: 1px solid var(--line-dark);
}

.activity-tabs a.active {
  background: var(--blue);
  color: #fff;
}

.activity-tabs a.active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.profile-activity-box {
  display: grid;
  gap: 8px;
}

.subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subsection-head h2 {
  margin: 0;
  color: #172033;
  font-size: 16px;
}

.profile-activity-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.profile-activity-list li {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.profile-activity-list a {
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-activity-list a:hover {
  color: var(--blue);
}

.profile-activity-list span,
.empty-mini {
  color: var(--muted);
  font-size: 12px;
}

.empty-mini {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.blacklist-panel {
  padding: 0 12px 12px;
}

.blacklist-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.blacklist-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.blacklist-user-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.blacklist-list strong {
  display: block;
  color: #172033;
  font-size: 14px;
}

.blacklist-list span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.message-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
}

.message-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 0 12px 8px;
}

.message-select-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.message-list li {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.message-list li[data-message-id] {
  cursor: pointer;
}

.message-list li[data-message-id]:hover .message-body {
  color: var(--accent);
}

.message-row-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.message-check {
  width: 16px;
  height: 16px;
}

.message-list li.unread .message-head strong::after {
  content: "새 쪽지";
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: #fff1f2;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.blacklist-reason {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 420px;
}

.blacklist-reason-view {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.blacklist-reason-view b {
  color: #172033;
}

.blacklist-reason input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
}

.blacklist-reason .ghost-btn {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
  white-space: nowrap;
}

.message-head strong {
  color: #172033;
  font-size: 13px;
}

.message-body {
  color: #1e2838;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-reply-context {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.message-reply-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.message-reply-body {
  color: #1e2838;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-compose-actions .ghost-btn,
.message-compose-actions .primary-btn {
  width: 78px;
  height: 38px;
  min-height: 38px;
}

.message-list .ghost-btn {
  justify-self: start;
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.notification-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
}

.notification-list li {
  border-bottom: 1px solid var(--line);
}

.notification-list a {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
}

.notification-list li.unread a {
  font-weight: 900;
}

.notification-list strong {
  color: var(--blue-dark);
  font-size: 12px;
}

.notification-list span {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-list em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.field-label {
  display: grid;
  gap: 6px;
  color: #344155;
  font-weight: 800;
}

.field-label span {
  font-size: 12px;
}

.field-label input[readonly] {
  background: #f1f5f9;
  color: var(--muted);
}

.nickname-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.password-change-box {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.profile-section-active {
  outline: 2px solid rgba(49, 116, 212, 0.22);
  outline-offset: 6px;
  border-radius: 4px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.form-hint {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcff;
  color: var(--muted);
  font-size: 12px;
}

.user-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.user-table {
  min-width: 620px;
}

.user-actions-col {
  width: 230px;
  text-align: right;
}

.user-cell-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.profile-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
}

.profile-row strong {
  color: var(--muted);
}

.profile-text {
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.form-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 8px;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcff;
}

.format-grid .field-label {
  gap: 3px;
}

.format-grid .field-label span {
  font-size: 11px;
}

.format-grid select {
  min-height: 28px;
  padding: 4px 8px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-actions .ghost-btn,
.form-actions .primary-btn {
  flex: 0 0 86px;
  width: 86px;
  height: 38px;
  min-height: 38px;
  padding: 1px 10px 0;
}

.auth-login-actions .ghost-btn,
.auth-login-actions .primary-btn {
  flex: 0 0 86px;
  width: 86px;
  height: 38px;
  min-height: 38px;
  justify-content: center;
  padding: 1px 10px 0;
}

.empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(340px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 20;
}

.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.34);
}

.confirm-dialog {
  display: grid;
  gap: 14px;
  width: min(340px, 100%);
  padding: 18px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
}

.confirm-dialog strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-dialog-actions .ghost-btn,
.confirm-dialog-actions .primary-btn {
  flex: 0 0 72px;
  width: 72px;
  height: 34px;
  min-height: 34px;
}

.point-transfer-dialog {
  width: min(360px, 100%);
}

.point-transfer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.point-transfer-summary span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.point-transfer-summary b {
  color: #172033;
  font-size: 14px;
}

[data-theme="dark"] .search-box,
[data-theme="dark"] .auth-link,
[data-theme="dark"] .auth-menu,
[data-theme="dark"] .author-menu,
[data-theme="dark"] .notification-popup,
[data-theme="dark"] .board-nav,
[data-theme="dark"] .content-panel,
[data-theme="dark"] .sidebar-card,
[data-theme="dark"] .ranking-panel,
[data-theme="dark"] .post-table,
[data-theme="dark"] .post-detail,
[data-theme="dark"] .comment-section,
[data-theme="dark"] .write-panel,
[data-theme="dark"] .profile-summary-card,
[data-theme="dark"] .form-hint,
[data-theme="dark"] .profile-box,
[data-theme="dark"] .activity-tabs,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--panel);
  color: var(--text);
}

[data-theme="dark"] .post-table th,
[data-theme="dark"] .post-table tr:hover,
[data-theme="dark"] .comment-head,
[data-theme="dark"] .reply-form,
[data-theme="dark"] .report-form,
[data-theme="dark"] .attached-link,
[data-theme="dark"] .author-grade,
[data-theme="dark"] .file-attach-box,
[data-theme="dark"] .profile-summary-card,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .empty-mini,
[data-theme="dark"] .activity-tabs a span,
[data-theme="dark"] .field-label input[readonly] {
  background: var(--chip);
  color: var(--text);
}

[data-theme="dark"] .section-head,
[data-theme="dark"] .notice-list,
[data-theme="dark"] .notice-row,
[data-theme="dark"] .side-box h2,
[data-theme="dark"] .side-list,
[data-theme="dark"] .side-list li,
[data-theme="dark"] .ranking-panel h2 {
  background: #1a1a1a;
  color: var(--text);
}

[data-theme="dark"] .notice-list,
[data-theme="dark"] .side-list li {
  border-color: var(--line);
}

[data-theme="dark"] .post-table {
  background: #242424;
}

[data-theme="dark"] .post-table th {
  background: #303030;
  color: #d6d6d6;
}

[data-theme="dark"] .post-table td {
  background: #242424;
}

[data-theme="dark"] .post-table tr:hover td {
  background: #343434;
}

[data-theme="dark"] .post-table tr.read-post .post-title {
  color: #8a97a8;
}

[data-theme="dark"] .blacklisted-row td,
[data-theme="dark"] .blacklisted-comment {
  background: #191919;
}

[data-theme="dark"] .blacklisted-content {
  color: #8a8f99;
}

[data-theme="dark"] .post-table tr.read-post .post-title .comment-count,
[data-theme="dark"] .post-table tr.read-post .post-title .badge {
  opacity: 0.72;
}

[data-theme="dark"] .post-title,
[data-theme="dark"] .post-title-cell {
  color: #f4f4f4;
}

[data-theme="dark"] .all-board-row strong {
  color: var(--text);
}

[data-theme="dark"] .all-board-row:hover strong {
  color: #8ec5ff;
}

[data-theme="dark"] .pagination a {
  background: #242424;
  color: #f2f2f2;
}

[data-theme="dark"] .pagination a.active,
[data-theme="dark"] .pagination a:hover {
  background: #2563eb;
  color: #fff;
}

[data-theme="dark"] .board-search-form select,
[data-theme="dark"] .board-search-form input {
  background: #242424;
  color: var(--text);
}

[data-theme="dark"] .game-action {
  border-color: #5a5a5a;
  background: #2d2d2d;
  color: #f2f2f2;
}

[data-theme="dark"] .game-action:hover {
  border-color: var(--blue);
  color: #fff;
}

[data-theme="dark"] .game-action.primary {
  border-color: var(--blue);
  background: #2563eb;
  color: #fff;
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .board-nav,
[data-theme="dark"] .toast {
  background: #0b0b0b;
}

[data-theme="dark"] .board-nav a {
  color: #e6e6e6;
}

[data-theme="dark"] .board-nav a.active,
[data-theme="dark"] .board-nav a:hover {
  background: #242424;
  color: #8ec5ff;
}

[data-theme="dark"] .brand-mark,
[data-theme="dark"] .primary-btn,
[data-theme="dark"] .search-box button,
[data-theme="dark"] .activity-tabs a.active {
  background: #2563eb;
}

[data-theme="dark"] .auth-menu a,
[data-theme="dark"] .author-menu a,
[data-theme="dark"] .author-menu button,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .header-theme-toggle,
[data-theme="dark"] .auth-link,
[data-theme="dark"] .ghost-btn,
[data-theme="dark"] .game-action,
[data-theme="dark"] .profile-summary-card p,
[data-theme="dark"] .profile-activity-list a,
[data-theme="dark"] .post-author-activity-head,
[data-theme="dark"] .post-author-activity-column h2,
[data-theme="dark"] .subsection-head h2,
[data-theme="dark"] .user-ranking-top a,
[data-theme="dark"] .user-ranking-top .ranking-author-link,
[data-theme="dark"] .user-ranking-score b,
[data-theme="dark"] .profile-level-summary strong,
[data-theme="dark"] .user-ranking-rank,
[data-theme="dark"] .blacklist-list strong,
[data-theme="dark"] .ranking-criteria-grid h2,
[data-theme="dark"] .criteria-list strong,
[data-theme="dark"] .message-head strong,
[data-theme="dark"] .message-body,
[data-theme="dark"] .message-reply-body,
[data-theme="dark"] .notification-list span,
[data-theme="dark"] .report-list span,
[data-theme="dark"] .notification-popup-list span,
[data-theme="dark"] .field-label {
  color: var(--text);
}

[data-theme="dark"] .message-reply-context {
  border-color: var(--line);
  background: #151515;
}

[data-theme="dark"] .profile-level-summary {
  border-color: var(--line);
  background: #151515;
}

[data-theme="dark"] .game-room-list strong,
[data-theme="dark"] .game-room-detail strong {
  color: var(--text);
}

[data-theme="dark"] .game-room-toggle {
  border-color: var(--line);
  background: #151515;
  color: var(--text);
}

[data-theme="dark"] .game-room-toggle:hover,
[data-theme="dark"] .game-room-toggle:focus-visible {
  border-color: #7ea2ff;
}

[data-theme="dark"] .game-room-seat {
  background: #171f2e;
}

[data-theme="dark"] .game-room-seat.ready {
  border-color: #7ea2ff;
  background: #182642;
}

[data-theme="dark"] .game-room-seat.cho-seat.ready {
  border-color: #fb7185;
  background: #3a1720;
}

[data-theme="dark"] .game-room-seat.selected {
  box-shadow: inset 0 0 0 1px #7ea2ff;
}

[data-theme="dark"] .game-room-seat.cho-seat.selected {
  box-shadow: inset 0 0 0 1px #fb7185;
}

[data-theme="dark"] .game-room-chat-log b {
  color: var(--text);
}

[data-theme="dark"] .point-transfer-summary span {
  border-color: var(--line);
  background: #151515;
}

[data-theme="dark"] .point-transfer-summary b {
  color: var(--text);
}

[data-theme="dark"] .ranking-criteria-grid {
  border-color: #3f4a5f;
  background: #111827;
}

[data-theme="dark"] .criteria-list li {
  border-top-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .criteria-list strong {
  color: #f8fafc;
}

[data-theme="dark"] .notification-popup-actions button {
  border-color: var(--line);
  background: #151515;
  color: var(--text);
}

[data-theme="dark"] .auth-menu a:hover,
[data-theme="dark"] .auth-menu button:hover,
[data-theme="dark"] .author-menu a:hover,
[data-theme="dark"] .author-menu button:hover,
[data-theme="dark"] .notification-popup-list a:hover,
[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .header-theme-toggle:hover {
  background: var(--chip);
  color: var(--blue);
}

[data-theme="dark"] .write-panel .ghost-btn,
[data-theme="dark"] .form-actions .ghost-btn {
  border-color: #5a5a5a;
  background: #2d2d2d;
  color: #f2f2f2;
}

[data-theme="dark"] .write-panel .ghost-btn:hover,
[data-theme="dark"] .form-actions .ghost-btn:hover {
  border-color: #93c5fd;
  background: #1e3a5f;
  color: #fff;
}

[data-theme="dark"] .hot-blocked-option {
  border-color: var(--line);
  background: #1f1f1f;
}

[data-theme="dark"] .hot-blocked-notice {
  color: var(--muted);
}

[data-theme="dark"] .format-grid {
  border-color: #4a4a4a;
  background: #242424;
}

[data-theme="dark"] .format-grid .field-label span {
  color: #d8d8d8;
}

[data-theme="dark"] .format-grid select,
[data-theme="dark"] .write-form input,
[data-theme="dark"] .write-form textarea,
[data-theme="dark"] .write-form select {
  border-color: #5a5a5a;
  background: #2b2b2b;
  color: #f4f4f4;
}

[data-theme="dark"] .admin-actions .ghost-btn {
  border-color: #60a5fa;
  background: #1e3a5f;
  color: #eaf4ff;
}

[data-theme="dark"] .admin-actions .ghost-btn:hover {
  border-color: #93c5fd;
  background: #28527f;
  color: #fff;
}

[data-theme="dark"] .comment-section h2 {
  background: #242424;
  color: #f2f2f2;
}

[data-theme="dark"] .comment-form {
  background: #1a1a1a;
  border-top: 1px solid #3a3a3a;
}

[data-theme="dark"] .comment-form textarea,
[data-theme="dark"] .report-form textarea,
[data-theme="dark"] .reply-form textarea {
  border-color: #5a5a5a;
  background: #2b2b2b;
  color: #f4f4f4;
}

[data-theme="dark"] .comment-form textarea::placeholder,
[data-theme="dark"] .reply-form textarea::placeholder {
  color: #a8a8a8;
}

[data-theme="dark"] .reply-toggle {
  border-color: #5a5a5a;
  background: #2d2d2d;
  color: #f2f2f2;
}

[data-theme="dark"] .report-toggle {
  border-color: #7f3f3f;
  background: #2d2d2d;
  color: #fca5a5;
}

[data-theme="dark"] .profile-activity-list span,
[data-theme="dark"] .blacklist-list span,
[data-theme="dark"] .blacklist-reason-view,
[data-theme="dark"] .meta-muted,
[data-theme="dark"] .theme-toggle span,
[data-theme="dark"] .report-list span b,
[data-theme="dark"] .report-bulk-actions label {
  color: var(--muted);
}

[data-theme="dark"] .activity-tabs a.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

[data-theme="dark"] .blacklist-reason-view b {
  color: var(--text);
}

@media (max-width: 920px) {
  .brand-row {
    grid-template-columns: 1fr auto;
  }

  .search-box {
    grid-column: 1 / -1;
    order: 3;
  }

  .auth-panel {
    grid-column: 2;
    order: 2;
    justify-content: flex-end;
  }

  .header-actions {
    grid-column: 2;
    order: 2;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 921px) and (max-width: 1180px) {
  .layout:has(.game-play-panel) {
    grid-template-columns: 1fr;
  }

  .layout:has(.game-play-panel) .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout:has(.game-play-panel) .game-frame {
    height: clamp(460px, calc(100vh - 220px), 640px);
    min-height: 0;
  }

  .scroll-tools {
    right: 294px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .brand-row,
  .board-nav,
  .layout {
    width: min(100% - 16px, 1180px);
  }

  .brand-row {
    gap: 10px;
    padding: 10px 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .brand strong {
    font-size: 18px;
  }

  .auth-panel {
    gap: 4px;
  }

  .auth-user {
    max-width: 92px;
    font-size: 11px;
  }

  .auth-alert-link {
    font-size: 9px;
  }

  .auth-link {
    min-height: 28px;
    padding: 0 7px;
    font-size: 11px;
  }

  .game-room-seats,
  .game-room-columns {
    grid-template-columns: 1fr;
  }

  #gameRoomChatForm {
    grid-template-columns: 1fr;
  }

  .blacklist-list li {
    grid-template-columns: 1fr;
  }

  .blacklist-list li .ghost-btn {
    justify-self: start;
  }

  .blacklist-reason {
    max-width: none;
  }

  .game-room-list li {
    grid-template-columns: 1fr;
  }

  .board-nav .all-boards-nav {
    margin-left: 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-head {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
  }

  .post-activity-toggle-row .ghost-btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .game-zone-grid,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .post-table thead {
    display: none;
  }

  .post-table,
  .post-table tbody,
  .post-table tr,
  .post-table td {
    display: block;
    width: 100%;
  }

  .post-table tr {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
  }

  .post-table td {
    border: 0;
    padding: 2px 0;
  }

  .post-title-cell,
  .post-title,
  .post-title span:first-child {
    max-width: 100%;
  }

  .post-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .post-title span:first-child {
    min-width: 0;
  }

  .post-table .col-board,
  .post-table .col-stat,
  .post-table .col-date {
    display: inline;
    width: auto;
    margin-right: 5px;
    color: var(--muted);
    font-size: 11px;
  }

  .post-table .col-stat::before,
  .post-table .col-date::before {
    content: attr(data-mobile-label) " ";
    font-weight: 800;
  }

  .user-table-wrap {
    overflow-x: visible;
  }

  .user-table {
    min-width: 0;
  }

  .user-table td[data-mobile-label] {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    width: 100%;
  }

  .user-table td[data-mobile-label]::before {
    content: attr(data-mobile-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .user-table .user-actions-col {
    text-align: left;
  }

  .user-table .user-actions {
    justify-content: flex-start;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .format-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px 5px;
    padding: 4px 6px;
  }

  .format-grid .field-label {
    gap: 2px;
  }

  .format-grid .field-label span {
    font-size: 10px;
  }

  .format-grid select {
    min-height: 24px;
    padding: 2px 5px;
    font-size: 11px;
  }

  .nickname-row {
    grid-template-columns: 1fr;
  }

  .profile-overview {
    grid-template-columns: 1fr;
  }

  .profile-summary-card p {
    max-height: 120px;
  }

  .all-board-row {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
  }

  .all-board-row span {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .ranking-criteria-grid {
    grid-template-columns: 1fr;
  }

  .notification-list a {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .user-ranking-row {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
  }

  .user-ranking-score {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .board-search-form {
    grid-template-columns: 1fr;
  }

  .post-author-activity-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .game-frame {
    height: calc(100vh - 220px);
    min-height: 460px;
  }

  .scroll-tools {
    right: 8px;
    bottom: 72px;
  }

  .reply-list,
  .reply-form {
    margin-left: 8px;
  }
}
