:root {
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --bg-soft: #eef0f3;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #059669;
  --danger: #dc2626;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Pinar', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
}

.container-full {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: clamp(0.75rem, 2vw, 1.5rem);
  padding-right: clamp(0.75rem, 2vw, 1.5rem);
}

/* —— Public —— */
.public-page {
  background: var(--bg);
}

.site-header-compact {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.header-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.header-admin {
  margin-inline-start: auto;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.header-admin:hover {
  color: var(--accent);
  text-decoration: none;
}

.empty-state {
  color: var(--muted);
  padding: 2rem 0;
}

.filters-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  padding: 0.35rem 0 0.25rem;
  margin-bottom: 0.15rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.filter-label {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
}

.filter-multi {
  min-width: 6.5rem;
  max-width: 10rem;
  height: 1.75rem;
  padding: 0 0.25rem;
  font: inherit;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  overflow: auto;
}

.filter-multi:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--accent);
}

.filter-count {
  font-size: 0.7rem;
  color: var(--muted);
  margin-inline-start: auto;
}

.filter-clear {
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  padding: 0 0.25rem;
}

.filter-clear:hover {
  color: var(--danger);
  text-decoration: none;
}

.filter-hint {
  margin: 0 0 0.65rem;
  font-size: 0.65rem;
  color: var(--muted);
}

.news-masonry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
  padding-bottom: 2.5rem;
}

@media (max-width: 1100px) {
  .news-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .news-masonry {
    grid-template-columns: minmax(0, 1fr);
  }
}

.news-masonry-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 10.5rem;
  padding: 0.75rem;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.news-masonry-card .news-card-footer {
  margin-top: auto;
}

.news-masonry-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

/* TEMP: hide category + priority on feed cards. Remove this rule to show again. */
.news-masonry-card .news-card-meta-temporary-hidden {
  display: none !important;
}

.news-masonry-card-head:not(:has(.tag-sensitive, .tag-sent:not([hidden]), .tag-verified:not([hidden]), .tag-irrelevant:not([hidden]))) {
  display: none;
  margin-bottom: 0;
}

.news-masonry-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.news-source-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0 0;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--muted);
}

.news-source-list li {
  margin-bottom: 0.35rem;
}

.news-source-list a {
  color: var(--text);
  text-decoration: none;
}

.news-source-list a:hover {
  text-decoration: underline;
}

.tag-category {
  background: var(--text);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

.category-col-title {
  margin: 0 0 0.65rem;
  padding-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--text);
  letter-spacing: -0.01em;
}

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

.news-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.news-row:last-child {
  border-bottom: 0;
}

.news-row-body {
  flex: 1;
  min-width: 0;
}

.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  line-height: 1.4;
  flex-shrink: 0;
  height: fit-content;
  margin-top: 0.15rem;
}

.tag-priority {
  min-width: 1.35rem;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
}

.tag-priority.pri-critical {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.tag-priority.pri-high {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.tag-priority.pri-medium {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.tag-source,
.tag-city {
  display: inline-block;
  margin-top: 0.35rem;
  margin-inline-start: 0.35rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  padding: 0;
}

.tag-city {
  color: #0f766e;
}

mark.hl-city {
  background: #dbeafe;
  padding: 0 0.1em;
  border-radius: 2px;
}

mark.hl-topic {
  background: #fef3c7;
  padding: 0 0.1em;
  border-radius: 2px;
}

.news-row-summary-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  margin-top: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border, #e5e5e5);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.news-card-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.news-card-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

.news-card-source-link {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  text-decoration: none;
}

.news-card-source-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-card-source-link:hover {
  text-decoration: underline;
}

.news-card-source-icon {
  flex-shrink: 0;
  opacity: 0.65;
}

.news-card-footer-top .js-news-open {
  font-size: 0.75rem;
  color: var(--muted, #666);
  padding: 0.15rem 0.35rem;
}

.news-card-footer-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

@media (min-width: 520px) {
  .news-card-footer-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
}

.news-card-toggle-group {
  display: flex;
  width: 100%;
  padding: 0.15rem;
  gap: 0.1rem;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 0.5rem;
  background: rgb(0 0 0 / 0.03);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.03);
}

@media (min-width: 520px) {
  .news-card-toggle-group {
    width: auto;
  }
}

.news-card-toggle {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0.35rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--muted, #666);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

@media (min-width: 520px) {
  .news-card-toggle {
    flex: none;
    min-width: 4.1rem;
  }
}

.news-card-toggle:hover {
  background: var(--card, #fff);
  color: var(--text, #111);
}

.news-card-toggle:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 1px;
}

.news-card-share-group {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.15rem;
  gap: 0.1rem;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 0.5rem;
  background: var(--card, #fff);
}

@media (min-width: 520px) {
  .news-card-share-group {
    width: auto;
  }
}

.news-card-share-btn {
  flex: 1;
  border: none;
  border-radius: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--text, #111);
  transition: background 0.15s;
}

@media (min-width: 520px) {
  .news-card-share-btn {
    flex: none;
  }
}

.news-card-share-btn:hover {
  background: rgb(0 0 0 / 0.04);
}

.news-card-share-divider {
  width: 1px;
  height: 1rem;
  background: var(--border, #e5e5e5);
  flex-shrink: 0;
}

.app-bottom-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 9999;
  max-width: min(92vw, 22rem);
  transform: translateX(-50%) translateY(0.75rem);
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  color: #fff;
  background: #111;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-bottom-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.news-masonry-card.is-sent {
  box-shadow: inset 0 0 0 2px rgb(34 197 94 / 0.85);
}

.news-masonry-card.is-irrelevant {
  box-shadow: inset 0 0 0 2px rgb(245 158 11 / 0.9);
}

.news-masonry-card.is-archived {
  box-shadow: inset 0 0 0 2px rgb(100 116 139 / 0.85);
}

.news-masonry-card.is-verified {
  opacity: 0.45;
}

.tag-verified {
  background: #e0e7ff;
  color: #3730a3;
}

.news-card-toggle.js-news-sent.btn-sent {
  background: rgb(5 150 105);
  color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.news-card-toggle.js-news-verify.btn-verified {
  background: var(--primary, #111);
  color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.news-card-toggle.js-news-irrelevant.btn-irrelevant {
  background: rgb(217 119 6);
  color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.news-card-toggle.js-news-archive.btn-archived {
  background: rgb(71 85 105);
  color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.tag-archived {
  background: #f1f5f9;
  color: #334155;
}

.news-detail-dialog {
  margin: auto;
  border: none;
  border-radius: 8px;
  padding: 0;
  width: min(96vw, 32rem);
  max-width: 32rem;
  max-height: min(90dvh, 640px);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.2);
  overflow: hidden;
}

.news-detail-dialog::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.news-detail-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: min(90dvh, 640px);
  min-height: 0;
}

.news-detail-dialog-head {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border, #e5e5e5);
}

.news-detail-dialog-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0.75rem 1rem 0;
}

.news-detail-dialog-scroll {
  max-height: min(50dvh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.35rem;
}

.news-detail-dialog-foot {
  flex-shrink: 0;
  padding: 0.5rem 1rem 0.75rem;
  border-top: 1px solid var(--border, #e5e5e5);
  margin-top: 0.5rem;
}

.news-detail-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.news-detail-summary {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted, #555);
  margin-top: 0.75rem;
}

.news-detail-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.tag-sensitive {
  color: #b45309;
}

.filter-sensitive-checkboxes {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.35rem;
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.header-last-update {
  flex-basis: 100%;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

@media (min-width: 640px) {
  .header-last-update {
    flex-basis: auto;
    margin-top: 0;
    margin-inline-start: auto;
    margin-inline-end: 0.5rem;
  }
}

.date-archive-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.8rem;
}

.date-nav-btn {
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.date-nav-label {
  font-weight: 600;
}

.date-picker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0.5rem;
}

.date-pill {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  text-decoration: none;
  color: inherit;
}

.date-pill.active {
  background: #eff6ff;
  border-color: #93c5fd;
}

.news-row-date {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.35rem;
}

.news-row-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  text-decoration: none;
  flex: 1 1 auto;
  min-height: 0;
}

.news-row-title.js-news-title {
  cursor: pointer;
}

.tag-sent {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.tag-irrelevant {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.news-detail-dialog-body .news-card-footer {
  margin-top: 0.75rem;
}

.news-detail-title {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.news-row-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.news-row-summary {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-row-summary--full {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  white-space: pre-wrap;
  word-break: break-word;
}

.news-detail-summary--solo {
  color: var(--text);
  font-size: 0.875rem;
}

/* —— Admin —— */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.admin-nav {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 1.25rem 1rem;
}

.admin-nav h2 {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.admin-nav a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 0.15rem;
  font-size: 0.9rem;
}

.admin-nav a:hover {
  background: var(--bg-soft);
  text-decoration: none;
}

.admin-main {
  padding: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
}

label {
  display: block;
  margin: 0.65rem 0 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  display: inline-block;
  margin-top: 0.75rem;
  background: var(--text);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
}

.btn:hover {
  opacity: 0.92;
}

.btn.secondary {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.inline-form {
  display: inline-block;
  margin: 0;
}

.inline-form .btn {
  margin-top: 0;
}

.meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.35rem;
  text-align: right;
  vertical-align: top;
}

.error {
  color: var(--danger);
  margin: 0.5rem 0;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(400px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.pipeline-status {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.pipeline-status.status-running {
  color: var(--accent);
}

.pipeline-status.status-success {
  color: var(--accent-2);
}

.pipeline-status.status-error {
  color: var(--danger);
}

.pipeline-log {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.pipeline-log-errors {
  max-height: 200px;
  border-color: #fecaca;
}

.log-line {
  display: flex;
  gap: 0.65rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid var(--border);
}

.log-line:last-child {
  border-bottom: 0;
}

.log-time {
  flex: 0 0 auto;
  color: var(--muted);
  min-width: 4.5rem;
}

.log-msg {
  flex: 1;
  word-break: break-word;
  color: var(--text);
}

.log-line.log-error .log-msg {
  color: var(--danger);
}

.log-stack {
  margin: 0.35rem 0 0.5rem 5rem;
  padding: 0.5rem;
  background: #fef2f2;
  border-radius: 6px;
  font-size: 0.7rem;
  overflow-x: auto;
  white-space: pre-wrap;
  color: #991b1b;
}

.log-empty {
  margin: 0;
  color: var(--muted);
  font-family: inherit;
}

tr.row-error td {
  color: var(--danger);
}

/* —— Admin compact —— */
body.admin-compact {
  font-size: 0.8125rem;
}

body.admin-compact .admin-main {
  padding: 0.85rem 1rem;
}

body.admin-compact h1 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

body.admin-compact .admin-lead {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  color: var(--muted);
}

body.admin-compact .card-compact {
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.55rem;
}

body.admin-compact .card-title {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
}

body.admin-compact label {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
}

body.admin-compact input,
body.admin-compact textarea,
body.admin-compact select {
  padding: 0.28rem 0.45rem;
  font-size: 0.8125rem;
  border-radius: 6px;
}

body.admin-compact textarea {
  min-height: 3.2rem;
}

body.admin-compact .btn {
  margin-top: 0;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

body.admin-compact .btn-sm {
  padding: 0.22rem 0.5rem;
}

body.admin-compact .admin-nav {
  padding: 0.65rem 0.5rem;
}

body.admin-compact .admin-nav a {
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
}

.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-end;
  margin-bottom: 0.4rem;
}

.admin-field {
  min-width: 120px;
  flex: 1 1 120px;
}

.admin-field-grow {
  flex: 2 1 200px;
}

.admin-field-check,
.admin-field-actions {
  flex: 0 0 auto;
  min-width: auto;
}

.admin-form-inline-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.admin-form-inline-add input {
  flex: 1 1 100px;
  min-width: 80px;
}

.admin-form-inline-add .input-num {
  flex: 0 0 3.5rem;
  min-width: 3.5rem;
}

.admin-form-inline-add textarea {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  resize: vertical;
}

.admin-form-inline-add .admin-tags-wrap.admin-tags-negative {
  border-color: #fecaca;
  background: #fffafa;
}

.admin-form-inline-add .admin-tags-negative .admin-tag-chip {
  background: #fef2f2;
  border-color: #fecaca;
}

.admin-form-inline-add .admin-tags-wrap.admin-tags-hashtag-bypass {
  border-color: #bfdbfe;
  background: #f8fafc;
}

.admin-form-inline-add .admin-tags-hashtag-bypass .admin-tag-chip {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.admin-form-inline-add .admin-tags-wrap {
  flex: 2 1 200px;
  min-width: 140px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  background: #fff;
}

.admin-form-inline-add .admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 100%;
}

.admin-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  line-height: 1.3;
}

.admin-tag-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 0.85rem;
  line-height: 1;
  color: #64748b;
}

.admin-tag-remove:hover {
  color: #b91c1c;
}

.admin-form-inline-add .admin-tags-text {
  flex: 1 1 80px;
  min-width: 72px;
  border: none;
  outline: none;
  padding: 0.15rem 0.25rem;
  font: inherit;
  font-size: 0.75rem;
  background: transparent;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.admin-check.inline {
  margin: 0;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  font-size: 0.75rem;
}

.admin-table th,
.admin-table td {
  padding: 0.35rem 0.4rem;
  vertical-align: middle;
}

.admin-table .cell-url {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
}

.admin-table .cell-muted {
  font-size: 0.68rem;
  color: var(--muted);
}

.admin-edit-row td {
  background: var(--bg-soft);
  padding: 0.5rem !important;
}

.admin-nested-cell {
  padding: 0.35rem !important;
}

.admin-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.btn-link {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  padding: 0;
}

.field-hint {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.probe-result {
  margin: 0.35rem 0;
  padding: 0.45rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.68rem;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
}

.admin-advanced {
  margin-top: 0.35rem;
  font-size: 0.72rem;
}

.admin-advanced summary {
  cursor: pointer;
  color: var(--muted);
}

.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.admin-flash {
  font-size: 0.72rem;
  color: var(--muted);
}

.admin-flash-error {
  color: #b91c1c;
}

@media (max-width: 860px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    border-left: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .admin-nav a {
    margin: 0;
  }
}

/* —— Sensitivity / cities printable report —— */
.sens-print-page {
  margin: 0;
  color: inherit;
  font-family: 'Pinar', system-ui, sans-serif;
}

.sens-print-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border, #d5dbe3);
}

.sens-print-toolbar-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sens-print-toolbar-main h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
}

.sens-print-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.sens-print-check {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}

.sens-print-sheet {
  max-width: 920px;
  margin: 1.25rem auto 2.5rem;
  padding: 0 1rem 2rem;
}

.sens-print-dochead {
  margin-bottom: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 2px solid currentColor;
}

.sens-print-dochead h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  font-family: inherit;
}

.sens-print-meta {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.75;
}

.sens-print-card {
  margin-bottom: 1rem;
  padding: 0.85rem 0 1rem;
  border-bottom: 1px solid var(--border, #dde3ea);
  break-inside: avoid;
  page-break-inside: avoid;
}

.sens-print-card.is-inactive {
  opacity: 0.7;
  border-bottom-style: dashed;
}

.sens-print-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sens-print-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: inherit;
}

.sens-print-slug {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  opacity: 0.65;
  font-family: inherit;
}

.sens-print-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sens-print-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
}

.sens-print-badge.is-on {
  color: #157a3c;
}

.sens-print-badge.is-off {
  color: #5c6570;
}

.sens-print-badge.is-info {
  color: #2a5f9e;
}

.sens-print-block {
  margin-top: 0.65rem;
}

.sens-print-block h3 {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
}

.sens-print-block h3 span {
  font-weight: 500;
  opacity: 0.65;
}

.sens-print-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sens-print-chips li {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  border: 1px solid currentColor;
  font-family: inherit;
}

.sens-print-chips.is-positive li {
  color: #1b6b3a;
}

.sens-print-chips.is-negative li {
  color: #9b2c2c;
}

.sens-print-chips.is-bypass li {
  color: #5b3a8c;
}

.sens-print-chips.is-ignore li {
  color: #6a5a3a;
}

.sens-print-empty {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.5;
}

.admin-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.75rem;
}

.report-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.report-total-chip {
  display: inline-flex;
  gap: 0.45rem;
  align-items: baseline;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border, #dde3ea);
  border-radius: 8px;
  font-size: 0.8rem;
}

.report-total-chip.is-off {
  opacity: 0.55;
}

.report-total-chip.is-topic {
  border-color: #1b6b3a;
}

.report-total-chip.is-city {
  border-color: #2a5f9e;
}

.report-total-chip.is-other {
  border-color: #6a5a3a;
}

.report-total-label {
  opacity: 0.8;
}

.report-table-wrap {
  overflow-x: auto;
}

.report-table th,
.report-table td {
  white-space: nowrap;
  text-align: center;
  font-size: 0.78rem;
}

.report-table th:first-child,
.report-table td:first-child {
  text-align: right;
  white-space: normal;
  min-width: 10rem;
}

.report-day-name {
  display: block;
  font-size: 0.72rem;
}

.report-col-topic {
  color: #1b6b3a;
}

.report-col-city {
  color: #2a5f9e;
}

.report-col-other {
  color: #6a5a3a;
}

.report-col-sent,
.report-total-chip.is-status-sent,
.report-print-total.is-status-sent {
  color: #0f6b4c;
}

.report-col-verified,
.report-total-chip.is-status-verified,
.report-print-total.is-status-verified {
  color: #2a5f9e;
}

.report-col-irrelevant,
.report-total-chip.is-status-irrelevant,
.report-print-total.is-status-irrelevant {
  color: #9b2c2c;
}

.report-col-archived,
.report-total-chip.is-status-archived,
.report-print-total.is-status-archived {
  color: #5c6570;
}

.report-total-chip.is-status-untouched,
.report-print-total.is-status-untouched {
  color: #6a5a3a;
}

.report-total-chip.is-status-sent,
.report-total-chip.is-status-verified,
.report-total-chip.is-status-irrelevant,
.report-total-chip.is-status-archived,
.report-total-chip.is-status-untouched {
  border-color: currentColor;
}

.report-print-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.report-print-total {
  display: inline-flex;
  gap: 0.4rem;
  align-items: baseline;
  padding: 0.2rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
}

.report-print-total.is-topic {
  color: #1b6b3a;
}

.report-print-total.is-city {
  color: #2a5f9e;
}

.report-print-total.is-other {
  color: #6a5a3a;
}

.report-print-table-wrap {
  overflow-x: auto;
}

.report-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-family: inherit;
}

.report-print-table th,
.report-print-table td {
  border: 1px solid #bbb;
  padding: 0.35rem 0.4rem;
  text-align: center;
  vertical-align: top;
}

.report-print-table th:first-child,
.report-print-table td:first-child {
  text-align: right;
}

.report-print-dayname {
  font-size: 0.7rem;
  opacity: 0.7;
}

.report-chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  direction: ltr;
}

.report-chart-wrap-lg {
  height: 360px;
}

.sens-print-sheet .report-chart-wrap {
  height: 260px;
}

.sens-print-sheet .report-chart-wrap-lg {
  height: 320px;
}

@media print {
  .no-print,
  .sens-print-toolbar {
    display: none !important;
  }

  .sens-print-sheet {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .sens-print-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-chart-wrap,
  .report-chart-wrap-lg {
    break-inside: avoid;
    page-break-inside: avoid;
    height: 300px !important;
  }

  .report-chart-wrap canvas {
    max-width: 100% !important;
  }
}
