/* Prosvet account panel styles. */

:root {
  --bg: #f5f7fa;
  --sidebar-bg: #fff;
  --card-head: #f5f7fa;
  --border: #e8edf2;
  --border-subtle: #f0f3f7;
  --text: #1a2332;
  --muted: #33586e;
  --muted2: #6f8292;
  --accent: #1a2332;
  --accent-hover: #33586e;
  --gold: #f2a93b;
  --green: oklch(0.6 0.15 145);
  --amber: oklch(0.65 0.15 80);
  --red: oklch(0.55 0.19 25);
  --gray: oklch(0.55 0.01 260);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: oklch(0.88 0.005 260); border-radius: 6px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Shell ---------- */
.app { display: flex; height: 100vh; width: 100%; overflow: hidden; }
.sidebar {
  width: 248px; flex: none; background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 12px;
}
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 0 22px; }
.brand-logo { display: block; width: 100%; height: auto; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex: none;
}
.wordmark { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500;
  color: oklch(0.45 0.01 260); background: transparent;
}
.nav-item:hover { background: oklch(0.96 0.003 260); }
.nav-item.active { font-weight: 700; color: var(--text); background: var(--border-subtle); }
.nav-icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: oklch(0.55 0.01 260); }
.nav-item.active .nav-icon { color: var(--text); }

.spacer { flex: 1; }

/* ---------- MCP usage indicator (sidebar) ---------- */
.mcp-usage { padding: 10px 10px 12px; margin: 0 2px 8px; border: 1px solid var(--border); border-radius: 9px; }
.mcp-usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mcp-usage-label { font-size: 12px; font-weight: 600; color: var(--text); }
.mcp-usage-count { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.mcp-usage-bar { height: 5px; border-radius: 100px; background: var(--border-subtle); overflow: hidden; margin-top: 7px; }
.mcp-usage-bar > span { display: block; height: 100%; border-radius: 100px; background: var(--accent); }
.mcp-usage-note { margin-top: 5px; font-size: 10.5px; color: var(--muted2); }

/* ---------- Section usage meters (seats / bases) ---------- */
.usage-meter { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 24px; }
.usage-meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.usage-meter-label { font-size: 13px; font-weight: 600; color: var(--text); }
.usage-meter-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-meter-bar { height: 6px; border-radius: 100px; background: var(--border-subtle); overflow: hidden; }
.usage-meter-bar > span { display: block; height: 100%; border-radius: 100px; background: var(--accent); }
.usage-meter-bar > span.near { background: oklch(0.65 0.15 80); }
.usage-meter-bar > span.full { background: var(--red); }
.usage-meter-note { margin-top: 8px; font-size: 12.5px; }
.usage-meter-note.danger { color: var(--red); }

.profile { position: relative; }
.profile-row {
  display: flex; align-items: center; gap: 9px; padding: 8px;
  border-radius: 9px; cursor: pointer; width: 100%; border: none; background: none; text-align: left;
}
.profile-row:hover { background: oklch(0.96 0.003 260); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--border-subtle);
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12.5px; flex: none;
}
.profile-meta { flex: 1; min-width: 0; }
.profile-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: 11.5px; color: var(--muted2); text-transform: capitalize; }
.profile-caret { width: 14px; height: 14px; flex: none; color: oklch(0.6 0.01 260); }

.popover {
  position: absolute; bottom: 56px; left: 0; right: 0; background: #fff;
  border: 1px solid oklch(0.9 0.005 260); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 20, 30, 0.12); padding: 6px;
  animation: fadeIn 0.12s ease-out; z-index: 20;
}
.popover.hidden { display: none; }
.popover-note { padding: 9px 10px; border-radius: 7px; font-size: 13px; color: oklch(0.4 0.01 260); cursor: default; }
.popover-divider { height: 1px; background: oklch(0.93 0.005 260); margin: 4px 6px; }
.popover-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 9px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer;
  color: var(--text); font-family: inherit;
}
.popover-item:hover { background: oklch(0.96 0.003 260); }
.popover-item.danger { color: var(--red); }
.popover-item.danger:hover { background: oklch(0.96 0.02 25); }

.content { flex: 1; overflow-y: auto; padding: 40px 48px; }
.container { max-width: 1240px; }

/* ---------- Headers / buttons ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
h1.title { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
.subtitle { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }
.btn-primary {
  background: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 9px 16px;
  border-radius: 8px; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:focus-visible, .submit-btn:focus-visible { outline: 3px solid rgba(242, 169, 59, .38); outline-offset: 2px; }
.btn-secondary {
  background: #fff; color: var(--text); border: 1px solid oklch(0.85 0.005 260);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ---------- Quick start ---------- */
.quickstart-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.quickstart-step { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-top: 1px solid oklch(0.95 0.005 260); }
.quickstart-step:first-child { border-top: none; }
.quickstart-check { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; margin-top: 1px; background: oklch(0.9 0.005 260); color: #fff; font-size: 13px; font-weight: 700; }
.quickstart-step.done .quickstart-check { background: var(--green); }
.quickstart-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.quickstart-copy strong { font-size: 14px; font-weight: 600; }
.quickstart-copy span { color: var(--muted2); font-size: 13px; margin-top: 2px; }
.quickstart-step.done .quickstart-copy strong { color: var(--muted); text-decoration: line-through; }
.quickstart-action { padding: 7px 13px; font-size: 12.5px; white-space: nowrap; }
.quickstart-done { padding: 7px 13px; border: 1px solid oklch(0.88 0.005 260); border-radius: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.qs-time { display: inline-flex; align-items: center; gap: 6px; color: #5a5f6b; margin-top: 8px; }
.qs-time svg { width: 16px; height: 16px; flex-shrink: 0; }
.qs-time span { font-size: 13px; font-weight: 600; }
.qs-total { display: inline-flex; align-items: center; gap: 6px; color: #5a5f6b; margin-left: 12px; vertical-align: middle; }
.qs-total svg { width: 18px; height: 18px; flex-shrink: 0; }
.qs-total span { font-size: 14px; font-weight: 600; }

/* ---------- Facts ---------- */
.facts-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.facts-toolbar input, .facts-toolbar select {
  min-height: 34px; border: 1px solid oklch(0.87 0.005 260); border-radius: 8px;
  background: #fff; color: var(--text); padding: 7px 10px; font: inherit; font-size: 13px;
}
.facts-toolbar .facts-search { flex: 1; min-width: 230px; }
.facts-summary { margin: 0 0 8px; color: var(--muted); font-size: 12px; text-align: right; }
.facts-card { overflow-x: auto; }
.grid-facts {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1.15fr) minmax(70px, .65fr) minmax(96px, .75fr) minmax(80px, .8fr) minmax(74px, .7fr) minmax(105px, .9fr) 32px;
  width: 100%; align-items: center;
}
.grid-facts > * { box-sizing: border-box; min-width: 0; padding-left: 6px; padding-right: 6px; }
.fact-statement { font-size: 13px; font-weight: 600; line-height: 1.35; }
.fact-keywords { display: flex; gap: 8px; flex-wrap: wrap; }
.fact-clamp { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.fact-status { min-width: 0; overflow: hidden; }
.fact-status .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.keyword { padding: 5px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.keyword-1 { color: oklch(0.5 0.15 250); background: color-mix(in oklch, oklch(0.5 0.15 250) 13%, white); }
.keyword-2 { color: oklch(0.5 0.14 25); background: color-mix(in oklch, oklch(0.5 0.14 25) 13%, white); }
.keyword-3 { color: oklch(0.5 0.14 145); background: color-mix(in oklch, oklch(0.5 0.14 145) 13%, white); }
.keyword-4 { color: oklch(0.5 0.14 300); background: color-mix(in oklch, oklch(0.5 0.14 300) 13%, white); }
.keyword-5 { color: oklch(0.5 0.14 60); background: color-mix(in oklch, oklch(0.5 0.14 60) 13%, white); }
.keyword-hidden { display: none !important; }
/* "…" chip revealing the tags that don't fit in the 3-row clamp. */
.keyword-more { border: 0; cursor: pointer; font-family: inherit; color: var(--muted); background: oklch(0.95 0.003 260); }
.keyword-more:hover { background: oklch(0.92 0.003 260); }
/* Fixed-positioned so it escapes the facts card's overflow clipping. */
.keyword-popup {
  position: fixed; z-index: 60; display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 320px; max-height: 460px; overflow-y: auto; padding: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 8px 24px rgba(20,20,30,.12);
}
.keyword-popup.hidden { display: none; }
.facts-card .thead { font-size: 11px; font-weight: 700; padding: 9px 12px; }
.facts-card .trow { font-size: 13px; padding: 10px 12px; }
.facts-card .cell-muted { color: oklch(0.4 0.01 260); font-size: 12.5px; }
.fact-updated { min-width: 0; overflow: hidden; }
.fact-updated-author { color: var(--muted); font-size: 12px; }
.fact-date, .fact-updated-date { color: oklch(0.65 0.005 260); font-size: 11px; line-height: 1.35; }
.fact-updated-date { margin-top: 1px; }
.fact-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.fact-actions form { margin: 0; }
.fact-deleted { opacity: .55; }
.fact-deleted .fact-statement { text-decoration: line-through; }
.fact-textarea { min-height: 105px; resize: vertical; }
.fact-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.fact-sort:hover { color: var(--accent); }
.fact-sort span { color: var(--accent); font-size: 10px; }
.fact-filter { appearance: none; -webkit-appearance: none; background-image: none; min-width: 0; overflow: hidden; padding-right: 12px; text-overflow: ellipsis; white-space: nowrap; width: 170px; }
.fact-source-filter { max-width: 170px; }
.facts-filter-reset { color: var(--red); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.facts-filter-reset:hover { text-decoration: underline; }
.fact-actions { position: relative; }
.fact-menu { position: relative; }
.fact-menu-toggle { align-items: center; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-flex; font-size: 20px; height: 24px; justify-content: center; line-height: 1; list-style: none; width: 24px; }
.fact-menu-toggle::-webkit-details-marker { display: none; }
.fact-menu-toggle:hover { background: oklch(0.95 0.003 260); }
.fact-menu-dropdown { background: #fff; border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 8px 24px rgba(20,20,30,.12); padding: 5px; position: absolute; right: 0; text-align: left; top: 30px; width: 150px; z-index: 10; }
/* Last rows open the menu upward so it isn't clipped by the table's overflow. */
.facts-card .trow:nth-last-child(-n+2) .fact-menu-dropdown { top: auto; bottom: 30px; }
.fact-menu-item { background: none; border: 0; border-radius: 6px; color: inherit; cursor: pointer; display: block; font: inherit; padding: 8px 10px; text-align: left; width: 100%; }
.fact-menu-item:hover { background: oklch(0.96 0.003 260); }
.fact-menu-danger { color: var(--red); }
.facts-pagination { align-items: center; color: var(--muted); display: flex; font-size: 12.5px; justify-content: space-between; margin-top: 16px; }
.facts-pager { align-items: center; display: flex; gap: 6px; }
.facts-pager form { margin: 0 10px 0 0; }
.facts-page-size { appearance: none; background: #fff; border: 1px solid var(--border); border-radius: 7px; color: inherit; cursor: pointer; font: inherit; padding: 6px 10px; }
.facts-page-button { align-items: center; border: 1px solid var(--border); border-radius: 7px; color: inherit; display: inline-flex; height: 30px; justify-content: center; text-decoration: none; width: 30px; }
.facts-page-button:not(.disabled):hover { border-color: var(--accent); color: var(--accent); }
.facts-page-button.disabled { color: oklch(0.75 0.005 260); cursor: default; }
.facts-page-label { color: oklch(0.4 0.01 260); padding: 0 6px; white-space: nowrap; }

@media (max-width: 760px) {
  .content { padding: 24px 18px; }
  .sidebar { width: 190px; }
  .facts-toolbar > * { flex: 1 1 145px; }
  .facts-toolbar .facts-search { flex-basis: 100%; }
}
.btn-secondary:hover { background: oklch(0.97 0.003 260); }
.btn-danger {
  background: #fff; color: var(--red); border: 1px solid color-mix(in oklch, var(--red) 45%, white);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-danger:hover { background: color-mix(in oklch, var(--red) 8%, white); }

/* ---------- Danger zone ---------- */
.danger-label { color: var(--red); }
.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid color-mix(in oklch, var(--red) 30%, white); border-radius: 10px;
  background: color-mix(in oklch, var(--red) 4%, white); padding: 16px 18px;
}
.danger-zone-title { font-weight: 600; margin-bottom: 4px; }

/* ---------- Cancelled subscription banner ---------- */
.cancelled-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid color-mix(in oklch, var(--red) 30%, white); border-radius: 10px;
  background: color-mix(in oklch, var(--red) 5%, white); padding: 16px 18px; margin-bottom: 20px;
}
.cancelled-banner-title { font-weight: 650; color: var(--red); margin-bottom: 4px; }

/* ---------- Danger confirmation modal ---------- */
.modal-title.danger-title { color: var(--red); }
.modal-danger { color: var(--red); font-weight: 600; margin: 4px 0 8px; }
.modal-danger-list { margin: 0 0 8px; padding-left: 20px; color: var(--text); font-size: 13px; line-height: 1.6; }

/* ---------- Tables ---------- */
.card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.thead, .trow { display: grid; align-items: center; }
.thead {
  padding: 10px 16px; background: var(--card-head); font-size: 11.5px;
  font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em;
}
.trow { padding: 13px 16px; border-top: 1px solid var(--border-subtle); font-size: 13.5px; position: relative; }
.cell-primary { font-weight: 600; }
.cell-sub { color: var(--muted2); font-size: 12.5px; }
.cell-muted { color: var(--muted2); }
.mono { font-family: ui-monospace, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-cap { color: oklch(0.4 0.01 260); text-transform: capitalize; }

.grid-users { grid-template-columns: 1.6fr 0.8fr 1fr 1fr 40px; }
.grid-tokens { grid-template-columns: 1.6fr 1fr 1fr 60px; }
.grid-direct { grid-template-columns: 1.4fr 1.6fr 1fr 90px; }
.grid-proxy { grid-template-columns: 1.4fr 1fr 1.2fr 1fr; }
.grid-invoices { grid-template-columns: 1fr 1fr 1fr 70px; }
.grid-invites { grid-template-columns: 1.6fr 0.8fr 1fr 90px; }

/* ---------- Empty states ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 44px 24px; text-align: center;
}
.card .thead + .empty, .card .empty:not(:first-child) { border-top: 1px solid var(--border-subtle); }
.empty-icon { width: 36px; height: 36px; border-radius: 9px; background: oklch(0.95 0.005 260); margin-bottom: 13px; }
.empty-title { font-size: 14px; font-weight: 600; color: oklch(0.3 0.01 260); margin-bottom: 4px; }
.empty-sub { font-size: 13px; color: var(--muted2); margin-bottom: 16px; }
.empty-sub:last-child { margin-bottom: 0; }

/* ---------- Modals ---------- */
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 22, 30, 0.4);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  animation: overlayIn 0.12s ease-out;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff; border-radius: 14px; width: 420px; max-width: 92vw;
  box-shadow: 0 24px 64px rgba(20, 20, 30, 0.25); animation: modalIn 0.14s ease-out;
  padding: 22px 24px 20px;
}
.modal-title { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.modal-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.modal .field-label { display: block; margin: 0 0 6px; }
.modal-input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; font-size: 13.5px;
  border: 1px solid oklch(0.87 0.005 260); border-radius: 8px; margin-bottom: 16px;
  outline: none; background: #fff; color: var(--text); font-family: inherit;
}
.modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px oklch(0.9 0.05 250); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.modal-actions .btn-primary { text-decoration: none; display: inline-block; }
.modal-wide { width: 640px; }
.modal-divider { height: 1px; background: var(--border); margin: 4px 0 18px; }
.pay-choice { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.pay-choice .btn-secondary { width: 100%; justify-content: center; }
.pay-choice .modal-sub { margin: 0; }
.modal-body { max-height: 62vh; overflow-y: auto; margin: 0 -4px 20px; padding: 0 4px; }
.modal-fieldset { border: 1px solid oklch(0.92 0.005 260); border-radius: 10px; padding: 16px; margin: 0 0 16px; }
.modal-fieldset:last-child { margin-bottom: 0; }
.modal-fieldset-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 12px; }
.modal-fieldset .modal-input:last-child { margin-bottom: 0; }
.modal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-grid-2 .modal-input { margin-bottom: 0; }
.token-reveal {
  display: flex; align-items: center; gap: 8px;
  background: oklch(0.97 0.003 260); border: 1px solid oklch(0.9 0.005 260); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 22px; font-size: 12.5px;
}
.token-reveal .mono { flex: 1; min-width: 0; word-break: break-all; }
.token-copy {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid oklch(0.85 0.005 260);
  background: #fff; color: var(--muted); cursor: pointer;
}
.token-copy:hover { background: oklch(0.95 0.003 260); color: var(--text); }
.token-copy svg { width: 16px; height: 16px; display: block; }
.token-copy.copied { color: var(--green); border-color: var(--green); }

.row-actions { text-align: right; position: relative; }
.dots {
  width: 26px; height: 26px; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
  border: none; background: none;
}
.dots:hover { background: oklch(0.95 0.003 260); }
.row-menu {
  position: absolute; right: 0; top: 32px; background: #fff; border: 1px solid oklch(0.9 0.005 260);
  border-radius: 9px; box-shadow: 0 8px 24px rgba(20, 20, 30, 0.12); padding: 5px; width: 172px;
  z-index: 10; text-align: left; animation: fadeIn 0.12s ease-out;
}
.row-menu.hidden { display: none; }
.row-menu-item { padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.row-menu-item:hover { background: oklch(0.96 0.003 260); }
.row-menu-item.danger { color: var(--red); }
.row-menu-item.danger:hover { background: oklch(0.96 0.02 25); }

.link-action { font-size: 13px; font-weight: 600; cursor: pointer; }
.link-edit { color: oklch(0.4 0.01 260); }
.link-edit:hover { text-decoration: underline; }
.link-danger { color: var(--red); }
.link-danger:hover { text-decoration: underline; }
.actions-inline { text-align: right; display: flex; gap: 14px; justify-content: flex-end; }

/* ---------- Pills ---------- */
.pill { display: inline-block; padding: 3px 9px; border-radius: 100px; font-size: 11.5px; font-weight: 600; }
.pill-green { color: var(--green); background: color-mix(in oklch, var(--green) 14%, white); }
.pill-amber { color: var(--amber); background: color-mix(in oklch, var(--amber) 14%, white); }
.pill-gray  { color: var(--gray);  background: color-mix(in oklch, var(--gray) 14%, white); }
.pill-red   { color: var(--red);   background: color-mix(in oklch, var(--red) 14%, white); }

/* ---------- Bases footnote ---------- */
.footnote { color: var(--muted2); font-size: 12.5px; margin-top: 12px; }
.footnote code { background: oklch(0.96 0.003 260); padding: 2px 6px; border-radius: 4px; }

/* ---------- Billing ---------- */
.section-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 12px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 32px; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: #fff; }
.plan-card.current { border-color: var(--accent); background: oklch(0.97 0.02 250); }
.plan-name { font-weight: 650; font-size: 15px; margin-bottom: 4px; }
.plan-price { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.plan-blurb { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.plan-cta { width: 100%; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; text-align: center; background: #fff; color: var(--text); border: 1px solid oklch(0.85 0.005 260); padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.plan-cta.current { background: oklch(0.94 0.01 250); color: oklch(0.4 0.1 250); border: none; cursor: default; }
.tariff-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.tariff-option { border: 1px solid var(--border); border-radius: 9px; padding: 14px; background: oklch(0.99 0.002 260); display: flex; flex-direction: column; }
.tariff-option.current { border-color: var(--accent); background: oklch(0.97 0.02 250); }
.tariff-option-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.tariff-option .plan-price { margin-bottom: 0; }
.tariff-period { font-size: 13px; color: var(--muted); }
.tariff-discount { display: inline-block; align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--green); background: color-mix(in oklch, var(--green) 14%, white); border-radius: 100px; padding: 2px 8px; margin-top: 6px; }
.tariff-trial { font-size: 12.5px; color: var(--muted); margin: 8px 0 14px; line-height: 1.5; }
.tariff-option > form,
.tariff-option > .plan-cta { margin-top: auto; }
.tariff-option > form { display: flex; flex-direction: column; }
.tariff-option > form .plan-cta { margin-top: 8px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 32px; }
.pay-card { border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.pay-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-chip { width: 34px; height: 22px; border-radius: 4px; background: oklch(0.9 0.02 260); flex: none; }

/* ---------- Profile section ---------- */
.profile-panel { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; max-width: 520px; }
.profile-field { display: grid; grid-template-columns: 140px 1fr; padding: 14px 16px; border-top: 1px solid var(--border-subtle); font-size: 13.5px; }
.profile-field:first-child { border-top: none; }
.profile-field .k { color: var(--muted); }
.profile-field .v { font-weight: 600; }

.consent-field { display:flex; align-items:flex-start; gap:8px; font-size:12px; line-height:1.4; color:var(--muted); }
.consent-field input { margin-top:2px; }
.cookie-banner { position:fixed; z-index:1000; left:16px; right:16px; bottom:16px; max-width:760px; margin:auto; padding:16px; border:1px solid var(--border); border-radius:12px; background:white; box-shadow:0 12px 40px rgba(0,0,0,.18); }
.cookie-actions { display:flex; gap:10px; margin-top:12px; }
.cookie-actions button { flex:1; min-height:40px; border:1px solid #333; border-radius:8px; background:#fff; color:#111; font-weight:600; }
.cookie-settings { position:fixed; right:16px; bottom:8px; z-index:900; border:0; background:transparent; color:var(--muted); text-decoration:underline; cursor:pointer; }
.legal-page { max-width:760px; margin:48px auto; padding:0 20px 64px; line-height:1.65; }
.legal-version { color:var(--muted); }

/* ---------- Auth (sign in / sign up) ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(242, 169, 59, .12), transparent 32rem),
    linear-gradient(180deg, #fff 0, var(--bg) 100%);
}
.auth-card { width: 100%; max-width: 420px; background: rgba(255, 255, 255, .96); border: 1px solid var(--border); border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(26, 35, 50, .09); }
.auth-brand { display: flex; align-items: center; justify-content: center; margin-bottom: 32px; }
.auth-brand .brand-logo { width: auto; height: 32px; max-width: 100%; }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; text-align: center; }
.auth-sub { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 28px; text-align: center; }
/* Кнопки провайдеров одинаковы по форме. Размер (44px, размер M) и скругление
   12px взяты из гайдлайна Яндекса — он единственный, кто их нормирует, а VK
   форму кнопки не диктует, поэтому общая геометрия устраивает обоих.
   Вертикальные паддинги обнулены: с базовыми 12px высота уезжает до 46px.
   ОСОЗНАННОЕ ОТСТУПЛЕНИЕ по кнопке Яндекса: гайдлайн
   https://yandex.ru/dev/id/doc/ru/codes/buttons-design запрещает менять её
   цвет, но по требованию дизайна она окрашена как остальные. Чтобы вернуть
   фирменный вид — задать ей отдельно чёрный фон и белый текст (ховер #1a1a1a);
   подпись, знак и отступы гайдлайну уже соответствуют. */
.provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: #fff; color: var(--text); border: 1px solid var(--border);
  padding: 0 14px; height: 44px; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  margin-bottom: 10px; text-decoration: none;
}
.provider-btn:hover { background: var(--bg); color: var(--text); border-color: #d4dce4; }
.provider-btn:focus-visible { outline: 3px solid rgba(242, 169, 59, .38); outline-offset: 2px; }
.provider-btn .badge { width: 20px; height: 20px; border-radius: 5px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.provider-btn__mark {
  width: 20px; height: 20px; border-radius: 50%; background: #FC3F1D; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; line-height: 1; flex: 0 0 auto;
}

/* Знак VK ID: скруглённый квадрат фирменного синего с белым «VK». Сама кнопка
   остаётся в нашем стиле — VK, в отличие от Яндекса, оформление кнопки не
   диктует, у него нормируется только знак. */
.provider-btn__mark--vk {
  border-radius: 6px; background: #0077FF;
  font-size: 9px; letter-spacing: .02em;
}

.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-alt a, .consent-field a { color: var(--text); font-weight: 700; text-underline-offset: 3px; }
.auth-alt a:hover, .consent-field a:hover { color: var(--slate, #33586e); }
.auth-note { font-size: 12.5px; color: var(--muted2); margin-top: 18px; line-height: 1.5; }
.invite-badge { display: table; font-size: 12px; font-weight: 700; color: var(--text); background: rgba(242, 169, 59, .14); border: 1px solid rgba(242, 169, 59, .45); border-radius: 100px; padding: 4px 11px; margin: 0 auto 18px; }

/* ---------- Auth: email + password form ---------- */
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--text); }
.field-input {
  width: 100%; box-sizing: border-box; padding: 12px 13px; font: inherit; font-size: 14px;
  border: 1px solid #d4dce4; border-radius: 10px; background: #fff; color: var(--text);
}
.field-input::placeholder { color: #8c9aa7; }
.field-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 169, 59, .2); }
.submit-btn {
  width: 100%; background: var(--accent); color: #fff; border: 1px solid var(--accent); cursor: pointer;
  padding: 12px 14px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; margin-top: 4px;
}
.submit-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.auth-error {
  font-size: 13px; color: oklch(0.45 0.17 25); background: oklch(0.96 0.03 25);
  border: 1px solid oklch(0.8 0.1 25); border-radius: 9px; padding: 10px 12px; margin-bottom: 18px;
}
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted2); font-size: 12px; margin: 20px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 560px) {
  .auth-wrap { align-items: flex-start; padding: 24px 16px; }
  .auth-card { padding: 28px 22px; border-radius: 14px; }
  .auth-brand { margin-bottom: 26px; }
  .auth-brand .brand-logo { height: 28px; }
  .auth-title { font-size: 23px; }
}

/* --- Account write actions (banners, disclosure forms, inline row forms) --- */
.banner {
  font-size: 13px; border-radius: 9px; padding: 10px 12px; margin-bottom: 16px;
  border: 1px solid var(--border);
}
.banner-ok { color: oklch(0.42 0.13 150); background: oklch(0.96 0.04 150); border-color: oklch(0.8 0.1 150); }
.banner-err { color: oklch(0.45 0.17 25); background: oklch(0.96 0.03 25); border-color: oklch(0.8 0.1 25); }
.banner-token { color: var(--text); background: oklch(0.97 0.02 250); border-color: oklch(0.8 0.08 250); word-break: break-all; }
.banner-token code { font-size: 13px; }

.disclosure { margin-bottom: 16px; }
.disclosure > summary { display: inline-block; cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.inline-form {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px;
  padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card);
}
.inline-form input, .inline-form select {
  flex: 1; min-width: 180px; padding: 9px 11px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text);
}
/* Buttons rendered as inline links inside table rows (revoke/remove/delete). */
.link-action { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
/* Mobile stub (F5): the account/onboarding UI is desktop-only, so on narrow
   viewports we hide the app entirely and show a friendly "open on desktop"
   screen instead of a broken layout. */
#mobile-stub { display: none; }
@media (max-width: 720px) {
  .app { display: none !important; }
  #mobile-stub {
    display: flex; flex-direction: column; min-height: 100vh;
    background: #FFFFFF; color: #1A2332;
    font-family: 'Manrope', system-ui, sans-serif;
  }
  .mobile-stub-head {
    height: 60px; border-bottom: 1px solid #E8EDF2;
    display: flex; align-items: center; justify-content: center;
  }
  .mobile-stub-head img { height: 24px; display: block; }
  .mobile-stub-main {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 48px 32px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
  }
  .mobile-stub-phone {
    position: relative; width: 88px; height: 150px; border: 5px solid #1A2332;
    border-radius: 18px; display: flex; align-items: center; justify-content: center;
    margin-bottom: 36px;
  }
  .mobile-stub-beam {
    width: 3px; height: 200px; border-radius: 2px;
    background: linear-gradient(to bottom, rgba(242,169,59,0), #F2A93B 25%, #F7C56E 50%, #F2A93B 75%, rgba(242,169,59,0));
    animation: beamPulse 3.5s ease-in-out infinite;
  }
  @keyframes beamPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
  .mobile-stub-main h1 { margin: 0 0 12px; font-size: 24px; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
  .mobile-stub-main p { margin: 0 0 28px; font-size: 15px; line-height: 1.6; color: #33586E; max-width: 280px; }
  .mobile-stub-btn {
    background: #1A2332; color: #FFFFFF; font-size: 15px; font-weight: 700;
    padding: 14px 26px; border-radius: 10px; display: inline-flex; align-items: center;
    gap: 9px; min-height: 44px; text-decoration: none;
  }
  .mobile-stub-btn:hover { background: #33586E; }
  .mobile-stub-dot { width: 6px; height: 6px; border-radius: 50%; background: #F2A93B; }
  .mobile-stub-url { margin-top: 14px; font-size: 13px; color: #8CA0B0; }
  .mobile-stub-foot { padding: 16px; text-align: center; font-size: 11.5px; color: #8CA0B0; border-top: 1px solid #E8EDF2; }
}
