:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  color: #18312a;
  background: #f4f6f2;
  font-synthesis: none;
  --ink: #18312a;
  --muted: #53645c;
  --line: #dce5db;
  --sidebar: #112d25;
  --accent: #d5f89d;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #4e874f; outline-offset: 3px; }
.layout { display: grid; grid-template-columns: 223px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 45px; padding: 31px 19px 22px; background: var(--sidebar); color: #f5f8ef; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; margin: 0 10px; gap: 12px; font-size: 29px; font-weight: 800; letter-spacing: -.075em; line-height: .95; text-decoration: none; }
.brand-period { color: var(--accent); }
.brand small { display: block; margin-top: 7px; font-size: 11px; font-weight: 600; letter-spacing: .025em; color: #bfd0c4; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: repeat(2, 10px); grid-template-rows: repeat(2, 10px); gap: 3px; place-content: center; border-radius: 11px; background: var(--accent); }
.brand-mark i { display: block; background: var(--sidebar); border-radius: 7px 7px 2px 7px; }
.brand-mark i:nth-child(2) { transform: rotate(90deg); }
.brand-mark i:nth-child(3) { transform: rotate(-90deg); }
.brand-mark i:nth-child(4) { transform: rotate(180deg); }
nav { display: grid; gap: 5px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 8px; color: #d7e5da; font-weight: 600; font-size: 14px; text-decoration: none; }
nav a:hover, nav a:focus-visible { background: #244337; color: white; }
nav a span { color: #bde490; width: 18px; font-size: 18px; line-height: 1; text-align: center; }
.worker-card { margin-top: auto; padding: 13px; color: #bacdc1; border: 1px solid #37554a; border-radius: 10px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.worker-title { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-weight: 650; color: #f4fbf0; font-size: 13px; }
.worker-dot, .metric i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: #839c8d; }
.worker-dot.idle, .worker-dot.running { background: #bfe992; box-shadow: 0 0 0 3px #bfe99224; }
.worker-dot.unavailable { background: #ffc083; }
main { width: 100%; max-width: 1400px; padding: 49px clamp(24px, 4vw, 62px) 58px; }
h1, h2, h3, p { margin: 0; }
.page-header { margin-bottom: 25px; }
h1 { font-size: clamp(34px, 4vw, 47px); line-height: 1.07; letter-spacing: -.06em; }
.page-header p { margin-top: 9px; color: var(--muted); font-size: 15px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.metric { padding: 17px 21px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfdfa; }
.metric span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.metric strong { display: block; margin-top: 3px; font-size: 32px; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric .queue-dot { background: #ac7d2b; }
.metric .running-dot { background: #487faf; }
.metric .complete-dot { background: #509250; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 4px #19372404; }
.card h2 { font-size: 21px; font-weight: 750; letter-spacing: -.035em; }
.new-crawl { padding: 21px 23px; margin-bottom: 19px; scroll-margin-top: 14px; }
form { display: grid; grid-template-columns: 1.25fr 1fr auto; align-items: end; gap: 13px; margin-top: 15px; }
label { display: grid; min-width: 0; gap: 6px; font-size: 13px; font-weight: 700; }
input, select { width: 100%; min-width: 0; min-height: 44px; padding: 0 11px; border: 1px solid #cfdad0; border-radius: 8px; color: var(--ink); background: #fcfdfb; font-size: 14px; font-weight: 500; }
input::placeholder { color: #637268; opacity: 1; }
.primary, .secondary { min-height: 44px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 750; }
.primary { color: #102a20; background: var(--accent); border-color: #b7db86; }
.primary:hover:not(:disabled) { background: #c5ed86; }
.submit { display: flex; align-items: center; justify-content: center; gap: 12px; white-space: nowrap; }
.submit span { font-size: 16px; }
.secondary { background: white; border-color: var(--line); color: var(--ink); }
.secondary:hover { background: #f3f6f1; }
.form-message, .profile, .history-message { margin-top: 11px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.form-message.problem, .history-message, .detail-error { color: #913820; }
.history { scroll-margin-top: 14px; overflow: hidden; }
.history-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 3px; padding: 4px; border-radius: 8px; background: #f1f5ef; }
.filters button { padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.filters button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 3px #172d251a; }
.filters button:hover { color: var(--ink); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 750; letter-spacing: .025em; background: #fafbf9; }
th, td { padding: 12px 13px; border-bottom: 1px solid #eaf0e7; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
td:nth-child(3) { white-space: nowrap; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.site-host, .site-path { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(35vw, 440px); }
.site-host { font-weight: 750; }
.site-path { color: var(--muted); font-size: 12px; }
.row-button { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; background: white; font-size: 12px; font-weight: 700; color: var(--ink); }
.row-button:hover { background: #eef5e9; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 70px; border-radius: 100px; padding: 4px 9px; color: #425650; background: #eaf0eb; font-weight: 700; font-size: 11px; }
.status-pill[data-status="running"] { background: #e8f1fa; color: #31577e; }
.status-pill[data-status="completed"] { background: #e7f4e1; color: #2a5d3b; }
.status-pill[data-status="failed"] { background: #f9e9e2; color: #8d3928; }
.status-pill[data-status="queued"] { background: #fbf0da; color: #785513; }
.empty { display: grid; justify-items: center; text-align: center; padding: 30px 17px 37px; }
.empty strong { margin-top: 10px; font-size: 15px; }
.empty p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; background: #eff7e7; border-radius: 13px; }
.empty-icon span { width: 24px; height: 24px; border: 1px solid #538064; box-shadow: inset 0 0 0 4px #eff7e7, inset 0 0 0 5px #538064; border-radius: 50%; position: relative; }
.empty-icon span::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #538064; }
.pagination { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination button { border: 1px solid var(--line); border-radius: 6px; margin-left: 5px; padding: 5px 8px; background: white; color: var(--ink); }
.history-message { padding: 0 22px 15px; }
.auth-panel { width: min(calc(100% - 30px), 480px); margin: min(15vh, 120px) auto 0; padding: 25px; }
.auth-panel h1 { font-size: clamp(26px, 5vw, 33px); }
.auth-panel form { grid-template-columns: 1fr; }
#auth-enrollment, #auth-setup { margin-bottom: 16px; }
#auth-enrollment img { display: block; max-width: 100%; height: auto; }
#auth-enrollment details, #auth-back { margin-top: 12px; }
#auth-enrollment summary { cursor: pointer; }
.sign-out { align-self: flex-start; margin: -34px 0 0; padding: 7px 12px; border: 1px solid #37554a; border-radius: 7px; background: transparent; color: #e6f2e7; font-size: 12px; }
dialog { position: fixed; inset: 0 0 0 auto; margin: 0; border: 0; width: min(100vw, 560px); max-width: none; min-height: 100dvh; max-height: 100dvh; padding: 0; background: white; color: var(--ink); box-shadow: -12px 0 40px #12322824; }
dialog::backdrop { background: #0d211c70; }
.detail-head { display: flex; justify-content: space-between; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin-top: 6px; font-size: 24px; overflow-wrap: anywhere; }
.close { width: 34px; height: 34px; background: #f3f6f2; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 21px; line-height: 1; }
.detail-body { display: grid; gap: 19px; padding: 20px 24px 28px; }
.detail-url { overflow-wrap: anywhere; color: var(--muted); font-size: 14px; }
.detail-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.detail-dates dt { font-size: 12px; color: var(--muted); }
.detail-dates dd { margin: 4px 0 0; font-size: 13px; font-weight: 700; }
.detail-error { padding: 11px; border-radius: 8px; background: #f9eee9; font-size: 13px; overflow-wrap: anywhere; }
.detail-actions:empty, .detail-actions:not(:has(button:not([hidden]))) { display: none; }
.detail-body h3 { font-size: 15px; margin-bottom: 8px; }
.download-list { display: grid; gap: 7px; }
.download-list a { display: flex; justify-content: space-between; gap: 14px; padding: 10px; font-size: 13px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; overflow-wrap: anywhere; }
.download-list a:hover { background: #f1f7ed; }
.download-list small { flex-shrink: 0; color: var(--muted); }
pre { overflow: auto; max-height: 48vh; min-height: 65px; margin: 0; padding: 11px; border-radius: 8px; background: #152d25; color: #e4f0e7; font: 12px/1.55 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 181px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  form { grid-template-columns: 1fr 1fr; }
  form .submit { grid-column: 1 / -1; justify-self: end; }
}
@media (max-width: 680px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 16px; }
  .brand { margin: 0; }
  nav { display: none; }
  .worker-card { width: fit-content; max-width: 180px; margin: 0; padding: 7px 9px; font-size: 11px; }
  .sign-out { grid-column: 2; justify-self: end; margin: 0; }
  main { padding: 27px 15px; }
  .page-header { margin-bottom: 18px; }
  .metrics { gap: 7px; }
  .metric { padding: 10px 9px 8px; }
  .metric strong { font-size: 25px; }
  .metric span { font-size: 11px; gap: 5px; }
  .new-crawl, .history-head { padding: 14px; }
  form { grid-template-columns: 1fr; }
  form .submit { justify-self: stretch; }
  th, td { padding: 8px 6px; }
  th:first-child, td:first-child { padding-left: 10px; }
  th:last-child, td:last-child { padding-right: 10px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  .site-host, .site-path { max-width: 43vw; }
  .detail-head, .detail-body { padding-inline: 16px; }
}

.crawl-form { grid-template-columns: minmax(120px, .62fr) minmax(170px, 1.35fr) minmax(160px, 1fr) auto; }
.crawl-form:has(.list-field:not([hidden])) { grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) auto; }
.crawl-form:has(.list-field:not([hidden])) .list-field { grid-column: 1 / -1; grid-row: 2; }
.list-field textarea { width: 100%; min-width: 0; min-height: 98px; padding: 9px 11px; border: 1px solid #cfdad0; border-radius: 8px; color: var(--ink); background: #fcfdfb; font: 13px/1.5 ui-monospace, monospace; resize: vertical; }
.list-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 5px; color: var(--muted); font-size: 12px; }
.list-upload { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.list-upload input { width: min(180px, 55vw); min-height: 30px; border: 0; background: transparent; padding: 2px; font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.download-list .bundle-link { background: #eaf6dd; border-color: #cee4b6; font-weight: 750; }
.link-map-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.link-map-head h3 { margin: 0; }
.link-map-head button, .map-direction button, #map-more { min-height: 34px; }
#link-map-body { display: grid; gap: 9px; margin-top: 9px; }
.map-direction { display: flex; gap: 6px; }
.map-direction button[aria-pressed="true"] { background: #eaf6dd; border-color: #cee4b6; }
.map-links { display: grid; gap: 6px; }
.map-link { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; overflow-wrap: anywhere; }
.map-link strong { font-size: 12px; }
.map-link small { color: var(--muted); }
#map-more { justify-self: start; }

@media (max-width: 950px) {
  .crawl-form { grid-template-columns: 1fr 1fr; }
  .crawl-form .submit { grid-column: auto; }
}
@media (max-width: 680px) {
  .crawl-form, .crawl-form:has(.list-field:not([hidden])) { grid-template-columns: 1fr; }
  .crawl-form:has(.list-field:not([hidden])) .list-field { grid-row: auto; }
}

#url-details {
  inset: 0;
  width: min(1180px, calc(100% - 32px));
  height: min(920px, calc(100dvh - 32px));
  min-height: 0;
  max-height: none;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
#url-details[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.url-head { align-items: center; padding-block: 13px; }
.url-head h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.url-head p { margin-top: 2px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.url-head .close { flex-shrink: 0; }
.url-browser { display: grid; grid-template-columns: minmax(205px, 26%) minmax(0, 1fr); min-height: 0; }
.url-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 15px 12px;
  border-right: 1px solid var(--line);
  background: #fcfdfa;
}
.url-picker input { min-height: 37px; }
.url-muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.url-list, .url-link-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.url-list { align-content: start; overflow: auto; padding: 3px; scrollbar-gutter: stable; }
.url-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 3px 8px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.url-result:hover { background: #f1f6ed; }
.url-result[aria-current="true"] { border-color: #cee4b6; background: #eaf6dd; }
.url-result-title, .url-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-result-title { font-size: 13px; font-weight: 700; }
.url-result small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.url-result-status { grid-column: 2; grid-row: 1; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.url-pagination { display: flex; justify-content: space-between; gap: 6px; }
.url-pagination button, #url-more-links { min-height: 33px; padding-inline: 10px; font-size: 12px; }
.url-main { min-width: 0; overflow: auto; padding: 19px clamp(12px, 2vw, 26px) 26px; background: #f4f6f2; }
.url-notice { margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.url-page-head { margin-bottom: 15px; overflow-wrap: anywhere; }
.url-page-head p { color: var(--muted); font-size: 13px; }
.url-page-head h3 { margin-top: 4px; font-size: clamp(20px, 3vw, 28px); letter-spacing: -.04em; line-height: 1.22; }
.url-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.url-badges:empty { display: none; }
.url-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.url-card { min-width: 0; padding: 13px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.url-card h4 { margin: 0 0 8px; font-size: 15px; }
.url-fields { display: grid; gap: 0; margin: 0; }
.url-fields > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 5px 10px; padding-block: 5px; border-bottom: 1px solid #edf0eb; }
.url-fields > div:last-child { border-bottom: 0; }
.url-fields dt { color: var(--muted); font-size: 12px; }
.url-fields dd { margin: 0; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.url-extra { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.url-extra summary { width: fit-content; color: #346044; cursor: pointer; font-size: 12px; font-weight: 700; }
.url-extra[open] summary { margin-bottom: 6px; }
.url-link-card { margin-top: 10px; }
.url-link-card .url-muted { margin-block: 8px 6px; }
.url-jump { padding: 0; border: 0; color: #2f6344; background: transparent; text-align: left; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; font-weight: inherit; overflow-wrap: anywhere; }
.url-link-list .url-jump { justify-self: start; font-size: 12px; font-weight: 700; }
#url-more-links { margin-top: 8px; }
@media (max-width: 740px) {
  #url-details { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .url-browser { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(85px, 28%) minmax(0, 1fr); }
  .url-picker { gap: 4px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .url-list { gap: 1px; }
  .url-result { padding: 6px 8px; }
}
@media (max-width: 490px) {
  .url-grid { grid-template-columns: minmax(0, 1fr); }
}
