:root {
  --bg: #f4f5f8;
  --card: #ffffff;
  --ink: #161a23;
  --muted: #6b7385;
  --line: #e6e8ef;
  --line-soft: #f0f1f5;
  --brand: #2f3fa8;
  --brand-soft: #e8eafc;
  --brand-ink: #ffffff;
  --ok: #17803d;
  --ok-bg: #e3f6ea;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --bad: #b42318;
  --bad-bg: #fde7e4;
  --bar-bg: #e3e5ee;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --card: #171a22;
    --ink: #e9ebf1;
    --muted: #98a0b3;
    --line: #272b36;
    --line-soft: #1f232d;
    --brand: #8b9bff;
    --brand-soft: #232a52;
    --brand-ink: #0b1020;
    --ok: #62d596;
    --ok-bg: #11301f;
    --warn: #f2c15b;
    --warn-bg: #33280d;
    --bad: #ff8f84;
    --bad-bg: #3a1714;
    --bar-bg: #2b303d;
  }
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); }
h1 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }
h2 { margin: 0 0 12px; font-size: 15px; }
h3 { margin: 20px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
code { font-family: var(--mono); background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------- layout */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px;
  background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 2px 8px 14px; }
.logo-mark { color: var(--brand); font-size: 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.nav-item, .folder {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
.nav-item:hover, .folder:hover { background: var(--line-soft); }
.nav-item.active, .folder.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.badge-n { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.folders { display: flex; flex-direction: column; gap: 1px; }
.folder .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .fcount { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.folder.active .fcount { color: inherit; }
.folder .fact { display: none; gap: 2px; }
.folder:hover .fact { display: inline-flex; }
.folder:hover .fcount { display: none; }
.fact button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 3px; font: inherit; }
.fact button:hover { color: var(--brand); }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: 10px; border-top: 1px solid var(--line); }

.main { padding: 24px 16px 48px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.page-head p { margin: 2px 0 0; }
.head-actions { display: flex; gap: 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 18px; margin-bottom: 16px; }
.table-card { overflow: hidden; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; margin: 0; }
  .side-head { display: none; }
  .folders { display: flex; flex-direction: row; overflow-x: auto; width: 100%; order: 5; padding-bottom: 4px; }
  .folder { width: auto; white-space: nowrap; flex: 0 0 auto; border: 1px solid var(--line); }
  .nav-item { white-space: nowrap; width: auto; }
  .side-foot { margin-top: 0; border-top: 0; margin-left: auto; gap: 10px; }
  .main { padding: 16px 12px 40px; }
}

/* -------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 12px; }

.strip { margin-bottom: 12px; padding: 9px 14px; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand); font-weight: 600; border: 1px solid var(--line); }

/* ------------------------------------------------------------ controls */
input[type="text"], input[type="number"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit;
}
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }
:is(input, select, textarea, button, summary):focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }
.tiny { width: 64px !important; margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--brand); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 10px; }
.btn.file { cursor: pointer; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 240px; width: auto; }
.toolbar select { width: auto; }

.bulkbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px;
  padding: 8px 12px; background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--radius);
}
.bulkbar select { width: auto; padding: 5px 8px; }
.sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 500; min-width: 0; }
.fld small { color: var(--muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.grid2.tight { gap: 0 8px; }
@media (max-width: 760px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 10px; }
.checks label, .inline-fld, .inline-chk span { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.inline-chk { justify-content: center; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0; }
.form-err { color: var(--bad); margin: 0; }

/* -------------------------------------------------------------- table */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0 7px; text-align: left; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 14px; }
th {
  height: 44px; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line); user-select: none;
}
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--ink); }
th.sorted { color: var(--ink); }
th.sorted::after { content: " ▾"; font-size: 10px; }
th.sorted.asc::after { content: " ▴"; }
td { height: 47px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
tr.trow:hover td { background: var(--line-soft); }
tr.trow.sel td { background: var(--brand-soft); }
tr.trow.failed td.dom, tr.trow.failed td.brand { opacity: 0.72; }
tr.detail > td { height: auto; padding: 0; background: var(--bg); }
.c-chk { width: 36px; }
.brand-txt { display: inline-block; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
a { color: var(--brand); }
td.dom { font-family: var(--mono); font-size: 13.5px; }
td.dom .name { font-weight: 700; }
td.dom .tld { color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.chev { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 2px 5px; transition: transform 0.12s; }
.chev[aria-expanded="true"] { transform: rotate(90deg); color: var(--brand); }
.tagchip {
  display: inline-block; padding: 1px 8px; margin-left: 4px; border-radius: 6px; background: var(--line-soft);
  color: var(--muted); font: 600 12px var(--sans); border: 0; cursor: pointer;
}
.tagchip:hover { background: var(--brand-soft); color: var(--brand); }
.tagchip.t-kandidat { background: var(--warn-bg); color: var(--warn); }
.tagchip.t-beli { background: var(--ok-bg); color: var(--ok); }
.tagchip.t-skip { background: var(--bad-bg); color: var(--bad); }

.score { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score .bar { width: 44px; height: 5px; border-radius: 99px; background: var(--bar-bg); overflow: hidden; }
.score .bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.score.low .bar i { background: var(--bad); }
.score.mid .bar i { background: #d99a1a; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.neutral { background: var(--line-soft); color: var(--muted); }

.hist { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.hist.ok { color: var(--ok); }
.hist.warn { color: var(--warn); }
.hist.bad { color: var(--bad); }
.hist .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.hist .bars i { width: 4px; border-radius: 1px; background: var(--bar-bg); }
.hist .bars i:nth-child(1) { height: 8px; }
.hist .bars i:nth-child(2) { height: 12px; }
.hist .bars i:nth-child(3) { height: 16px; }
.hist .bars i.on { background: var(--brand); }
.folder-cell { display: inline-block; max-width: 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; color: var(--muted); }
.warn-ico { color: var(--warn); cursor: help; white-space: nowrap; }
.warn-txt { margin-left: 5px; font-size: 12px; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.pager-btns { display: inline-flex; gap: 6px; }

/* ------------------------------------------------------- baris detail */
.d-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 16px 20px 18px 54px; white-space: normal;
  position: sticky; left: 0; box-sizing: border-box; width: var(--ww, 100%); }
@media (max-width: 980px) { .d-wrap { grid-template-columns: 1fr; padding-left: 20px; } }
.d-sec h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 3px 10px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }
.d-sec ul { margin: 0; padding-left: 18px; }
.d-sec .err { color: var(--warn); }
.d-edit { display: grid; gap: 8px; }
.d-edit label { display: grid; gap: 3px; font-weight: 500; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ----------------------------------------------------------- job & lain */
table.plain td { height: 52px; }
.progress { width: 160px; height: 7px; border-radius: 99px; background: var(--bar-bg); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.progress i { display: block; height: 100%; background: var(--brand); transition: width 0.3s; }
.prov { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.diag { margin-top: 12px; display: grid; gap: 8px; }
.diag .item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 2px; }
.diag .item b { display: flex; align-items: center; gap: 8px; }

/* --------------------------------------------------------------- dialog */
.dlg { border: 0; padding: 0; border-radius: 14px; width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--card); color: var(--ink); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35); }
.dlg::backdrop { background: rgba(10, 12, 20, 0.5); }
.dlg-inner { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 17px; }
.dlg-body { padding: 16px 20px; overflow-y: auto; }
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.dlg-foot .form-err { margin-right: auto; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: 380px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
.toast.err { background: var(--bad); color: #fff; }

/* ---------------------------------------------------------------- login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login-card h1 { margin-top: 6px; }
.login-card .logo { padding: 0 0 12px; }
.login-card form { margin-top: 18px; }

/* kolom Folder disembunyikan saat sedang melihat satu folder (informasinya redundan) */
#tbl.hide-folder :is(th.c-folder, td.fcell) { display: none; }

/* ------------------------------------------------- sebelum sesi login terverifikasi */
body.booting .shell { visibility: hidden; }

/* ---- dialog scan: pilihan sumber daftar + mode brand ---- */
.seg { display: inline-flex; padding: 3px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--line-soft); }
.seg-btn { appearance: none; border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.samples { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; max-height: 96px; overflow: auto; }
.samples:empty { display: none; }
.samples .chip { padding: 2px 9px; border-radius: 999px; background: var(--line-soft); font: 12.5px/1.6 var(--mono); color: var(--ink); }
.job-src { min-width: 190px; }
.job-src .chip { display: inline-block; padding: 1px 8px; margin: 1px 0; border-radius: 999px; background: var(--line-soft); font-size: 12px; font-weight: 600; color: var(--ink); }
.job-src > div { margin-top: 4px; font-size: 12px; max-width: 280px; }
.samples .chip.seen { opacity: 0.55; text-decoration: line-through; }
.note-box { margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }

/* ---- traffic organik historis: sel tabel, grafik detail ---- */
.small-note { margin: 0 0 10px; font-size: 12.5px; }
.tr-cell { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.tr-cell b { font-weight: 600; min-width: 34px; text-align: right; }
.tr-cell.hi b { color: var(--ok); }
.spark { width: 64px; height: 18px; flex: none; }
.spark path { fill: none; stroke: var(--muted); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.tr-cell.hi .spark path { stroke: var(--ok); }
.d-chart { grid-column: 1 / -1; }
.d-chart .chart { width: 100%; height: 130px; display: block; }
.d-chart .chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.d-chart .chart .l-traffic { fill: none; stroke: #e8830c; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.d-chart .chart .a-traffic { fill: #e8830c; opacity: 0.14; }
.d-chart .chart .l-pages { fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.d-chart .legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.d-chart .legend i { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.d-chart .axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------ struktur direktori (Top pages) */
.st-cell { display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-cell b { font-weight: 600; min-width: 18px; text-align: right; }
.st-cell.hi b { color: var(--ok); }
.st-lbl { color: var(--muted); font-size: 12px; }
.st-home { color: var(--muted); font-size: 12px; margin-left: 4px; }
.d-struct { grid-column: 1 / -1; }
.st-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 8px; }
.st-stat { color: var(--muted); font-size: 12.5px; }
.st-stat b { color: var(--ink); font-size: 18px; font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.st-scroll { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-table th { position: sticky; top: 0; background: var(--card); text-align: left; padding: 6px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.st-table td { height: 34px; padding: 5px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.st-table th.num, .st-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.st-table .st-url { font-family: var(--mono); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-table .st-dir { color: var(--muted); }
.st-table .st-kw { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.st-table .st-home-row td { background: var(--line-soft); }

/* Pencarian katalog eksternal */
.src-chip{font-size:11px;border-radius:5px;padding:3px 6px;background:var(--brand-soft);color:var(--brand);white-space:nowrap} 
.source-actions{white-space:nowrap;min-width:250px}.source-actions .btn{margin:2px}.small-note{font-size:12px} 
#view-sources .row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0} 
#view-sources table td{vertical-align:middle;padding:9px} 

/* Pencarian otomatis: pilihan TLD dan panel hasil */
.source-tld-picker { border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin: 7px 0 16px; }
.source-tld-picker legend { padding: 0 5px; font-weight: 650; }
.tld-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 9px 14px; margin: 12px 0; }
.tld-option { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
.tld-option input { accent-color: var(--brand); }
.source-tld-picker small { display: block; line-height: 1.6; margin-top: 8px; }
#sourceListDlg .dlg-body { min-height: 130px; }
#sourceListDlg td:first-child { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* EDF v2: daftar status dan histogram Wayback */
.quick-domains {display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 14px}
.quick-domains .btn {white-space:nowrap}
.wb-year-chart {display:block;width:100%;height:150px;color:#3a91f3;border-bottom:1px solid var(--border,#27364b);background:linear-gradient(180deg,transparent 49%,rgba(110,150,190,.09) 50%,transparent 51%)}
.d-wb-chart {min-width:min(480px,100%)}

/* v2.3: hasil live pencarian expired + Wayback dalam satu halaman */
.source-live-metrics { display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:10px;margin:12px 0; }
.source-live-metric { padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg,transparent); }
.source-live-metric b { display:block;font-size:1.25rem;margin-top:4px; }
.source-live-columns { gap:18px; }
.source-live-columns h3 { margin:8px 0; }
.source-live-columns h3 small { font-weight:normal;font-size:.75rem;opacity:.7; }
.source-live-columns .tablewrap { max-height:380px;overflow:auto; }
@media(max-width:840px){ .source-live-columns { grid-template-columns:1fr; } }

/* v2.5: pilihan cepat Indonesia / Global pada dua daftar path Wayback */
.archive-mode-picker { display:inline-flex; gap:4px; align-items:center; flex-wrap:wrap; padding:3px; background:var(--line-soft); border:1px solid var(--line); border-radius:10px; }
.archive-mode-picker .archive-mode { white-space:normal; text-align:center; border:1px solid transparent; font-size:12px; padding:7px 10px; }
.archive-mode-picker .archive-mode.active, .archive-mode-picker .archive-mode[aria-pressed="true"] { background:var(--brand); color:var(--brand-ink); border-color:var(--brand); font-weight:700; }
.archive-mode-picker .archive-mode:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }

/* ===================== menu Ahrefs (mandiri) ===================== */
.ah-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.ah-num { text-align: right; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--brand); }
th.sortable[data-dir="asc"]::after { content: " ▲"; font-size: 10px; }
th.sortable[data-dir="desc"]::after { content: " ▼"; font-size: 10px; }
.ah-dom { font-weight: 600; color: var(--ink); text-decoration: none; }
.ah-dom:hover { color: var(--brand); text-decoration: underline; }
.ah-err { color: var(--bad); font-size: 12.5px; max-width: 380px; white-space: normal; margin-top: 2px; }
p.ah-err { max-width: none; margin: 6px 0; }
.ah-actions { white-space: nowrap; }
.ah-actions .btn { margin-left: 4px; }
.ah-spark { width: 72px; height: 20px; display: block; }
.ah-spark polyline { fill: none; stroke: #f59e0b; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.ah-est { background: var(--line-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.ah-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 10px 0 4px; }
.ah-chk { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; cursor: pointer; }
.ah-chk.ah-pages { color: #3b82f6; }
.ah-chk.ah-traffic { color: #f59e0b; }
.ah-chart { margin-bottom: 8px; }
.ah-svg { width: 100%; height: auto; display: block; }
.ah-grid line { stroke: var(--line); stroke-width: 1; }
.ah-axis text { fill: var(--muted); font-size: 11px; }
.ah-axis .ah-ax-p { fill: #3b82f6; }
.ah-axis .ah-ax-t { fill: #f59e0b; }
.ah-axis .ah-xtick { stroke: var(--line); stroke-width: 1; }
.ah-line-p { stroke: #3b82f6; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ah-line-t { stroke: #f59e0b; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ah-snap { stroke: var(--brand); stroke-width: 1; stroke-dasharray: 4 3; }
.ah-snap-t { fill: var(--brand); font-size: 11px; font-weight: 600; }
.ah-cursor { stroke: var(--muted); stroke-width: 1; }
.ah-tip { fill: var(--ink); font-size: 12px; font-weight: 600; }
.ah-snapbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.ah-snapbar select { max-width: 360px; }
.ah-snapnew { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ah-url { max-width: 420px; word-break: break-all; }
.ah-url a { color: var(--brand); text-decoration: none; }
.ah-url a:hover { text-decoration: underline; }
.ah-share { color: var(--muted); font-size: 11.5px; }
.ah-cc { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--line-soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.ah-pages-table td { height: 40px; }
@media (max-width: 700px) {
  .ah-snapbar { flex-direction: column; align-items: flex-start; }
  .ah-snapbar select { max-width: 100%; }
}

/* menu Ahrefs: domain yang sudah dicek tetapi tanpa halaman organik tampil redup agar mudah dibedakan */
.ah-nopages td { color: var(--muted); }
.ah-nopages td .ah-dom { color: inherit; font-weight: 500; }
#ahStats { grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); }

/* v2.9: mode Wayback saja + kolom folder/halaman arsip */
.wo-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 0 10px; border: 1px solid var(--line, #d9dde3); border-radius: 8px; background: var(--card, #fff); flex-wrap: wrap; }
.wo-bar .wo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted, #8a93a0); flex: none; }
.wo-bar.on .wo-dot { background: var(--ok, #1a8f4c); }
.wo-bar .wo-txt { flex: 1 1 260px; min-width: 0; }
.wbf { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.wbf b { font-weight: 600; }
.wbf .wbf-top { color: var(--muted); font-size: 12px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbf.zero b { color: var(--muted); font-weight: 500; }
.kind-chip { display: inline-block; padding: 0 6px; border-radius: 9px; font-size: 11px; border: 1px solid var(--line, #d9dde3); color: var(--muted); }
.kind-chip.folder, .kind-chip.deep { color: var(--ok, #1a8f4c); border-color: currentColor; }
