/* Служебные состояния аккаунта (MVPStates). Только отрисовка.
   Плашка .port-st: персик — нужно действие, серый — подождать, лиловый — лимит, зелёный — снова работает. */

.port-st {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--m-peach-line);
  background: var(--m-peach-deep);
  font-size: 13.5px;
  line-height: 1.4;
  animation: port-st-in var(--m-dur-in) var(--m-ease-out) both;
}
.port-st > svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--m-peach);
}
.port-st > span { flex: 1; min-width: 0; }
.port-st b { display: block; color: var(--m-peach-text); font-weight: 650; }
.port-st small { display: block; margin-top: 2px; font-size: 12px; color: var(--m-muted); }
.port-st .nav-k-account-id-btn { margin-top: 8px; }
.port-st[data-tone="calm"] { border-color: var(--m-line); background: var(--m-raised); }
.port-st[data-tone="calm"] b { color: var(--m-text); }
.port-st[data-tone="calm"] > svg { color: var(--m-muted); }
.port-st[data-tone="limit"] { border-color: var(--m-turn-line); background: var(--m-turn-deep); }
.port-st[data-tone="limit"] b { color: var(--m-turn-text); }
.port-st[data-tone="limit"] > svg { color: var(--m-turn); }
.port-st[data-tone="ok"] { border-color: var(--m-success-line); background: var(--m-success-deep); }
.port-st[data-tone="ok"] b { color: var(--m-success-text); }
.port-st[data-tone="ok"] > svg { color: var(--m-success); }

@keyframes port-st-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .port-st { animation: port-st-fade var(--m-dur-fade, 160ms) var(--m-ease-out) both; }
}
@keyframes port-st-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Лист аккаунта гасит вход, как остальные секции: снимок не ловит полупрозрачность. */
body[data-nav-k="1"] .nav-k-account-sheet .port-st { animation: none; }

.port-st > svg.port-spin { color: var(--m-accent-soft); animation: port-spin var(--m-loop-spin, .9s) linear infinite; }
@keyframes port-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .port-st > svg.port-spin { animation: none; }
}

.port-key-tag {
  margin-left: auto;
  flex: none;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--m-line);
  color: var(--m-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.port-key-tag[data-tone="ok"] { color: var(--m-success-text); border-color: var(--m-success-line); }
.port-key-tag[data-tone="peach"] { color: var(--m-peach-text); border-color: var(--m-peach-line); }
.port-key-tag[data-tone="limit"] { color: var(--m-turn-text); border-color: var(--m-turn-line); }
.nav-k-key-row[data-status="invalid"] { border-color: var(--m-peach-line); }
.nav-k-key-row[data-status="no_funds"] { border-color: var(--m-turn-line); }
.nav-k-key-row .port-st { margin-top: 0; }

/* Новичок на ПК: колонка как в эталоне, по центру. На телефоне шапка экрана и так скрыта. */
.nav-k-fst-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--m-muted); }
@media (min-width: 1024px) {
  body[data-nav-k-desk="1"] .nav-k-desk-main > .nav-k-fst { max-width: 560px; margin: 24px auto 0; }
}

/* Полоса подарка: лиловый остаток, не призыв к оплате. Ширина полоски — data-pct, без inline. */
.port-lim {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-top: 1px solid var(--m-line-soft);
  border-bottom: 1px solid var(--m-line-soft);
  background: var(--m-deep);
  color: var(--m-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  flex: none;
}
.port-lim span { flex: 1; min-width: 0; color: var(--m-turn-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-lim em { font-style: normal; color: var(--m-accent-text); flex: none; }
.port-lim i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--m-turn); }
.port-lim i[data-pct="0"] { width: 0; }
.port-lim i[data-pct="10"] { width: 10%; }
.port-lim i[data-pct="20"] { width: 20%; }
.port-lim i[data-pct="30"] { width: 30%; }
.port-lim i[data-pct="40"] { width: 40%; }
.port-lim i[data-pct="50"] { width: 50%; }
.port-lim i[data-pct="60"] { width: 60%; }
.port-lim i[data-pct="70"] { width: 70%; }
.port-lim i[data-pct="80"] { width: 80%; }
.port-lim i[data-pct="90"] { width: 90%; }
.port-lim i[data-pct="100"] { width: 100%; }
@media (min-width: 1024px) {
  .port-lim { height: 34px; padding: 0 20px; font-size: 12.5px; }
}

/* Служба down/restarting: карточка в «Ваш ход». Персик — нужно слово. Зелёный «работает» не рисуем, пока state не running. */
.port-bot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--m-peach-line);
  background: var(--m-card);
  min-width: 0;
  animation: port-st-in var(--m-dur-in) var(--m-ease-out) both;
}
.port-bot-h { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--m-muted); }
.port-bot-h > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-bot-mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--agent-qa, #2E8F6A);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.port-bot-tag {
  flex: none;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--m-peach-deep);
  color: var(--m-peach-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}
.port-bot > b { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.port-bot > small { margin-top: -4px; font-size: 12px; color: var(--m-muted); }
.port-bot-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.port-bot-acts button,
.port-svc-f button {
  height: 42px;
  min-width: 0;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--m-line);
  background: var(--m-raised);
  color: var(--m-text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--m-dur-tap) var(--m-ease-out);
}
.port-bot-acts button.primary,
.port-svc-f button.primary { border: 0; background: var(--m-accent); color: #fff; font-weight: 700; }
.port-bot-acts button:active,
.port-svc-f button:active { transform: scale(.97); }
.port-bot-acts button:disabled,
.port-svc-f button:disabled { opacity: .55; cursor: default; transform: none; }

/* Правая панель 420 рядом с колонкой A2. Появляется только от 1024, вместе с ctx.deskWide. */
#pc-root[data-desk] > .port-svc {
  flex: 0 0 420px;
  width: 420px;
  min-width: 420px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--m-line-soft);
  background: var(--m-card);
  animation: port-st-in var(--m-dur-in) var(--m-ease-out) both;
}
.port-svc-h {
  flex: none;
  padding: 12px 16px;
  border-bottom: 1px solid var(--m-line-soft);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--m-muted);
}
.port-svc-b { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.port-svc-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--m-peach-line); background: var(--m-card); }
.port-svc-hd { display: flex; align-items: center; gap: 10px; }
.port-svc-hd > i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--m-peach); }
.port-svc-card[data-st="busy"] .port-svc-hd > i { background: var(--m-accent-soft); animation: port-svc-pulse var(--m-loop-live, 1.6s) ease-in-out infinite; }
.port-svc-hd > span { flex: 1; min-width: 0; }
.port-svc-hd b { display: block; font-size: 14px; font-weight: 650; }
.port-svc-hd small { display: block; font-size: 12px; color: var(--m-muted); }
.port-svc-f { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--m-line-soft); }
@keyframes port-svc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.86); }
}
@media (prefers-reduced-motion: reduce) {
  .port-bot,
  #pc-root[data-desk] > .port-svc { animation: port-st-fade var(--m-dur-fade, 160ms) var(--m-ease-out) both; }
  .port-svc-card[data-st="busy"] .port-svc-hd > i,
  .port-bot-acts button,
  .port-svc-f button { animation: none; transition: none; }
}

/* AlphaGaps #guest-first. Одна фиолетовая кнопка — микрофон. «Добавить ключ» вторичная. */
.port-guest > * { animation: port-st-in var(--m-dur-in) var(--m-ease-out) both; }
.port-guest > :nth-child(2) { animation-delay: var(--m-dur-step); }
.port-guest > :nth-child(3) { animation-delay: calc(var(--m-dur-step) * 2); }
.port-guest > :nth-child(4) { animation-delay: calc(var(--m-dur-step) * 3); }
.port-guest > :nth-child(5) { animation-delay: calc(var(--m-dur-step) * 4); }
.port-guest > :nth-child(6) { animation-delay: calc(var(--m-dur-step) * 5); }
.port-guest > :nth-child(7) { animation-delay: calc(var(--m-dur-step) * 6); }
.port-guest-welcome {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--m-accent-line);
  background: var(--m-accent-deep);
  font-size: 13.5px;
  line-height: 1.35;
}
.port-guest-welcome .moment-mark { width: 18px; height: 18px; color: var(--m-accent-text); flex: none; }
.port-guest-welcome b { font-weight: 700; }
.port-guest .nav-k-qask { min-height: 56px; border-radius: 18px; }
.port-guest .nav-k-qask-voice {
  width: 44px;
  height: 44px;
  background: var(--m-accent);
  color: #fff;
}
.port-guest .nav-k-qask-send {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.port-guest-quota {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px;
  font-size: 12.5px;
  color: var(--m-muted);
}
.port-guest-quota b { margin-left: auto; color: var(--m-text); font-weight: 650; font-variant-numeric: tabular-nums; }
.port-guest-qbar { display: flex; gap: 3px; margin: 0 2px; }
.port-guest-qbar i { flex: 1; height: 4px; border-radius: 2px; background: var(--m-accent-soft); }
.port-guest-qbar i[data-off="1"] { background: var(--m-line); }
.port-guest-tiles { display: flex; flex-direction: column; gap: 8px; }
.port-guest-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--m-line);
  background: var(--m-card);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--m-dur-tap) var(--m-ease-out);
}
.port-guest-tile:active { transform: scale(.97); }
.port-guest-tile[data-k="demo"] {
  border-color: var(--m-turn-line);
  background: var(--m-turn-wash), var(--m-card);
}
.port-guest-tile > span:nth-child(2) { flex: 1; min-width: 0; }
.port-guest-tile b { display: block; font-size: 15.5px; font-weight: 700; }
.port-guest-tile small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--m-muted); line-height: 1.35; }
.port-guest-avas { display: flex; flex: none; }
.port-guest-ava {
  width: 30px;
  height: 30px;
  margin-left: -8px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.port-guest-ava:first-child { margin-left: 0; }
.port-guest-ava[data-role="lead"] { background: var(--m-accent); }
.port-guest-ava[data-role="design"] { background: var(--agent-design); }
.port-guest-ava[data-role="dev"] { background: var(--agent-dev); }
.port-guest-ava .moment-mark { width: 13px; height: 13px; color: #fff; }
.port-guest-plus {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--m-raised);
  color: var(--m-accent-text);
  display: grid;
  place-items: center;
}
.port-guest-tile .nav-k-res-btn { flex: none; height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; }
.port-guest-tile .sum-edit { margin-left: auto; color: var(--m-dim); font-size: 18px; font-weight: 500; }
.port-guest-hint { margin: 2px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--m-dim); text-align: center; }
.port-guest :is(.nav-k-qask-voice, .port-guest-tile .nav-k-res-btn) {
  transition: transform var(--m-dur-tap) var(--m-ease-out);
}
.port-guest :is(.nav-k-qask-voice, .port-guest-tile .nav-k-res-btn):active { transform: scale(.97); }
@media (min-width: 1024px) {
  body[data-nav-k-desk="1"] .nav-k-desk-main > .port-guest { max-width: 760px; margin: 0 auto; }
  body[data-nav-k-desk="1"] .port-guest-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .port-guest > * { animation: port-st-fade var(--m-dur-fade) var(--m-ease-out) both; }
  .port-guest :is(.port-guest-tile, .nav-k-qask-voice, .nav-k-res-btn) { transition: none; }
}
