.hidden { display: none !important; }
.muted { color: #808695; }
.warn { margin: 8px 0 0; color: #d03050; font-size: 0.85rem; }
.error { color: #d03050; min-height: 1.2em; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body {
  --paper: #f5f7f9;
  --ink: #333639;
  --mist: #fff;
  --line: #efeff5;
  --muted: #808695;
  --pine: #18a058;
  --fail: #d03050;
  --primary: #2d8cf0;
  background: #f5f7f9;
  color: #333639;
  color-scheme: light;
}
h1, h2, h3 { font-family: var(--sans); font-weight: 600; }
:focus-visible { outline-color: var(--primary); }

.login-page {
  display: flex;
  min-height: 100vh;
  background: #f5f7f9;
  color: #333639;
}
.login-brand {
  display: none;
  flex: 1 1 45%;
  flex-direction: column;
  justify-content: space-between;
  padding: 64px 56px 40px;
  color: #fff;
  background:
    linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(150deg, #14213d 0%, #1876e6 55%, #2d8cf0 100%);
}
.brand-mark { margin: 0 0 16px; font-size: 30px; font-weight: 600; }
.brand-desc { margin: 0 0 40px; max-width: 420px; font-size: 15px; line-height: 1.7; color: rgb(255 255 255 / 72%); }
.brand-points { margin: 0; padding: 0; list-style: none; }
.brand-points li { margin-bottom: 14px; font-size: 14px; color: rgb(255 255 255 / 82%); }
.brand-points li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: rgb(255 255 255 / 85%); }
.brand-copy { margin: 0; font-size: 13px; color: rgb(255 255 255 / 55%); }
.login-main {
  display: flex;
  flex: 1 1 55%;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px 32px;
  background: #fff;
  border: 1px solid #efeff5;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(15 23 42 / 6%);
}
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-card p { margin: 0 0 32px; font-size: 14px; color: #808695; }
.login-card label { display: block; margin: 16px 0 8px; font-size: 14px; }
.login-card label:first-of-type { margin-top: 0; }
.login-card input {
  width: 100%;
  border: 1px solid #e0e0e6;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}
.login-card input:focus { border-color: #2d8cf0; }
.login-card button {
  width: 100%;
  margin-top: 20px;
  border: 0;
  border-radius: 3px;
  padding: 10px 16px;
  background: #2d8cf0;
  color: #fff;
  font-weight: 600;
}
.login-card button:hover { background: #1876e6; }
.login-card .error { margin: 12px 0 0; }

.layout { min-height: 100vh; background: #f5f7f9; }
.sider {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 200px;
  background: rgb(0, 20, 40);
  box-shadow: 2px 0 8px 0 rgb(29 35 41 / 5%);
  z-index: 13;
}
.logo {
  display: flex;
  align-items: center;
  height: 64px;
  padding-left: 20px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}
.menu { display: flex; flex-direction: column; padding: 8px 0; }
.menu-item {
  height: 42px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: rgb(255 255 255 / 82%);
  text-align: left;
}
.menu-item:hover { color: #fff; }
.menu-item.on { background: #2d8cf0; color: #fff; font-weight: 600; }

.layout-right { margin-left: 200px; min-width: 0; min-height: 100vh; }
.layout-header {
  position: sticky;
  top: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  background: #fff;
  color: #515a6e;
  box-shadow: 0 1px 4px rgb(0 21 41 / 8%);
}
.crumbs { font-size: 14px; }
.crumbs span { color: #515a6e; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-right a, .header-right button {
  border: 0;
  background: none;
  padding: 0;
  color: #515a6e;
  text-decoration: none;
}
.header-right a:hover, .header-right button:hover { color: #2d8cf0; }

.tabs-view {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: #f5f7f9;
}
.tab {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 3px;
  background: #fff;
  color: #515a6e;
}
.tab:hover { color: #515a6e; }
.tab.on { color: #2d8cf0; }

.content { margin: 0 10px 10px; }
.banner {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 3px;
  background: #fff;
  border: 1px solid #efeff5;
  line-height: 1.5;
}
.view-head h1 { margin: 0 0 12px; font-size: 16px; color: #1f2225; }
.view-head p { margin: 8px 0 0; max-width: 46em; }
.crumb { margin: 0 0 8px; color: #808695; font-size: 13px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select, .panel textarea, .panel input, .detail-sheet textarea, .detail-sheet input {
  border: 1px solid #e0e0e6;
  border-radius: 3px;
  background: #fff;
  color: #333639;
  padding: 8px 12px;
}
.filters input:focus, .filters select:focus, .panel textarea:focus, .panel input:focus, .detail-sheet textarea:focus, .detail-sheet input:focus {
  border-color: #2d8cf0;
}
.filters input { flex: 1; min-width: 180px; }
.filters select { width: 140px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stat {
  border: 1px solid #e0e0e6;
  border-radius: 3px;
  background: #fff;
  padding: 4px 10px;
  color: #515a6e;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.stat:hover { color: #2d8cf0; border-color: #2d8cf0; }
.stat.on { color: #fff; border-color: #2d8cf0; background: #2d8cf0; font-weight: 600; }

.search-card, .table-card, .panel {
  background: #fff;
  border-radius: 3px;
  padding: 16px 16px 12px;
  margin-top: 10px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}
.card-title { margin: 0 0 12px; color: #1f2225; font-size: 14px; font-weight: 600; }
.sheet { overflow: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1600px; }
.c-when { width: 88px; }
.c-who { width: 128px; }
.c-title { width: 220px; }
.c-industry { width: 88px; }
.c-work { width: 360px; }
.c-tags { width: 140px; }
.c-likes, .c-comments { width: 72px; }
.c-comment-body { width: 200px; }
.c-device { width: 132px; }
.c-liked { width: 80px; }
.c-state { width: 120px; }
.c-link { width: 64px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.comment-preview { display: block; max-height: 4.8em; overflow: hidden; color: #333639; font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.device-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafafc;
  color: #1f2225;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid #efeff5;
}
td {
  padding: 12px;
  border-bottom: 1px solid #efeff5;
  vertical-align: top;
  color: #333639;
}
tbody tr:last-child td { border-bottom: 0; }
td:nth-child(4) { vertical-align: middle; }
tbody tr.work:hover td { background: #f7f7fa; }
.when { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.when .time { color: #808695; font-size: 12px; }
.who strong { display: block; font-weight: 600; font-size: 14px; }
.who .plat { display: block; color: #808695; font-size: 12px; }
.copy { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: #333639; line-height: 1.55; }
.metrics { display: block; margin-top: 6px; color: #808695; font-size: 12px; }
.covers { display: flex; align-items: center; gap: 10px; min-height: 118px; overflow-x: auto; }
.cover-more {
  flex: 0 0 auto;
  min-width: 40px;
  color: #808695;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.cover {
  position: relative;
  width: 88px;
  height: 118px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: #f3f3f5;
  box-shadow: inset 0 0 0 1px #efeff5;
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #808695; font-size: 12px; }
.cover:hover { box-shadow: inset 0 0 0 1px #2d8cf0; }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .pill {
  display: inline-block;
  padding: 0 7px;
  border-radius: 2px;
  background: #f0f7ff;
  color: #2d8cf0;
  font-size: 12px;
  line-height: 22px;
}
.pill.ok { background: #edf7f2; color: #18a058; }
.pill.bad { background: #fdecee; color: #d03050; }
.pill.video { background: #f5f0ff; color: #8a2be2; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.linkish { color: #2d8cf0; text-decoration: none; }
.linkish:hover { text-decoration: underline; }
.empty { padding: 48px 16px; color: #808695; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
.pager button, .ghost, .result-line button {
  border: 1px solid #e0e0e6;
  border-radius: 3px;
  background: #fff;
  color: #333639;
  padding: 6px 12px;
}
.pager button:hover, .ghost:hover, .result-line button:hover { color: #2d8cf0; border-color: #2d8cf0; }
.pager button:disabled { opacity: 0.45; cursor: default; }
#page-label { font-variant-numeric: tabular-nums; color: #808695; min-width: 7em; text-align: right; }

.panel textarea { width: 100%; min-height: 220px; resize: vertical; }
.row-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
#ingest-go, #detail-save {
  border: 0;
  border-radius: 3px;
  background: #2d8cf0;
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
}
#ingest-go:hover, #detail-save:hover { background: #1876e6; color: #fff; }
#detail-save:disabled,
#detail-save:disabled:hover { background: #a8d0f8; color: #fff; cursor: default; }
.results { display: flex; flex-direction: column; margin-top: 10px; background: #fff; border-radius: 3px; padding: 4px 16px; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #efeff5; padding: 12px 0; }
.result-line p { margin: 4px 0 0; overflow-wrap: anywhere; }
.result-line.bad { color: #d03050; }
.api-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.api-head:first-child { margin-top: 0; }
.api-head h2 { margin: 0; font-size: 16px; }
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fafafc;
  color: #333639;
  border: 1px solid #efeff5;
  border-radius: 3px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

dialog {
  width: min(480px, 100vw);
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border: 0;
  border-left: 1px solid #efeff5;
  border-radius: 0;
  padding: 0;
  background: #fff;
  color: #333639;
  box-shadow: -2px 0 8px rgb(0 21 41 / 8%);
  overscroll-behavior: contain;
}
.detail-sheet { padding: 16px 22px 24px; max-height: 100vh; overflow: auto; }
.vfield { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid #efeff5; }
.vk { color: #808695; font-size: 12px; }
.vfield p { margin: 0; }
.detail-sheet h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.vcovers { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vcovers .cover.on { box-shadow: inset 0 0 0 2px #2d8cf0; }
.detail-sheet h3 { margin: 18px 0 8px; font-size: 15px; }
.detail-sheet label { display: block; margin: 14px 0 6px; font-size: 14px; }
.detail-sheet input, .detail-sheet textarea { width: 100%; }
dialog::backdrop { background: rgb(0 0 0 / 40%); }
.store-note { margin: 8px 0; line-height: 1.5; }
.store-note.bad { color: #d03050; }
.store-note.ok { color: #18a058; }
.detail-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.comments p { margin: 8px 0; line-height: 1.55; }
.comments .who { font-weight: 600; display: inline; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.danger { background: #d03050; color: #fff; border: 0; border-radius: 3px; padding: 8px 12px; }
.danger:hover { background: #b32645; color: #fff; }
.file-list { margin: 8px 0 0; padding: 0; list-style: none; }
.file-list a { color: #2d8cf0; word-break: break-all; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; }

@media (min-width: 960px) {
  .login-brand { display: flex; }
}

@media (max-width: 800px) {
  .sider { position: relative; width: 100%; min-height: 0; }
  .layout-right { margin-left: 0; }
  .menu { flex-direction: row; overflow: auto; }
  .menu-item { flex: 0 0 auto; }
  .filters { flex-direction: column; }
  .filters select { width: 100%; }
  dialog { width: 100vw; margin: 0; }
}
