:root {
  --ink: #1F2937;
  --muted: #667085;
  --line: #D0D5DD;
  --soft-line: #E7E9ED;
  --page: #F3F4F6;
  --panel: #FFFFFF;
  --success: #18864B;
  --warning: #B54708;
  --danger: #B42318;
  --shadow: 0 16px 44px rgba(16, 24, 40, 0.10);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { min-width: 320px; margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--page); color: var(--ink); }
button, input { font: inherit; }
button, a, input { outline-offset: 3px; }

.site-header { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand, .back-link { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); font-weight: 700; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--navy); color: var(--ivory); font-size: 12px; letter-spacing: .06em; }
.back-link { color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--ink); }

main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 88px; }
.intro { max-width: 900px; margin-bottom: 42px; }
.eyebrow, .step-label { margin: 0; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 10px 0 16px; color: var(--navy); font-size: clamp(48px, 7vw, 76px); line-height: 1; letter-spacing: -.045em; }
.intro-copy { max-width: 820px; margin: 0; color: #475467; font-size: 19px; line-height: 1.6; }
.project-facts { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 9px; }
.project-facts span { padding: 7px 10px; border: 1px solid var(--blue-border); border-radius: 999px; background: var(--blue-soft); color: var(--blue-text); font-size: 12px; font-weight: 700; }
.privacy-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; }

.workspace { display: grid; gap: 28px; }
.card { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.queue-panel, .output-panel, .recording { overflow: hidden; border-radius: 12px; }
.panel-heading { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--soft-line); }
.panel-heading h2, .run-heading h2, .recording h2 { margin: 5px 0 0; color: var(--navy); font-size: 22px; }
.panel-heading p:last-child, .recording > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.queue-table-wrap, .results-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.queue-table { min-width: 700px; }
.results-table { min-width: 980px; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line); background: #F8F9FA; color: #475467; font-size: 11px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 9px 12px; border-bottom: 1px solid var(--soft-line); color: #344054; font-size: 13px; }
.queue-table td:first-child { width: 112px; }
.queue-table td:last-child { width: 52px; }
.queue-table input { width: 100%; min-width: 170px; height: 38px; padding: 0 9px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink); }
.queue-table input:hover { border-color: var(--line); }
.queue-table input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-ring); }
.row-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.row-status::before { width: 7px; height: 7px; border-radius: 50%; background: #98A2B3; content: ""; }
tr.processing .row-status { color: var(--blue); }
tr.processing .row-status::before { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
tr.complete .row-status { color: var(--success); }
tr.complete .row-status::before { background: var(--success); }
.remove-row { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: #98A2B3; cursor: pointer; font-size: 18px; }
.remove-row:hover { background: #FEF3F2; color: var(--danger); }

.queue-actions { padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #F8F9FA; }
.queue-actions > div:first-child { display: grid; gap: 3px; }
.queue-actions strong { color: #344054; font-size: 13px; }
.queue-actions span { color: var(--muted); font-size: 12px; }
.button-row { display: flex; gap: 10px; }
.button { min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-weight: 700; }
.button:disabled { cursor: wait; opacity: .58; }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-secondary { border-color: var(--line); background: white; color: #344054; }
.button-secondary:hover:not(:disabled) { background: #F8F9FA; }

.run-panel { overflow: hidden; border-radius: 4px; }
.app-bar { min-height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 4px solid var(--blue); }
.app-title { display: flex; align-items: center; gap: 12px; }
.app-title div { display: grid; gap: 2px; }
.app-title strong { color: #1D2939; font-size: 15px; }
.app-title div span { color: var(--muted); font-size: 12px; }
.app-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px; background: var(--blue); color: white; font-size: 12px; font-weight: 700; }
.environment { padding: 4px 8px; border: 1px solid var(--blue-border); border-radius: 3px; background: var(--blue-soft); color: var(--blue-text); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.run-heading { padding: 20px 24px 14px; display: flex; align-items: end; justify-content: space-between; gap: 20px; background: #FAFAFA; }
.run-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #98A2B3; }
.status-dot.running { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.status-dot.complete { background: var(--success); }
.progress-track { height: 4px; background: #E4E7EC; }
.progress-fill { width: 0; height: 100%; background: var(--blue); transition: width 180ms ease; }

.run-body { min-height: 420px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.directory { min-width: 0; border-right: 1px solid var(--soft-line); background: #F8FAFC; }
.directory-header { min-height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--soft-line); background: white; }
.directory-logo { color: var(--blue); font-size: 14px; font-weight: 700; }
#active-query { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.directory-results { padding: 16px; display: grid; align-content: start; gap: 10px; }
.empty-state { min-height: 335px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); text-align: center; }
.empty-state span { font-size: 42px; }
.empty-state p { max-width: 260px; margin: 0; font-size: 13px; line-height: 1.5; }
.business-card { padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 7px 18px; border: 1px solid var(--line); border-radius: 7px; background: white; opacity: 0; transform: translateY(5px); animation: reveal 220ms ease forwards; }
.business-card strong { color: #1D2939; font-size: 14px; }
.business-card .category, .business-card .meta { color: var(--muted); font-size: 12px; }
.business-card .rating { color: var(--warning); font-size: 12px; font-weight: 700; }
.business-card .meta { grid-column: 1 / -1; }
.activity-panel { padding: 18px; background: white; }
.activity-panel h3 { margin: 0 0 14px; color: #344054; font-size: 13px; }
.activity-panel ol { max-height: 360px; margin: 0; padding: 0; display: grid; gap: 12px; overflow-y: auto; list-style: none; }
.activity-panel li { padding-left: 12px; border-left: 2px solid #D0D5DD; }
.activity-panel li.active { border-left-color: var(--blue); }
.activity-panel li.success { border-left-color: var(--success); }
.log-time { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.activity-panel p { margin: 3px 0 0; color: #475467; font-size: 12px; line-height: 1.45; }

.sheet-status { padding: 6px 9px; border-radius: 4px; background: #F2F4F7; color: var(--muted); font-size: 12px; font-weight: 700; }
.sheet-status.complete { background: #ECFDF3; color: var(--success); }
.empty-row td { padding: 32px 16px; color: var(--muted); text-align: center; }

.recording { margin-top: 28px; padding: 24px; display: grid; grid-template-columns: minmax(240px, .45fr) minmax(0, 1fr); align-items: center; gap: 30px; }
.demo-video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 6px; background: #111; }
footer { padding: 0 24px 40px; color: var(--muted); font-size: 12px; text-align: center; }
footer p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .run-body { grid-template-columns: 1fr; }
  .directory { border-right: 0; border-bottom: 1px solid var(--soft-line); }
  .activity-panel ol { max-height: 240px; }
}

@media (max-width: 700px) {
  .site-header, main { width: min(100% - 28px, 1440px); }
  main { padding: 38px 0 64px; }
  .panel-heading, .queue-actions, .run-heading { align-items: stretch; flex-direction: column; }
  .button-row { display: grid; grid-template-columns: 1fr 1fr; }
  .recording { grid-template-columns: 1fr; padding: 18px; }
  .app-bar, .run-heading { padding-left: 16px; padding-right: 16px; }
  .environment { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* Compact composition used only by the automated portfolio recording. */
html.recording-mode .site-header,
html.recording-mode .intro,
html.recording-mode .recording,
html.recording-mode footer {
  display: none;
}

html.recording-mode body {
  background: #E9EDF3;
}

html.recording-mode main {
  width: calc(100% - 28px);
  max-width: none;
  padding: 14px 0;
}

html.recording-mode .workspace {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

html.recording-mode .queue-panel {
  grid-column: 1 / -1;
}

html.recording-mode .queue-table-wrap,
html.recording-mode #add-search,
html.recording-mode #reset-demo,
html.recording-mode .queue-panel .panel-heading p:last-child {
  display: none;
}

html.recording-mode .queue-panel .panel-heading {
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 0;
}

html.recording-mode .queue-panel .panel-heading h2 {
  font-size: 18px;
}

html.recording-mode .queue-actions {
  min-height: 48px;
  padding: 7px 18px;
  border-top: 1px solid var(--soft-line);
}

html.recording-mode .run-panel,
html.recording-mode .output-panel {
  height: 754px;
}

html.recording-mode .run-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

html.recording-mode .app-bar {
  min-height: 54px;
  padding: 0 16px;
}

html.recording-mode .run-heading {
  padding: 13px 16px 10px;
}

html.recording-mode .run-heading h2 {
  font-size: 18px;
}

html.recording-mode .run-body {
  min-height: 0;
  flex: 1;
  grid-template-columns: 1fr;
}

html.recording-mode .directory {
  border-right: 0;
}

html.recording-mode .activity-panel {
  display: none;
}

html.recording-mode .directory-results {
  padding: 12px;
}

html.recording-mode .business-card {
  padding: 12px;
}

html.recording-mode .output-panel {
  min-width: 0;
  overflow: hidden;
}

html.recording-mode .output-panel .panel-heading {
  min-height: 82px;
  padding: 13px 16px;
}

html.recording-mode .output-panel .panel-heading h2 {
  font-size: 18px;
}

html.recording-mode .output-panel .panel-heading p:last-child {
  margin-top: 3px;
  font-size: 11px;
}

html.recording-mode .results-table-wrap {
  height: calc(100% - 82px);
  overflow: hidden;
}

html.recording-mode .results-table {
  min-width: 0;
  table-layout: fixed;
}

html.recording-mode .results-table th,
html.recording-mode .results-table td {
  padding: 8px 7px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.recording-mode .results-table th {
  font-size: 9px;
}

html.recording-mode .results-table th:nth-child(1),
html.recording-mode .results-table td:nth-child(1) { width: 23%; }
html.recording-mode .results-table th:nth-child(2),
html.recording-mode .results-table td:nth-child(2) { width: 17%; }
html.recording-mode .results-table th:nth-child(3),
html.recording-mode .results-table td:nth-child(3) { width: 12%; }
html.recording-mode .results-table th:nth-child(4),
html.recording-mode .results-table td:nth-child(4) { width: 16%; }
html.recording-mode .results-table th:nth-child(5),
html.recording-mode .results-table td:nth-child(5) { width: 10%; }
html.recording-mode .results-table th:nth-child(6),
html.recording-mode .results-table td:nth-child(6) { width: 22%; }

html.recording-mode .empty-row td {
  padding: 32px 16px;
  white-space: normal;
}
