/* Raleway 700 (app.css only loads up to 600); Vazirmatn draws Arabic and Persian letters (پ چ ژ گ ک ی), which Raleway lacks. */
@import url(https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&family=Vazirmatn:wght@400;500;600;700&display=swap);

/* Home page + setup panel. Inherits the app's dark world (see app.css / CoreUI).
   Logical properties throughout so Arabic (dir=rtl) mirrors without overrides. */

.st-home, .st-panel, .st-confirm {
  --st-ground: #141414;
  --st-card: #181818;
  --st-raised: #1e1e1e;
  --st-line: #2c2c2c;
  --st-line-strong: #3a3a3a;
  --st-ink: #ececec;
  --st-ink-2: #a3a3a3;
  --st-green: #2b7d4b;
  --st-green-hover: #308a53;
  --st-green-ink: #5fc283;
  --st-blue-ink: #8cc4f2;
  --st-blue-bg: #182634;
  --st-amber-ink: #f0b35a;
  --st-amber-bg: #2e2416;
  --st-red-ink: #f08a8a;
  --st-radius: 8px;
  --st-ease: cubic-bezier(.16, 1, .3, 1);
  color: var(--st-ink);
  font-family: Raleway, Vazirmatn, system-ui, sans-serif;
  color-scheme: dark;
  scrollbar-color: #3a3a3a transparent;
}

/* rtl.css sets IRANSans (never loaded) on every element; keep this scope's faces */
.st-home *, .st-panel *, .st-confirm * { font-family: inherit; }

.st-home ::selection, .st-panel ::selection { background: #2b7d4b; color: #fff; }

.st-home {
  box-sizing: border-box;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: 40px 32px 72px;
}

/* Head */
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-block-end: 32px; }
.st-title { font-size: 2rem; font-weight: 700; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
.st-lede { color: var(--st-ink-2); font-size: 1rem; margin: 0; max-width: 60ch; }

/* Buttons */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 6px; border: 1px solid transparent;
  font: 600 .9375rem/1 Raleway, Vazirmatn, system-ui, sans-serif; color: var(--st-ink);
  background: var(--st-raised); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--st-ease), border-color .2s var(--st-ease), transform .2s var(--st-ease);
}
.st-btn:hover, a.st-btn:hover { text-decoration: none; color: var(--st-ink); }
a.st-btn { color: var(--st-ink); }
.st-btn:active { transform: translateY(1px); }
.st-btn:disabled { opacity: .6; cursor: progress; }
.st-btn-primary, a.st-btn-primary { background: var(--st-green); color: #fff; }
.st-btn-primary:hover, a.st-btn-primary:hover { background: var(--st-green-hover); color: #fff; }
.st-btn-quiet { background: transparent; border-color: var(--st-line-strong); }
.st-btn-quiet:hover { background: var(--st-raised); }
.st-btn-danger { background: #8f2f2f; color: #fff; }
.st-btn-danger:hover { background: #a33737; color: #fff; }
.st-btn-wide { width: 100%; }
.st-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.st-home :focus-visible, .st-panel :focus-visible, .st-confirm :focus-visible {
  outline: 2px solid var(--st-green-ink); outline-offset: 2px;
}

/* Checklist with route line */
.st-check { background: var(--st-card); border-radius: var(--st-radius); padding: 28px 32px 30px; margin-block-end: 44px; }
.st-check-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-end: 28px; }
.st-check h2 { font-size: 1.25rem; font-weight: 700; margin: 0; }

.st-route {
  --st-progress: 0;
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); position: relative;
}
/* the track runs between the first and last dot centres (dot = 40px) */
.st-route::before, .st-route::after {
  content: ""; position: absolute; inset-block-start: 18px; height: 4px; border-radius: 2px;
  inset-inline-start: 20px;
}
.st-route::before { inset-inline-end: calc(25% - 20px); background: var(--st-line); }
.st-route::after {
  /* --st-shown is set by setup.js from the last progress this browser saw, so the line only moves for real progress */
  width: calc(75% * var(--st-shown, var(--st-progress)));
  background: linear-gradient(to right, var(--st-green) var(--st-split, 100%), var(--st-blue-ink) var(--st-split, 100%));
  transition: width 1.1s var(--st-ease), height 1.1s var(--st-ease);
}
[dir="rtl"] .st-route::after { background: linear-gradient(to left, var(--st-green) var(--st-split, 100%), var(--st-blue-ink) var(--st-split, 100%)); }
.st-stop-action { margin-block-start: 12px; }

.st-stop { position: relative; z-index: 1; padding-inline-end: 16px; }
.st-dot {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--st-card); border: 3px solid var(--st-line); color: var(--st-ink-2);
  font-weight: 700; font-variant-numeric: tabular-nums; margin-block-end: 12px;
}
.st-dot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.st-stop.is-done .st-dot { background: var(--st-green); border-color: var(--st-green); color: #fff; }
.st-stop.is-current .st-dot { border-color: var(--st-green-ink); color: var(--st-green-ink); }
.st-stop.is-live .st-dot { border-color: var(--st-blue-ink); color: var(--st-blue-ink); animation: st-pulse 2.4s ease-in-out infinite; }
@keyframes st-pulse { 50% { box-shadow: 0 0 0 7px rgba(140, 196, 242, .14); } }
.st-stop-name { display: block; font-weight: 700; font-size: 1rem; color: var(--st-ink); }
.st-stop.is-todo .st-stop-name { color: var(--st-ink-2); }
.st-stop-hint { display: block; color: var(--st-ink-2); font-size: .875rem; margin-block-start: 2px; overflow-wrap: anywhere; }
.st-stop.is-live .st-stop-hint { color: var(--st-blue-ink); }
.st-note { color: var(--st-ink-2); font-size: .875rem; margin: 22px 0 0; max-width: 70ch; }
.st-check .st-note { max-width: none; padding-block-start: 18px; border-block-start: 1px solid var(--st-line); }

/* Sites */
.st-sites-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-block-end: 16px; flex-wrap: wrap; }
.st-sites h2 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.st-plan { color: var(--st-ink-2); font-size: .875rem; margin: 0; }
.st-empty { color: var(--st-ink-2); margin: 0; }

.st-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.st-site {
  background: var(--st-card); border: 1px solid transparent; border-radius: var(--st-radius);
  padding: 22px 22px 18px; display: flex; flex-direction: column; min-height: 268px;
  transition: border-color .2s var(--st-ease);
}
.st-site:hover { border-color: var(--st-line-strong); }
.st-site-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-fav { border-radius: 4px; flex: none; background: var(--st-raised); }
.st-site .st-site-url { color: var(--st-ink); font-weight: 700; font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-underline-offset: 3px; }
.st-site .st-site-url:hover { color: #fff; }

.st-pill { align-self: flex-start; margin: 12px 0 0; font-size: .8125rem; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: var(--st-raised); color: var(--st-ink-2); }
.st-pill.is-keywords, .st-pill.is-start { background: var(--st-amber-bg); color: var(--st-amber-ink); }
.st-pill.is-sent, .st-pill.is-processing { background: var(--st-blue-bg); color: var(--st-blue-ink); }
.st-pill.is-ready { background: #1a2b20; color: #7fd39b; }

/* the route, carried on every card */
.st-mini { list-style: none; display: flex; align-items: center; margin: 14px 0 0; padding: 0; }
.st-mini li { width: 10px; height: 10px; border-radius: 50%; background: var(--st-line-strong); flex: none; }
.st-mini li + li { margin-inline-start: 26px; position: relative; }
.st-mini li + li::before { content: ""; position: absolute; inset-inline-end: 12px; inset-block-start: 4px; width: 22px; height: 2px; background: var(--st-line-strong); }
.st-mini li.is-done { background: var(--st-green-ink); }
.st-mini li.is-done + li.is-done::before, .st-mini li.is-done + li.is-live::before { background: var(--st-green-ink); }
.st-mini li.is-passed { background: var(--st-blue-ink); }
.st-mini li.is-done + li.is-passed::before, .st-mini li.is-passed + li.is-live::before { background: var(--st-blue-ink); }
.st-mini li.is-live { background: var(--st-blue-ink); animation: st-pulse 2.4s ease-in-out infinite; }

.st-metric { margin-block-start: 18px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.st-num { font-size: 2.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.st-num-unit { font-size: 1.25rem; color: var(--st-ink-2); margin-inline-start: 2px; }
.st-num.is-empty { color: var(--st-line-strong); }
.st-num-label { color: var(--st-ink-2); font-size: .875rem; }
.st-delta { flex-basis: 100%; font-size: .8125rem; margin-block-start: 6px; font-weight: 600; }
.st-delta.is-up { color: var(--st-green-ink); }
.st-delta.is-down { color: var(--st-red-ink); }
.st-site-meta { color: var(--st-ink-2); font-size: .875rem; margin: 6px 0 0; }

.st-actions { margin-block-start: auto; padding-block-start: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-link-danger, .st-link {
  background: none; border: 0; padding: 4px 2px; font: 600 .875rem Raleway, Vazirmatn, system-ui, sans-serif; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent;
}
.st-link-danger { color: var(--st-red-ink); margin-inline-start: auto; }
.st-link { color: var(--st-green-ink); }
.st-link-danger:hover, .st-link:hover { text-decoration-color: currentColor; }

.st-site-add { background: transparent; border: 2px dashed var(--st-line); padding: 0; }
.st-site-add:hover { border-color: var(--st-line-strong); }
.st-site-add button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0;
  color: var(--st-ink-2); font: 600 1rem Raleway, Vazirmatn, system-ui, sans-serif; cursor: pointer; border-radius: var(--st-radius);
}
.st-site-add button:hover { color: var(--st-ink); }

/* Side panel */
.st-panel {
  position: fixed; inset-block: 0; inset-inline-end: 0; inset-inline-start: auto; margin: 0;
  width: min(460px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  border: 0; border-inline-start: 1px solid var(--st-line); padding: 0;
  background: var(--st-raised); color: var(--st-ink);
  box-shadow: -24px 0 48px rgba(0, 0, 0, .5);
}
[dir="rtl"] .st-panel { box-shadow: 24px 0 48px rgba(0, 0, 0, .5); }
.st-panel[open] { display: flex; flex-direction: column; animation: st-slide .38s var(--st-ease); }
[dir="rtl"] .st-panel[open] { animation-name: st-slide-rtl; }
@keyframes st-slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes st-slide-rtl { from { transform: translateX(-40px); opacity: 0; } }
.st-panel::backdrop { background: rgba(0, 0, 0, .55); }

.st-panel-bar { display: flex; align-items: center; gap: 16px; padding: 20px 28px 0; }
.st-progress { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.st-progress span { height: 4px; border-radius: 2px; background: var(--st-line); transition: background-color .4s var(--st-ease); }
.st-progress span.is-on { background: var(--st-green-ink); }
.st-close { width: 36px; height: 36px; border-radius: 6px; border: 0; background: transparent; color: var(--st-ink-2); display: grid; place-items: center; cursor: pointer; }
.st-close:hover { background: var(--st-card); color: var(--st-ink); }
.st-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.st-step { flex: 1; display: flex; flex-direction: column; padding: 28px 28px 24px; overflow-y: auto; }
.st-step[hidden] { display: none; }
.st-panel-title { font-size: 1.5rem; font-weight: 700; line-height: 1.25; margin: 0 0 8px; outline: none; text-wrap: balance; }
.st-panel-help { color: var(--st-ink-2); margin: 0 0 24px; }

.st-label { display: block; font-weight: 600; font-size: .9375rem; margin: 18px 0 8px; color: var(--st-ink); }
.st-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.st-label-row .st-label { margin-block-end: 8px; }
.st-counter { color: var(--st-ink-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
.st-input {
  display: block; width: 100%; background: var(--st-ground); color: var(--st-ink);
  border: 1px solid var(--st-line-strong); border-radius: 6px; padding: 11px 12px;
  font: 400 1rem/1.4 Raleway, Vazirmatn, system-ui, sans-serif; caret-color: var(--st-green-ink);
  transition: border-color .2s var(--st-ease);
}
.st-input:hover { border-color: #4a4a4a; }
.st-input:focus { border-color: var(--st-green-ink); outline: none; box-shadow: 0 0 0 3px rgba(95, 194, 131, .18); }
.st-input::placeholder { color: #8f8f8f; }
.st-input-lg { font-size: 1.125rem; padding: 14px; }
select.st-input { appearance: auto; }
.st-textarea { min-height: 220px; resize: vertical; line-height: 1.7; }
.st-hint { color: var(--st-ink-2); font-size: .875rem; margin: 8px 0 0; }
.st-hint.is-warn { color: var(--st-amber-ink); }
.st-error { color: var(--st-red-ink); font-size: .9375rem; font-weight: 600; margin: 10px 0 0; }
.st-error:empty { display: none; }
.st-balance { display: block; margin-top: 2px; }
.st-balance.is-low { color: var(--st-red-ink); font-weight: 600; }
.st-problem { color: var(--st-red-ink); font-size: .875rem; font-weight: 600; line-height: 1.45; margin: 8px 0 0; }

.st-fieldset { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.st-fieldset legend { float: none; width: auto; padding: 0; margin-block-start: 0; }
.st-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--st-line-strong); border-radius: 6px; overflow: hidden; }
.st-seg input { position: absolute; opacity: 0; pointer-events: none; }
.st-seg label { margin: 0; padding: 11px; text-align: center; font-weight: 600; cursor: pointer; color: var(--st-ink-2); transition: background-color .2s var(--st-ease), color .2s var(--st-ease); }
.st-seg label + input + label { border-inline-start: 1px solid var(--st-line-strong); }
.st-seg input:checked + label { background: var(--st-green); color: #fff; }
.st-seg input:focus-visible + label { outline: 2px solid var(--st-green-ink); outline-offset: -4px; }

.st-summary { margin: 0; border-block: 1px solid var(--st-line); }
.st-summary > div { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 14px 0; }
.st-summary > div + div { border-block-start: 1px solid var(--st-line); }
.st-summary dt { color: var(--st-ink-2); font-weight: 600; font-size: .8125rem; grid-column: 1; }
.st-summary dd { margin: 2px 0 0; font-weight: 600; grid-column: 1; overflow-wrap: anywhere; }
.st-summary .st-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.st-summary .st-link[hidden] { display: none; }

.st-vroute { list-style: none; margin: 4px 0 0; padding: 0; }
.st-vroute li { position: relative; padding: 0 0 22px; padding-inline-start: 34px; font-weight: 600; color: var(--st-ink-2); }
.st-vroute li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 2px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--st-line-strong); background: var(--st-raised); box-sizing: border-box; }
.st-vroute li::after { content: ""; position: absolute; inset-inline-start: 8px; inset-block-start: 22px; width: 2px; height: calc(100% - 22px); background: var(--st-line-strong); }
.st-vroute li:last-child::after { display: none; }
.st-vroute li.is-done { color: var(--st-ink); }
.st-vroute li.is-done::before { background: var(--st-green-ink); border-color: var(--st-green-ink); }
.st-vroute li.is-done::after { background: var(--st-green-ink); }
.st-vroute li.is-live { color: var(--st-blue-ink); }
.st-vroute li.is-live::before { border-color: var(--st-blue-ink); animation: st-pulse 2.4s ease-in-out infinite; }

.st-panel-foot { margin-block-start: auto; padding-block-start: 24px; display: flex; gap: 10px; justify-content: flex-end; }
.st-panel-foot .st-btn-primary { flex: 1; }
.st-panel-foot [hidden] { display: none; }

/* Remove confirmation */
.st-confirm { border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-raised); padding: 28px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 48px rgba(0, 0, 0, .5); }
.st-confirm::backdrop { background: rgba(0, 0, 0, .55); }
.st-confirm h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 8px; overflow-wrap: anywhere; }
.st-confirm p { color: var(--st-ink-2); margin: 0; }
.st-confirm .st-panel-foot .st-btn { flex: 1; }

@media (max-width: 860px) {
  .st-home { padding: 28px 16px 56px; }
  .st-head { flex-direction: column; align-items: stretch; }
  .st-title { font-size: 1.625rem; }
  .st-check { padding: 22px 20px; }
  .st-check-head { flex-direction: column; align-items: stretch; }
  .st-route { grid-template-columns: 1fr; row-gap: 18px; }
  /* the route turns vertical, running between the first and last dot centres */
  .st-route::before, .st-route::after { inset-inline-start: 18px; width: 4px; inset-block-start: 20px; }
  .st-route::before { inset-inline-end: auto; inset-block-end: 20px; height: auto; }
  .st-route::after, [dir="rtl"] .st-route::after {
    height: calc((100% - 40px) * var(--st-shown, var(--st-progress)));
    background: linear-gradient(to bottom, var(--st-green) var(--st-split, 100%), var(--st-blue-ink) var(--st-split, 100%));
  }
  .st-stop .st-stop-action { grid-column: 2; justify-self: start; }
  .st-stop { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; padding: 0; }
  .st-stop .st-dot { grid-row: 1 / span 2; margin: 0; }
  .st-grid { grid-template-columns: 1fr; }
  .st-panel-bar { padding: 16px 20px 0; }
  .st-step { padding: 22px 20px 20px; }
}

/* Running check: keywords searched so far (coreui/check-progress) */
.st-check-progress { margin: 14px 0 0; width: 100%; }
.st-check-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .875rem; color: var(--st-ink-2); }
.st-check-progress-count { font-variant-numeric: tabular-nums; }
.st-check-progress-pct { color: var(--st-blue-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.st-check-progress-track { height: 8px; margin-block-start: 8px; border-radius: 4px; background: var(--st-line); overflow: hidden; }
.st-check-progress-fill {
  display: block; height: 100%; min-width: 4px; border-radius: inherit;
  background: linear-gradient(90deg, var(--st-green), var(--st-blue-ink));
  transition: width 1.1s var(--st-ease);
}
[dir="rtl"] .st-check-progress-fill { background: linear-gradient(-90deg, var(--st-green), var(--st-blue-ink)); }
.st-check-progress-eta { margin: 6px 0 0; font-size: .8125rem; color: var(--st-ink-2); }
.st-status .st-check-progress { flex-basis: 100%; }

@media (prefers-reduced-motion: reduce) {
  .st-check-progress-fill { transition: none; }
  .st-route::after { transition: none; }
  .st-panel[open] { animation: none; }
  .st-stop.is-live .st-dot, .st-mini li.is-live, .st-vroute li.is-live::before { animation: none; }
}

/* Report page banner (coreui/report-status) */
.st-home.is-inline { max-width: none; padding: 0; margin-block-end: 20px; }
.st-status {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; row-gap: 12px;
  background: var(--st-card); border-radius: var(--st-radius); padding: 18px 22px;
}
.st-status .st-pill, .st-status .st-mini { margin: 0; }
.st-status-text { flex: 1 1 320px; margin: 0; color: var(--st-ink-2); font-size: .9375rem; }
