:root {
  --bg: #0f1318;
  --surface: #151a21;
  --surface-soft: #1b222b;
  --ink: #f3f6f8;
  --muted: #98a2b3;
  --line: #2b3542;
  --nav: #111820;
  --nav-soft: #1d2a25;
  --blue: #3f7ad7;
  --green: #1f7a5a;
  --green-soft: #23392f;
  --red: #c2413b;
  --amber: #b9822b;
  --violet: #7770d8;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  color-scheme: dark;
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-panel {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-brand {
  margin-bottom: 24px;
  color: var(--ink);
}

.auth-brand p {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-screen.is-checking .auth-form {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.auth-form input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.auth-form input:focus,
.search-box input:focus,
.filter-box select:focus,
.page-jump input:focus,
.advanced-filters input:focus,
.advanced-filters select:focus,
.compose-form input:focus,
.compose-form select:focus,
.compose-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.18);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.auth-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  color: #fff;
}

.auth-button.primary {
  background: var(--green);
}

.auth-button.secondary {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink);
}

.auth-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
  font-weight: 800;
}

.auth-screen.is-checking .auth-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-screen.is-checking .auth-status::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

.auth-status.is-error {
  color: var(--red);
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: #f7faf9;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.brand p {
  margin: 4px 0 0;
  color: #b9c5ca;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button,
.utility-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  color: #edf4f6;
  background: transparent;
  padding: 0 12px;
  font-weight: 800;
  text-decoration: none;
}

.nav-button:hover,
.utility-button:hover {
  background: var(--nav-soft);
}

.nav-button.is-active {
  background: var(--green-soft);
  border-color: rgba(31, 122, 90, 0.72);
  color: #f7faf9;
}

.nav-icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.storage-panel {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.account-box {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
}

.account-box span {
  color: #d9e4e7;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.utility-button {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.danger-lite {
  color: #ffd6d1;
}

.workspace {
  min-width: 0;
  padding: 22px 24px 28px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.search-box,
.filter-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-box input,
.filter-box select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.search-box input {
  width: min(34vw, 360px);
}

.filter-box select {
  width: 132px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.metric {
  min-height: 82px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  font-size: 28px;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.stat-metric {
  margin: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 232px);
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 232px);
}

.compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 232px);
}

.devices-grid,
.notices-grid,
.backup-grid,
.status-grid,
.admins-grid {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 232px);
}

.notices-grid {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.stats-grid {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 232px);
}

.list-pane,
.detail-pane,
.policy-pane,
.devices-pane,
.audit-pane,
.lab-card,
.compose-pane,
.compose-side,
.notice-form-pane,
.notice-list-pane,
.stats-card,
.status-card,
.admins-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lab-card {
  padding: 18px;
}

.single-pane {
  display: block;
  min-height: calc(100vh - 232px);
}

.wide-card {
  width: 100%;
}

.category-add-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(3, minmax(110px, 1fr)) 92px auto;
  gap: 8px;
  margin: 14px 0;
  align-items: end;
}

.category-add-form input,
.category-table input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 10px;
  outline: none;
  font-weight: 800;
}

.category-table input[readonly] {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
}

.category-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  accent-color: var(--green);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.category-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.category-table th,
.category-table td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.category-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.category-table tr:last-child td {
  border-bottom: 0;
}

.category-table td:first-child,
.category-table td:nth-child(2),
.category-table td:nth-child(7) {
  width: 64px;
}

.category-table td:last-child {
  width: 150px;
}

.notice-form-pane,
.notice-list-pane,
.backup-pane {
  padding: 18px;
}

.backup-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.advanced-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.advanced-filters input,
.advanced-filters select {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

.advanced-filters .action-button {
  min-height: 36px;
  justify-self: start;
  align-self: end;
  width: auto;
  padding: 0 14px;
}

.active-filter {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(31, 122, 90, 0.45);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(31, 122, 90, 0.12);
  color: var(--ink);
}

.active-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ghost-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 900;
}

.mini-check {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.mini-check input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  accent-color: var(--green);
}

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

.status-card,
.admins-pane {
  padding: 18px;
}

.control-list,
.status-list,
.admin-list,
.calendar-list {
  display: grid;
  gap: 10px;
}

.control-row,
.status-row,
.admin-row,
.calendar-item {
  display: grid;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.control-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.control-row strong,
.admin-row strong,
.calendar-item strong,
.status-row strong {
  display: block;
}

.control-row em,
.calendar-item span,
.status-row em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.control-row input {
  width: 44px;
  height: 24px;
}

.status-row {
  grid-template-columns: 92px minmax(0, 1fr);
}

.status-row p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  font-weight: 800;
}

.admins-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.admin-row {
  grid-template-columns: minmax(0, 1fr) 150px 100px;
}

.admin-row select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

.calendar-item time {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.compose-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.compose-preview h4 {
  margin: 8px 0;
  font-size: 17px;
}

.compose-preview p {
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.compose-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: var(--nav);
}

.compose-preview-votes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compose-preview-vote {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--vote-color) 72%, #2563eb);
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--vote-color) 40%, transparent), transparent 78%);
  padding: 0 12px;
  color: var(--ink);
  font-weight: 900;
}

.compose-preview-vote span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-preview-vote em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.compose-side {
  display: grid;
  gap: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.lab-head,
.score-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.lab-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.lab-copy {
  color: var(--muted);
  line-height: 1.55;
  font-weight: 750;
}

.lab-copy.strong {
  color: var(--ink);
  font-weight: 900;
}

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.draft-list,
.notice-list {
  display: grid;
  gap: 10px;
}

.draft-item,
.notice-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.notice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.notice-row p,
.draft-item p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 750;
}

.suggestion-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  margin: 12px 0;
}

.pane-head.compact {
  margin-bottom: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 900;
}

.suggestion-chip small {
  color: var(--muted);
  margin-left: 4px;
}

.lab-preview {
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 220px;
  display: grid;
  place-items: center;
}

.lab-preview img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
  background: var(--nav);
}

.score-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.muted-panel {
  color: var(--muted);
}

.score-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

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

.score-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.score-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.score-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.stats-alerts {
  padding: 18px;
}

.audit-list.compact {
  margin-top: 8px;
}

.audit-item.severity-2,
.audit-item.severity-3 {
  border-color: rgba(194, 65, 59, 0.5);
}

.mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mini-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 5px;
  vertical-align: -1px;
}

.legend-visitor {
  background: var(--green);
}

.score-list {
  display: grid;
  gap: 8px;
}

.safe-search-panel {
  display: grid;
  gap: 10px;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(90px, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.score-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.score-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.score-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #2a3540;
}

.score-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.score-track .ok {
  background: var(--green);
}

.score-track .warn {
  background: var(--amber);
}

.score-track .danger {
  background: var(--red);
}

.stats-chart-card,
.stats-table-card {
  overflow: hidden;
}

.stats-chart {
  height: 280px;
  display: grid;
  grid-template-columns: repeat(60, minmax(10px, 1fr));
  align-items: end;
  gap: 4px;
  padding: 18px 18px 14px;
  overflow-x: auto;
}

.stats-bar {
  min-width: 10px;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 28px;
  align-items: end;
  gap: 8px;
}

.stats-bar span {
  width: 100%;
  min-height: 4px;
  align-self: end;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #45b184, var(--green));
}

.stats-bar em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.stats-row {
  grid-template-columns: minmax(140px, 1fr) 96px 96px 96px 96px minmax(140px, 1fr);
}

.list-pane {
  min-width: 0;
  overflow: hidden;
}

.pane-head {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.pane-head h3 {
  margin: 0;
  font-size: 17px;
}

.pane-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.post-list {
  height: calc(100vh - 290px);
  overflow: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.post-row {
  min-height: 104px;
  width: 100%;
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.compose-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.compose-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.compose-form label span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compose-form label em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.compose-form input,
.compose-form select,
.compose-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.compose-form input,
.compose-form select {
  height: 42px;
}

.compose-form textarea {
  min-height: 172px;
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

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

.compose-vote-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.compose-vote-head,
.compose-vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compose-vote-head strong {
  display: block;
  font-size: 14px;
}

.compose-vote-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.compose-vote-list {
  display: grid;
  gap: 10px;
}

.compose-vote-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.compose-vote-row label {
  flex: 1;
  min-width: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
}

.vote-remove-button::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.vote-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vote-color-swatch {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--vote-color);
}

.vote-color-swatch.is-selected {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.vote-color-swatch.is-selected::after {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.vote-color-swatch:disabled:not(.is-selected) {
  filter: grayscale(0.8);
  opacity: 0.24;
}

.compose-image-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.compose-image-row div:first-child {
  display: grid;
  gap: 3px;
}

.compose-image-row strong {
  font-size: 13px;
}

.compose-image-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compose-image-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  min-height: 220px;
  display: grid;
  place-items: center;
}

.compose-image-box img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  background: var(--nav);
}

.action-row.compact {
  margin-top: 0;
}

.submit-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.form-error,
.form-message {
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.form-error {
  border: 1px solid rgba(194, 65, 59, 0.45);
  background: rgba(194, 65, 59, 0.12);
  color: #ffc3bf;
}

.form-message {
  border: 1px solid rgba(31, 122, 90, 0.45);
  background: rgba(31, 122, 90, 0.12);
  color: #c9f2dd;
}

.post-row.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.row-top,
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
}

.badge.active {
  background: var(--green);
}

.badge.hidden,
.badge.auto_hidden {
  background: var(--amber);
}

.badge.deleted,
.badge.banned {
  background: var(--red);
}

.badge.limited,
.badge.under_review {
  background: var(--violet);
}

.row-date,
.row-meta,
.detail-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.row-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 15px;
  line-height: 1.45;
}

.detail-pane {
  min-width: 0;
  padding: 20px;
  overflow: auto;
}

.empty-state {
  height: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.detail-title {
  margin: 16px 0 12px;
  font-size: 25px;
  line-height: 1.35;
}

.image-preview {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-placeholder {
  min-height: 174px;
  display: grid;
  place-items: center;
  border: 1px dashed #475467;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 800;
}

.post-category-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.post-category-editor label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.post-category-editor span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.post-category-editor select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.vote-panel {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.vote-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.vote-row.is-leading {
  color: #fff;
}

.vote-row > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #2a3540;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--vote-color), color-mix(in srgb, var(--vote-color) 12%, transparent), transparent);
}

.vote-row.is-leading .bar {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--vote-color) 62%, #fff);
}

.bar-fill.true {
  background: var(--green);
}

.bar-fill.false {
  background: var(--red);
}

.section-title {
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-list,
.audit-list,
.device-list,
.comment-list {
  display: grid;
  gap: 8px;
}

.report-item,
.audit-item,
.device-item,
.comment-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.comment-item.is-deleted {
  opacity: 0.62;
}

.comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-comment-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-comment-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 12px;
  font: inherit;
  outline: none;
}

.admin-comment-form .action-button {
  justify-self: end;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.action-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
}

.action-button.green {
  background: var(--green);
}

.action-button.blue {
  background: var(--blue);
}

.action-button.red {
  background: var(--red);
}

.action-button.amber {
  background: var(--amber);
}

.policy-pane,
.devices-pane,
.audit-pane {
  grid-column: 1 / -1;
  padding: 22px;
}

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

.policy-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-soft);
}

.policy-block h3 {
  margin: 0 0 10px;
}

.policy-block p,
.policy-block li {
  color: var(--muted);
  line-height: 1.65;
}

.table-like {
  display: grid;
  gap: 8px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 12px 0;
}

.page-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--nav);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
}

.page-jump {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.page-jump input {
  width: 86px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  text-align: center;
  outline: none;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 130px 120px minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.device-activity-row {
  grid-template-columns: minmax(180px, 1.5fr) 72px 72px 72px 112px 126px 96px;
}

.restriction-row {
  grid-template-columns: minmax(180px, 1.3fr) 120px 100px minmax(160px, 1fr) 110px;
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .storage-panel {
    margin-top: 0;
  }

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

  .toolbar {
    width: 100%;
    align-items: stretch;
  }

  .search-box {
    flex: 1;
  }

  .search-box input {
    width: 100%;
  }

  .content-grid,
  .lab-grid,
  .compose-grid,
  .devices-grid,
  .notices-grid,
  .stats-grid,
  .status-grid,
  .admins-grid {
    grid-template-columns: 1fr;
  }

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

  .post-list {
    height: auto;
    max-height: 360px;
  }
}

@media (max-width: 720px) {
  .auth-actions,
  .metrics,
  .policy-grid,
  .stats-overview {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 16px;
  }

  .toolbar {
    flex-direction: column;
  }

  .compose-form-grid,
  .category-add-form,
  .advanced-filters,
  .score-metrics.two {
    grid-template-columns: 1fr;
  }

  .compose-image-row {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-bar {
    justify-content: stretch;
  }

  .page-button,
  .page-jump {
    flex: 1;
    justify-content: center;
  }

  .filter-box select {
    width: 100%;
  }

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

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

  .stats-chart {
    grid-template-columns: repeat(30, minmax(12px, 1fr));
  }

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

  .status-row,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .score-metrics {
    grid-template-columns: 1fr;
  }

  .score-row {
    grid-template-columns: minmax(86px, 118px) minmax(60px, 1fr) 82px;
  }

  .vote-row {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .vote-row > span:last-child {
    grid-column: 2;
  }
}
