﻿/* =============================================
   QA API Tester — Styles
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* The `hidden` attribute must win over class display rules (e.g. the
   inline-flex of .ctrl-btn--link), or role-gated controls such as the
   admin-only "Users" link would still show. */
[hidden] { display: none !important; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f0f4f8;
  color: #111827;
  line-height: 1.55;
  padding-top: 56px;
}

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  z-index: 100;
}

.topbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

.topbar__title { font-size: 1rem; }

.topbar__nav {
  display: flex;
  gap: 0.4rem;
}

.ctrl-btn {
  padding: 0.3rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  transition: filter 0.15s, opacity 0.15s;
}

.ctrl-btn:hover  { filter: brightness(1.1); }
.ctrl-btn:active { opacity: 0.85; }

.ctrl-btn--stop  { background: #dc2626; }
.ctrl-btn--reset { background: #6b7280; }
.ctrl-btn--pdf   { background: #16a34a; }
.ctrl-btn--todo  { background: #0ea5e9; }

/* ── Auth top bar (T7) ── */
.topbar__auth {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid #e5e7eb;
}

.topbar__user {
  font-size: 0.76rem;
  font-weight: 600;
  color: #374151;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctrl-btn--link {
  background: #2563eb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.ctrl-btn--logout { background: #dc2626; }

/* ── Auth screens (T7): login and change-password ── */
body.auth-body {
  min-height: 100vh;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(5, 150, 105, 0.12), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(2, 132, 199, 0.14), transparent 45%),
    #f0f4f8;
}

.auth-card {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 20px 45px -20px rgba(17, 24, 39, 0.25), 0 2px 6px rgba(17, 24, 39, 0.04);
  padding: 2.5rem 2rem 2rem;
  overflow: hidden;
}

/* Brand accent: same gradient as the primary button. */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
}

.auth-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-subtitle { font-size: 0.85rem; color: #6b7280; margin-bottom: 1.25rem; }

.auth-card .auth-title {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 0.35rem;
}
.auth-card .auth-subtitle {
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-card .input-group { margin-bottom: 1.1rem; }

/* Login and change-password inputs: large touch targets, 16px text so
   mobile browsers do not zoom on focus, and a visible focus ring. */
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fafbfc;
  color: #111827;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-card input[type="email"]:hover,
.auth-card input[type="password"]:hover { border-color: #9ca3af; }

.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.auth-card .btn-run-all {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem;
  font-size: 1rem;
}

.auth-card .btn-run-all:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

/* login.js disables the button while the request is in flight. */
.auth-card .btn-run-all:disabled {
  cursor: progress;
  opacity: 0.65;
  filter: none;
  box-shadow: none;
  transform: none;
}

.auth-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

/* ── Admin users screen (T9b): same topbar as index.html, wider card ── */
.admin-main {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

.admin-card {
  width: min(1100px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.06);
  padding: 1.5rem 1.75rem 2rem;
}

.admin-section + .admin-section { margin-top: 2rem; }

.admin-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.admin-subtitle { font-size: 0.95rem; font-weight: 700; }

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.admin-form .input-group { margin-bottom: 0; }
.admin-form .btn-run-all { grid-column: 1 / -1; justify-self: start; margin-top: 0.5rem; }

/* Same treatment as input[type="text"], scoped so the login and
   change-password screens keep their current look. */
.admin-card input[type="email"],
.admin-card input[type="password"],
.admin-card select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fafbfc;
  color: #111827;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.admin-card input[type="email"]:focus,
.admin-card input[type="password"]:focus,
.admin-card select:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th,
.admin-table td {
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-table thead th {
  background: #f8f9fb;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tbody tr:nth-child(even) { background: #fafafa; }
.admin-table tbody tr:hover { background: #eff6ff; }

.admin-user__email { font-weight: 600; }
.admin-user__name { font-size: 0.78rem; color: #6b7280; }

.admin-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-badge--on  { background: #dcfce7; color: #166534; }
.admin-badge--off { background: #fee2e2; color: #991b1b; }

.admin-row { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.admin-row select { max-width: 9.5rem; }

.admin-note { font-size: 0.78rem; color: #6b7280; margin-top: 0.35rem; }
.admin-empty { font-size: 0.85rem; color: #6b7280; margin-top: 0.75rem; }


/* ── Main layout ── */
.app-main {
  width: 100%;
  margin: 0;
  padding: 1.5rem 1.5rem 3rem calc(64px + 2rem);
  transition: padding-left 0.18s ease;
}

.action-nav {
  position: fixed;
  z-index: 90;
  top: 72px;
  bottom: 1rem;
  left: 1rem;
  width: 64px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.45rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: width 0.18s ease;
}

.action-nav__toggle,
.action-nav__item {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease;
}

.action-nav__toggle {
  background: #1f2937;
}

.action-nav__items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.action-nav__item:hover,
.action-nav__toggle:hover { filter: brightness(1.1); }

.action-nav__item:focus-visible,
.action-nav__toggle:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}

.action-nav__icon {
  width: 24px;
  flex: 0 0 24px;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1;
}

.action-nav__label {
  display: none;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-nav__item--run { background: linear-gradient(135deg, #059669 0%, #0284c7 100%); }
.action-nav__item--desktop { background: #2563eb; }
.action-nav__item--mobile { background: #ea580c; }
.action-nav__item--links { background: #7c3aed; }
.action-nav__item--anchors { background: #0891b2; }
.action-nav__item--images { background: #15803d; }
.action-nav__item--help {
  margin-top: auto;
  background: #f3f4f6;
  color: #374151;
}

body.action-nav-expanded .action-nav {
  width: 224px;
}

body.action-nav-expanded .app-main {
  padding-left: calc(224px + 2rem);
}

body.action-nav-expanded .action-nav__toggle,
body.action-nav-expanded .action-nav__item {
  width: 100%;
  height: 44px;
  flex-basis: 44px;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0 0.75rem;
}

body.action-nav-expanded .action-nav__label {
  display: inline;
}

.app-main.app-main--todo-open {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.app-main.app-main--todo-open > .todo-panel {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin-bottom: 0;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  overflow: auto;
}

.app-main.app-main--todo-open > :not(.todo-panel) {
  grid-column: 1;
}

/* ── Todo panel ── */
.todo-panel {
  background: #1f2937;
  border: 1px solid #374151;
  border-left: 4px solid #38bdf8;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.todo-panel__header {
  display: block;
  margin-bottom: 0.45rem;
  line-height: 1.25;
}

.todo-panel__header h3 {
  display: inline;
  margin-right: 0.3rem;
  font-size: 1.08rem;
  color: #ffffff;
}

.todo-panel__header span {
  display: inline;
  font-size: 0.88rem;
  color: #bfdbfe;
  font-weight: 600;
}

.todo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.28rem;
}

.todo-item {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.98rem;
  line-height: 1.28;
  color: #ffffff;
}

.todo-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #93c5fd;
  border-radius: 3px;
  background: #111827;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.todo-item input[type="checkbox"]:checked {
  background: #0ea5e9;
  border-color: #7dd3fc;
}

.todo-item input[type="checkbox"]:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.todo-item--auto {
  color: #ffffff;
  font-weight: 400;
}

.todo-item--auto input[type="checkbox"] {
  border-color: #93c5fd;
}

/* ── Form card ── */
.form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.input-group {
  margin-bottom: 1rem;
}

.input-group:last-child { margin-bottom: 0; }

.form-fields-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 1rem;
  align-items: start;
}

.form-fields-row > .input-group {
  min-width: 0;
  margin-bottom: 0;
}

.input-group > label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #374151;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fafbfc;
  color: #111827;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"]::placeholder,
textarea::placeholder { color: #9ca3af; }

textarea {
  height: 140px;
  resize: vertical;
}

.form-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
  cursor: pointer;
}

.btn-run-all {
  flex: 1;
  padding: 0.85rem;
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
}

.btn-run-all:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.38);
}

.btn-run-all:active { transform: scale(0.99); }

.help-trigger {
  width: 46px;
  aspect-ratio: 1;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.help-trigger span {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.help-trigger:hover { background: #f1f5f9; }
.help-trigger:focus-visible,
.help-dialog__close:focus-visible { outline: 3px solid #38bdf8; outline-offset: 2px; }

.section-help-trigger {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  background: transparent;
}

.section-help-trigger span {
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
}

.section-help-trigger:hover { background: rgba(255, 255, 255, 0.75); }

.help-dialog {
  width: min(440px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 1.2rem;
  overflow-y: auto;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #1f2937;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.24);
}

.help-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.help-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.help-dialog__header h2 {
  font-size: 1rem;
  line-height: 1.35;
}

.help-dialog p {
  font-size: 0.9rem;
  line-height: 1.55;
}

.help-dialog p + p { margin-top: 0.7rem; }

.help-dialog__important {
  margin-top: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-left: 3px solid #d97706;
  background: #fffbeb;
}

.help-dialog__close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.help-dialog__close:hover { background: #e5e7eb; }

/* ── Outputs grid ── */
#outputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
}

/* ── Section dividers inside grid ── */
.section-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
  border-bottom: 1.5px solid #e5e7eb;
  margin-top: 0.4rem;
  border-radius: 4px 4px 0 0;
}

.section-header:first-child { margin-top: 0; }

/* Section color themes */
.section-header--h1      { color: #6d28d9; background: #f5f3ff; border-bottom-color: #c4b5fd; }
.section-header--desktop { color: #1d4ed8; background: #eff6ff; border-bottom-color: #93c5fd; }
.section-header--mobile  { color: #0f766e; background: #f0fdfa; border-bottom-color: #5eead4; }
.section-header--links   { color: #b45309; background: #fffbeb; border-bottom-color: #fcd34d; }
.section-header--anchors { color: #c2410c; background: #fff7ed; border-bottom-color: #fdba74; }

/* Panel accent borders */
.panel--h1      { border-left: 3px solid #7c3aed; }
.panel--desktop { border-left: 3px solid #2563eb; }
.panel--mobile  { border-left: 3px solid #0d9488; }
.panel--links   { border-left: 3px solid #d97706; }
.panel--anchors { border-left: 3px solid #ea580c; }

/* ── Panels ── */
.panel {
  background: #fff;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow 0.2s;
  min-width: 0;
}

.panel:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

.panel h3 {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #374151;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.panel h3 small {
  font-size: 0.72rem;
  font-weight: 400;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel--full { grid-column: 1 / -1; }
.panel--half { grid-column: span 1; }

/* ── Text output ── */
.text-output {
  white-space: pre-wrap;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #374151;
  max-height: 280px;
  overflow-y: auto;
}

.text-output + .text-output { margin-top: 0.5rem; }

/* ── Status badges ── */
.status-ok      { color: #16a34a; font-weight: 700; }
.status-fail    { color: #dc2626; font-weight: 700; }
.status-partial { color: #d97706; font-weight: 700; }

/* ── Word diff output (text reading) ── */
.diff-line {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  margin-bottom: 0.55rem;
  white-space: normal;
}

.diff-line--ok { opacity: 0.7; }
.diff-line--missing,
.diff-line--partial { opacity: 1; }

.diff-badge {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 4px;
  padding: 0.08rem 0.3rem;
  margin: 0 0.2rem;
  vertical-align: baseline;
}

.diff-badge--missing {
  color: #991b1b;
  background: #fee2e2;
}

.diff-badge--partial {
  color: #92400e;
  background: #fef3c7;
}

.diff-meta {
  color: #6b7280;
  font-size: 0.72rem;
}

.diff-row {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  margin-top: 0.15rem;
  padding-left: 1.1rem;
}

.diff-label {
  min-width: 1.7rem;
  color: #6b7280;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.diff-row--co .diff-text { color: #7f1d1d; }
.diff-row--cp .diff-text { color: #14532d; }

mark.diff-del {
  background: #fecaca;
  color: #7f1d1d;
  border-radius: 2px;
  padding: 0 2px;
}

mark.diff-ins {
  background: #bbf7d0;
  color: #14532d;
  border-radius: 2px;
  padding: 0 2px;
}

/* ── H1 panel ── */
.h1-panel .h1-summary {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.h1-panel .h1-details {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.6;
}

/* ── Links table ── */
.anchors-panel { overflow-x: auto; }
#anchors-output { overflow-x: auto; }

.anchors-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.81rem;
}

.anchors-table th,
.anchors-table td {
  border: 1px solid #e5e7eb;
  padding: 0.4rem 0.55rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Compact variant for anchor validation results */
.anchors-table--sm th,
.anchors-table--sm td {
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
}

.anchors-table thead {
  position: sticky;
  top: 0;
}

.anchors-table th {
  background: #f8f9fb;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.anchors-table tbody tr:nth-child(even) { background: #fafafa; }
.anchors-table tbody tr:hover { background: #eff6ff; }

.anchors-table th:nth-child(1),
.anchors-table td:nth-child(1) {
  width: 3rem;
  text-align: center;
  color: #9ca3af;
}

.anchors-table th:nth-child(4),
.anchors-table td:nth-child(4) {
  width: 3.5rem;
  text-align: center;
}

.anchors-table th:last-child,
.anchors-table td:last-child {
  width: 5rem;
  text-align: center;
}

.anchors-url a { color: #2563eb; text-decoration: none; }
.anchors-url a:hover { text-decoration: underline; }
.anchors-url, .anchors-url a { word-break: break-word; overflow-wrap: anywhere; }

.images-panel { overflow-x: auto; }
.image-results-table { min-width: 900px; }
.image-results-table caption {
  caption-side: top;
  padding: 0.6rem;
  color: #374151;
  font-weight: 700;
  text-align: left;
}
.image-results-table th:nth-child(2),
.image-results-table td:nth-child(2) { width: 38%; }
.image-results-table th:nth-child(3),
.image-results-table td:nth-child(3) { width: 7rem; text-align: center; }
.image-results-table th:nth-child(4),
.image-results-table td:nth-child(4),
.image-results-table th:nth-child(5),
.image-results-table td:nth-child(5) { width: 22%; text-align: left; }
.image-url a { color: #2563eb; text-decoration: none; overflow-wrap: anywhere; }
.image-url a:hover { text-decoration: underline; }
.image-ddc-yes { color: #15803d; font-weight: 700; }
.image-ddc-no { color: #b91c1c; font-weight: 700; }
.image-field-pass,
.image-status-pass { color: #15803d; font-weight: 700; }
.image-field-fail,
.image-status-fail { color: #b91c1c; font-weight: 700; }

.link-check-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.link-check-btn:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #312e81;
}

.link-find-hit {
  outline: 2px solid #f59e0b;
  outline-offset: -2px;
  background: #fffbeb !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-main { padding: 1rem 1rem 2rem calc(64px + 2rem); }
  body.action-nav-expanded .app-main { padding-left: calc(224px + 2rem); }
  .app-main.app-main--todo-open {
    display: block;
  }
  .app-main.app-main--todo-open > .todo-panel {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 1rem;
  }
  #outputs { grid-template-columns: 1fr; }
  .panel--full, .panel--half { grid-column: 1; }
  .todo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar__title { font-size: 0.9rem; }
  .ctrl-btn { padding: 0.25rem 0.5rem; font-size: 0.7rem; }
  .topbar__user { display: none; }
  .topbar__auth { margin-left: 0.4rem; padding-left: 0.4rem; }
}