:root {
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --bg-elev-2: #eef1f5;
  --panel: #ffffff;
  --ink: #1a2233;
  --ink-dim: #4a5468;
  --muted: #6b7689;
  --line: #e1e6ed;
  --line-strong: #c8d0db;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #e0ecff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --mono: "JetBrains Mono", "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  --sidebar-w: 220px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 38%),
    var(--bg);
}

.auth-card {
  width: min(100%, 420px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(26, 34, 51, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-brand div {
  display: grid;
  gap: 3px;
}

.auth-brand strong {
  font-size: 20px;
}

.auth-brand small,
.auth-hint {
  color: var(--muted);
}

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

.auth-form .primary {
  width: 100%;
  padding: 11px 16px;
}

/* ---------- 整體佈局 ---------- */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- 側邊欄 ---------- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidenav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--ink-dim);
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.sidenav-item:hover {
  background: var(--bg-elev-2);
  color: var(--ink);
}

.sidenav-item.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.sidenav-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.current-user {
  display: grid;
  gap: 2px;
}

.current-user strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user span {
  color: var(--muted);
  font: 11px var(--mono);
  text-transform: uppercase;
}

.health {
  font-size: 13px;
  color: var(--success);
  font-family: var(--mono);
}

.health.running {
  color: var(--warning);
}

/* ---------- 工作區 ---------- */

.workspace {
  flex: 1;
  padding: 28px 32px;
  overflow: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-head {
  margin-bottom: 22px;
}

.view-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.view-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- OCR 錯誤訓練樣本 ---------- */

.ocr-training-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.ocr-training-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ocr-training-stat {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.ocr-training-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ocr-training-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 28px;
}

.ocr-training-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px) minmax(150px, 220px);
  gap: 12px;
  align-items: end;
  margin-bottom: 4px;
}

.ocr-training-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ocr-training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.ocr-training-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  box-shadow: 0 8px 24px rgba(18, 25, 38, 0.05);
}

.ocr-training-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  cursor: zoom-in;
}

.ocr-training-preview:hover {
  background: #f8fafc;
}

.ocr-training-preview img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(45deg, #eef1f5 25%, transparent 25%),
    linear-gradient(-45deg, #eef1f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1f5 75%),
    linear-gradient(-45deg, transparent 75%, #eef1f5 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.ocr-training-card-body {
  padding: 14px;
}

.ocr-training-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ocr-training-card-title strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
}

.ocr-platform-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.ocr-platform-badge.web {
  background: #e0f2fe;
  color: #0369a1;
}

.ocr-platform-badge.consultant {
  background: #ede9fe;
  color: #6d28d9;
}

.ocr-reason {
  display: inline-block;
  margin-top: 9px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.ocr-training-card dl {
  display: grid;
  gap: 5px;
  margin: 12px 0;
}

.ocr-training-card dl div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  font-size: 11px;
}

.ocr-training-card dt {
  color: var(--muted);
}

.ocr-training-card dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-dim);
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocr-open-run {
  width: 100%;
}

.ocr-training-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 36px 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- 按鈕 ---------- */

button {
  border: 0;
  border-radius: 8px;
  background: var(--bg-elev-2);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

button:hover {
  background: var(--line);
}

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

button.primary {
  background: var(--accent);
  color: white;
}

button.primary:hover {
  background: var(--accent-dark);
}

button.danger-btn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

button.danger-btn:hover {
  background: #fecaca;
}

button.primary.big {
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  margin-top: 14px;
}

select,
input {
  font: inherit;
}

input[type="text"],
input[type="search"],
input[type="password"],
input:not([type]) {
  appearance: none;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 15px;
  font-family: var(--mono);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 24px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input[type="text"]:hover,
input[type="search"]:hover,
input[type="password"]:hover,
input:not([type]):hover {
  border-color: #9db5e9;
}

input[type="text"]::placeholder,
input[type="search"]::placeholder,
input[type="password"]::placeholder,
input:not([type])::placeholder {
  color: #8a94a6;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input:not([type]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 0 0 4px rgba(37, 99, 235, 0.14),
    0 14px 30px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 241, 245, 0.96)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.25L7 8.75L10.5 5.25' stroke='%234a5468' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
  color: var(--ink);
  padding: 11px 42px 11px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

select:hover {
  border-color: var(--accent);
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.ghost-btn:hover {
  background: var(--bg-elev-2);
  color: var(--ink);
}

.ghost-btn.small {
  padding: 4px 10px;
  font-size: 12px;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.badge {
  background: var(--bg-elev-2);
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 500;
}

/* ---------- 執行視圖 ---------- */

.view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field span {
  font-weight: 500;
}

.field.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

.field.check input {
  width: auto;
  margin: 0;
  width: 18px;
  height: 18px;
}

.field.check.nested {
  margin-left: 28px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  color: var(--ink-dim);
  font-size: 14px;
}

.field.check.hidden {
  display: none;
}

.status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
  font-family: var(--mono);
}

.run-config-link-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.playwright-panel-head {
  margin-bottom: 12px;
}

.playwright-view-card {
  max-width: 1080px;
}

.playwright-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.playwright-status {
  display: grid;
  gap: 10px;
}

.playwright-source {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
}

.playwright-source.unavailable {
  border-color: #fecaca;
  background: #fef2f2;
}

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

.playwright-run + .playwright-run {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.playwright-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  word-break: break-all;
}

.status-warn {
  margin-top: 8px;
  font-size: 12px;
  color: var(--warning);
  font-family: var(--mono);
}

.status-error {
  margin: 0;
  color: var(--danger);
  font-family: var(--mono);
}

.run-config-link-panel .hidden {
  display: none;
}

.run-config-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.run-config-link-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.run-config-link-path {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  word-break: break-all;
}

.run-config-link-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.run-config-link-field {
  flex: 1;
  margin: 0;
}

.run-config-link-field select {
  width: 100%;
}

.run-config-form-placeholder {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--bg);
  font-size: 13px;
}

.run-config-form {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 246, 248, 0.96));
}

.run-config-form-head {
  margin-bottom: 16px;
}

.card-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.config-sections {
  display: grid;
  gap: 16px;
}

.config-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.config-section h3 {
  margin-top: 0;
}

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

.config-form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.binding-platform-label > span {
  font-weight: 500;
}

.binding-custom-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.binding-custom-label {
  font-size: 0.875rem;
  color: var(--ink-dim);
  font-weight: 500;
}

.binding-custom-fields {
  display: flex;
  gap: 8px;
}

.binding-custom-fields select {
  flex: 1;
  min-width: 0;
}

.alias-control {
  display: flex;
  gap: 6px;
  align-items: center;
}

.alias-control select,
.alias-control input {
  flex: 1;
  min-width: 0;
}

/* ---------- 帳號與平台頁面佈局 ---------- */

.accounts-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  align-items: start;
}

.accounts-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.accounts-panel-pool {
  border-top: 3px solid var(--accent);
}

.accounts-panel-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.accounts-panel-head h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.accounts-panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.accounts-env-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.accounts-env-select {
  font-size: 0.875rem;
}

.accounts-env-meta {
  padding: 12px;
  background: var(--bg-elev-2);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.accounts-section-head {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.accounts-section-head--accounts {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.accounts-section-hint {
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

/* 平台列表 */
.accounts-platforms-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accounts-platform-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-elev-2);
}

.accounts-platform-name {
  font-size: 0.9rem;
  color: var(--accent);
}

/* 帳號池 */
.accounts-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.accounts-alias-input {
  flex: 1;
  min-width: 0;
}

.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accounts-list-empty {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.accounts-account-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg-elev-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accounts-account-row--inherited {
  background: var(--bg);
  border-color: var(--line);
  opacity: 0.75;
}

.accounts-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.accounts-account-actions {
  display: flex;
  gap: 6px;
}

.accounts-account-alias {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.accounts-account-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.accounts-account-fields--dim input {
  color: var(--muted);
  background: var(--bg);
  cursor: not-allowed;
}

/* pill badges */
.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.6;
}

.pill-default {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.pill-inherited {
  background: var(--bg-elev-2);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}

.pill-override {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.config-form-grid.one-col {
  grid-template-columns: 1fr;
}

/* ---------- 目標樹 ---------- */

.targets-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.targets-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.94));
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  min-width: min(100%, 360px);
}

.targets-search-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-left: 10px;
}

.targets-search input {
  flex: 1;
  min-width: 180px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 10px 12px 10px 0;
  font-size: 13px;
}

.targets-search input::placeholder {
  color: var(--muted);
}

.targets-search input:hover,
.targets-search input:focus {
  border: 0;
  box-shadow: none;
  transform: none;
}

.targets-toolbar button {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
}

.targets-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.targets-hint code {
  font-family: var(--mono);
  color: var(--accent-dark);
}

.targets-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 500;
}

.targets-toggle input[type="checkbox"] {
  flex-shrink: 0;
}

.targets-settings-dialog {
  width: min(820px, calc(100vw - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
}

.targets-settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.targets-settings-shell {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.targets-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.targets-settings-head h2 {
  margin: 0;
  font-size: 20px;
}

.targets-settings-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.targets-settings-toolbar,
.targets-settings-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.targets-settings-actions {
  justify-content: flex-end;
}

.targets-settings-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-height: min(60vh, 640px);
  overflow: auto;
  padding-right: 4px;
}

.targets-settings-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.96));
}

.targets-settings-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.targets-settings-meta strong {
  display: block;
  font-size: 14px;
  word-break: break-all;
}

.targets-settings-meta span {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.targets-settings-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.targets-settings-order {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.targets-settings-order input {
  width: 92px;
}

.targets-settings-hidden {
  white-space: nowrap;
}

.sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}

.targets-tree {
  max-height: calc(100vh - 360px);
  min-height: 360px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 6px;
  font-family: var(--mono);
  font-size: 14px;
}

.targets-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.target-file {
  border-radius: 6px;
}

.target-file + .target-file {
  margin-top: 4px;
}

.target-file-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
}

.target-file-head:hover {
  background: var(--bg-elev-2);
}

.target-toggle {
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.target-toggle:hover {
  background: var(--line);
  color: var(--ink);
}

.target-toggle:disabled {
  visibility: hidden;
}

.target-file-label {
  flex: 1;
  color: var(--ink);
  word-break: break-all;
  font-size: 14px;
  font-weight: 500;
}

.target-file-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-elev-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 500;
}

.target-file-match {
  font-size: 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
}

.target-test-list {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px 36px;
}

.target-test-list li {
  padding: 2px 0;
}

.target-test-item {
  padding: 4px 0 6px;
  border-radius: 6px;
}

.target-test-list label,
.target-test-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.target-test-list label:hover,
.target-test-label:hover {
  background: var(--bg-elev-2);
  color: var(--ink);
}

.target-test-name {
  font-weight: 500;
  color: var(--ink);
  font-family: var(--mono);
}

.target-test-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfccb;
  border: 1px solid #bef264;
  color: #3f6212;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.target-test-badge--tag {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.target-test-badge--public {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.target-test-badge--private {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.run-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

.target-test-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.target-test-label-row .target-test-label {
  flex: 1;
  min-width: 0;
}

.tag-edit-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
}

.target-test-item:hover .tag-edit-btn {
  opacity: 1;
}

.tag-edit-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #4338ca;
  opacity: 1;
}

.visibility-toggle-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
}

.target-test-item:hover .visibility-toggle-btn,
.visibility-toggle-btn:focus-visible {
  opacity: 1;
}

.visibility-toggle-btn:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
  opacity: 1;
}

.tag-editor {
  margin: 6px 0 6px 28px;
  padding: 10px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #f5f7ff;
}

.tag-editor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 8px;
}

.tag-editor-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 500;
}

.tag-editor-chip-remove {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tag-editor-chip-remove:hover {
  background: #93c5fd;
}

.tag-editor-add-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tag-editor-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #a5b4fc;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

.tag-editor-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px #e0e7ff;
}

.tag-editor-add-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #a5b4fc;
  border-radius: 6px;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.tag-editor-add-btn:hover {
  background: #c7d2fe;
}

.tag-editor-actions {
  display: flex;
  gap: 8px;
}

.tag-editor-save {
  height: 28px;
  padding: 0 14px;
  font-size: 13px;
}

.tag-editor-cancel {
  height: 28px;
  padding: 0 12px;
  font-size: 13px;
}

.target-test-doc {
  margin: 2px 0 4px 30px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-elev-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  white-space: pre-wrap;
  line-height: 1.55;
}

.target-test-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

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

/* ---------- 紀錄視圖 ---------- */

.runs-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.runs-sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 20px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
  min-width: 0;
}

.runs-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  min-height: 360px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
  min-width: 0;
  overflow: hidden;
}

.detail-filled {
  display: block;
}

.run-detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  font-family: var(--mono);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 4px;
}

.table-wrap table {
  min-width: 920px;
  table-layout: fixed;
}

.table-wrap td:first-child {
  word-break: break-all;
  width: 34%;
}

.table-wrap td:last-child,
.table-wrap .error-detail {
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.55;
}

.error-detail {
  vertical-align: top;
}

.error-preview {
  display: block;
  max-height: 4.8em;
  overflow: hidden;
  white-space: pre-wrap;
}

.error-expand-trigger {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  font-size: 12px;
}

.error-expand-trigger:hover {
  background: rgba(220, 38, 38, 0.14);
}

.error-dialog[hidden] {
  display: none;
}

.error-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.error-dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 12, 20, 0.74);
}

.error-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 1120px);
  max-height: 86vh;
  margin: 7vh auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

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

.error-dialog-head h3 {
  margin: 0;
  color: var(--ink);
}

.error-dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
  font-size: 24px;
  line-height: 1;
}

.error-dialog-content {
  margin: 0;
  border: 0;
  border-radius: 0;
  max-height: none;
  flex: 1;
  min-height: 320px;
  white-space: pre-wrap;
  overflow: auto;
  color: var(--danger);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.runs-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.runs-filters input,
.runs-filters select {
  width: 100%;
  font-size: 13px;
}

.runs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 300px);
  overflow: auto;
}

.runs-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 4px;
  margin: 0;
}

.run-card {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.run-card:hover {
  background: var(--bg-elev-2);
}

.run-card.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.run-card strong {
  font-weight: 600;
  font-size: 13px;
  display: block;
  margin-bottom: 6px;
}

.run-card-main {
  text-align: left;
  padding: 2px 4px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  width: 100%;
  color: var(--ink);
}

.run-card-main:hover {
  background: transparent;
}

.run-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.run-card-header strong {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.run-card-targets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.run-card-target {
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.run-card-target em {
  font-style: normal;
  color: var(--muted);
}

.run-rerun-btn {
  white-space: nowrap;
  align-self: center;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.05);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.run-rerun-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.detail.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  min-height: 280px;
  font-size: 15px;
}

/* ---------- 狀態 pill ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.passed {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.pill.failed,
.pill.error {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.pill.running,
.pill.starting,
.pill.queued {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}

.pill.skipped {
  background: rgba(107, 118, 137, 0.12);
  color: var(--muted);
}

/* ---------- 結果摘要 ---------- */

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
}

.metric span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.metric strong {
  display: block;
  font-size: 26px;
  margin-top: 6px;
  font-family: var(--mono);
  color: var(--ink);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--mono);
}

th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
  vertical-align: top;
}

.artifact-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
}

.artifact-section-header h3 {
  margin: 0 0 4px;
}

.artifact-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.artifact-download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.artifact-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-dim);
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.artifact-download-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.artifact-download-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.artifact-download-btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.artifact-download-btn-primary:hover {
  background: var(--accent-hover, var(--accent));
  color: white;
}

.artifact-download-btn-primary span {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

@media (max-width: 760px) {
  .artifact-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .artifact-download-actions {
    justify-content: stretch;
  }

  .artifact-download-btn {
    flex: 1 1 180px;
    justify-content: center;
  }
}

.artifact-grid figure {
  margin: 0;
}

.artifact-card {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(18, 25, 38, 0.04);
}

.artifact-card-report {
  grid-column: 1 / -1;
}

.artifact-grid figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  font-family: var(--mono);
  word-break: break-all;
}

.artifact-zoom-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.artifact-zoom-trigger:hover {
  background: transparent;
}

.artifact-grid img,
.artifact-grid video,
.artifact-grid iframe {
  width: 100%;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}

.artifact-grid img,
.artifact-grid video {
  height: 260px;
  object-fit: contain;
  display: block;
}

.artifact-grid iframe {
  min-height: 520px;
}

.artifact-lightbox[hidden] {
  display: none;
}

.artifact-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.artifact-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 12, 20, 0.82);
}

.artifact-lightbox-backdrop:hover {
  background: rgba(8, 12, 20, 0.82);
}

.artifact-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 1440px);
  max-height: 92vh;
  margin: 4vh auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.artifact-lightbox-image {
  width: 100%;
  max-height: calc(92vh - 56px);
  object-fit: contain;
  border-radius: 12px;
  background: #111827;
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.35);
}

.artifact-lightbox-caption {
  margin-top: 10px;
  color: #f4f7fb;
  font: 12px/1.5 var(--mono);
  word-break: break-all;
  text-align: center;
}

.artifact-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.56);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  padding: 0;
  z-index: 2;
}

.artifact-lightbox-nav:hover {
  background: rgba(15, 23, 42, 0.78);
}

.artifact-lightbox-prev {
  left: 18px;
}

.artifact-lightbox-next {
  right: 18px;
}

.artifact-lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 768px) {
  .artifact-lightbox-dialog {
    width: min(96vw, 1440px);
    margin: 2vh auto;
  }

  .artifact-lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }

  .artifact-lightbox-prev {
    left: 8px;
  }

  .artifact-lightbox-next {
    right: 8px;
  }
}

body.lightbox-open {
  overflow: hidden;
}

pre {
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8f9fb;
  color: #1a2233;
  overflow: auto;
  max-height: 360px;
  font: 13px/1.6 var(--mono);
}

h3 {
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- 設定檔視圖 ---------- */

.config-card textarea {
  width: 100%;
  min-height: calc(100vh - 320px);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  font: 14px/1.6 var(--mono);
  resize: vertical;
}

.config-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tabs button {
  background: var(--bg-elev-2);
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--mono);
}

.tabs button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.members-panel {
  margin-top: 16px;
}

.member-controls {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.audit-list {
  display: grid;
}

.audit-row {
  display: grid;
  grid-template-columns: 170px 140px minmax(220px, 1fr) 50px;
  gap: 12px;
  align-items: center;
  padding: 10px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.audit-row:first-child {
  border-top: 0;
}

/* ---------- RWD ---------- */

@media (max-width: 1100px) {
  .view-grid {
    grid-template-columns: 1fr;
  }
  .accounts-layout {
    grid-template-columns: 1fr;
  }
  .accounts-account-fields {
    grid-template-columns: 1fr;
  }
  .runs-layout {
    grid-template-columns: 1fr;
  }
  .runs-sidebar {
    position: static;
  }
  .targets-search {
    width: 100%;
  }
  .targets-search input {
    min-width: 0;
  }
  .targets-settings-row {
    flex-direction: column;
    align-items: stretch;
  }
  .targets-settings-controls {
    justify-content: space-between;
  }
  .ocr-training-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .ocr-training-search {
    grid-column: 1 / -1;
  }
  .member-controls,
  .audit-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 64px;
  }
  .sidebar {
    padding: 16px 8px;
  }
  .brand-name,
  .sidenav-item span:not(.sidenav-icon),
  .sidebar-footer .ghost-btn,
  .health,
  .current-user {
    display: none;
  }
  .sidenav-item {
    justify-content: center;
    padding: 12px 0;
  }
  .workspace {
    padding: 20px;
  }
  .ocr-training-head {
    align-items: stretch;
    flex-direction: column;
  }
  .ocr-training-summary,
  .ocr-training-toolbar {
    grid-template-columns: 1fr;
  }
  .ocr-training-search {
    grid-column: auto;
  }
  .run-config-link-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .run-config-link-controls {
    flex-direction: column;
    align-items: stretch;
  }
}
