/* ============================================================
   Forum Harvester — Frontend (Crowd editorial style)
   ============================================================ */

.fh-front{
  --bg:        #FAFAF7;
  --surface:   #FFFFFF;
  --mute:      #6B6B66;
  --mute-2:    #9A9A93;
  --line:      #ECEBE5;
  --line-2:    #E3E2DC;
  --chip:      #F3F2EC;
  --chip-hover:#EDEBE3;
  --accent:    oklch(0.42 0.075 155);
  --accent-ink:oklch(0.32 0.07 155);
  --accent-soft:oklch(0.97 0.018 155);
  --accent-ring:oklch(0.42 0.075 155 / 0.18);
  --success:   oklch(0.55 0.12 155);
  --success-soft:oklch(0.96 0.03 155);
  --warn:      oklch(0.78 0.13 80);
  --warn-soft: oklch(0.97 0.04 85);
  --danger-soft:oklch(0.97 0.028 25);
  --info-soft: oklch(0.96 0.02 250);
  --info-ink:  oklch(0.45 0.08 250);
  --tab-bg:    var(--bg);
  --tab-color:         var(--mute);
  --tab-hover:         var(--ink-2);
  --tab-active-color:  var(--ink);
  --tab-active-line:   var(--ink);
  --tab-badge-bg:      var(--chip);
  --tab-badge-color:   var(--mute);
  --tab-badge-active-bg:   var(--ink);
  --tab-badge-active-color:#F6F5EE;
  --radius:    10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 0 rgba(26,26,25,.03), 0 1px 2px rgba(26,26,25,.04);
  --shadow-pop: 0 1px 0 rgba(26,26,25,.04), 0 12px 32px -14px rgba(26,26,25,.18);
  --ctrl-h:    34px;
  --fh-width:  100%;

  font: 13.5px/1.5 "Inter", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  /* background: var(--bg); */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01","cv11";
  width: 100%; /* фон всегда на всю ширину */
  margin: 0 auto;
  padding: 0 0 140px;
}
.fh-front *,.fh-front *::before,.fh-front *::after{ box-sizing:border-box; }
.fh-front h1,.fh-front h2,.fh-front h3{
  font-family: "Inter Tight","Inter",sans-serif;
  letter-spacing: -0.01em; margin:0;
}
.fh-front .mono{
  font-family:"JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.fh-front-locked{
  padding:32px; background:var(--warn-soft);
  border:1px solid var(--warn); border-radius:var(--radius-lg);
  text-align:center;
}

/* ============ TABS ============ */
.fh-tabs{
  border-bottom:1px solid var(--line);
  /* background: var(--tab-bg); */
  position: sticky; top:0; z-index:10;
  width:100%; /* фон на всю ширину */
}
.fh-tabs-in{
  max-width: var(--fh-width); margin:0 auto; padding:0 28px;
  display:flex; align-items:stretch; gap:2px;
}
.fh-tab{
  position:relative; display:inline-flex; align-items:center; gap:8px;
  padding:14px 14px 13px;
  font: 500 13px "Inter",sans-serif; color:var(--tab-color);
  background:transparent; border:none; cursor:pointer;
  border-bottom:1.5px solid transparent; margin-bottom:-1px;
  transition: color .15s;
}
.fh-tab svg{ opacity:.8; color:currentColor; }
.fh-tab:hover{ color:var(--tab-hover); }
.fh-tab.active{ color:var(--tab-active-color); border-bottom-color:var(--tab-active-line); font-weight:600; }
.fh-tab .fh-badge{
  font-family:"JetBrains Mono"; font-size:10.5px;
  background:var(--tab-badge-bg); color:var(--tab-badge-color);
  border-radius:4px; padding:1px 5px; margin-left:2px;
}
.fh-tab.active .fh-badge{ background:var(--tab-badge-active-bg); color:var(--tab-badge-active-color); }

/* ============ PAGE ============ */
.fh-page{
  max-width: var(--fh-width); margin:0 auto; padding:32px 28px 0;
}
.fh-page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  margin-bottom:22px; gap:24px;
}
.fh-eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px; color:var(--mute); margin-bottom:10px;
}
.fh-eyebrow .fh-dot{
  width:6px; height:6px; border-radius:50%;
  background:var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.fh-page-head h1{ font-size:26px; font-weight:600; }
.fh-page-head p{ color:var(--mute); margin:6px 0 0; font-size:13.5px; max-width:56ch; }
.fh-page-head-actions{ display:flex; gap:8px; flex-shrink:0; }

.fh-panel{ display:none; }
.fh-panel.active{ display:block; }

/* ============ CARD ============ */
.fh-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.fh-card-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
}
.fh-card-head .fh-hl{ display:flex; align-items:center; gap:10px; }
.fh-card-head h2{
  font-family:"Inter",sans-serif; font-size:13px; font-weight:600;
}
.fh-card-total{
  font-family:"JetBrains Mono"; font-size:12px; color:var(--mute);
}
.fh-card-total b{ color:var(--ink); font-weight:600; }

/* ============ CONTROLS (единая высота) ============ */
.fh-ctrl{
  height:var(--ctrl-h);
  border:1px solid var(--line-2);
  background:var(--surface);
  border-radius:var(--radius-sm);
  color:var(--ink);
  font: 500 12.5px "Inter",sans-serif;
  padding:0 10px;
  display:inline-flex; align-items:center; gap:6px;
  outline:none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.fh-ctrl:focus,.fh-ctrl:focus-visible{
  border-color:var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.fh-ctrl:hover:not(:focus){ border-color:var(--ink-2); }
select.fh-ctrl{
  appearance:none; -webkit-appearance:none;
  padding-right:26px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236B6B66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat;
  background-position:right 10px center;
  cursor:pointer;
}
input.fh-ctrl{ min-width:200px; }
textarea.fh-ctrl{
  height:auto; min-height:88px; padding:14px 16px;
  resize:vertical; font:15px/1.55 "Inter",sans-serif;
  font-family:"JetBrains Mono",monospace; font-size:13px;
}

/* Search field with icon */
.fh-search-wrap{ position:relative; }
.fh-search-wrap svg{
  position:absolute; left:10px; top:50%; transform:translateY(-50%);
  color:var(--mute-2);
}
.fh-search-wrap input.fh-ctrl{ padding-left:32px; }

/* ============ BUTTONS ============ */
.fh-btn{
  height:var(--ctrl-h);
  padding:0 12px;
  font: 500 12.5px "Inter",sans-serif; color:var(--ink);
  background:var(--surface);
  border:1px solid var(--line-2);
  border-radius:var(--radius-sm);
  cursor:pointer;
  display:inline-flex; align-items:center; gap:6px;
  transition: border-color .12s, background .12s, transform .05s;
  white-space:nowrap;
}
.fh-btn:hover{ border-color:var(--ink); }
.fh-btn:active{ transform:translateY(1px); }
.fh-btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; }
.fh-btn.primary{
  background:var(--ink); border-color:var(--ink); color:#F6F5EE; font-weight:600;
}
.fh-btn.primary:hover{ background:#000; }
.fh-btn.danger{
  background:var(--danger); color:#fff; border-color:var(--danger);
}
.fh-btn.danger:hover{ filter:brightness(1.1); }
.fh-btn.ghost{
  border-color:transparent; background:transparent; color:var(--mute);
}
.fh-btn.ghost:hover{ color:var(--ink); background:var(--chip); }
.fh-btn.accent{
  background:var(--accent); border-color:var(--accent); color:#F6F5EE; font-weight:600;
}
.fh-btn.accent:hover{ filter:brightness(.95); }

/* Icon-only button */
.fh-ib{
  width:26px; height:26px; border-radius:6px;
  display:grid; place-items:center;
  color:var(--mute); cursor:pointer;
  background:transparent; border:none;
}
.fh-ib:hover{ background:var(--chip); color:var(--ink); }

/* ============ TOOLBAR ============ */
.fh-toolbar{
  display:flex; align-items:center; gap:10px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  flex-wrap:wrap;
}
.fh-toolbar .fh-spacer{ flex:1; }

/* ============ CHIPS ============ */
.fh-chips{
  display:flex; flex-wrap:wrap; gap:6px;
  padding:14px 18px;
  border-bottom:1px dashed var(--line);
}
.fh-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 11px;
  font: 500 12px "Inter"; color:var(--ink-2);
  background:var(--surface);
  border:1px solid var(--line-2);
  border-radius:999px; cursor:pointer;
  transition: all .12s;
}
.fh-chip:hover{ border-color:var(--ink); }
.fh-chip .fh-n{
  font-family:"JetBrains Mono"; font-size:10.5px; color:var(--mute);
}
.fh-chip.on{
  background:var(--ink); color:#F6F5EE; border-color:var(--ink);
}
.fh-chip.on .fh-n{ color:#D8D6CB; }

/* ============ SELECT-ALL BANNER ============ */
.fh-sab{
  display:none; align-items:center; gap:14px;
  padding:10px 18px;
  background:var(--info-soft);
  border-bottom:1px solid color-mix(in oklab, var(--info-ink) 15%, transparent);
  font-size:12.5px; color:var(--info-ink);
}
.fh-sab.visible{ display:flex; }
.fh-sab a{
  color:var(--info-ink); font-weight:600; text-decoration:underline; cursor:pointer;
}
.fh-sab.on{
  background:var(--success-soft); color:var(--accent-ink);
  border-bottom-color: color-mix(in oklab, var(--accent) 25%, transparent);
}
.fh-sab.on a{ color:var(--accent-ink); }
.fh-sab .fh-sab-x{
  margin-left:auto; color:currentColor; opacity:.6;
  background:transparent; border:none; cursor:pointer; font-size:14px;
}
.fh-sab .fh-sab-x:hover{ opacity:1; }

/* ============ CUSTOM CHECKBOX ============ */
.fh-cb{
  position:relative; width:16px; height:16px;
  border-radius:4px; border:1.5px solid var(--line-2);
  background:var(--surface); cursor:pointer;
  display:grid; place-items:center;
  transition: all .12s; flex-shrink:0;
}
.fh-cb:hover{ border-color:var(--ink); }
.fh-cb.on{ background:var(--ink); border-color:var(--ink); }
.fh-cb.on::after{
  content:""; width:8px; height:5px;
  border-left:1.8px solid #fff; border-bottom:1.8px solid #fff;
  transform: rotate(-45deg) translate(0,-1px);
}
.fh-cb.indet{ background:var(--ink); border-color:var(--ink); }
.fh-cb.indet::after{
  content:""; width:8px; height:0; border:none;
  border-top:1.8px solid #fff; transform:none;
}
/* Hidden real checkbox behind custom */
.fh-cb input{ position:absolute; opacity:0; width:100%; height:100%; cursor:pointer; margin:0; }

/* ============ TABLE ============ */
.fh-tbl-wrap{ overflow-x:auto; }
table.fh-tbl{
  width:100%; border-collapse:collapse; font-size:13px;
}
.fh-tbl th,.fh-tbl td{
  padding:12px 14px; border-bottom:1px solid var(--line);
  text-align:left; vertical-align:middle;
}
.fh-tbl th{
  font: 500 11.5px "Inter"; color:var(--mute);
  letter-spacing:0.02em;
  background: color-mix(in oklab, var(--bg) 60%, white);
  white-space:nowrap;
}
.fh-tbl tbody tr:hover{ background: color-mix(in oklab, var(--bg) 55%, white); }
.fh-tbl td.c-check{ width:32px; padding-right:0; }
.fh-tbl td.c-domain{ min-width:280px; }
.fh-tbl td.c-actions{ width:84px; text-align:right; white-space:nowrap; }

/* Domain cell */
.fh-domain-cell{ display:flex; align-items:flex-start; gap:10px; }
.fh-favicon{
  width:26px; height:26px; border-radius:6px;
  background:var(--chip); color:var(--mute);
  display:grid; place-items:center;
  font-family:"Inter Tight"; font-weight:600; font-size:11px;
  flex-shrink:0; border:1px solid var(--line);
  text-transform:uppercase;
  margin-top:2px;
}
a.fh-d-host{
  font-weight:600; color:var(--ink); font-size:13px;
  letter-spacing:-0.005em;
  text-decoration:none;
  display:block;
}
a.fh-d-host:hover{ color:var(--accent); text-decoration:underline; }
.fh-d-url{
  margin-top:1px;
}
.fh-d-url a{
  color:var(--mute); font-size:11.5px;
  font-family:"JetBrains Mono";
  text-decoration:none;
  word-break:break-all;
}
.fh-d-url a:hover{ color:var(--accent); text-decoration:underline; }
.fh-d-title{
  color:var(--mute-2); font-size:11px;
  margin-top:3px; font-style:italic;
  max-width:380px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.fh-d-query{
  margin-top:2px;
  font-size:10.5px;
  font-family:"JetBrains Mono";
  color:var(--accent);
  opacity:.7;
  max-width:380px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* Status pills */
.fh-pill{
  display:inline-flex; align-items:center; gap:5px;
  height:22px; padding:0 8px; border-radius:999px;
  font: 600 11px "Inter",sans-serif;
  letter-spacing:0.01em;
  border:1px solid transparent;
}
.fh-pill .fh-pill-dot{ width:6px; height:6px; border-radius:50%; }
.fh-pill-approved{ background:var(--success-soft); color:var(--accent-ink); border-color: color-mix(in oklab, var(--accent) 22%, transparent);}
.fh-pill-approved .fh-pill-dot{ background:var(--accent); }
.fh-pill-new{ background:var(--info-soft); color:var(--info-ink); border-color: color-mix(in oklab, var(--info-ink) 20%, transparent);}
.fh-pill-new .fh-pill-dot{ background:var(--info-ink); }
.fh-pill-posted{ background:var(--chip); color:var(--ink); border-color:var(--line-2);}
.fh-pill-posted .fh-pill-dot{ background:var(--ink); }
.fh-pill-rejected{ background:var(--danger-soft); color:var(--danger); border-color: color-mix(in oklab, var(--danger) 22%, transparent);}
.fh-pill-rejected .fh-pill-dot{ background:var(--danger); }

/* Engine badge */
.fh-engine{
  display:inline-flex; align-items:center; gap:5px;
  font: 500 11.5px "Inter"; color:var(--ink-2);
}
.fh-engine .fh-e-dot{
  width:6px; height:6px; border-radius:2px; background:var(--mute-2);
}

/* Category cell */
.fh-cat-cell{
  display:inline-flex; align-items:center; gap:6px;
  padding:3px 9px;
  font: 500 11.5px "Inter";
  background:var(--chip); color:var(--ink-2);
  border-radius:999px; cursor:pointer;
  border:1px dashed transparent;
  transition: all .12s;
}
.fh-cat-cell:hover{ border-color:var(--line-2); background:var(--surface); }
.fh-cat-cell.empty{
  color:var(--mute-2); background:transparent;
  border:1px dashed var(--line-2);
}
.fh-cat-input{
  height:22px; padding:0 8px;
  font: 500 11.5px "Inter",sans-serif;
  border:1px solid var(--accent);
  border-radius:999px; outline:none;
  background:var(--surface); color:var(--ink);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Metrics */
.fh-metrics{
  display:flex; gap:10px;
  font-family:"JetBrains Mono"; font-size:11.5px; color:var(--ink-2);
}
.fh-metrics .fh-m{ display:flex; align-items:center; gap:4px; }
.fh-metrics .fh-lbl{
  color:var(--mute-2); font-size:10px; font-family:"Inter";
  text-transform:uppercase; letter-spacing:0.04em;
}
.fh-metrics .good{ color:var(--accent); }
.fh-metrics .bad{ color:var(--danger); }

/* Row actions */
.fh-row-actions{ display:inline-flex; gap:4px; }

/* ============ PAGINATION ============ */
.fh-tfoot{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 18px; color:var(--mute); font-size:12.5px;
}
.fh-pager{ display:inline-flex; gap:2px; }
.fh-pager button{
  height:28px; min-width:28px; padding:0 8px;
  font: 500 12px "Inter"; color:var(--ink-2);
  background:transparent; border:1px solid transparent;
  border-radius:6px; cursor:pointer;
}
.fh-pager button:hover{ background:var(--chip); }
.fh-pager button.on{ background:var(--ink); color:#F6F5EE; }
.fh-pager .fh-dots{ padding:0 6px; color:var(--mute-2); align-self:center; }

/* ============ FLOATING BULK BAR ============ */
.fh-bulk-bar{
  display:none; /* shown via JS */
  position:fixed; left:50%; bottom:28px;
  transform:translateX(-50%);
  background:var(--ink); color:#F6F5EE;
  padding:8px 10px 8px 16px;
  border-radius:12px;
  align-items:center; gap:8px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.35);
  z-index:20;
  font-size:12.5px;
  animation: fh-bar-in .2s ease-out;
}
.fh-bulk-bar.visible{ display:flex; }
@keyframes fh-bar-in{
  from{ opacity:0; transform:translate(-50%,16px); }
  to{ opacity:1; transform:translate(-50%,0); }
}
.fh-bulk-bar .fh-bcount{
  font-weight:600; margin-right:8px; font-family:"Inter";
}
.fh-bulk-bar .fh-bcount b{
  font-family:"JetBrains Mono"; margin-right:2px;
}
.fh-bulk-bar .fh-bsep{
  width:1px; height:18px; background:rgba(255,255,255,.15); margin:0 2px;
}
.fh-bulk-bar .fh-bb{
  height:28px; padding:0 10px;
  font: 500 12px "Inter"; color:#E8E6DA;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.1);
  border-radius:7px; cursor:pointer;
  display:inline-flex; align-items:center; gap:5px;
}
.fh-bulk-bar .fh-bb:hover{ background:rgba(255,255,255,.12); color:#fff; }
.fh-bulk-bar .fh-bb.del{
  background: color-mix(in oklab, var(--danger) 80%, black);
  border-color: color-mix(in oklab, var(--danger) 80%, black);
  color:#fff;
}
.fh-bulk-bar .fh-bb.del:hover{ filter:brightness(1.12); }
.fh-bulk-bar .fh-bb.clear{
  background:transparent; border-color:transparent;
  color:rgba(255,255,255,.6); padding:0 8px;
}
.fh-bulk-bar .fh-bb.clear:hover{ color:#fff; }

/* ============ PROGRESS ============ */
.fh-progress-wrap{ margin:16px 18px; display:none; }
.fh-progress-wrap.visible{ display:block; }
.fh-progress-bar{
  height:6px; border-radius:6px; background:var(--line); overflow:hidden;
}
.fh-progress-fill{
  height:100%; background:var(--ink); width:0%; transition:width .4s ease;
}
.fh-progress-text{
  margin-top:8px; font-size:12px; color:var(--mute);
  font-family:"JetBrains Mono"; text-align:center;
}

/* ============ LOG ============ */
.fh-log{
  display:none; margin:16px 18px; padding:14px 16px;
  background:#0F0F0D; color:#A7E1A7;
  border-radius:var(--radius); font-family:"JetBrains Mono";
  font-size:12px; max-height:350px; overflow-y:auto; line-height:1.6;
}
.fh-log.visible{ display:block; }
.fh-log-row{ padding:2px 0; }
.fh-log-row.error{ color:#FCA5A5; }
.fh-log-row.success{ color:#86EFAC; }

/* ============ FORM AREA (Сбор / Импорт / Анкоры) ============ */
.fh-form-area{
  padding:20px 18px; border-top:1px solid var(--line);
}
.fh-form-area label.fh-flabel{
  display:flex; align-items:center; justify-content:space-between;
  font-size:12.5px; color:var(--mute); font-weight:500;
  margin-bottom:10px;
}
.fh-form-area .fh-flabel .fh-hint{
  font-size:12px; color:var(--mute-2);
}
.fh-form-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:18px 20px;
}
.fh-form-row{
  display:flex; align-items:center; gap:10px;
  flex-wrap:wrap; margin-top:14px;
}
.fh-form-row label{
  display:inline-flex; align-items:center; gap:8px;
  font: 500 12.5px "Inter"; color:var(--ink);
}
.fh-form-row input[type="number"]{
  width:80px;
}
.fh-form-foot{
  display:flex; align-items:center; justify-content:flex-end; gap:10px;
  padding:14px 18px; border-top:1px solid var(--line);
}

/* Anchor form */
.fh-anchor-form{
  display:none; background:var(--bg);
  padding:18px; border:1px solid var(--line); border-radius:var(--radius);
  margin:14px 18px;
}
.fh-anchor-form.visible{ display:block; }
.fh-anchor-grid3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; margin-bottom:14px; }
.fh-anchor-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }

/* Anchor table */
.fh-anchor-alive{ color:var(--accent); font-weight:600; font-size:12px; }
.fh-anchor-dead{ color:var(--danger); font-weight:600; font-size:12px; }

/* ============ FOOTNOTE ============ */
.fh-footnote{
  max-width: var(--fh-width); margin:36px auto 0;
  color:var(--mute-2); font-size:12px;
  display:flex; justify-content:space-between;
  padding:0 28px;
}
.fh-footnote a{ color:var(--mute); text-decoration:none; }
.fh-footnote a:hover{ color:var(--ink); }

/* ============ LOADING ============ */
.fh-loading{
  text-align:center; padding:40px 20px;
  color:var(--mute); font-size:13px;
}

/* ============ RESPONSIVE ============ */
@media (max-width:900px){
  .fh-front{ padding:0 0 100px; }
  .fh-page{ padding:20px 16px 0; }
  .fh-tabs-in{ padding:0 16px; overflow-x:auto; white-space:nowrap; }
  .fh-page-head{ flex-direction:column; align-items:flex-start; }
  .fh-form-grid{ grid-template-columns:1fr; }
  .fh-anchor-grid3{ grid-template-columns:1fr; }
  .fh-anchor-grid2{ grid-template-columns:1fr; }
  .fh-toolbar{ padding:12px 14px; }
  .fh-chips{ padding:10px 14px; }
  .fh-tbl th:nth-child(n+6),.fh-tbl td:nth-child(n+6){ display:none; }
  .fh-bulk-bar{
    left:10px; right:10px; bottom:10px;
    transform:none; flex-wrap:wrap; padding:10px 12px;
  }
}
