:root {
  color-scheme: dark;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: #f5f4fb;
  background: #0c0d13;
  --ink: #f5f4fb;
  --muted: #a5a8bd;
  --faint: #9296ac;
  --canvas: #0b0c11;
  --sidebar: #101119;
  --panel: #15161f;
  --surface: #191b27;
  --hover: #212433;
  --field: #10111a;
  --line: #2e3142;
  --line-soft: #242635;
  --accent: #d5ccff;
  --accent-ink: #211737;
  --accent-soft: #2a2440;
  --amber: #f4cb8b;
  --amber-soft: #3a2c20;
  --danger: #ffaeb9;
  --danger-soft: #3b2331;
  --lavender: #cec7ff;
  --lavender-soft: #2d2944;
  --radius: 17px;
  --gutter: clamp(24px, 3.5vw, 54px);
  --group-grid: minmax(0, 1.65fr) minmax(112px, .73fr) minmax(95px, .63fr) minmax(135px, 1fr) 13px;
  accent-color: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  display: grid;
  grid-template-columns: 234px minmax(0, 1fr);
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse 52rem 31rem at 26% -11rem, #2b2448 0, transparent 76%),
    radial-gradient(ellipse 31rem 37rem at 101% 11rem, #1a1b30 0, transparent 76%),
    var(--canvas);
}
a { color: inherit; }
button, input { font: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, summary, a, input { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
:focus-visible { outline: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: -.015em; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 31px 18px 20px;
  background: radial-gradient(ellipse 17rem 11rem at 15% 0, #2b2742, transparent), var(--sidebar);
  border-right: 1px solid #2b2c3b;
}
.brand {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 11px;
  margin-left: 6px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f0edff, #9f8dea);
  box-shadow: 0 5px 22px #9f8dea44, inset 0 1px #fcf8ff8c;
  color: #22193a;
  font: italic 750 26px / 1 Georgia, serif;
  padding-right: 1px;
}
.brand strong { font-size: 24px; font-weight: 670; line-height: 1; letter-spacing: -.045em; }

.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav a:focus-visible { background: var(--hover); color: var(--ink); }
.sidebar nav a:focus-visible { text-decoration: underline; }
.sidebar nav a[aria-current="page"] {
  background: linear-gradient(120deg, #302840, #242234 75%);
  border-color: #4b4267;
  color: #eee9ff;
  box-shadow: inset 0 1px #c9bbfc17;
}
.nav-icon { position: relative; display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; }
.icon-groups::before, .icon-groups::after { position: absolute; display: block; content: ""; }
.icon-groups::before { inset: 2px 2px 3px 2px; border: 1.4px solid currentColor; border-radius: 3px; }
.icon-groups::after { width: 6px; height: 6px; left: 5px; bottom: 3px; border: 1.4px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.icon-packages::before { position: absolute; inset: 4px; content: ""; border: 1.4px solid currentColor; transform: rotate(45deg); border-radius: 2px; }
.icon-payments::before { position: absolute; inset: 4px 1px; content: ""; border: 1.4px solid currentColor; border-radius: 2px; }
.icon-payments::after { position: absolute; inset: 8px 2px auto; height: 1px; content: ""; background: currentColor; }
.icon-access::before { position: absolute; inset: 3px 4px 8px; content: ""; border: 1.4px solid currentColor; border-radius: 5px 5px 0 0; }
.icon-access::after { position: absolute; inset: 8px 2px 2px; content: ""; border: 1.4px solid currentColor; border-radius: 3px; background: var(--sidebar); }

.operator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  margin-top: auto;
  padding: 12px 2px 0;
  border-top: 1px solid var(--line);
}
.operator-profile { display: flex; align-items: center; min-width: 0; gap: 7px; }
.operator-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #4b4465;
  border-radius: 10px;
  background: #28243b;
  color: #e1d9ff;
  font-size: 11px;
  font-weight: 650;
}
.operator-identity { display: grid; gap: 3px; min-width: 0; }
.operator-identity strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.operator-identity small { color: var(--muted); font-size: 11px; }
.button.icon-button { flex: 0 0 35px; width: 35px; min-height: 35px; padding: 0; color: var(--muted); background: transparent; }
.icon-button:is(:hover, :focus-visible) { color: var(--ink); background: var(--hover); border-color: var(--line); }
.icon-logout { position: relative; width: 17px; height: 17px; display: inline-block; }
.icon-logout::before { position: absolute; inset: 2px 7px 2px 2px; content: ""; border: 1.4px solid currentColor; border-right: 0; border-radius: 2px 0 0 2px; }
.icon-logout::after { position: absolute; inset: 5px 3px 5px auto; width: 7px; content: ""; border: 1.4px solid currentColor; border-width: 1.4px 1.4px 0 0; transform: rotate(45deg); }

.main {
  width: min(100%, 1500px);
  justify-self: center;
  min-width: 0;
  padding: 22px var(--gutter) 64px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 39px;
  margin-bottom: 31px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.last-sync { color: var(--faint); font-size: 12px; }
.button-refresh span { font-size: 18px; line-height: 1; }

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 27px;
}
.page-head h1 {
  font: 650 clamp(42px, 5.2vw, 68px) / .99 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.064em;
}
.page-head p { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.period {
  padding: 6px 10px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  font: 500 12px / 1.25 ui-monospace, Consolas, monospace;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: 1.48fr 1fr 1fr 1fr;
  gap: 13px;
  margin-bottom: 32px;
}
.metrics > div {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  min-height: 145px;
  padding: 17px 17px 15px;
  background: linear-gradient(149deg, #1b1c2a, var(--panel) 62%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px #e7daff0a, 0 14px 28px #01010c2e;
}
.metrics > .metric-spend {
  background: radial-gradient(ellipse 16rem 11rem at 100% 0, #362c57, transparent 90%), #1e1a30;
  border-color: #51446b;
}
.metrics dt, .metric-note { color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.metrics dt { color: #c5c6d7; font-size: 13px; }
.metrics dd[id]:not(.metric-note) {
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.06;
  overflow-wrap: anywhere;
}
.metrics .metric-spend dd[id]:not(.metric-note) { color: #f2edff; font-size: clamp(26px, 3.35vw, 40px); }
.meter {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 4px;
  background: #35364b;
  color: #d5ccff;
}
.meter::-webkit-progress-bar { background: #35364b; border-radius: 4px; }
.meter::-webkit-progress-value { background: linear-gradient(90deg, #a190e4, currentColor); border-radius: 4px; }
.meter::-moz-progress-bar { background: currentColor; border-radius: 4px; }
.meter[data-level="high"] { color: var(--amber); }
.metric-spend .meter { margin-block: 2px 1px; }

.groups-panel {
  background: linear-gradient(150deg, #151722, #12131b 80%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
}
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 18px 19px 12px;
}
.list-title { display: flex; flex-wrap: wrap; gap: 5px 13px; align-items: baseline; }
.list-title h2 { font-size: 20px; font-weight: 650; letter-spacing: -.025em; }
.list-count { color: var(--faint); font-size: 12px; white-space: nowrap; }
.group-filter { position: relative; width: min(100%, 270px); flex-shrink: 0; color: var(--muted); }
.group-filter::before {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  width: 11px;
  height: 11px;
  border: 1.35px solid currentColor;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.group-filter::after {
  position: absolute;
  top: 22px;
  left: 21px;
  width: 5px;
  height: 1.35px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
  content: "";
  pointer-events: none;
}
.group-states {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 18px 13px;
}
.group-states label { position: relative; display: flex; cursor: pointer; }
.group-states input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.group-states label span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  min-height: 33px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.group-states label:hover span, .group-states input:focus-visible + span { background: var(--hover); color: var(--ink); }
.group-states input:focus-visible + span { text-decoration: underline; text-underline-offset: 3px; }
.group-states input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: #4a4069; }
.group-states small { font: 500 11px / 1 ui-monospace, Consolas, monospace; opacity: .86; }
.group-columns, .group-summary {
  display: grid;
  grid-template-columns: var(--group-grid);
  align-items: center;
  gap: 12px 17px;
  padding-inline: 19px;
}
.group-columns {
  padding-block: 10px;
  background: #171924;
  border-block: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
}
.entry-list { display: grid; gap: 10px; }
.groups-panel .entry-list { gap: 0; }
.entry {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
}
.groups-panel .entry {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
}
.groups-panel .entry:last-child { border-bottom: 0; }
.entry[open] { border-color: #5a5077; }
.groups-panel .entry[open] { background: #191c2b; }
.entry-summary {
  display: grid;
  align-items: center;
  gap: 12px 17px;
  padding: 15px 19px;
  min-height: 65px;
  list-style: none;
}
.entry-summary::-webkit-details-marker { display: none; }
.entry-summary:hover, .entry-summary:focus-visible { background: var(--hover); }
.entry-summary:focus-visible .entry-title strong { text-decoration: underline; }
.group-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.group-avatar {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-content: center;
  border: 1px solid #454665;
  border-radius: 9px;
  background: #282a44;
  color: #e1dfff;
  font-weight: 650;
  font-size: 11px;
}
.group[data-status="pending"] .group-avatar { background: #392e28; border-color: #5b4738; color: #f2d0a5; }
.group[data-status="paused"] .group-avatar { background: var(--lavender-soft); border-color: #524b6c; color: var(--lavender); }
.entry-title { display: grid; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.entry-title strong { font-size: 14px; font-weight: 650; line-height: 1.35; }
.subtle { color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.entry-cell { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.cell-label { display: block; color: var(--muted); font-size: 11px; }
.group-summary .cell-label { display: none; }
.entry-number { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 610; line-height: 1.35; overflow-wrap: anywhere; }
.budget .meter { width: min(100%, 136px); }
.state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 5px;
  background: #2a2b39;
  color: #c8c9d7;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}
.state::before { flex: 0 0 5px; width: 5px; height: 5px; border-radius: 5px; background: currentColor; content: ""; }
.state-active, .state-paid { background: #20352f; color: #a9e2cc; }
.state-pending, .state-approved, .state-refund_pending, .state-invited { background: var(--amber-soft); color: var(--amber); }
.state-refunded { background: var(--lavender-soft); color: var(--lavender); }
.state-revoked { background: #2c2b37; color: #c6c5d3; }
.chevron {
  width: 7px;
  height: 7px;
  place-self: center;
  border: solid var(--muted);
  border-width: 0 1.4px 1.4px 0;
  transform: translateY(-2px) rotate(45deg);
}
.entry[open] .chevron { transform: translateY(2px) rotate(225deg); }
.package-summary { grid-template-columns: minmax(0, 1.6fr) minmax(82px, .65fr) minmax(74px, .65fr) auto 13px; }
.entry-content { padding: 19px; border-top: 1px solid var(--line); background: #12141e; }
.group-forms { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .85fr); gap: 15px; }
.settings-form, .credit-form {
  display: grid;
  min-width: 0;
  align-content: start;
  justify-items: start;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
}
.settings-form > *, .credit-form > * { min-width: 0; }
.settings-form h3, .credit-form h3, .new-package h2, dialog h2 { font-size: 17px; font-weight: 650; letter-spacing: -.024em; }
fieldset { min-width: 0; margin: 0; border: 0; }
form fieldset { padding: 0; width: 100%; }
legend { padding: 0; }
form legend { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.options { display: flex; flex-wrap: wrap; gap: 6px; }
.options label, .check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.options label { padding: 5px 8px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; }
.options label:has(:checked) { background: var(--accent-soft); border-color: #695983; }
.options label:hover, .options label:focus-within { background: var(--hover); }
.options label:has(:disabled) { color: var(--faint); cursor: default; }
.options label input, .check input { margin: 0; }
.check:has(input:focus-visible), .options label:has(input:focus-visible) { text-decoration: underline; text-underline-offset: 3px; }
.provider-note { display: block; color: var(--amber); font-size: 10px; }
.field { display: grid; align-content: start; gap: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
input:is([type="text"], [type="number"], [type="search"]), .field input {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 37px;
  padding: 8px 9px;
  border: 1px solid #393b52;
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font-size: 13px;
  transition: background-color .16s, border-color .16s;
}
input:is([type="text"], [type="number"], [type="search"]):focus, .field input:focus { border-color: #8775b7; background: #1c1f31; }
.group-filter input { padding-left: 32px; }
input::placeholder { color: #9a9db5; opacity: 1; }
input[readonly] { color: var(--faint); }
.settings-line, .fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 8px 13px; width: 100%; }
.group-usage { width: 100%; padding-top: 4px; }
.group-usage > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-block: 6px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.group-usage dd { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.package-form { display: grid; gap: 13px; }
.package-fields { display: grid; grid-template-columns: .9fr 1.5fr 1fr .85fr .85fr; gap: 10px; }
.package-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.package-actions .check { margin-right: auto; }
.new-package { border: 1px solid var(--line); border-radius: var(--radius); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 37px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  transition: background-color .16s, border-color .16s;
}
.button:disabled { cursor: default; opacity: .48; }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:not(:disabled):is(:hover, :focus-visible) { background: #e4dcff; }
.button-secondary { background: #1b1e2c; border-color: #3e4056; }
.button-secondary:not(:disabled):is(:hover, :focus-visible) { background: #2a2840; border-color: #675d84; }
.button-danger { background: var(--danger); color: #371725; }
.button-danger:not(:disabled):is(:hover, :focus-visible) { background: #ffcbd3; }
.notice, .empty, .form-error {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.notice { margin-bottom: 15px; background: var(--accent-soft); border-color: #4e4569; color: var(--accent); }
.notice-error, .form-error { background: var(--danger-soft); border-color: #715067; color: var(--danger); }
.provider-empty, #payments-offline { margin-bottom: 16px; }
#group-empty { margin: 0 19px 18px; }
.payments-table-wrapper { border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; background: var(--panel); }
.payments-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; line-height: 1.45; }
.payments-table th, .payments-table td { padding: 14px 15px; vertical-align: top; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.payments-table th { background: #181a27; color: var(--muted); font-size: 12px; font-weight: 600; }
.payments-table tbody tr:last-child td { border-bottom: 0; }
.payments-table tr:hover td { background: #202232; }
.payment-cell { display: grid; align-content: start; justify-items: start; gap: 4px; }
.payment-title { font-weight: 650; }
.payments-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
dialog {
  width: min(100% - 30px, 440px);
  padding: 21px;
  border: 1px solid #55506e;
  border-radius: var(--radius);
  background: #1a1b29;
  color: var(--ink);
  box-shadow: 0 20px 90px #0009;
}
dialog::backdrop { background: #0a0a12cb; }
dialog p { margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 17px; }

.access-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, .85fr); align-items: start; gap: 14px; }
.access-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.access-panel h2 { font-size: 20px; font-weight: 640; letter-spacing: -.025em; }
.access-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.access-members { display: grid; }
.access-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}
.access-member .button { min-height: 33px; padding-inline: 9px; font-size: 12px; }
.access-status { color: var(--muted); font-size: 13px; line-height: 1.55; }
.access-status.notice-error { margin-top: 8px; padding: 9px; border-radius: 7px; }
.invite-panel { display: grid; gap: 11px; }
.invite-panel form, .invite-share { display: grid; justify-items: start; gap: 7px; }
.invite-panel form { margin-top: 3px; }
.invite-panel .button { margin-top: 3px; }
.invite-share { margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--line-soft); }

.login-page {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 42rem 28rem at 24% 9%, #30274b 0, transparent 76%),
    radial-gradient(ellipse 42rem 29rem at 83% 100%, #1a1b36 0, transparent 72%),
    var(--canvas);
}
.login-shell { display: grid; place-items: center; padding: 26px 17px; }
.login-card {
  width: min(100%, 465px);
  padding: clamp(22px, 6vw, 45px);
  border: 1px solid #454057;
  border-radius: 24px;
  background: linear-gradient(148deg, #242035, #171822 61%);
  box-shadow: 0 24px 90px #08070fb3, inset 0 1px #c7b9e62e;
}
.login-brand { width: fit-content; margin: 0 0 30px; }
.login-card h1 { font-size: clamp(30px, 8.2vw, 47px); font-weight: 650; letter-spacing: -.05em; line-height: 1.07; }
.login-intro { max-width: 35ch; margin-top: 11px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.telegram-button {
  width: 100%;
  min-height: 47px;
  margin-top: 24px;
  padding: 11px;
  gap: 9px;
  background: #9cd7ff;
  border-color: #b7e2ff;
  color: #15243e;
  font-size: 14px;
}
.telegram-button:not(:disabled):is(:hover, :focus-visible) { background: #baE5ff; }
.telegram-mark {
  width: 17px;
  height: 17px;
  background: currentColor;
  clip-path: polygon(3% 45%, 97% 7%, 77% 94%, 51% 72%, 34% 86%, 39% 65%, 75% 30%, 32% 58%);
}
.login-status { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-status:empty { margin-top: 0; }
.login-error { color: var(--danger); }

@media (max-width: 1100px) {
  body:not(.login-page) { grid-template-columns: 185px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .main { --gutter: 24px; }
  .group-columns, .entry-summary { gap: 10px 13px; padding-inline: 14px; }
  .group-columns, .group-summary { --group-grid: minmax(0, 1.4fr) minmax(83px, .63fr) minmax(68px, .6fr) minmax(102px, 1fr) 11px; }
  .metrics { gap: 8px; }
  .metrics > div { padding: 13px; }
  .group-forms { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  body:not(.login-page) { display: block; }
  .sidebar {
    position: static;
    gap: 17px;
    height: auto;
    padding: 16px var(--gutter) 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .brand { margin-left: 0; }
  .sidebar nav { display: flex; }
  .sidebar nav a { min-height: 36px; padding: 6px 10px; font-size: 13px; }
  .operator { padding: 7px 1px 0; }
  .main { padding-top: 23px; }
  .toolbar { position: absolute; top: 16px; right: var(--gutter); margin: 0; padding: 0; border: 0; }
  .last-sync { display: none; }
  .metrics { margin-bottom: 22px; }
}
@media (max-width: 620px) {
  :root { --gutter: 15px; }
  .main { --gutter: 15px; }
  .sidebar nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
  .sidebar nav a { justify-content: center; gap: 5px; }
  .nav-icon { transform: scale(.84); }
  .brand strong { font-size: 22px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 23px; }
  .button-refresh { min-height: 34px; }
  .page-head { flex-wrap: wrap; align-items: start; gap: 10px; margin-bottom: 16px; }
  .page-head h1 { font-size: clamp(41px, 10vw, 53px); }
  .page-head p { margin-top: 7px; font-size: 13px; }
  .period { padding-block: 4px; }
  .metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .metrics > div { padding: 12px 10px; min-height: 115px; gap: 5px; }
  .metrics dt { font-size: 11px; }
  .metric-note { font-size: 11px; }
  .group-columns { display: none; }
  .list-head { padding: 13px 12px 8px; flex-wrap: wrap; }
  .group-filter { width: 100%; }
  .group-states { padding: 0 10px 9px; border-bottom: 1px solid var(--line-soft); }
  .group-states label span { gap: 4px; padding-inline: 6px; }
  .group-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.25fr);
    gap: 9px 11px;
    padding: 12px;
  }
  .group-identity { grid-column: 1 / -1; grid-row: 1; padding-right: 15px; }
  .group-summary > .entry-cell { grid-row: 2; }
  .group-summary > .entry-cell:nth-child(2) { grid-column: 1; }
  .group-summary > .entry-cell:nth-child(3) { grid-column: 2; }
  .group-summary > .budget { grid-column: 3; }
  .group-summary .cell-label { display: block; }
  .group-summary .chevron { grid-column: 3; grid-row: 1; justify-self: end; }
  .entry-content { padding: 11px; }
  .settings-form, .credit-form { padding: 11px; gap: 10px; }
  .page-head .button { margin-top: 1px; }
  .package-summary { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) auto 10px; gap: 8px; padding: 12px; }
  .package-summary > .entry-title { grid-column: 1 / 4; }
  .package-summary > .chevron { grid-column: 4; grid-row: 1; }
  .package-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payments-table-wrapper { border: 0; background: transparent; }
  .payments-table, .payments-table tbody { display: block; }
  .payments-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .payments-table tbody { display: grid; gap: 8px; }
  .payments-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 11px; background: var(--panel); overflow: hidden; }
  .payments-table td, .payments-table tbody tr:last-child td { padding: 9px 11px; border: 0; }
  .payments-table td:first-child { grid-column: 1 / -1; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
  .payments-table td[data-label]::before { display: block; margin-bottom: 3px; color: var(--faint); font-size: 10.5px; content: attr(data-label); }
  .payments-table td:last-child:empty { display: none; }
  .payments-table .button { padding-inline: 8px; font-size: 12px; }
  .access-layout { grid-template-columns: 1fr; }
  .invite-panel { grid-row: 1; }
  .access-panel { padding: 13px; }
  .login-brand { margin-bottom: 24px; }
}
@media (max-width: 365px) {
  .sidebar nav a { font-size: 12px; }
  .sidebar nav a .nav-icon { display: none; }
  .access-member { grid-template-columns: minmax(0, 1fr) auto; }
  .access-member .button { grid-column: 1 / -1; justify-self: start; }
  .options { gap: 4px; }
  .group-states label span { font-size: 11px; padding-inline: 4px; }
  .entry-number { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
