:root {
  --bg: #0D110F;
  --text: #F1EEE2;
  --text-strong: #F9F5E8;
  --text-muted: #8A968E;
  --text-dim: #67746B;
  --text-faint: #4E5A52;

  --card-bg: #121714;
  --card-bg-muted: #151A17;
  --card-bg-soft: #101512;
  --card-border: #1E2621;
  --card-border-soft: #222824;

  --accent-bg: #1F4B3A;
  --accent-bg-active: #1A3F31;
  --accent-border: #2C5C46;

  --olive: #8A8B3D;
  --ghost-border: #2C332E;
  --ghost-bg-active: #1A211D;

  --warn-bg: #4B3A1F;
  --warn-border: #7A5C2C;
  --warn-text: #F2D9A6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}

a { color: #9CC5AD; text-decoration: none; }
a:hover { color: #C7E0D2; }

button { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

@keyframes koraShimmer { 0% { opacity: .45 } 50% { opacity: .9 } 100% { opacity: .45 } }

.app {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: calc(var(--tg-top, 0px) + 12px) 16px calc(var(--tg-bottom, 0px) + 20px);
  max-width: 460px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 16px;
}
.logo { height: 18px; width: auto; display: block; }
.topbar__spacer { flex: 1; }

.sources {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 16px;
  margin: -4px 0 0;
  scrollbar-width: none;
}
.sources::-webkit-scrollbar { display: none; }

.source-pill {
  font-size: 13px;
  white-space: nowrap;
  flex: none;
  border-radius: 6px;
  padding: 6px 10px;
}
.source-pill--active {
  font-weight: 600;
  color: var(--text);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
}
.source-pill--soon {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5B6862;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 6px 10px;
}
.soon-tag {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.screens { display: flex; flex-direction: column; flex: 1; }
.screen { display: flex; flex-direction: column; gap: 14px; }
.screen[data-screen="pending"],
.screen[data-screen="error"] { align-items: center; text-align: center; padding-top: 24px; gap: 16px; }

.head-block { display: flex; flex-direction: column; gap: 4px; }
.head-block--center { align-items: center; gap: 6px; }

.title-lg { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.title-md { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.title-sm { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.title-xs { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: 0; color: var(--text); }

.subtitle { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); text-wrap: pretty; }
.screen[data-screen="pending"] .subtitle,
.screen[data-screen="error"] .subtitle { font-size: 14px; line-height: 1.5; }

.card {
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card--accent { border: 1px solid var(--accent-border); background: var(--card-bg); }
.card--muted { border: 1px solid var(--card-border-soft); background: var(--card-bg-muted); }

.plan-row { display: flex; align-items: center; gap: 8px; }
.plan-name { font-size: 15px; font-weight: 600; color: var(--text); }
.plan-name--lg { font-size: 16px; }

.badge {
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.01em;
}
.badge--available { color: #C9D8CE; background: var(--accent-bg); }

.price-row { display: flex; align-items: baseline; gap: 7px; }
.price { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; color: var(--text-strong); }
.price-period { font-size: 13px; color: #7E8B83; }

.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.45;
  color: #CBD5CE;
}
.dot {
  width: 4px; height: 4px; border-radius: 1px;
  background: var(--text-faint);
  margin-top: 8px;
  flex: none;
}
.dot--olive { width: 6px; height: 6px; border-radius: 50%; margin-top: 0; background: var(--olive); }

.btn {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn--primary {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--text);
}
.btn--primary:active { background: var(--accent-bg-active); }
.btn--ghost {
  border-color: var(--ghost-border);
  background: transparent;
  color: #E4E9E5;
  font-weight: 500;
}
.btn--ghost:active { background: var(--ghost-bg-active); }
.btn--danger {
  border-color: #6B2C2C;
  background: transparent;
  color: #E88A8A;
  font-weight: 500;
}
.btn--danger:active { background: #2A1616; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

.btn-link {
  align-self: flex-start;
  background: transparent;
  border: none;
  padding: 0 0 4px;
  font-family: inherit;
  font-size: 13px;
  color: #7E8B83;
  cursor: pointer;
}

.plan-stub-list { display: flex; flex-direction: column; gap: 8px; }
.plan-stub {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg-soft);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plan-stub__name { font-size: 14px; font-weight: 500; color: #7E8B83; }
.tag {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid #232A25;
  border-radius: 4px;
  padding: 2px 6px;
}

.footnote { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-dim); text-align: center; text-wrap: pretty; }

.methods { display: flex; flex-direction: column; gap: 8px; }
.method {
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg-soft);
  border: 1px solid var(--card-border);
}
.method[data-selected="true"] { background: var(--card-bg); border-color: var(--accent-border); }
.method:disabled { opacity: .55; cursor: not-allowed; }

.method__row { display: flex; align-items: center; gap: 10px; width: 100%; }
.method__radio {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #2A322C;
}
.method[data-selected="true"] .method__radio { border-color: var(--accent-border); }
.method__radio-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.method[data-selected="true"] .method__radio-dot { background: var(--olive); }

.method__icon {
  width: 30px; height: 30px; border-radius: 6px; flex: none;
  background: var(--bg); border: 1px solid #232A25;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.method__title { font-size: 14px; font-weight: 600; color: var(--text); }
.method__spacer { flex: 1; }
.method__fee {
  font-size: 12px; border-radius: 4px; padding: 2px 6px; white-space: nowrap;
  color: var(--text-muted); border: 1px solid #232A25;
}
.method[data-free="true"] .method__fee { color: #C9D8CE; border-color: var(--accent-border); }

.method__note { font-size: 12px; line-height: 1.45; color: var(--text-muted); padding-left: 68px; }
.method__total { font-size: 12px; color: #CBD5CE; padding-left: 68px; }
.method__total b { font-weight: 600; color: var(--text-strong); }

.status-pill {
  display: flex; align-items: center; gap: 7px;
  background: #16241C; border: 1px solid #23342A; border-radius: 4px;
  padding: 3px 8px; font-size: 12px; color: #C9D8CE;
  margin-left: auto;
}

.hr { height: 1px; background: var(--card-border-soft); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: 12px; color: var(--text-dim); }
.field__value { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-strong); }
.field__value--sm { font-size: 14px; font-weight: 400; color: #CBD5CE; }
.field__value--token { font-family: monospace; word-break: break-all; }

.notice {
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  color: #9AA69E;
}
.notice .dot { flex: none; margin-top: 0; }
.notice--warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}
.notice--warn .dot { background: var(--warn-text); }
/* Плашка «расширение пока только на русском» (англ. интерфейс) — должна быть заметной. */
.notice--alert {
  border-color: #7A2E2E;
  background: #2A1414;
  color: #F2C9C9;
}
.notice--alert b { color: #FFFFFF; }

.pending-icon {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1.5px solid var(--accent-border);
  background: var(--card-bg);
  position: relative;
}
.pending-icon__hand { position: absolute; left: 50%; top: 50%; border-radius: 2px; }
.pending-icon__hand--minute { width: 2px; height: 17px; background: #C9D8CE; transform-origin: 50% 100%; transform: translate(-50%, -100%) rotate(38deg); }
.pending-icon__hand--hour { width: 2px; height: 12px; background: var(--olive); transform-origin: 50% 100%; transform: translate(-50%, -100%) rotate(-70deg); }
.pending-icon__center { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #C9D8CE; transform: translate(-50%, -50%); }

.error-icon {
  width: 48px; height: 48px; border-radius: 10px;
  border: 1px solid var(--ghost-border);
  background: var(--card-bg-muted);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.error-icon__line { position: absolute; width: 2px; height: 22px; background: var(--text-muted); border-radius: 2px; }
.error-icon__line--1 { transform: rotate(45deg); }
.error-icon__line--2 { transform: rotate(-45deg); }

/* --- doc (оферта/политика, rules.html) --- */
.doc { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }
.doc h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.doc p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; color: #CBD5CE; text-wrap: pretty; }
.doc p:last-child { margin-bottom: 0; }
.doc ol, .doc ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc li { font-size: 14px; line-height: 1.5; color: #CBD5CE; }
.doc b { color: var(--text-strong); }
.doc a { word-break: break-word; }
.doc__updated { margin: 0; font-size: 12px; color: var(--text-dim); }

/* --- loading skeleton --- */
.skeleton { border-radius: 8px; background: #171D19; animation: koraShimmer 1.4s ease-in-out infinite; }
.skeleton--title { height: 24px; width: 55%; margin-bottom: 10px; }
.skeleton-card { border: 1px solid var(--card-border); background: var(--card-bg); }
.skeleton--line-sm { height: 16px; width: 40%; border-radius: 6px; background: #1B221E; }
.skeleton--line-lg { height: 38px; width: 55%; border-radius: 8px; background: #1B221E; animation-delay: .1s; }
.skeleton--line { height: 12px; width: 88%; border-radius: 6px; animation-delay: .2s; }
.skeleton--line-76 { width: 76%; animation-delay: .3s; }
.skeleton--block { height: 44px; border-radius: 8px; background: #1B221E; margin-top: 6px; animation-delay: .4s; }
