:root{
  --safe-top:env(safe-area-inset-top, 0px);
  /* Типове значення; точну висоту ставить tourCardHeight() при відкритті. */
  --tour-card-h:42svh;
  /* One scale for the whole interface. Before this there were 16 font sizes,
     10 radii and about 20 padding combinations, which is what made the pages
     read as assembled rather than designed. */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px;
  --r-xs:5px; --r-sm:10px; --r-md:14px; --r-lg:16px; --r-xl:20px; --r-pill:999px;
  /* Шкала піднята на крок: 12/13 читались як дрібний шрифт на телефоні,
     а майже весь інтерфейс ходить через ці токени, тож більшає скрізь
     одночасно і пропорції лишаються ті самі. Поля вводу не чіпаємо —
     нижче 16px iOS збільшує сторінку на фокусі. */
  --fs-xs:13px; --fs-sm:14px; --fs-base:15px; --fs-md:16px; --fs-lg:19px; --fs-xl:23px;
  /* Apple's minimum comfortable tap target. */
  --tap:44px;
  /* A secondary button has to sit ABOVE the card it is on, not below it.
     --bg is the page colour, so using it made buttons read as holes. */
  --btn:#232832; --btn-hover:#2d333f; --btn-border:#3a4150;
  /* Fields are capped by what goes in them: a repeat count does not need
     440px, and a full-width row of empty box looks unconsidered. */
  --field-xs:150px; --field-sm:320px; --field-md:460px;
  --bg:#0b0d10; --card:#15181d; --card-border:#22262d; --text:#eef0f2; --muted:#8a919b;
  --accent:#ff4b4b; --accent2:#ff8a3d; --ok:#3ddc84;
  --n1:#ff4b4b; --n2:#ff8a3d; --n3:#4b9eff; --n4:#b26bff; --n5:#2dd4bf; --n6:#ffd23d; --n7:#3ddc84;
  --n8:#8a919b;
}

.acc-num{
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:22px; height:22px; border-radius:50%; font-size:var(--fs-xs); font-weight:700;
  color:#111; margin-right:2px;
}
.num-1{background:var(--n1)} .num-2{background:var(--n2)} .num-3{background:var(--n3)}
.num-4{background:var(--n4)} .num-5{background:var(--n5)} .num-6{background:var(--n6)}
.num-7{background:var(--n7)}
.num-8{background:var(--n8)}
.acc.num-border-1{border-left:3px solid var(--n1)} .acc.num-border-2{border-left:3px solid var(--n2)}
.acc.num-border-3{border-left:3px solid var(--n3)} .acc.num-border-4{border-left:3px solid var(--n4)}
.acc.num-border-5{border-left:3px solid var(--n5)} .acc.num-border-6{border-left:3px solid var(--n6)}
.acc.num-border-7{border-left:3px solid var(--n7)}
.acc.num-border-8{border-left:3px solid var(--n8)}

.quick-nav{
  display:flex; gap:6px; padding:2px 2px 12px; margin-bottom:2px;
}
.quick-nav::-webkit-scrollbar{height:0}
.quick-nav-item{
  flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
  padding:10px 8px; border-radius:var(--r-md); background:var(--card);
  border:1px solid var(--card-border); font-size:var(--fs-sm); color:var(--muted);
  cursor:pointer; text-align:center; line-height:1.25; min-width:0;
}
.quick-nav-item.active{color:var(--text); font-weight:600; border-color:var(--accent)}
.quick-nav-item .acc-num{width:18px; height:18px; font-size:var(--fs-xs)}
.sidebar-item.has-unread, .quick-nav-item.has-unread{position:relative}
.sidebar-item.has-unread::after, .quick-nav-item.has-unread::after{
  content:''; position:absolute; top:6px; right:8px;
  width:8px; height:8px; border-radius:50%; background:var(--accent);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
/* Double-tap to zoom is never what someone meant on a page of switches and
   chips, and it costs every tap a 300ms wait while the browser decides.
   `manipulation` drops that gesture and keeps pinch-zoom, which is the one
   people actually use to read a screenshot — unlike user-scalable=no, which
   would take that away too. */
html, body{touch-action:manipulation}
[hidden]{display:none!important}
body{
  margin:0; font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text',sans-serif;
  background:var(--bg); color:var(--text);
  /* Safari's bottom bar sits over the page, and its height is not in
     safe-area-inset-bottom while it is showing, so the last card ended under
     it. This is that bar plus the home indicator. */
  padding:calc(20px + env(safe-area-inset-top)) 16px calc(72px + env(safe-area-inset-bottom));
}
.wrap{max-width:520px; margin:0 auto}
.sidebar{display:none}

/* Desktop: this is a SETTINGS page, not a metrics dashboard — real settings
   UIs (Stripe, GitHub, Linear) show one section at a time next to a
   persistent nav, rather than every panel expanded simultaneously. That
   fixes "everything open = lost" at the source instead of fighting layout. */
@media (min-width: 860px){
  .wrap{max-width:1080px}
  .settings-shell{display:flex; gap:28px; align-items:flex-start}
  .quick-nav{display:none}
  .sidebar{
    display:flex; flex-direction:column; gap:2px; flex:none; width:230px;
    position:sticky; top:20px;
  }
  .sidebar-item{
    display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--r-sm);
    cursor:pointer; font-size:var(--fs-base); color:var(--muted);
  }
  .sidebar-item:hover{background:var(--card)}
  .sidebar-item.active{background:var(--card); color:var(--text); font-weight:600; border:1px solid var(--card-border)}
  .sidebar-icon{width:20px; text-align:center; flex:none}
  .content-pane{flex:1; min-width:0}

  .plan-cards{overflow-x:visible; flex-wrap:nowrap; scroll-snap-type:none}
  .plan-card{flex:1 1 0; max-width:none; scroll-snap-align:none}
}
.pane-col{display:flex; flex-direction:column; min-width:0}
@media (min-width: 1100px){
  .content-pane{display:flex; align-items:flex-start; gap:var(--sp-5); max-width:none}
  .pane-col{flex:1 1 0}
}
@media (min-width: 1400px){
  .wrap{max-width:1360px}
  .sidebar{width:260px}
}
/* Wraps instead of overflowing: with the guide link there are three pills,
   and on a 320px iPhone they pushed the page 13px wider than the screen. */
.topbar{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:22px}
.topbar-actions{display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:12px; min-width:0}
.brand{display:flex; align-items:center; gap:10px}
.brand .badge{
  width:34px; height:34px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--accent), var(--accent2)); font-size:var(--fs-lg);
}
.brand h1, .brand .brand-name{font-size:var(--fs-lg); margin:0; letter-spacing:-.2px}
/* These are links with padding, so the 44px tap height stretched them into
   lopsided ovals with the text sitting at the top. They are chips of one
   height and one shape now, with their content centred. */
.logout{
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
  min-height:34px; padding:0 var(--sp-3); white-space:nowrap;
  font-size:var(--fs-xs); color:var(--muted); text-decoration:none;
  border:1px solid var(--card-border); border-radius:var(--r-sm);
}
.logout:active{opacity:.6}
.plan-badge{font-size:var(--fs-xs); font-weight:700; letter-spacing:.04em; padding:4px 10px; border-radius:var(--r-pill)}
.plan-badge.pro{background:linear-gradient(135deg, var(--accent), var(--accent2)); color:#fff}
.plan-badge.free{background:var(--card); border:1px solid var(--card-border); color:var(--muted)}

.section{margin-bottom:26px}
.section-title{font-size:var(--fs-sm); color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin:0 0 10px 4px}
.card{background:var(--card); border:1px solid var(--card-border); border-radius:var(--r-lg); overflow:hidden}

.content-pane .panel{display:none; min-width:0}
.content-pane .panel.active-panel{display:block; animation:slide-in .2s ease}
/* Side by side on a desktop, so everything in a group stays open; on a phone
   they stack, and only the first one does. */
@media (min-width: 860px){
  .acc-body[hidden], #plans-body[hidden]{display:block !important}
  .acc-head, .plan-summary{cursor:default}
  .chev{display:none}
  /* A guide collapses on every width, so its own chevron stays. */
  .guide-head .chev{display:inline}
}

.acc{margin-bottom:16px; border:1px solid var(--card-border); border-radius:var(--r-lg); overflow:hidden; background:var(--card)}
.acc-head{
  display:flex; justify-content:space-between; align-items:center; padding:18px 18px 12px; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.acc-title{font-size:var(--fs-md); font-weight:600}
.acc-sub{font-size:var(--fs-xs); font-weight:400; color:var(--muted); margin-left:6px}
.acc-sub.locked-badge{color:var(--accent2)}
.acc-body{padding:0 18px 18px; display:flex; flex-direction:column; gap:12px}
.acc-body .card{margin-top:0}
/* A box inside a box inside a card: the inner frame earned nothing and
   doubled every edge. Fields sit directly on the panel, and the hint that
   explains them sits right under them instead of across another border. */
.acc-body .card{border-color:transparent; background:transparent}
.acc-body .addbox{padding:0; background:transparent; border:none}

/* A toggle beside a six-line paragraph centres itself against the whole
   block and reads as unattached. The switch belongs on the title's line. */
.setting-block{
  padding:var(--sp-4); border-radius:var(--r-md);
  border:1px solid var(--card-border); background:var(--bg);
  display:flex; flex-direction:column; gap:var(--sp-2);
}
.setting-head{display:flex; align-items:center; justify-content:space-between; gap:var(--sp-3)}
.setting-title{font-size:var(--fs-base); font-weight:600}
.setting-block .hint{margin:0}
.acc-body .addbox{margin-top:0}
.acc-body .hint{margin-left:0}

.plan-summary{
  display:flex; justify-content:space-between; align-items:center; cursor:pointer;
  background:var(--card); border:1px solid var(--card-border); border-radius:var(--r-lg); padding:14px 16px; margin-bottom:10px;
}
#plans-body{padding:0; margin-bottom:10px}
.plan-cards{
  display:flex; flex-direction:row; gap:12px; margin-top:10px; padding-bottom:6px;
  overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.plan-cards::-webkit-scrollbar{height:6px}
.plan-cards::-webkit-scrollbar-thumb{background:var(--card-border); border-radius:3px}
.plan-card{
  background:var(--card); border:1px solid var(--card-border); border-radius:var(--r-lg); padding:16px;
  flex:0 0 82%; max-width:300px; scroll-snap-align:center;
}
@media (min-width: 480px){
  .plan-card{flex-basis:270px}
}
.plan-card.current{border-color:var(--accent)}
.plan-card-top{display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px}
.plan-card-name{font-size:var(--fs-md); font-weight:700}
.plan-card-price{font-size:var(--fs-base); color:var(--muted)}
.plan-card ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px}
.plan-card li{font-size:var(--fs-sm); display:flex; align-items:center; gap:8px}
.plan-card li.no{color:var(--muted)}
.plan-card li .mark{flex:none; width:16px; text-align:center}
.plan-card li.yes .mark{color:var(--ok)}
.plan-card li.no .mark{color:var(--accent2)}
.plan-card li.no .req-plan{color:var(--accent2); font-weight:600; margin-left:auto; flex:none; font-size:var(--fs-xs); white-space:nowrap}



/* ── Support ────────────────────────────────────────────────────────────
   Three guides sat in one card, each a different shape: a link, a strip of
   screenshots, a paragraph. They are three rows of the same shape now, and
   what is inside each differs only because the subject does. */
.guide{border:1px solid var(--card-border); border-radius:var(--r-md); background:var(--card); overflow:hidden}
.guide + .guide{margin-top:var(--sp-3)}
.guide-landed{animation:guide-landed 1.6s ease-out}
@keyframes guide-landed{
  0%{border-color:var(--accent); box-shadow:0 0 0 3px rgba(255,75,75,.25)}
  60%{border-color:var(--accent); box-shadow:0 0 0 3px rgba(255,75,75,.18)}
  100%{border-color:var(--card-border); box-shadow:0 0 0 0 rgba(255,75,75,0)}
}
@media (prefers-reduced-motion: reduce){
  .guide-landed{animation:none; border-color:var(--accent)}
}
.guide-top{display:flex; align-items:stretch}
.guide-head{
  all:unset; box-sizing:border-box; cursor:pointer;
  display:flex; align-items:center; gap:var(--sp-3);
  flex:1 1 auto; min-width:0; padding:var(--sp-4); min-height:var(--tap);
}
.guide-head:hover{background:rgba(255,255,255,.02)}
/* One guide can be sent on its own, so each carries its own link. */
.guide-link{
  all:unset; box-sizing:border-box; cursor:pointer; flex:none;
  display:flex; align-items:center; justify-content:center;
  width:var(--tap); font-size:var(--fs-sm); opacity:.45;
}
.guide-link:hover{opacity:1}
.guide-link:active{opacity:.6}
.guide-icon{flex:none; font-size:var(--fs-lg); line-height:1}
.guide-text{display:flex; flex-direction:column; gap:2px; flex:1 1 auto; min-width:0}
.guide-q{font-size:var(--fs-base); font-weight:600; color:var(--text); line-height:1.35}
.guide-sub{font-size:var(--fs-sm); color:var(--muted); line-height:1.4}
.guide-head .chev{flex:none}
.guide-body{padding:0 var(--sp-4) var(--sp-4); border-top:1px solid var(--card-border); padding-top:var(--sp-4)}
.guide-lede{margin:0 0 var(--sp-4); font-size:var(--fs-sm); color:var(--muted); line-height:1.55}
.guide-body .steps{margin:0}
.guide-action{
  all:unset; box-sizing:border-box; cursor:pointer; display:flex; align-items:center;
  justify-content:center; width:100%; margin-top:var(--sp-4); min-height:var(--btn-h);
  padding:0 var(--sp-4); border-radius:var(--r-sm);
  border:1px solid var(--btn-border); background:var(--btn);
  font-size:var(--fs-sm); font-weight:600; color:var(--text); text-align:center;
}
.guide-action:hover{border-color:var(--accent2)}
.guide-action:active{opacity:.7}

/* ── Chat ───────────────────────────────────────────────────────────────
   It was a list of "Власник: text" lines, which reads as a log, not as a
   conversation someone is waiting on an answer in. */
.chat{
  display:flex; flex-direction:column; gap:var(--sp-3);
  max-height:360px; overflow-y:auto; padding:var(--sp-1) 2px;
}
.chat-row{display:flex}
.chat-row.from-me{justify-content:flex-end}
.chat-bubble{
  max-width:min(84%, 460px); padding:10px 12px; border-radius:var(--r-md);
  background:var(--btn); border:1px solid var(--card-border);
}
.from-me .chat-bubble{
  background:rgba(255,138,61,.12); border-color:rgba(255,138,61,.3);
  border-bottom-right-radius:var(--r-xs);
}
.from-owner .chat-bubble{border-bottom-left-radius:var(--r-xs)}
.chat-text{font-size:var(--fs-sm); line-height:1.5; color:var(--text); white-space:pre-wrap; word-break:break-word}
.chat-meta{margin-top:4px; font-size:var(--fs-xs); color:var(--muted)}
.chat-link{color:var(--accent2); text-decoration:underline; text-underline-offset:2px; word-break:break-all}
.chat-link:visited{color:var(--accent2)}
.chat-divider{
  display:flex; align-items:center; gap:var(--sp-3);
  font-size:var(--fs-xs); font-weight:600; color:var(--accent2); text-transform:uppercase;
  letter-spacing:.4px;
}
.chat-divider::before, .chat-divider::after{content:''; flex:1 1 auto; height:1px; background:rgba(255,138,61,.35)}
.chat-empty{
  display:flex; flex-direction:column; align-items:center; gap:var(--sp-2);
  padding:var(--sp-6) var(--sp-4); text-align:center;
}
.chat-empty span{font-size:28px; line-height:1}
.chat-empty p{margin:0; font-size:var(--fs-sm); color:var(--muted); line-height:1.5; max-width:320px}
.chat-compose{display:flex; align-items:flex-end; gap:var(--sp-2); margin-top:var(--sp-3)}
.chat-compose textarea{
  flex:1 1 auto; min-width:0; resize:none; font-family:inherit;
  font-size:16px; line-height:1.4; padding:11px 14px; max-height:140px;
  color:var(--text); background:#0f1114;
  border:1px solid var(--card-border); border-radius:var(--r-md); outline:none;
}
.chat-compose textarea:focus{border-color:var(--accent)}
.chat-send{
  all:unset; box-sizing:border-box; cursor:pointer; flex:none;
  width:var(--btn-h); height:var(--btn-h); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  color:#fff; font-size:var(--fs-base);
}
.chat-send:active{opacity:.8}
.chat-badge{
  padding:2px 8px; border-radius:var(--r-pill); background:var(--accent);
  color:#fff; font-size:var(--fs-xs); font-weight:700;
}
#feedbackResetBtn{margin-top:var(--sp-3)}

.locked-notice{
  display:flex; align-items:flex-start; gap:10px; padding:16px;
  background:rgba(255,138,61,.08); border:1px solid rgba(255,138,61,.35); border-radius:var(--r-md);
}
.locked-notice .lock-icon{flex:none; font-size:var(--fs-lg); line-height:1}
.locked-notice .lock-text{font-size:var(--fs-sm); color:var(--text)}
.locked-notice .lock-text b{color:var(--accent2)}

select{
  width:100%; font-size:16px; padding:14px 16px; color:var(--text); background:var(--card);
  border:none; appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%238a919b'/></svg>");
  background-repeat:no-repeat; background-position:right 16px center;
}

.row{
  display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px 16px;
  border-bottom:1px solid var(--card-border);
}
.row:last-child{border-bottom:none}
.row .label{font-size:var(--fs-md)}
.row .label.link{color:var(--text); text-decoration:none; border-bottom:1px dashed var(--muted)}
.row .label.link:active{opacity:.7}

.switch{position:relative; width:48px; height:28px; flex:none}
.switch input{opacity:0; width:0; height:0}
.slider{position:absolute; cursor:pointer; inset:0; background:#2b2f36; border-radius:28px; transition:.2s}
.slider:before{content:"";position:absolute; height:22px; width:22px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.3)}
input:checked + .slider{background:linear-gradient(135deg, var(--accent), var(--accent2))}
input:checked + .slider:before{transform:translateX(20px)}

.empty{padding:18px 16px; color:var(--muted); font-size:var(--fs-base)}

/* overflow:visible overrides .card's overflow:hidden — otherwise the
   absolutely-positioned city/keyword suggestion dropdowns below the input
   get clipped by the card's own rounded-corner box on wide viewports,
   where the input+button fit on one row and never grow the card tall
   enough to contain them (narrow viewports happened to work by accident:
   flex-wrap pushed the button below, growing the card enough to fit). */
.addbox{margin-top:0; display:flex; gap:10px; padding:14px; align-items:center; flex-wrap:wrap; overflow:visible}
.addbox input, .addbox textarea, .field-row input, .field-row textarea,
.field-label input, .field-label textarea{
  flex:1; min-width:180px; max-width:var(--field-md);
  font-size:16px; padding:12px 14px; color:var(--text); background:#0f1114;
  border:1px solid var(--card-border); border-radius:var(--r-sm); outline:none;
}
.addbox input[type=number]{max-width:var(--field-xs)}
.addbox input[readonly]{max-width:var(--field-md); color:var(--muted)}
.addbox input:focus, .addbox textarea:focus,
.field-row input:focus, .field-label input:focus{border-color:var(--accent)}
.addbox textarea{resize:none; max-height:40vh; max-height:40dvh; font-family:inherit; line-height:1.4}
.field-label{
  flex:1; min-width:180px; display:flex; flex-direction:column; gap:4px; font-size:var(--fs-xs); color:var(--muted);
}
.field-label input{width:100%}
button{font-family:inherit; cursor:pointer}

.addbox button{
  flex:none; padding:12px 18px; font-size:var(--fs-base); font-weight:600;
  color:var(--text); border:1px solid var(--btn-border);
  border-radius:var(--r-sm); background:var(--btn);
}
.addbox button, .small-btn, .kw-add button{
  transition:filter .12s ease, transform .05s ease, opacity .12s ease;
}
.addbox button:hover, .small-btn:hover, .kw-add button:hover{
  background:var(--btn-hover); border-color:var(--accent2); filter:none;
}
.addbox button:active, .small-btn:active, .kw-add button:active{transform:scale(.97)}
.addbox button:disabled, .small-btn:disabled, .kw-add button:disabled{
  opacity:.5; cursor:not-allowed; filter:none; transform:none;
}
.addbox button:focus-visible, .small-btn:focus-visible, .kw-add button:focus-visible{
  outline:2px solid var(--accent2); outline-offset:2px;
}
.small-btn.ghost:hover{border-color:var(--accent2); color:var(--text); filter:none}
.admin-trial-btn{flex:none; white-space:nowrap; font-size:var(--fs-xs)}
.hint{font-size:var(--fs-sm); line-height:1.5; color:var(--muted); margin:0 2px}
.hint a{color:var(--accent); text-decoration:none}
button.copied{
  background:var(--ok); border-color:var(--ok); color:#0b0e13; font-weight:700;
}
.hint.warn{
  color:var(--text); background:rgba(255,186,8,.12); border-left:3px solid #ffba08;
  border-radius:var(--r-sm); padding:8px 10px; margin:8px 0 0;
}
.hint.error{
  color:#fff; background:var(--accent); border-radius:var(--r-sm); padding:8px 10px; margin:8px 0 0;
  font-weight:600;
}

.autocomplete-wrap{position:relative; flex:1; min-width:180px; max-width:var(--field-md)}
.autocomplete-wrap input{width:100%}
.suggestions{
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:10;
  background:#15181d; border:1px solid var(--card-border); border-radius:var(--r-sm); overflow:hidden;
  max-height:240px; overflow-y:auto;
}
.suggestions .item{padding:10px 14px; font-size:var(--fs-base); cursor:pointer; border-bottom:1px solid var(--card-border)}
.suggestions .item:last-child{border-bottom:none}
.suggestions .item:hover{background:#1c2027}
.suggestions .item .oblast{display:block; font-size:var(--fs-xs); color:var(--muted); margin-top:2px}

.row .x{color:var(--muted); cursor:pointer; font-size:var(--fs-base); margin-left:12px; flex:none}
.catalog-toggle{
  margin-top:10px; padding:14px 16px; display:flex; justify-content:space-between; align-items:center;
  cursor:pointer;
}
.catalog-toggle .label{font-size:var(--fs-base); color:var(--muted)}
.small-btn{
  flex:none; padding:8px 14px; font-size:var(--fs-sm); font-weight:600;
  color:var(--text); border:1px solid var(--btn-border);
  border-radius:var(--r-sm); background:var(--btn);
}
.small-btn.ghost{
  background:#0f1114; border:1px solid var(--card-border); color:var(--text); padding:6px 10px; font-size:var(--fs-xs);
}

.threat-block{
  background:var(--bg); border:1px solid var(--card-border); border-radius:var(--r-sm);
  margin-bottom:var(--sp-2);
}
.threat-block:last-child{margin-bottom:0}
.threat-block:hover{border-color:var(--btn-border)}
.threat-block > .row{border-bottom:none; background:transparent; border:none; margin:0}
.threat-head{display:flex; justify-content:space-between; align-items:center; padding:14px 16px; cursor:pointer}
.threat-head .label{display:flex; align-items:center; gap:6px}
.chev{color:var(--muted); font-size:var(--fs-xs); transition:transform .15s}
.chev.open{transform:rotate(90deg)}
.kw-panel{padding:0 16px 14px}
/* These links had no rule at all, so the browser drew them in its own blue —
   and in its own purple once visited, which on this background is invisible. */
.hint-cta{
  color:var(--accent2); font-weight:600; text-decoration:none;
  white-space:nowrap; border-bottom:1px solid transparent;
}
.hint-cta:visited{color:var(--accent2)}
.hint-cta:hover{border-bottom-color:var(--accent2)}
.hint-cta:active{opacity:.7}

.threat-warn{
  margin:0 16px 14px; padding:10px 12px; border-radius:var(--r-md);
  background:rgba(255,138,61,.08); border:1px solid rgba(255,138,61,.35);
  font-size:var(--fs-sm); color:var(--text); line-height:1.5;
}
.kw-list{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px}
.kw-chip{
  display:flex; align-items:center; gap:6px; background:#0f1114; border:1px solid var(--card-border);
  border-radius:var(--r-pill); padding:6px 10px; font-size:var(--fs-sm); color:var(--text);
}
.kw-chip .x{color:var(--muted); cursor:pointer; font-size:var(--fs-xs)}
.kw-add{display:flex; gap:8px}
.kw-add input{
  flex:1; max-width:var(--field-sm); font-size:16px; padding:10px 12px; color:var(--text); background:#0f1114;
  border:1px solid var(--card-border); border-radius:var(--r-sm); outline:none;
}
.kw-add button{
  flex:none; padding:10px 14px; font-size:var(--fs-sm); font-weight:600;
  color:var(--text); border:1px solid var(--btn-border);
  border-radius:var(--r-sm); background:var(--btn);
}

.readiness-alert{
  display:flex; align-items:center; gap:16px; margin-bottom:16px; padding:20px 22px;
  border-radius:var(--r-lg); border:2px solid var(--accent);
  background:linear-gradient(135deg, rgba(255,75,75,.18), rgba(255,138,61,.10)) var(--card);
  animation:readiness-pulse 2.2s ease-in-out infinite;
}
@keyframes readiness-pulse{
  0%,100%{box-shadow:0 0 0 0 rgba(255,75,75,.45)}
  50%{box-shadow:0 0 0 10px rgba(255,75,75,0)}
}
@media (prefers-reduced-motion: reduce){
  .readiness-alert{animation:none}
}
.readiness-icon{font-size:34px; flex:none; line-height:1}
.readiness-body{flex:1; min-width:0}
.readiness-alert h2{margin:0 0 6px; font-size:var(--fs-lg); letter-spacing:-.2px}
.readiness-alert p{margin:0; font-size:var(--fs-sm); line-height:1.5; color:var(--text); opacity:.85}
.readiness-alert button{
  flex:none; padding:13px 20px; font-size:var(--fs-base); font-weight:700; color:#fff; border:none;
  border-radius:var(--r-md); background:linear-gradient(135deg, var(--accent), var(--accent2));
  transition:filter .12s ease, transform .05s ease;
}
.readiness-confirm{
  display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:10px;
  font-size:var(--fs-sm); font-weight:600;
}
/* Smaller than the main call to action: this pair answers a question, it is
   not the step the banner is pushing. */
.readiness-alert .readiness-confirm button{
  padding:8px 14px; font-size:var(--fs-sm); width:auto;
}
.readiness-alert .confirm-no{
  background:transparent; border:1px solid var(--accent); color:var(--text);
}
.readiness-alert button:hover{filter:brightness(1.1)}
.readiness-alert button:active{transform:scale(.97)}
.readiness-alert button:disabled{opacity:.6; filter:none; transform:none}
@media (max-width: 640px){
  .readiness-alert{flex-wrap:wrap; gap:12px; padding:16px}
  .readiness-alert button{width:100%}
}

/* The label+badge column is the only part allowed to shrink; the controls
   keep their natural width so the toggle can never be pushed onto its own
   row on a narrow screen. */
.row-main{display:flex; align-items:center; gap:10px; flex:1 1 auto; min-width:0}
.row-stack{display:flex; flex-direction:column; gap:3px; flex:1 1 auto; min-width:0}
.row-line{display:flex; align-items:center; gap:10px; min-width:0; flex-wrap:wrap}
.row-note{min-width:0}
.row-note-btn{
  all:unset; cursor:pointer; display:inline-block; max-width:100%;
  font-size:var(--fs-xs); color:var(--muted); line-height:1.4;
  border-bottom:1px dashed var(--card-border);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.row-note-btn:active{opacity:.6}
#regions .region-item{border-bottom:1px solid var(--card-border)}
#regions .region-item:last-child{border-bottom:none}
#regions .region-item > .row{border-bottom:none}
.region-edit{padding:0 var(--sp-4) var(--sp-3)}
.row.row-off .label{opacity:.6}
.row.row-added .label{opacity:.55}
.row-added-mark{
  flex:none; font-size:var(--fs-xs); font-weight:600; color:var(--muted); white-space:nowrap;
}
.row-off-badge{
  flex:0 1 auto; min-width:0; padding:3px 9px; border-radius:var(--r-pill);
  font-size:var(--fs-xs); font-weight:700; line-height:1.3;
  color:#fff; background:var(--accent);
}
@media (max-width: 560px){
  .row-main{gap:8px}
  .row-off-badge{font-size:var(--fs-xs); padding:2px 8px}
}

/* ── Setup tour ─────────────────────────────────────────────────────────
   Full screen on purpose: the card it replaces sat among eight collapsed
   panels and was read by almost nobody. */
/* Смужка симуляції. Видима лише адміністратору, тож навмисно не схожа на
   решту інтерфейсу: її не можна сплутати з тим, що бачить користувач. */
/* Інструкція — рядок-посилання, а не акордеон: натиснув і ти вже на сторінці. */
.guide-row{
  display:flex; align-items:center; gap:12px; width:100%;
  padding:14px 16px; border-bottom:1px solid var(--card-border);
  color:var(--text); text-decoration:none; font-size:var(--fs-md); font-weight:600;
}
.guide-row:last-child{border-bottom:none}
.guide-row:hover{background:rgba(255,255,255,.03)}
.guide-row .guide-q{flex:1}
.guide-go{color:var(--muted); font-size:var(--fs-lg)}
.guide-page{display:flex; flex-direction:column; gap:14px}
.slide-action{display:flex; flex-direction:column; justify-content:center; gap:12px; padding:0 8px}
.slide-lede{margin:0 0 4px; font-size:var(--fs-md); line-height:1.5}
.slide-action .guide-action{margin-top:0}
.guide-section{
  margin:18px 0 0; font-size:var(--fs-lg); letter-spacing:-.2px;
  padding-top:16px; border-top:1px solid var(--card-border);
}
.guide-page > .guide-section:first-child{border-top:none; padding-top:0; margin-top:0}

/* Кнопка зі скріншотами тонула серед тексту, і її просто не помічали. */
.guide-action{
  display:block; margin-top:18px; padding:14px 18px; text-align:center;
  border:none; border-radius:var(--r-md); color:#fff; font-weight:700;
  font-size:var(--fs-md); text-decoration:none; width:100%;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
}

.sim-bar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:0 0 12px; padding:8px 12px; border-radius:var(--r-sm);
  border:1px dashed var(--accent2); background:rgba(255,138,61,.08);
  font-size:var(--fs-sm);
}
.sim-bar.on{background:rgba(255,138,61,.18); border-style:solid}
.sim-label{color:var(--muted)}
.sim-bar.on .sim-label{color:var(--text); font-weight:700}

/* Прожектор. Панелі затемнення ловлять кліки (pointer-events лишаються), а
   сам виріз — ні, тож людина натискає тільки те, про що йдеться на кроці. */
.spot{position:fixed; inset:0; z-index:99; pointer-events:none}
.spot-pane{
  position:fixed; background:rgba(8,10,16,.78); pointer-events:auto;
  touch-action:none; transition:all .18s ease;
}
.spot-ring{
  position:fixed; pointer-events:none;
  border:2px solid var(--accent2); border-radius:var(--r-md);
  box-shadow:0 0 0 6px rgba(255,138,61,.14), 0 0 24px rgba(255,138,61,.25);
  transition:all .18s ease;
}
/* Рамка перетинає картку, а не охоплює її: без кутів, інакше поряд із
   заокругленням картки стає друге, трохи інше. */
.spot.cut .spot-ring{border-radius:0; border-left:none; border-right:none}

/* У режимі прожектора картка кроку стоїть біля вирізу, а не по центру, і не
   має власного затемнення — його вже дають панелі. */
.tour-backdrop.anchored{
  background:none; backdrop-filter:none; display:block; pointer-events:none;
}
/* Крок без підсвіченої ділянки: та сама картка внизу, а зверху просто
   затемнений сайт — щоб форма не мінялась від кроку до кроку. */
.tour-backdrop.anchored.plain{
  background:rgba(8,10,16,.78); backdrop-filter:blur(6px); pointer-events:auto;
}
/* Картка стоїть унизу і не рухається. Раніше вона ставала під вирізом, тож
   на кожному кроці «Назад» і «Далі» опинялись на новому місці — цілитись у
   кнопку, яка щойно переїхала, неможливо. Тепер їздить виріз, а не картка. */
.tour-backdrop.anchored .tour{
  position:fixed; margin:0; left:50%; transform:translateX(-50%);
  /* Врівень з низом, як і футер повноекранної картки: інакше «Далі» стрибає
     на десяток пікселів щоразу, коли крок міняє режим. */
  top:auto; bottom:env(safe-area-inset-bottom, 0px);
  width:min(420px, calc(100vw - 24px)); max-width:none;
  pointer-events:auto; box-shadow:0 18px 50px rgba(0,0,0,.55);
  /* На телефоні звичайна картка туру розгорнута на весь екран — у режимі
     прожектора це не лишає місця самому вирізу, тож тут вона низька. */
  /* Висоту рахує tourCardHeight(): вона має лишити над карткою смугу,
     здатну вмістити найвищу ціль. Частка від висоти екрана тут не працює —
     ціль має свій розмір у пікселях, і на 568px він майже весь екран. */
  height:var(--tour-card-h);
  border-radius:var(--r-lg) var(--r-lg) 0 0; border:1px solid var(--card-border);
}
.tour-backdrop.anchored .tour-body{padding-top:4px}
/* Підлога висоти лишилась від повноекранної картки. У режимі прожектора
   картка невисока, і підлога, вища за неї, виштовхує футер — «Назад» і
   «Далі» — за межі екрана. На телефоні 45svh менше за картку, тож видно це
   було лише на ПК. */
.tour-backdrop.anchored .tour-body{min-height:0}
.tour-backdrop.anchored .tour-shot{display:none}
/* Поки питаємо про вихід, кроки ні до чого: лишається саме питання. */
.tour.asking .tour-foot, .tour.asking .tour-progress{display:none}
.tour-exit{display:flex; flex-direction:column; gap:10px; margin-top:16px}
.tour-exit .tour-action{width:100%; text-align:center}
.tour-action.ghost{background:transparent; border:1px solid var(--btn-border); color:var(--muted)}
.tour-next.blocked{opacity:.45; filter:grayscale(.5)}
.tour-blocked{margin:12px 0 0; font-size:var(--fs-sm); color:var(--accent); font-weight:600}
.tour-skip{
  background:none; border:none; color:var(--muted); font-size:var(--fs-sm);
  text-decoration:underline; padding:8px 4px;
}
.tour-skip:hover{color:var(--text)}

.tour-backdrop{
  position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center;
  /* Затемнення тягнеться на всю висоту (inset:0), бо 100svh — це висота з
     показаними смугами браузера: щойно вони ховаються, знизу з-під діалога
     визирав сам сайт. Межу тримає вже картка, не затемнення. */
  padding:calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background:rgba(8,10,16,.82); backdrop-filter:blur(6px);
}
.tour{
  /* 100svh, а не 100%: висота з показаними смугами. Інакше смуги повертаються
     поверх «Назад» і «Далі» тієї ж миті, коли діалог блокує прокрутку. */
  display:flex; flex-direction:column; width:100%; max-width:560px;
  max-height:min(100%, calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  border-radius:var(--r-xl); border:1px solid var(--card-border); background:var(--card);
  box-shadow:0 24px 60px rgba(0,0,0,.5); overflow:hidden;
}
.tour-head{display:flex; align-items:center; gap:12px; padding:16px 18px 0}
.tour-progress{display:flex; flex:1; gap:6px}
.tour-dot{
  flex:1; height:5px; padding:0; border:none; border-radius:3px;
  background:var(--btn-border); cursor:pointer;
}
.tour-dot.done{background:var(--accent2)}
.tour-dot.current{background:var(--accent)}
.tour-close{
  flex:none; width:32px; height:32px; padding:0; font-size:16px; line-height:1;
  border:none; border-radius:var(--r-sm); background:transparent; color:var(--text); opacity:.6;
}
.tour-close:hover{opacity:1}
.tour-body{flex:1; min-height:0; overflow-y:auto; padding:14px 22px 18px}
.tour-step-label{
  margin:0 0 6px; font-size:var(--fs-xs); font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--accent);
}
.tour-body h2{margin:0 0 12px; font-size:var(--fs-xl); letter-spacing:-.3px}

/* Одна сходинка задає розмір усієї картки, решта — частки від неї. Доти
   кожен елемент мав власний розмір на кожній сходинці, і сусідні кроки
   різнились удвічі: головний рядок одного кроку був більший за заголовок
   іншого. Тепер крок може відрізнятись від кроку щонайбільше на сходинку,
   а всередині картки співвідношення однакове скрізь. */
/* Вибір між «по районах» і «по всьому місту» стоїть у самому типі загрози:
   це не налаштування збоку, а те, як цей тип працює. Дві кнопки замість
   тумблера — бо тумблер не каже, що буде у вимкненому стані. */
/* Компактні, як чипси зі словами під ними: це вибір усередині картки, а не
   головна дія на екрані. На всю ширину вони з'їдали висоту картки. */
.scope-row{display:flex; gap:6px; margin:0 16px 8px; flex-wrap:wrap}
.scope-btn{
  flex:0 0 auto; padding:6px 12px; border-radius:var(--r-pill);
  border:1px solid var(--btn-border); background:var(--btn); color:var(--muted);
  font-size:var(--fs-xs); font-weight:600; cursor:pointer; line-height:1.3;
}
.scope-btn:hover{background:var(--btn-hover)}
.scope-btn.active{border-color:var(--accent2); color:var(--text); background:#2a211b}

.tour-content{font-size:20px}
.tour-content.roomiest{font-size:28px}
.tour-content.roomier{font-size:24px}
.tour-content.roomy{font-size:20px}
.tour-content.tight{font-size:17px}

.tour-content p{margin:0 0 12px; font-size:1em; line-height:1.4}
/* Другорядне лишається другорядним, але не дрібним: 0.75 від головного —
   це межа, за якою текст перестає читатись із витягнутої руки. */
.tour-content .tour-task.is-next, .tour-content .tour-task.is-done{font-size:.8em}
.tour-content .tour-note{font-size:.75em; opacity:.75}
.tour-content .tour-action{font-size:.7em}
/* Кроки з двома реченнями лишали дві третини картки порожніми, а текст у них
   був того самого розміру, що й на найдовшому кроці. Розмір обирається за
   тим, скільки місця справді лишилось незаповненим (див. fitTourText). */
.tour-body.tight{padding:8px 18px 10px}
.tour-body.tight h2{font-size:var(--fs-lg); margin-bottom:8px}
.tour-body.tight .tour-step-label{margin-bottom:3px}
.tour-body .tour-content.tight .tour-done{padding:5px 10px; margin-bottom:8px}
/* Дві кнопки магазинів поруч, а не одна під одною: у низькій картці це
   різниця в цілий рядок. */
.tour-content.tight .tour-stores{gap:6px; flex-direction:row}
.tour-content.tight .tour-stores .tour-action{flex:1 1 0; min-width:0; text-align:center; padding:10px 8px}
/* Підкроки кроку: зроблене — сірим з галочкою, поточне — великим і яскравим.
   Розмір успадковується від .tour-content, тож підбір під висоту картки
   працює на них так само, як на звичайних абзацах. */
.tour-task{display:flex; gap:var(--sp-2); align-items:baseline; margin:0 0 10px}
.tour-task::before{flex:none; font-weight:700}
.tour-task.is-now{font-weight:600}
.tour-task.is-now::before{content:'→'; color:var(--accent2)}
.tour-task.is-next{opacity:.65}
.tour-task.is-next::before{content:'•'; color:var(--muted)}
.tour-task.is-done{opacity:.55}
.tour-task.is-done::before{content:'✓'; color:var(--ok)}

.tour-done{
  display:inline-block; margin:0 0 12px; padding:6px 12px; border-radius:999px;
  font-size:var(--fs-sm); font-weight:700; color:#0b3; background:rgba(0,187,51,.12);
}
/* .oauth-btn lives in login.css and setup.css, which not every page loads —
   this is the call-to-action button for anything built on the base template. */
.cta{
  display:inline-block; margin:4px 8px 4px 0; padding:12px 18px; font-size:var(--fs-base); font-weight:700;
  color:#fff; text-decoration:none; border:none; border-radius:var(--r-md);
  background:linear-gradient(135deg, var(--accent), var(--accent2));
}
.tour-stores{display:flex; flex-wrap:wrap; gap:8px}
.tour-field{
  display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0 0 12px;
  padding:12px 14px; border-radius:var(--r-md); border:1px solid var(--card-border); background:var(--bg);
}
.tour-field-label{font-size:var(--fs-xs); opacity:.7; width:100%}
.tour-field code{flex:1; min-width:0; font-size:var(--fs-sm); word-break:break-all}
/* The global button rule sets only the font, so anything without an explicit
   background falls back to the platform default — grey and native-looking in
   WebKit, which is what iPhone Safari renders. */
.tour-copy, .tour-confirm button{
  padding:8px 14px; font-size:var(--fs-sm); font-weight:600; border-radius:var(--r-sm);
  border:1px solid var(--card-border); background:var(--card); color:var(--text);
}
.tour-confirm .confirm-yes{
  border:none; color:#fff; background:linear-gradient(135deg, var(--accent), var(--accent2));
}
.tour-prev{border-radius:var(--r-md); font-size:var(--fs-base); font-weight:600}
/* On a desktop the screenshot is ~650px tall and made two of the six steps
   three times the height of the rest, so it opens on demand there. On a phone
   the dialog is full screen and the picture is the clearest part of the
   instruction, so it stays visible, just smaller. */
.tour-shot{margin-top:var(--sp-3)}
.tour-shot > summary{
  display:inline-flex; align-items:center; gap:var(--sp-2);
  padding:var(--sp-2) var(--sp-3); border-radius:var(--r-sm);
  border:1px solid var(--card-border); background:var(--bg);
  font-size:var(--fs-sm); font-weight:600; color:var(--text);
  cursor:pointer; list-style:none;
}
.tour-shot > summary::-webkit-details-marker{display:none}
.tour-shot > summary:hover{border-color:var(--accent2)}
.tour-shot[open] > summary{margin-bottom:var(--sp-3)}
.tour-shot img{
  display:block; width:auto; max-width:100%; max-height:46vh; max-height:46svh; margin:0 auto;
  border-radius:var(--r-md); border:1px solid var(--card-border);
}
@media (min-width: 560px){
  /* 250px was the height of a step without a screenshot, so it held nothing
     up: the two steps that carry one still jumped 130px taller, and the
     buttons moved out from under the cursor between one step and the next.
     390px is the tallest step.

     The floor is capped against the screen because a floor taller than the
     window stops the body shrinking, and then the footer — Назад and Далі —
     is pushed off the bottom. A phone held sideways is 390px tall, and that
     is exactly where the buttons went missing. */
  .tour-body{min-height:min(390px, 45svh)}
}
@media (max-width: 560px){
  .tour-shot > summary{display:none}
  /* These are portrait phone captures (590x1280), so a height cap shrinks
     them to a thumbnail. Width is the dimension to limit. */
  .tour-shot img{max-width:230px; max-height:none}
}
.tour-confirm{display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:12px; font-weight:600}
.tour-confirm button{padding:8px 14px; font-size:var(--fs-sm); border-radius:var(--r-sm)}
.tour-foot{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 18px; border-top:1px solid var(--card-border);
}
.tour-prev{background:transparent; border:1px solid var(--btn-border); color:var(--text); padding:11px 16px}
.tour-next{
  margin-left:auto; padding:11px 20px; font-weight:700; color:#fff; border:none; border-radius:var(--r-md);
  background:linear-gradient(135deg, var(--accent), var(--accent2));
}
@media (max-width: 560px){
  /* Відступи безпечної зони тут лишаються: без них верх картки заходив під
     острівець, а низ — під смугу жестів. */
  .tour-backdrop{padding:env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px)}
  .tour{
    max-width:none; border-radius:0; border:none;
    height:calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  .tour-backdrop.anchored .tour{
    width:100vw; max-width:none; height:var(--tour-card-h);
    border-radius:var(--r-lg) var(--r-lg) 0 0; border:1px solid var(--card-border);
  }
}

/* Three pills plus the brand do not fit a 390px header, and the product name
   was breaking across two lines. Below that width the guide link is its icon. */
.tour-link{display:inline-flex; align-items:center; gap:5px}
.brand h1, .brand .brand-name{white-space:nowrap}
@media (max-width: 480px){
  /* The icon alone, as a square chip rather than a circle beside two ovals. */
  .tour-link span{display:none}
  .tour-link{width:var(--tap); padding:0}
  .topbar-actions{gap:8px}
}

/* ── Install page ───────────────────────────────────────────────────────── */
.install-hero{text-align:center; padding:6px 0 22px}
.install-icon{
  display:block; margin:0 auto 16px; border-radius:var(--r-lg);
  box-shadow:0 12px 32px rgba(255,75,75,.22);
}
.install-hero h2{margin:0 0 8px; font-size:var(--fs-xl); letter-spacing:-.3px}
.install-hero p{margin:0 auto; max-width:380px; font-size:var(--fs-base); line-height:1.6; opacity:.78}

.install-direct{
  margin-bottom:20px; padding:18px; text-align:center;
  border-radius:var(--r-lg); border:1px solid rgba(255,138,61,.4);
  background:linear-gradient(160deg, rgba(255,75,75,.12), rgba(255,138,61,.05)) var(--card);
}
.install-direct .cta{margin:0 0 8px}
.install-direct .hint{margin:0}

/* A segmented control, so the phone in your hand decides what you read. */
.platform-tabs{
  display:flex; gap:4px; margin-bottom:16px; padding:4px;
  border-radius:var(--r-md); background:var(--card); border:1px solid var(--card-border);
}
.platform-tabs button{
  flex:1; padding:10px 6px; font-size:var(--fs-sm); font-weight:600; border:none; border-radius:var(--r-sm);
  background:transparent; color:var(--muted); transition:background .15s ease, color .15s ease;
}
.platform-tabs button.active{background:var(--bg); color:var(--text)}

.platform-panel{margin-bottom:24px}
.platform-note{margin:0 0 14px; font-size:var(--fs-sm); color:var(--muted)}
.steps{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px}
.steps li{
  display:flex; align-items:flex-start; gap:14px; position:relative;
  padding:0 0 20px; font-size:var(--fs-base); line-height:1.55;
}
/* The line joining the numbers reads as a sequence rather than a pile. */
.steps li:not(:last-child)::before{
  content:''; position:absolute; left:14px; top:30px; bottom:2px; width:2px;
  background:var(--card-border);
}
.step-num{
  flex:none; width:30px; height:30px; display:flex; align-items:center; justify-content:center;
  border-radius:50%; font-size:var(--fs-sm); font-weight:700; color:#fff; z-index:1;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
}
.steps li > div{padding-top:4px}
.step-sub{display:block; margin-top:3px; font-size:var(--fs-sm); color:var(--muted)}
.step-glyph{
  width:17px; height:17px; vertical-align:-3px; margin:0 1px;
  color:var(--accent2);
}

.install-facts{
  display:flex; flex-direction:column; gap:2px; margin-bottom:22px;
  border-radius:var(--r-lg); border:1px solid var(--card-border); background:var(--card); overflow:hidden;
}
.install-facts > div{
  display:flex; align-items:flex-start; gap:12px; padding:14px 16px;
  border-bottom:1px solid var(--card-border);
}
.install-facts > div:last-child{border-bottom:none}
.install-facts span{flex:none; font-size:var(--fs-lg); line-height:1.3}
.install-facts p{margin:0; font-size:var(--fs-sm); line-height:1.5; opacity:.85}
.install-next{display:block; text-align:center; margin:0}

.site-footer{
  display:flex; flex-wrap:wrap; justify-content:center; gap:8px 18px;
  margin-top:36px; padding-top:20px; border-top:1px solid var(--card-border);
}
.site-footer a{font-size:var(--fs-sm); color:var(--muted); text-decoration:none}
.site-footer a:hover{color:var(--text)}

/* Правовий рядок під футером: присутній на кожній сторінці, бо цього
   вимагають платіжні системи, але дрібніший і приглушений — він має бути
   знайденим, коли його шукають, і не відвертати, коли ні. */
.site-legal{
  display:flex; flex-wrap:wrap; justify-content:center; align-items:center;
  gap:2px 8px; margin-top:var(--sp-2);
}
.site-legal a{font-size:var(--fs-xs); color:var(--muted); opacity:.7; text-decoration:none}
.site-legal a:hover{opacity:1; color:var(--text)}
.site-legal span{font-size:var(--fs-xs); color:var(--muted); opacity:.35}

/* On a narrow phone the banner icon stole a third of the width, pushing the
   heading onto two lines and the text onto six. */
@media (max-width: 560px){
  .readiness-alert{flex-direction:column; align-items:flex-start; gap:10px}
  .readiness-icon{font-size:26px}
  .readiness-body{width:100%}
}
/* Three pills plus the product name do not fit 320px on one line. */
@media (max-width: 420px){
  .quick-nav-item{font-size:var(--fs-xs); padding:8px 6px; gap:4px}
  .brand h1, .brand .brand-name{font-size:var(--fs-md)}
  .logout{padding:5px 9px; font-size:var(--fs-xs)}
  .topbar-actions{gap:8px}
}

/* The placeholder used to carry the field's whole meaning and was cut off at
   half of it; the label says what it is, the placeholder shows an example. */
.field-optional{
  margin-left:var(--sp-2); padding:2px var(--sp-2); border-radius:var(--r-pill);
  font-size:var(--fs-xs); font-weight:600; color:var(--muted);
  background:var(--card); border:1px solid var(--card-border);
}
/* Every add-form follows the same shape: fields full width one under the
   other, the action under them. As a flex row these crammed two inputs and a
   button into one line, so each field got a third of the width and its
   placeholder was cut in half. */
.addbox{flex-direction:column; align-items:stretch}
.addbox > *{width:100%}
.addbox .field-label{margin-bottom:0}
.addbox .field-label input{width:100%; min-width:0; margin-top:var(--sp-1)}
.addbox button{align-self:flex-start; width:auto}
/* A lone field with its button still reads better side by side. */
.addbox.inline{flex-direction:row; align-items:center; flex-wrap:wrap}
.addbox.inline > *{width:auto}
.addbox.inline input{flex:1; min-width:180px}

/* The colour coding came back without the numbering: the stripe is keyed to
   the panel itself, so reordering or regrouping cannot scramble it. */
#acc-regions{border-left:2px solid var(--n3)}
#acc-threats{border-left:2px solid var(--n4)}
#acc-channels{border-left:2px solid var(--n5)}
#acc-token{border-left:2px solid var(--n2)}
#acc-notif{border-left:2px solid var(--n6)}
#acc-help{border-left:2px solid var(--n7)}
#acc-referral{border-left:2px solid var(--n1)}
#acc-about{border-left:2px solid var(--n8)}

/* Each group carries one of those colours, so the tab and the panels under
   it read as the same place. */
.quick-nav-item[data-nav="watch"].active, .sidebar-item#nav-watch.active{border-color:var(--n3)}
.quick-nav-item[data-nav="deliver"].active, .sidebar-item#nav-deliver.active{border-color:var(--n2)}
.quick-nav-item[data-nav="help"].active, .sidebar-item#nav-help.active{border-color:var(--n7)}
.quick-nav-item[data-nav="more"].active, .sidebar-item#nav-more.active{border-color:var(--n8)}
.sidebar-item.active{border-left-width:3px}

/* Tap targets. A 28px-tall pill is fine with a mouse and a miss on a phone. */
@media (hover: none){
  .logout, .quick-nav-item, .acc-head, .platform-tabs button{min-height:var(--tap)}
  .tour-dot{position:relative}
  .tour-dot::after{content:''; position:absolute; inset:-14px 0}
  .addbox button, .cta, .tour-next, .tour-prev, .readiness-alert button{min-height:var(--tap)}
  .site-footer a{padding:var(--sp-2) var(--sp-1)}
}
/* iOS zooms the page when a focused input is under 16px; every text field
   stays at 16px for that reason, not for looks. */
input, textarea, select{font-size:16px}

/* One source of vertical rhythm inside a panel. A plain wrapper div counted
   as a single flex child, so its own contents got no spacing at all while
   their siblings outside got 12px — that is the uneven gap in the channels
   card. Wrappers now stack on the same scale, and nothing adds its own
   margin on top of the gap. */
.stack{display:flex; flex-direction:column; gap:var(--sp-3)}
.acc-body > *{margin-top:0; margin-bottom:0}

/* ── About ──────────────────────────────────────────────────────────────
   Prose sections differ wildly in length, so a two-column grid of them
   tore holes in the page. The width goes to a side index instead, the way
   documentation does it, and the text keeps one readable column. */
.about-hero{max-width:680px; margin:0 0 var(--sp-6)}
.about-hero h2{margin:0 0 var(--sp-2); font-size:var(--fs-xl); letter-spacing:-.4px; line-height:1.25}
.about-lede{margin:0; font-size:var(--fs-base); line-height:1.6; color:var(--muted)}

.about-layout{display:block}
.about-nav{display:none}
.about-body{display:flex; flex-direction:column; gap:var(--sp-3); max-width:720px}

@media (min-width: 960px){
  .about-layout{display:grid; grid-template-columns:230px minmax(0, 1fr); gap:var(--sp-8); align-items:start}
  .about-nav{
    display:flex; flex-direction:column; gap:var(--sp-1);
    position:sticky; top:var(--sp-5);
  }
  .about-nav a{
    padding:var(--sp-2) var(--sp-3); border-radius:var(--r-sm);
    font-size:var(--fs-sm); color:var(--muted); text-decoration:none; line-height:1.4;
  }
  .about-nav a:hover{background:var(--card); color:var(--text)}
  .about-body{gap:var(--sp-4)}
}

.about-card{
  padding:var(--sp-5); border-radius:var(--r-lg);
  border:1px solid var(--card-border); background:var(--card);
  scroll-margin-top:var(--sp-5);
}
.about-card h3{margin:0 0 var(--sp-3); font-size:var(--fs-md); letter-spacing:-.1px}

/* Правові сторінки — суцільний документ, а не стос карток. Рамка навколо
   розділу договору нічого не означає: його не можна вимкнути чи згорнути,
   як картку міста в кабінеті. Структуру тримають заголовок, відступ і
   волосяна лінія між розділами — так, як це зроблено в розділі умов самої
   iOS. Ширину тримає сама обгортка сторінки — окрема межа для тексту
   всередині неї розводила ліві краї: перемикач і футер починались в одному
   місці, текст у іншому. */
.legal{max-width:none}
.legal-head{margin:0 0 var(--sp-6)}
.legal-head h2{margin:0 0 var(--sp-1); font-size:var(--fs-xl); letter-spacing:-.4px; line-height:1.25}
.legal-revision{margin:0; font-size:var(--fs-sm); color:var(--muted)}

.legal section{padding:var(--sp-6) 0; border-top:1px solid var(--card-border)}
.legal section:first-of-type{padding-top:0; border-top:0}
.legal h3{margin:0 0 var(--sp-3); font-size:var(--fs-md); letter-spacing:-.1px}
.legal p{margin:0 0 var(--sp-3); font-size:var(--fs-base); line-height:1.65; color:var(--text)}
.legal p:last-child{margin-bottom:0}
.legal a{color:var(--accent2)}
/* Segmented control, як у налаштуваннях iOS: утоплена доріжка, активний
   сегмент піднятий світлішою плашкою з м'якою тінню. Пропорції й радіуси —
   звідти ж, щоб елемент читався з першого погляду. */
.segmented{
  display:flex; gap:2px; padding:2px; margin:0 0 var(--sp-6);
  background:rgba(118,118,128,.24); border-radius:9px;
}
.segmented a{
  flex:1 1 0; min-width:0; display:flex; align-items:center; justify-content:center;
  min-height:32px; padding:0 var(--sp-2); border-radius:7px;
  font-size:var(--fs-sm); font-weight:500; line-height:1.2; text-align:center;
  color:var(--text); text-decoration:none;
}
.segmented a:hover{background:rgba(118,118,128,.18)}
.segmented a.selected{
  background:#636366; font-weight:600;
  box-shadow:0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04);
}
.segmented a.selected:hover{background:#6c6c70}
@media (max-width: 380px){
  .segmented a{font-size:var(--fs-xs); padding:0 var(--sp-1)}
}

/* Чернетка і реквізити лишаються в рамці — на відміну від розділів тексту,
   це справді окремі об'єкти. */
.legal-draft{
  margin-bottom:var(--sp-6); border-color:#c2410c;
  background:color-mix(in srgb, #c2410c 10%, var(--card));
}
.legal-draft h3{margin:0 0 var(--sp-2); font-size:var(--fs-md)}
.legal-draft p{margin:0; font-size:var(--fs-sm); line-height:1.6}
.legal-req{
  display:grid; grid-template-columns:minmax(120px, max-content) minmax(0, 1fr);
  gap:var(--sp-2) var(--sp-4); margin:0; font-size:var(--fs-sm); line-height:1.6;
}
.legal-req dt{color:var(--muted)}
.legal-req dd{margin:0; color:var(--text); overflow-wrap:anywhere}
@media (max-width: 480px){
  .legal-req{grid-template-columns:minmax(0, 1fr); gap:0}
  .legal-req dt{margin-top:var(--sp-2)}
}
.legal-req dt{color:var(--muted)}
.legal-req dd{margin:0; color:var(--text); overflow-wrap:anywhere}
@media (max-width: 480px){
  .legal-req{grid-template-columns:minmax(0, 1fr); gap:0}
  .legal-req dt{margin-top:var(--sp-2)}
}
.about-card p{margin:0 0 var(--sp-3); font-size:var(--fs-base); line-height:1.65; color:var(--text)}
.about-card p:last-child{margin-bottom:0}
.about-card ul{margin:0; padding-left:var(--sp-5); display:flex; flex-direction:column; gap:var(--sp-2)}
.about-card li{font-size:var(--fs-base); line-height:1.6}


/* Secondary actions: present, pressable, quiet. The screen pushes one thing
   at a time, and that one keeps the gradient. */
.addbox button, .small-btn, .kw-add button, .tour-action{
  color:var(--text); border:1px solid var(--btn-border); background:var(--btn);
  font-weight:600;
}
.addbox button:hover, .small-btn:hover, .kw-add button:hover, .tour-action:hover{
  background:var(--btn-hover); border-color:var(--accent2); filter:none;
}
.tour-action{
  display:inline-block; margin:var(--sp-1) var(--sp-2) var(--sp-1) 0;
  padding:var(--sp-3) var(--sp-4); border-radius:var(--r-md);
  font-size:var(--fs-base); text-decoration:none;
}

/* ── Field rows ─────────────────────────────────────────────────────────
   Two numbers and a Save are one decision, and a topic with its Copy is
   one object; stacking each part on its own line turned both into a column
   of half-empty rows. They share a baseline and wrap only when they must. */
.field-row{
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--sp-3);
  width:100%; margin:0;
}
/* A labelled field in a row carried a 180px minimum from the standalone case,
   so two small number fields and their button needed 459px and broke into
   three lines on a phone. In a row they share what there is. */
.field-row > .field-label{flex:1 1 90px; width:auto; min-width:0; margin:0; max-width:var(--field-xs)}
.field-row > .field-label input{width:100%; min-width:0}
.field-row > .grow{flex:1 1 220px; min-width:0; max-width:none}
.field-row > input{
  font-size:16px; padding:12px 14px; color:var(--text); background:#0f1114;
  border:1px solid var(--card-border); border-radius:var(--r-sm); outline:none;
}
.field-row > input:focus{border-color:var(--accent)}
.field-row > button{
  flex:0 0 auto; align-self:flex-end;
  padding:12px 18px; font-size:var(--fs-base); font-weight:600;
  color:var(--text); border:1px solid var(--btn-border);
  border-radius:var(--r-sm); background:var(--btn);
}
.field-row > button:hover{background:var(--btn-hover); border-color:var(--accent2)}
.mono{font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:var(--fs-sm)}
/* The topic is long and unreadable as one run of characters on a phone. */
@media (max-width: 560px){
  .mono{font-size:var(--fs-xs)}
}

/* The caption and its "необов'язково" tag are one line. As separate flex
   children of the label they became two rows, and the tag stretched across
   the card looking like another input. */
.field-caption{font-size:var(--fs-xs); color:var(--muted)}
.field-caption i{font-style:normal; opacity:.6}
/* The city field and this one are the same width, so the form reads as one
   block rather than two unrelated boxes. */
.addbox .field-label{max-width:var(--field-md)}
.addbox .field-label input{max-width:none}

/* Chevrons are hidden on desktop because panels do not collapse there — but
   this one is the only thing marking the catalogue row as pressable. */
.acc-body .card.catalog-toggle{
  border:1px solid var(--card-border); border-radius:var(--r-sm);
  background:var(--bg); margin-top:0;
}
.catalog-toggle:hover{border-color:var(--accent2)}
.catalog-toggle .chev{display:inline !important; color:var(--muted); font-size:var(--fs-xs)}
.catalog-toggle .label{color:var(--text); font-weight:600}

/* A call to action should not be spliced into the middle of a sentence. */
.hint .hint-cta{display:block; margin-top:var(--sp-1)}

/* ── One button, one height ─────────────────────────────────────────────
   Five rules set their own padding and font, so two buttons sitting in the
   same row came out different heights and widths. Size is a token now. */
:root{--btn-h:42px; --btn-h-sm:34px}
.addbox button, .field-row > button, .cta, .tour-next, .tour-prev,
.readiness-alert button, .tour-action{
  min-height:var(--btn-h); display:inline-flex; align-items:center; justify-content:center;
  padding-block:0; padding-inline:var(--sp-4);
}
.small-btn, .kw-add button, .tour-copy, .tour-confirm button, .readiness-confirm button{
  min-height:var(--btn-h-sm); display:inline-flex; align-items:center; justify-content:center;
  padding-block:0; padding-inline:var(--sp-3);
}

/* ── Lists read as lists ────────────────────────────────────────────────
   A city, a channel and a threat type are items you scan and act on. With
   the inner card flattened they had lost every edge and looked like loose
   lines of text. */
.acc-body .card > .row{
  background:var(--bg); border:1px solid var(--card-border); border-radius:var(--r-sm);
  margin-bottom:var(--sp-2);
}
.acc-body .card > .row:last-child{margin-bottom:0; border-bottom:1px solid var(--card-border)}
.acc-body .card > .row:hover{border-color:var(--btn-border)}
.row .label{font-weight:600}
.empty{
  padding:var(--sp-5); text-align:center; color:var(--muted); font-size:var(--fs-sm);
  border:1px dashed var(--card-border); border-radius:var(--r-sm);
}

/* A short optional field reads better with its caption beside it than above:
   the bordered tag was heavier than the thing it qualified. */
.field-inline{display:flex; align-items:center; gap:var(--sp-3); flex-wrap:wrap; width:100%}
.field-inline .field-caption{
  flex:0 0 auto; font-size:var(--fs-xs); color:var(--muted); white-space:nowrap;
}
.field-inline .field-caption i{font-style:normal; opacity:.65}
.field-inline input{flex:1 1 200px; min-width:0; max-width:none}

/* Exactly two cards share a row and should end at the same line; three or
   more flow independently so a tall one does not strand its neighbour. */
@media (min-width: 1100px){
  .content-pane.equal-height{align-items:stretch}
  .content-pane.equal-height .pane-col{display:flex}
  .content-pane.equal-height .panel.active-panel{flex:1; display:flex; flex-direction:column}
  .content-pane.equal-height .panel.active-panel .acc-body{flex:1}
  .content-pane.equal-height .panel.active-panel .acc-body > .hint:last-child,
  .content-pane.equal-height .panel.active-panel .acc-body > .setting-block:last-child{
    margin-top:auto;
  }
}

/* ── Moving a trigger word ──────────────────────────────────────────────
   Drag works with a mouse; tapping a word opens the same list, because
   drag-and-drop on a phone is a coin toss. */
.kw-chip{position:relative; cursor:grab; user-select:none}
.kw-chip:hover{border-color:var(--accent2)}
.kw-chip.dragging{opacity:.4; cursor:grabbing}
.threat-block.drop-target{border-color:var(--accent); background:rgba(255,75,75,.06)}

.kw-menu{
  position:fixed; z-index:120; min-width:200px; max-width:min(260px, calc(100vw - 32px));
  display:flex; flex-direction:column; gap:2px; padding:var(--sp-2);
  border-radius:var(--r-md); border:1px solid var(--card-border);
  background:var(--card); box-shadow:0 16px 40px rgba(0,0,0,.5);
}
.kw-menu-title{padding:var(--sp-2); font-size:var(--fs-xs); color:var(--muted)}
.kw-menu-empty{padding:var(--sp-2); font-size:var(--fs-sm); color:var(--muted)}
.kw-menu-item{
  text-align:left; padding:var(--sp-2) var(--sp-3); border:none; border-radius:var(--r-sm);
  background:transparent; color:var(--text); font-size:var(--fs-sm); font-weight:600;
}
.kw-menu-item:hover{background:var(--btn)}

/* A fork stops receiving our keyword updates, so it says so. */
.kw-mark{
  margin-left:var(--sp-2); padding:2px var(--sp-2); border-radius:var(--r-pill);
  font-size:var(--fs-xs); font-weight:600; color:var(--accent2);
  background:rgba(255,138,61,.12); border:1px solid rgba(255,138,61,.3);
}
.kw-reset{margin-top:var(--sp-2); align-self:flex-start}

/* Adding a word is a chip until you mean to type, so a type's words stay one
   tidy row instead of a field and a button under every block. */
.kw-chip-add{
  border-style:dashed; color:var(--muted); font-weight:600;
  background:transparent; cursor:pointer;
}
.kw-chip-add:hover{color:var(--text); border-color:var(--accent2)}
.kw-inline-input{
  min-width:150px; max-width:200px; padding:6px 10px; font-size:16px;
  color:var(--text); background:#0f1114;
  border:1px solid var(--accent); border-radius:var(--r-pill); outline:none;
}
/* Six types with their words run long on a phone. */
@media (max-width: 560px){
  .kw-chip{font-size:var(--fs-xs); padding:5px 9px; gap:5px}
  .kw-list{gap:6px}
}

/* A caption belongs to the field under it. As separate children of a column
   that stretches to match its neighbour, they drifted apart and read as a
   broken layout. */
.field-group{display:flex; flex-direction:column; gap:var(--sp-1)}

/* На широкому екрані картка не має бути тим самим вузьким аркушем, що й на
   телефоні: ширина там є, і ширша картка лишає більше місця підсвіченій
   ділянці, бо текст у ній переноситься рідше. */
@media (min-width: 720px){
  .tour-backdrop.anchored .tour{
    width:min(820px, calc(100vw - 64px));
    /* Висоти на ПК вистачає і смузі, і картці: найвища ціль займає 270px,
       решта може йти картці. */
    height:clamp(300px, 40svh, 420px);
  }
  .tour-backdrop.anchored .tour-body{padding:12px 28px 16px}
  .tour-backdrop.anchored .tour-foot{padding:12px 28px}
}

/* Нова відповідь відкриває чат на весь екран: ховати її в картці, що
   розгортається серед інших панелей, означає, що її прочитають колись.
   Трьома класами, бо .content-pane .panel.active-panel ставить display:block
   і з двома перемагало б. */
.acc.panel.chat-full{
  position:fixed; inset:0; z-index:95; margin:0; border-radius:0; border:none;
  display:flex; flex-direction:column;
  padding:env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  background:var(--bg);
}
.acc.panel.chat-full .acc-head{flex:0 0 auto}
.acc.panel.chat-full .acc-body{flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column}
.acc.panel.chat-full #feedbackForm{flex:1; min-height:0; display:flex; flex-direction:column}
.acc.panel.chat-full #feedbackThread{flex:1; min-height:0; max-height:none}
.acc.panel.chat-full .chev{display:none}
.chat-close{
  background:none; border:none; color:var(--muted); font-size:var(--fs-lg);
  padding:4px 10px; cursor:pointer;
}
.chat-close:hover{color:var(--text)}

/* Поки йде крок, панелі не їдуть: виріз міряється на наступному кадрі після
   перемикання вкладки, і заставав панель посеред slide-in — рамка лягала на
   десяток пікселів убік від картки. Та й рухатись під час кроку нічого не
   має, крім самого вирізу. */
body.tour-open .content-pane .panel.active-panel{animation:none}

/* Перелік каналів групами: місто як заголовок, кількість підключених поруч. */
.catalog-group{border-bottom:1px solid var(--card-border)}
.catalog-group:last-child{border-bottom:none}
.catalog-group-head{
  display:flex; align-items:center; gap:var(--sp-2); width:100%;
  padding:10px 2px; background:none; border:none; cursor:pointer;
  color:var(--text); font-size:var(--fs-sm); font-weight:700; text-align:left;
}
.catalog-group-name{flex:1; min-width:0}
.catalog-group-count{
  flex:none; font-size:var(--fs-xs); font-weight:600; color:var(--muted);
}
.catalog-group-chev{flex:none; color:var(--muted); transition:transform .15s ease}
.catalog-group-chev.open{transform:rotate(180deg)}
.catalog-group-body{padding-bottom:var(--sp-2)}

/* Підтвердження там, де людина дивиться: рядок на дві секунди зеленіє. */
.row.row-just-added{
  background:rgba(46,204,113,.14);
  transition:background 1.2s ease;
}
.row.row-just-added .row-added-mark{color:var(--ok); font-weight:700}

/* Підтвердження, яке не треба шукати очима й не треба закривати: спливає над
   усім, тримається три секунди й зникає само. 200 — вище за тур і за
   повноекранний чат, бо це відповідь на щойно зроблену дію. */
.toast-stack{
  position:fixed; z-index:200; left:50%; transform:translateX(-50%);
  bottom:calc(env(safe-area-inset-bottom, 0px) + 24px);
  display:flex; flex-direction:column; gap:8px; align-items:center;
  width:min(420px, calc(100vw - 32px)); pointer-events:none;
}
.toast{
  width:100%; padding:12px 16px; border-radius:var(--r-md, 12px);
  background:#1b2029; border:1px solid var(--card-border);
  box-shadow:0 10px 30px rgba(0,0,0,.45);
  color:var(--text); font-size:var(--fs-sm); font-weight:600; line-height:1.4;
  opacity:0; transform:translateY(8px); transition:opacity .18s ease, transform .18s ease;
}
.toast.in{opacity:1; transform:translateY(0)}
.toast.ok{border-color:var(--ok)}
.toast.ok::before{content:'✓ '; color:var(--ok); font-weight:800}
