/* Widget "Get your number" for smsverify.pro.
   Styling matched to the LIVE smsverify.pro (Open Sans, accent #f4364c, radius 6px,
   flat, no shadows). Mobile-first. Data: catalog.json (our SVN). Redirect to SVN is silent.
   Tokens taken from prod computed style 2026-07-12. */

.gn {
  --ink: #3c3c3c;            /* main text (prod body color) */
  --muted: #8b90a0;          /* secondary */
  --line: #e2e3e8;           /* hairlines */
  --soft: #f6f6f6;           /* prod hero bg / fills */
  --white: #ffffff;
  --accent: #f4364c;         /* prod CTA */
  --accent-hover: #e70e28;   /* prod CTA hover */
  --good: #1f9d57;           /* success-rate high (>=4.5:1 on white) */
  --warn: #b46b0f;           /* success-rate low */
  --radius: 6px;             /* prod radius */

  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  font-family: "Open Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
.gn *, .gn *::before, .gn *::after { box-sizing: border-box; }
.gn button { font-family: inherit; }

.gn-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
@media (min-width: 600px) { .gn-card { padding: 28px; } }

/* header */
.gn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gn-h1 { font-size: 22px; font-weight: 600; margin: 0; color: var(--ink); }
.gn-filters {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  font-size: 14px; padding: 8px 14px; border-radius: var(--radius); cursor: pointer;
}
.gn-filters:hover { border-color: var(--accent); color: var(--accent); }
.gn-filters .n { background: var(--accent); color: #fff; font-size: 12px; min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* stepper + progress */
.gn-step { color: var(--muted); font-size: 14px; margin: 16px 0 8px; }
.gn-step b { color: var(--ink); font-weight: 600; }
.gn-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 18px; }
.gn-bar i { height: 4px; border-radius: 999px; background: var(--line); }
.gn-bar i.on { background: var(--accent); }

/* selected chips */
.gn-chips { display: grid; gap: 10px; margin-bottom: 16px; }
/* minmax(0,1fr) not 1fr — grid tracks default to min-width:auto and would refuse to shrink
   below the chip content, pushing a long name past the card edge. */
@media (min-width: 480px) { .gn-chips.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.gn-chip {
  display: flex; align-items: center; gap: 10px; min-height: 48px; min-width: 0;
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 12px;
}
.gn-chip .m { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
/* name shrinks + ellipsis; flag, dial code and × never shrink → nothing spills out */
.gn-chip b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.gn-chip .m > .gn-flag, .gn-chip .m > .gn-ico { flex-shrink: 0; }
.gn-chip small { color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.gn-chip .x { border: none; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; min-width: 32px; min-height: 32px; flex-shrink: 0; }
.gn-chip .x:hover { color: var(--accent); }

/* search */
.gn-search { position: relative; margin-bottom: 12px; }
.gn-search input {
  width: 100%; min-height: 46px; border: 1px solid #999; background: var(--white);
  border-radius: var(--radius); padding: 11px 14px 11px 40px; font-size: 16px; color: var(--ink);
}
.gn-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.gn-search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* lists */
.gn-list { max-height: 340px; overflow-y: auto; position: relative; }
.gn-list::-webkit-scrollbar { width: 8px; }
.gn-list::-webkit-scrollbar-thumb { background: #dcdee5; border-radius: 8px; }
/* virtualized rows: absolute top=i*rowH. Высота строки задаётся slotом (rowH), контент
   центрируется по вертикали через сам .gn-row (align-items:center). НЕ обрезаем overflow —
   иначе на iOS/крупном системном шрифте срезается низ букв (хвост «g», «y»). rowH берётся
   с запасом (см. app.js), так что соседние строки не наезжают. */
.gn-vrow { box-sizing: border-box; height: var(--gn-rowh); min-height: 0 !important; }
.gn-vrow > .gn-row, .gn-vrow > .gn-crow { height: 100%; }

/* back button (step 3 → step 2) */
.gn-back-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  border: none; background: none; color: var(--muted); font-size: 14px; cursor: pointer;
  padding: 8px 0; margin-bottom: 4px;
}
.gn-back-btn:hover { color: var(--accent); }

/* loading skeleton rows */
.gn-skel { height: 48px; border-radius: var(--radius); margin-bottom: 8px;
  background: linear-gradient(90deg, #f0f1f4 25%, #e7e9ee 50%, #f0f1f4 75%);
  background-size: 200% 100%; animation: gn-sh 1.2s infinite; }
@keyframes gn-sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.gn-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px;
  padding: 10px 8px; border: none; border-bottom: 1px solid var(--line);
  background: none; cursor: pointer; text-align: left; color: inherit; font-size: 16px;
}
.gn-row:last-child { border-bottom: none; }
.gn-row:hover, .gn-row:focus-visible { background: var(--soft); outline: none; }
/* overflow:hidden нужен для ellipsis длинных имён, но он же режет НИЗ глифов с выносом
   (g, y, p) — заметно на iOS-шрифте. Запас по высоте: line-height 1.5 + вертикальный
   padding, чтобы hidden-бокс был выше глифов. padding не влияет на flex-выравнивание. */
.gn-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; padding: 2px 0; }
.gn-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.gn-dial { color: var(--muted); font-size: 14px; }
.gn-price { color: var(--ink); font-size: 14px; font-weight: 600; }
.gn-price .from { color: var(--muted); font-weight: 400; }

/* country row = grid: flag | name(+dial inline) | price | rate.
   dial code lives WITH the country name (logical), NOT next to price.
   Columns match visible cells exactly, so the rate toggle never breaks the layout:
     rate ON  → flag | name | price | rate  (4 cols)
     rate OFF → flag | name | price         (3 cols, via .hide-rate) */
.gn-crow {
  display: grid; align-items: center; width: 100%; min-height: 52px; gap: 10px;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  padding: 10px 8px; border: none; border-bottom: 1px solid var(--line);
  background: none; cursor: pointer; text-align: left; color: inherit; font-size: 16px;
}
.gn-crow:last-child { border-bottom: none; }
.gn-crow:hover, .gn-crow:focus-visible { background: var(--soft); outline: none; }
.gn-crow .gn-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.gn-crow .gn-name .c-dial { color: var(--muted); font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums; }
.gn-crow .c-price { color: var(--ink); font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gn-crow .c-price .from { color: var(--muted); font-weight: 400; }
.gn-crow .c-price .pre { color: var(--accent); font-weight: 600; }
/* Match .c-price's typography (14px/16px) so the % baseline lines up with the price — the cell
   otherwise inherits the row's 16px font-size, giving a taller line-box that visually raises the %. */
.gn-crow .c-rate { text-align: right; font-variant-numeric: tabular-nums; min-width: 40px; font-size: 14px; line-height: 16px; }
.gn.hide-rate .gn-crow { grid-template-columns: 26px minmax(0, 1fr) auto; }
.gn.hide-rate .c-rate { display: none; }
.gn.hide-rate .c-op-rate { display: none; }
@media (max-width: 480px) {
  .gn-crow { gap: 8px; grid-template-columns: 24px minmax(0, 1fr) auto auto; }
  .gn.hide-rate .gn-crow { grid-template-columns: 24px minmax(0, 1fr) auto; }
}

/* service icon: real SVN webp; letter placeholder is the onerror fallback */
.gn-ico {
  width: 34px; height: 34px; border-radius: var(--radius); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; background: var(--soft); color: var(--ink);
  border: 1px solid var(--line); object-fit: contain; overflow: hidden;
}
img.gn-ico { padding: 3px; background: #fff; }

/* success-rate toggle (step 2) */
.gn-toggle { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 14px; color: var(--muted); cursor: pointer; min-height: 40px; }
.gn-toggle input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.gn-flag { width: 26px; height: 18px; border-radius: 3px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); background: var(--soft); }

/* success-rate */
.gn-rate { font-size: 13px; font-weight: 600; }
.gn-rate.good { color: var(--good); }
.gn-rate.warn { color: var(--warn); }
/* operator-row delivery %: same 14px/16px line-box as .gn-price so its baseline lines up
   (else it inherits the row's 16px, sitting visually higher than the price). */
.gn-prov .c-op-rate { font-size: 14px; line-height: 16px; }

/* choose button — inline-flex+center so the label sits in the MIDDLE of the min-height:40px
   box. Without this the <span>'s text hugs the baseline and looks shifted UP inside the row. */
.gn-choose {
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  font-size: 14px; padding: 8px 16px; border-radius: var(--radius); cursor: pointer;
  min-height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.gn-choose:hover { border-color: var(--accent); color: var(--accent); }

/* "Not on the list" — always-present last row → pre-order bot */
.gn-notlisted { text-decoration: none; color: inherit; }
.gn-notlisted .gn-name { font-weight: 600; }
.gn-ico-q {
  background: var(--soft); color: var(--accent); border-color: var(--line);
  font-size: 20px; font-weight: 700;
}
.gn-notlisted:hover .gn-choose { border-color: var(--accent); color: var(--accent); }

/* providers */
.gn-sub { font-size: 13px; font-weight: 600; color: var(--muted); margin: 4px 0 8px; }
.gn-prov {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  padding: 12px 14px; cursor: pointer; margin-bottom: 8px; text-align: left; color: inherit; font-size: 16px;
}
.gn-prov[aria-checked="true"] { border-color: var(--accent); background: #fff5f6; }
.gn-prov:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gn-prov .pname { flex: 1; font-weight: 600; }
.gn-prov .left { color: var(--muted); font-size: 13px; }
.gn-radio { width: 20px; height: 20px; border-radius: 999px; border: 2px solid #c3c6ce; flex-shrink: 0; position: relative; }
.gn-prov[aria-checked="true"] .gn-radio { border-color: var(--accent); }
.gn-prov[aria-checked="true"] .gn-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--accent); }

/* hidden-note */
.gn-note { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 0 2px; }
.gn-note button { border: none; background: none; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13px; min-height: 40px; }

/* buy button (prod CTA) */
.gn-buy {
  width: 100%; min-height: 50px; margin-top: 16px; border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.gn-buy:hover:not([disabled]) { background: var(--accent-hover); }
.gn-buy[disabled] { background: #d9adb2; cursor: not-allowed; }
.gn-buy:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.gn-empty { text-align: center; color: var(--muted); padding: 32px 10px; }

/* ===== Filters modal (flat, brand) ===== */
.gn-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 9999; }
.gn-modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; padding: 20px; }
.gn-modal h2 { font-size: 18px; font-weight: 600; margin: 0 0 16px; display: flex; justify-content: space-between; align-items: center; }
.gn-modal h2 button { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); min-width: 40px; min-height: 40px; }
.gn-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gn-f label { font-size: 15px; }
.gn-f input { width: 90px; min-height: 44px; border: 1px solid #999; border-radius: var(--radius); padding: 8px 10px; font-size: 16px; text-align: right; }
.gn-sort { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.gn-sort button { min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); font-size: 14px; cursor: pointer; color: var(--ink); }
.gn-sort button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: #fff5f6; }
.gn-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.gn-foot .reset { border: none; background: none; color: var(--muted); cursor: pointer; min-height: 44px; }
.gn-foot .apply { border: none; background: var(--accent); color: #fff; font-weight: 600; padding: 12px 24px; border-radius: var(--radius); cursor: pointer; min-height: 44px; }
