:root {
  --bg: #0a0a0c;
  --panel: #121216;
  --panel-2: #17171c;
  --panel-hover: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.1);
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #f2f3f5;
  --muted: #9a9aa2;
  --faint: #6e6e76;
  --accent: #1c52de;
  --accent-2: #6a96ff;
  --accent-soft: rgba(28, 82, 222, 0.16);
  --accent-ring: rgba(28, 82, 222, 0.55);
  --danger: #e5534b;
  --danger-soft: rgba(229, 83, 75, 0.12);
  --ok: #3fb970;
  --ok-soft: rgba(63, 185, 112, 0.14);
  --warn: #d9a03f;
  --warn-soft: rgba(217, 160, 63, 0.14);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 224px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Satoshi, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto,
    sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}

code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Forms */
input,
textarea,
select {
  font: inherit;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  outline: none;
  width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

textarea.body-editor {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  padding: 12px 14px;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 14px 0 6px;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.field label {
  margin-top: 14px;
}

.field:first-child label {
  margin-top: 0;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.owner-hint {
  color: var(--warn);
}

/* Layout */
.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border-soft);
  padding: 16px 10px 12px;
  display: flex;
  flex-direction: column;
  /* Sticky flex items collapse the main column in desktop Safari. */
  align-self: flex-start;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  background: #0c0c0f;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
}

.login-card .brand-mark {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

.brand-name {
  font-weight: 600;
  font-size: 14px;
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 10px 6px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

.sidebar nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.sidebar nav a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.sidebar nav a svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.75;
}

.sidebar nav a.active svg {
  opacity: 1;
  color: var(--accent-2);
}

.sidebar .foot {
  border-top: 1px solid var(--border-soft);
  padding: 12px 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

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

.foot-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.foot-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--faint);
}

.foot button {
  background: none;
  border: none;
  color: var(--faint);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  flex-shrink: 0;
}

.foot button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.content {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 72px;
  max-width: 1240px;
}

@media (max-width: 900px) {
  .shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    z-index: 40;
  }

  .brand {
    padding: 0;
  }

  .menu-btn {
    display: inline-flex;
  }

  .sidebar nav,
  .sidebar .foot {
    display: none;
  }

  .sidebar.open nav {
    display: flex;
    padding-top: 14px;
  }

  .sidebar.open .foot {
    display: flex;
    margin-top: 12px;
  }

  .content {
    padding: 20px 16px 56px;
  }
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 3px;
}

.page-desc {
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 26px 0 10px;
}

.section-title:first-child {
  margin-top: 0;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.card.flush {
  padding: 0;
  overflow: hidden;
}

.card.flush > .stat-label {
  padding: 14px 14px 0;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

@media (max-width: 1000px) {
  .grid.cols-4,
  .grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

.stat-label {
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

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

.table tbody tr:hover td {
  background: var(--panel-hover);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .actions-cell {
  text-align: right;
  white-space: nowrap;
}

.table .actions-cell .btn + .btn,
.table .actions-cell .btn + a,
.table .actions-cell a + .btn {
  margin-left: 6px;
}

.table .sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.table.breakdown td {
  padding: 8px 14px;
}

.breakdown-label {
  width: 160px;
}

.breakdown-num {
  width: 96px;
  white-space: nowrap;
}

.breakdown-empty {
  padding: 14px;
  font-size: 13px;
}

.bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 3px;
  background: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: filter 0.12s, background 0.12s, border-color 0.12s;
}

.btn:hover {
  filter: brightness(1.1);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.secondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  filter: none;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  filter: none;
}

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(229, 83, 75, 0.28);
}

.btn.danger:hover {
  background: rgba(229, 83, 75, 0.2);
  filter: none;
}

.btn.sm {
  padding: 4px 9px;
  font-size: 12px;
  border-radius: 6px;
}

.btn.block {
  width: 100%;
}

/* Text that acts like a button (e.g. a row title that opens a detail view). */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  white-space: normal;
}

.link-btn:hover {
  color: var(--accent-2);
}

/* Switch */
.switch {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  padding: 0;
  transition: background 0.15s;
  vertical-align: middle;
}

.switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}

.switch.on {
  background: var(--accent);
  border-color: var(--accent);
}

.switch.on .knob {
  transform: translateX(12px);
  background: #fff;
}

.switch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

.badge.open,
.badge.warn,
.badge.paused,
.badge.reviewing,
.badge.new {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.in_progress,
.badge.peak,
.badge.owner,
.badge.info {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.badge.resolved,
.badge.published,
.badge.completed,
.badge.active,
.badge.accepted,
.badge.ok,
.badge.transferred {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.free,
.badge.draft,
.badge.scheduled,
.badge.cancelled,
.badge.admin,
.badge.archived,
.badge.declined,
.badge.pending,
.badge.skipped,
.badge.neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.badge.live,
.badge.failed,
.badge.danger {
  background: var(--danger-soft);
  color: #ff6b61;
}

/* Misc */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  max-width: 300px;
}

.toolbar select {
  width: auto;
}

.spacer {
  flex: 1;
}

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

.faint {
  color: var(--faint);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

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

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

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

.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 16px;
  align-items: start;
}

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

.sticky-aside {
  position: sticky;
  top: 16px;
}

@media (max-width: 900px) {
  .sticky-aside {
    position: static;
  }
}

.list-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 11px 13px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
}

.list-item:hover {
  border-color: var(--border);
}

.list-item.active {
  border-color: var(--accent-ring);
  background: var(--accent-soft);
}

.tile {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
}

.empty-state {
  text-align: center;
  padding: 44px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-state.compact {
  padding: 22px 16px;
  border: none;
}

.empty-title {
  font-weight: 600;
  font-size: 14px;
}

.empty-hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.empty-action {
  margin-top: 14px;
}

td .empty-state {
  border: none;
  padding: 28px 16px;
}

.error-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: rgba(229, 83, 75, 0.08);
  border: 1px solid rgba(229, 83, 75, 0.28);
  color: var(--danger);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

.error-text {
  flex: 1;
  line-height: 1.45;
}

.error-text .hint {
  color: rgba(229, 83, 75, 0.85);
}

.error-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.error-box .btn.secondary {
  color: var(--danger);
  border-color: rgba(229, 83, 75, 0.35);
}

.error-box .btn.ghost {
  color: var(--danger);
}

.note-box {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.note-box.warn {
  border-color: rgba(217, 160, 63, 0.35);
  color: var(--warn);
}

/* Skeleton */
.skeleton {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-row td {
  padding: 13px 12px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.loading {
  color: var(--muted);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 28px;
}

.login-card h1 {
  font-size: 18px;
  margin: 14px 0 2px;
}

.login-card .sub {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
}

.login-card .btn {
  width: 100%;
  margin-top: 18px;
  padding: 9px;
}

.login-card .btn + .btn {
  margin-top: 8px;
}

.modal:focus,
.modal.confirm:focus {
  outline: none;
}

.login-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px;
  z-index: 50;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.modal.wide {
  max-width: 820px;
}

.modal.confirm {
  max-width: 440px;
  margin-top: 14vh;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.modal h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.confirm-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.modal .actions .spacer {
  flex: 1;
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.18s ease-out;
}

.toast.success {
  border-left-color: var(--ok);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast span {
  flex: 1;
  line-height: 1.45;
}

.toast button {
  background: none;
  border: none;
  color: var(--faint);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.toast button:hover {
  color: var(--text);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Chart */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
  margin-top: 14px;
}

.chart .bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  position: relative;
  transition: background 0.12s;
}

.chart .bar:hover {
  background: var(--accent);
}

.chart .bar:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  margin-bottom: 6px;
  z-index: 5;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.seg button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 5px 12px;
  font-weight: 500;
  font-size: 13px;
}

.seg button + button {
  border-left: 1px solid var(--border-soft);
}

.seg button:hover {
  color: var(--text);
}

.seg button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.seg button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

/* Key-value detail list */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 14px;
  font-size: 13px;
  margin-top: 8px;
}

.kv dt {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 2px;
}

.kv dd {
  margin: 0;
  word-break: break-word;
}

/* Content previews */
.preview {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.preview img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 10px;
  max-height: 180px;
  object-fit: cover;
}

.preview h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.preview .p-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.preview .p-body {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 8px;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.preview .p-cta {
  display: inline-block;
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.status-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--faint);
}

.status-dot.ok::before {
  background: var(--ok);
}

.reply-thread {
  white-space: pre-wrap;
  line-height: 1.6;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  min-height: 48px;
  font-size: 13px;
}
