/*
 * Your site (app/views/sites, SitesController): the connection ladder, the
 * search queries, the business profile, keywords, competitors and the
 * settings shortcuts. Every rule sits under .shell .pg-site; the page header
 * block carries the class too (it renders in the shell's app-head).
 * Shared components (ui-card, ui-chip, ui-btn...) are in ui.css; this file
 * only places them and gives the cards their padding.
 */

.shell .pg-site { color: var(--app-ink); font-size: 14px; line-height: 1.5; }

/* ── Page header: favicon, domain, platform, status line ── */
.shell .pg-site.site-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.shell .pg-site .site-head__fav { display: inline-flex; flex: none; }
.shell .pg-site .site-head__fav .app-fav { width: 36px; height: 36px; padding: 5px; border-radius: 10px; }
.shell .pg-site .site-head__fav .app-fav--letter { padding: 0; font-size: 15px; }
.shell .pg-site .site-head__text { min-width: 0; }
.shell .pg-site .site-head__row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shell .pg-site .site-head__row h1 { min-width: 0; }
.shell .pg-site .site-head__page { display: none; }
.shell .pg-site .site-head__status { margin: 3px 0 0; font-size: 13px; line-height: 1.4; color: var(--app-ink-2); }
.shell .pg-site.site-actions { display: inline-flex; }

/* ── Cards (ui.css) get their padding here: 24 for the hero, 20 for the
   side cards, 16 for the hero on phones ── */
.shell .pg-site .ui-card { position: relative; padding: 20px; color: var(--app-ink); }
.shell .pg-site .ui-card--hero { padding: 24px; }

/* ── Layout: main column and a side column of cards ── */
.shell .pg-site .site-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.shell .pg-site .site-main { display: grid; gap: 40px; min-width: 0; }
.shell .pg-site .site-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }

/* ── Sections: flat, a hair rule under the header ── */
.shell .pg-site .site-section { min-width: 0; }
.shell .pg-site .site-section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--app-hair);
}
.shell .pg-site .site-section__title { margin: 0; font-family: var(--f-display); font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--app-ink); }
.shell .pg-site .site-section__meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--app-ink-3); font-variant-numeric: tabular-nums; }
.shell .pg-site .site-section__lead { margin: 12px 0 0; max-width: 64ch; font-size: 14px; color: var(--app-ink-2); }
.shell .pg-site .site-section__more { margin-top: 12px; }

/* ── The connection ladder (hero card) ── */
.shell .pg-site .site-ladder__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.shell .pg-site .site-ladder__head .ui-label { line-height: 1.3; }
.shell .pg-site .site-ladder__count { font-family: var(--f-mono); font-size: 12px; color: var(--app-ink-3); font-variant-numeric: tabular-nums; }
.shell .pg-site .site-ladder__count b { font-weight: 600; color: var(--app-ink); }

.shell .pg-site .site-steps { margin: 0; padding: 0; list-style: none; }
.shell .pg-site .site-step { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 16px; }
.shell .pg-site .site-step__rail { display: flex; flex-direction: column; align-items: center; padding-top: 2px; }
.shell .pg-site .site-step__rung { flex: 1; width: 2px; min-height: 16px; margin: 6px 0 4px; border-radius: 2px; background: var(--app-hair-2); }
.shell .pg-site .site-step__rung--done { background: var(--app-sheen-y); }
.shell .pg-site .site-step__rung--ahead { background: repeating-linear-gradient(to bottom, var(--app-hair-2) 0 4px, transparent 4px 8px); }
.shell .pg-site .site-step__body { min-width: 0; padding-bottom: 28px; }
.shell .pg-site .site-step:last-child .site-step__body { padding-bottom: 0; }
/* The current step's panel bleeds up so its title stays level with the node. */
.shell .pg-site .site-step__body.ui-warm { margin: -14px 0 28px; padding: 14px 18px 18px; }
.shell .pg-site .site-step:last-child .site-step__body.ui-warm { margin-bottom: 0; padding-bottom: 18px; }

.shell .pg-site .site-step__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 22px; }
.shell .pg-site .site-step__title { margin: 0; font-family: var(--f-display); font-size: 16px; font-weight: 700; line-height: 22px; letter-spacing: -0.01em; color: var(--app-ink); }
.shell .pg-site .site-step--ahead .site-step__title { color: var(--app-ink-2); }
.shell .pg-site .site-step__text { margin: 6px 0 0; max-width: 62ch; font-size: 14px; color: var(--app-ink-2); }
.shell .pg-site .site-step__text b { font-weight: 600; color: var(--app-ink); overflow-wrap: anywhere; }
.shell .pg-site .site-step--ahead .site-step__text { color: var(--app-ink-3); }
.shell .pg-site .site-step__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0 0; font-size: 12.5px; color: var(--app-ink-3); }
.shell .pg-site .site-step__note { margin: 12px 0 0; max-width: 62ch; font-size: 13px; color: var(--app-ink-3); }
.shell .pg-site .site-plugin { gap: 6px; color: var(--app-ink-2); }
.shell .pg-site .site-plugin svg { flex: none; color: var(--app-ok); }
.shell .pg-site .site-step__controls,
.shell .pg-site .site-step__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 14px; }
.shell .pg-site .site-step__body > .ui-link { display: inline-block; margin-top: 10px; }
.shell .pg-site .site-step__article { font-weight: 600; color: var(--app-ink); text-decoration: none; overflow-wrap: anywhere; }
.shell .pg-site .site-step__article:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.shell .pg-site .site-url { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-family: var(--f-mono); font-size: 12px; color: var(--app-accent); text-decoration: none; overflow-wrap: anywhere; }
.shell .pg-site .site-url span { min-width: 0; }
.shell .pg-site .site-url svg { flex: none; }
.shell .pg-site .site-url:hover span { text-decoration: underline; text-underline-offset: 3px; }
.shell .pg-site .site-num { font-family: var(--f-mono); font-size: 12px; color: var(--app-ink-2); font-variant-numeric: tabular-nums; }
.shell .pg-site .site-inline-form { display: inline-flex; margin: 0; }

.shell .pg-site .site-ladder__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--app-hair);
  font-size: 12.5px; color: var(--app-ink-3);
}

/* "Send the setup to my web person", folded under the connect button. */
.shell .pg-site .site-setup { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255, 120, 70, 0.18); }
.shell .pg-site .site-setup summary {
  display: flex; align-items: center; gap: 8px; min-height: 32px;
  font-size: 13.5px; font-weight: 500; color: var(--app-ink-2);
  list-style: none; cursor: pointer; border-radius: 6px;
}
.shell .pg-site .site-setup summary::-webkit-details-marker { display: none; }
.shell .pg-site .site-setup summary svg { flex: none; color: var(--app-ink-3); }
.shell .pg-site .site-setup summary::after {
  content: ''; flex: none; width: 7px; height: 7px; margin: -3px 4px 0 auto;
  border-right: 1.5px solid var(--app-ink-3); border-bottom: 1.5px solid var(--app-ink-3);
  transform: rotate(45deg); transition: transform 0.18s var(--app-ease);
}
.shell .pg-site .site-setup[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
.shell .pg-site .site-setup summary:hover { color: var(--app-ink); }
.shell .pg-site .site-setup__text { margin: 6px 0 12px; font-size: 13px; color: var(--app-ink-3); }
.shell .pg-site .site-setup__form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px; }

/* ── Search queries ── */
.shell .pg-site .site-queries { margin-top: 4px; }
.shell .pg-site .site-query {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 56px 72px 64px; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--app-hair);
}
.shell .pg-site .site-query--head { padding: 10px 0 8px; font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--app-ink-3); }
.shell .pg-site .site-query__text { min-width: 0; font-size: 14px; color: var(--app-ink); overflow-wrap: anywhere; }
.shell .pg-site .site-query__spark { display: block; height: 24px; color: var(--app-ember); }
.shell .pg-site .site-query__spark svg { display: block; width: 96px; height: 24px; overflow: visible; }
.shell .pg-site .site-query__n { text-align: right; font-family: var(--f-mono); font-size: 12px; color: var(--app-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── About your business ── */
.shell .pg-site .site-save { display: inline-flex; align-items: center; gap: 6px; min-height: 18px; font-family: var(--f-mono); font-size: 11.5px; color: var(--app-ink-3); font-variant-numeric: tabular-nums; }
.shell .pg-site .site-save__saving { display: none; }
.shell .pg-site .site-save.is-saved::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--app-ok); }
.shell .pg-site .site-save.is-error { font-family: var(--f-body); font-size: 12.5px; color: var(--app-hot); }
.shell .pg-site .site-section:has(form[aria-busy="true"]) .site-save__saving { display: inline; }
.shell .pg-site .site-section:has(form[aria-busy="true"]) .site-save__state,
.shell .pg-site .site-section:has(form[aria-busy="true"]) .site-save::before { display: none; }

.shell .pg-site .site-about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.shell .pg-site .site-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.shell .pg-site .site-field--wide { grid-column: 1 / -1; }
.shell .pg-site .site-field__label { font-size: 13px; font-weight: 600; color: var(--app-ink); }
.shell .pg-site .site-field__hint { font-size: 12.5px; color: var(--app-ink-3); }
.shell .pg-site .site-field__error { margin: 8px 0 0; font-size: 12.5px; color: var(--app-hot); }

/* ── Keywords ── */
.shell .pg-site .site-kws { margin: 8px 0 0; padding: 0; list-style: none; }
.shell .pg-site .site-kw {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--app-hair);
}
.shell .pg-site .site-kw__name { min-width: 0; font-size: 14px; color: var(--app-ink); overflow-wrap: anywhere; transition: color 0.15s var(--app-ease); }
.shell .pg-site .site-kw.is-off .site-kw__name { color: var(--app-ink-3); }
.shell .pg-site .site-kw__vol { font-size: 12.5px; color: var(--app-ink-3); white-space: nowrap; }
.shell .pg-site .site-kw__vol b { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--app-ink-2); font-variant-numeric: tabular-nums; }
.shell .pg-site .site-kw.is-off .site-kw__vol b { color: var(--app-ink-3); }
.shell .pg-site .site-kw__none { font-size: 12.5px; }
.shell .pg-site .site-kw__form { display: flex; margin: 0; }

/* ── Side cards ── */
.shell .pg-site .site-card__title { margin: 0; font-family: var(--f-display); font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--app-ink); }
.shell .pg-site .site-card__lead { margin: 4px 0 0; font-size: 13px; color: var(--app-ink-3); }
.shell .pg-site .site-card__empty { margin: 14px 0 0; font-size: 13.5px; color: var(--app-ink-2); }
.shell .pg-site .site-card__note { margin: 14px 0 0; font-size: 13px; color: var(--app-ink-3); }
.shell .pg-site .site-inline-link { color: var(--app-accent); font-weight: 600; text-decoration: none; }
.shell .pg-site .site-inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.shell .pg-site .site-comps { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.shell .pg-site .site-comp {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 3px 0 8px;
  border-radius: 8px; background: var(--app-bg); box-shadow: inset 0 0 0 1px var(--app-hair-2);
  font-family: var(--f-mono); font-size: 12px; color: var(--app-ink);
}
.shell .pg-site .site-comp__fav { flex: none; width: 14px; height: 14px; border-radius: 3px; }
.shell .pg-site .site-comp__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell .pg-site .site-comp__form { display: flex; margin: 0; }
.shell .pg-site .site-comp__x {
  position: relative; display: grid; place-items: center; width: 24px; height: 24px;
  border: 0; border-radius: 6px; background: none; color: var(--app-ink-3); cursor: pointer;
  transition: background-color 0.15s var(--app-ease), color 0.15s var(--app-ease);
}
.shell .pg-site .site-comp__x::after { content: ''; position: absolute; inset: -6px -4px; }
.shell .pg-site .site-comp__x:hover { background: var(--app-hover); color: var(--app-hot); }
.shell .pg-site .site-comp-add { display: flex; gap: 8px; margin-top: 14px; }
.shell .pg-site .site-comp-add .ui-input { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; font-family: var(--f-mono); font-size: 12.5px; }
.shell .pg-site .site-comp-add .ui-btn { flex: none; }

.shell .pg-site .site-adv__list { margin: 10px -8px -6px; padding: 0; list-style: none; }
.shell .pg-site .site-adv__row {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px;
  border-radius: 8px; color: var(--app-ink); font-size: 14px; text-decoration: none;
  transition: background-color 0.15s var(--app-ease);
}
.shell .pg-site .site-adv__row:hover { background: var(--app-hover); }
.shell .pg-site .site-adv__row:focus-visible { outline-offset: -2px; }
.shell .pg-site .site-adv__icon { display: inline-flex; flex: none; color: var(--app-ink-3); }
.shell .pg-site .site-adv__label { flex: 1 0 auto; white-space: nowrap; }
.shell .pg-site .site-adv__meta { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--f-mono); font-size: 11.5px; color: var(--app-ink-3); font-variant-numeric: tabular-nums; }
.shell .pg-site .site-adv__chev { display: inline-flex; flex: none; color: var(--app-ink-3); transition: transform 0.15s var(--app-ease); }
.shell .pg-site .site-adv__row:hover .site-adv__chev { transform: translateX(2px); }
/* Images leads with the latest covers, the whole tile one link. */
.shell .pg-site .site-adv__images {
  display: block; margin: 14px -8px 0; padding: 8px 8px 0; border-radius: 10px; color: var(--app-ink); text-decoration: none;
  transition: background-color 0.15s var(--app-ease);
}
.shell .pg-site .site-adv__images:hover { background: var(--app-hover); }
.shell .pg-site .site-adv__images:focus-visible { outline-offset: -2px; }
.shell .pg-site .site-adv__images .site-adv__row { padding: 8px 0; background: none; }
.shell .pg-site .site-adv__images:hover .site-adv__chev { transform: translateX(2px); }
.shell .pg-site .site-adv__images .site-adv__label { font-weight: 600; }
.shell .pg-site .site-adv__covers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.shell .pg-site .site-adv__covers .ui-cover { width: 100%; height: auto; aspect-ratio: 1.91; border-radius: 8px; }
.shell .pg-site .site-adv__covers .site-adv__sheen { grid-column: 1 / -1; display: grid; place-items: center; aspect-ratio: auto; height: 64px; color: var(--app-ink-3); }
.shell .pg-site .site-adv__images + .site-adv__list { margin-top: 2px; }

/* ── Narrower windows: one column, the side cards side by side ── */
@media (max-width: 1279.98px) {
  .shell .pg-site .site-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .shell .pg-site .site-side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
}

/* ── Phones and tablets (the shell's top bar shows the domain) ── */
@media (max-width: 1023.98px) {
  .shell .pg-site .site-head__fav { display: none; }
  .shell .pg-site .site-head__domain { display: none; }
  .shell .pg-site .site-head__page { display: inline; }
  .shell .pg-site .site-head__row { flex-wrap: wrap; gap: 6px 10px; }
  .shell .pg-site .site-visit { width: 44px; height: 44px; padding: 0; }
  .shell .pg-site .site-visit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .shell .pg-site .site-grid, .shell .pg-site .site-main { gap: 32px; }
  .shell .pg-site .ui-card--hero { padding: 16px; }
  .shell .pg-site .site-step__body.ui-warm { padding: 14px 14px 16px; }
  .shell .pg-site .site-step__actions .ui-btn--primary { height: 44px; }
  .shell .pg-site .site-step__actions .site-inline-form:has(.ui-btn--primary) { display: flex; width: 100%; }
  .shell .pg-site .site-step__actions .ui-btn--primary { width: 100%; }
  .shell .pg-site .ui-switch { height: 44px; padding-right: 14px; }
  .shell .pg-site .ui-switch--bare { height: auto; margin: -8px -6px; padding: 12px 6px; }
  .shell .pg-site .site-comp { height: 36px; }
  .shell .pg-site .site-comp__x { width: 30px; height: 30px; }
  .shell .pg-site .site-comp__x::after { inset: -7px; }
  .shell .pg-site .site-comp-add .ui-input { min-height: 44px; }
  .shell .pg-site .site-comp-add .ui-btn { height: 44px; }
  .shell .pg-site .site-setup summary { min-height: 44px; }
  .shell .pg-site .site-setup__form { grid-template-columns: minmax(0, 1fr); }
  .shell .pg-site .site-setup__form .ui-btn { height: 44px; }
  .shell .pg-site .site-adv__row { min-height: 44px; }
  .shell .pg-site .ui-input { min-height: 44px; font-size: 16px; }
}

@media (max-width: 719.98px) {
  .shell .pg-site .site-side { grid-template-columns: minmax(0, 1fr); }
  .shell .pg-site .site-about { grid-template-columns: minmax(0, 1fr); }
  .shell .pg-site .site-step { column-gap: 12px; }

  .shell .pg-site .site-query--head { display: none; }
  .shell .pg-site .site-query {
    grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "text text text" "spark clicks pos";
    row-gap: 6px; column-gap: 16px;
  }
  .shell .pg-site .site-query__text { grid-area: text; }
  .shell .pg-site .site-query__spark { grid-area: spark; }
  .shell .pg-site .site-query__n[data-label="Clicks"] { grid-area: clicks; }
  .shell .pg-site .site-query__n[data-label="Pos."] { grid-area: pos; }
  .shell .pg-site .site-query__n[data-label="Impr."] { display: none; }
  .shell .pg-site .site-query__n::before { content: attr(data-label) " "; color: var(--app-ink-3); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; }
}

@media (prefers-reduced-motion: reduce) {
  .shell .pg-site *, .shell .pg-site *::before, .shell .pg-site *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
