:root {
  color-scheme: dark;
  --bg: #000;
  --frame-bg: #000;
  --shell-bg:
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.08), transparent 34%),
    #000;
  --topbar-bg: rgba(0, 0, 0, 0.72);
  --brand-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  --panel: rgba(255, 255, 255, 0.05);
  --panel-soft: rgba(255, 255, 255, 0.03);
  --panel-hover: rgba(255, 255, 255, 0.08);
  --control-bg: rgba(255, 255, 255, 0.06);
  --control-soft: rgba(255, 255, 255, 0.035);
  --icon-bg: rgba(255, 255, 255, 0.06);
  --icon-color: rgba(255, 255, 255, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --frame-line: rgba(255, 255, 255, 0.06);
  --desktop-frame-line: rgba(255, 255, 255, 0.08);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.58);
  --subtle: rgba(255, 255, 255, 0.36);
  --placeholder: rgba(255, 255, 255, 0.28);
  --primary: #e8e8e8;
  --primary-text: #060606;
  --danger: #ff8f86;
  --danger-bg: rgba(255, 143, 134, 0.1);
  --danger-border: rgba(255, 143, 134, 0.32);
  --danger-text: #ffd8d4;
  --good: #9ee7bd;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  --float-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  --frame-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
  --nav-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(15, 15, 15, 0.72);
  --nav-border: rgba(255, 255, 255, 0.09);
  --nav-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 52px rgba(0, 0, 0, 0.5);
  --nav-text: rgba(255, 255, 255, 0.52);
  --nav-active-text: #fff;
  --nav-active-bg: rgba(255, 255, 255, 0.075);
  --nav-active-border: rgba(255, 255, 255, 0.1);
  --toast-bg: rgba(16, 16, 16, 0.92);
  --modal-overlay: rgba(0, 0, 0, 0.68);
  --modal-bg: rgba(18, 18, 18, 0.96);
  --qr-line: #111;
  --qr-bg: #fff;
  --qr-text: #111;
  --radius: 16px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f6;
  --frame-bg: rgba(255, 255, 255, 0.78);
  --shell-bg:
    radial-gradient(circle at 50% -12%, rgba(92, 121, 255, 0.16), transparent 38%),
    linear-gradient(180deg, #f8f9fc 0%, #e8edf4 100%);
  --topbar-bg: rgba(255, 255, 255, 0.78);
  --brand-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(237, 240, 247, 0.72));
  --panel: rgba(255, 255, 255, 0.72);
  --panel-soft: rgba(255, 255, 255, 0.5);
  --panel-hover: rgba(255, 255, 255, 0.96);
  --control-bg: rgba(255, 255, 255, 0.72);
  --control-soft: rgba(255, 255, 255, 0.56);
  --icon-bg: rgba(17, 24, 39, 0.055);
  --icon-color: rgba(17, 24, 39, 0.72);
  --line: rgba(17, 24, 39, 0.12);
  --line-strong: rgba(17, 24, 39, 0.22);
  --frame-line: rgba(17, 24, 39, 0.08);
  --desktop-frame-line: rgba(17, 24, 39, 0.12);
  --text: #111827;
  --muted: rgba(17, 24, 39, 0.62);
  --subtle: rgba(17, 24, 39, 0.4);
  --placeholder: rgba(17, 24, 39, 0.34);
  --primary: #111827;
  --primary-text: #fff;
  --danger: #b42318;
  --danger-bg: rgba(180, 35, 24, 0.08);
  --danger-border: rgba(180, 35, 24, 0.24);
  --danger-text: #8f1d15;
  --good: #087443;
  --shadow: 0 12px 32px rgba(31, 41, 55, 0.08);
  --float-shadow: 0 18px 48px rgba(31, 41, 55, 0.14);
  --frame-shadow: 0 28px 80px rgba(31, 41, 55, 0.22);
  --nav-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 248, 252, 0.78)),
    rgba(255, 255, 255, 0.74);
  --nav-border: rgba(17, 24, 39, 0.12);
  --nav-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 46px rgba(31, 41, 55, 0.15);
  --nav-text: rgba(17, 24, 39, 0.52);
  --nav-active-text: #111827;
  --nav-active-bg: rgba(17, 24, 39, 0.08);
  --nav-active-border: rgba(17, 24, 39, 0.1);
  --toast-bg: rgba(255, 255, 255, 0.92);
  --modal-overlay: rgba(15, 23, 42, 0.28);
  --modal-bg: rgba(255, 255, 255, 0.96);
  --qr-line: #111827;
  --qr-bg: #fff;
  --qr-text: #111827;
}

* {
  box-sizing: border-box;
}

.auth-qr {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 8px;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.login-panel {
  margin-top: 12px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.text-button svg { width: 18px; height: 18px; }
.recovery-details { margin-top: 14px; }
.recovery-code { display: block; overflow-wrap: anywhere; padding: 10px 0; }

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.app-shell {
  height: 100dvh;
  min-height: 0;
  display: flex;
  justify-content: center;
  background: var(--shell-bg);
}

.app-frame {
  width: min(100%, 520px);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--frame-bg);
  overflow: hidden;
  overflow-x: hidden;
  border-left: 1px solid var(--frame-line);
  border-right: 1px solid var(--frame-line);
}

.topbar {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(160%);
}

.brand-button {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--brand-bg);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-weight: 780;
}

.brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
}

.page-title {
  padding-left: 2px;
}

.top-title {
  font-size: 17px;
  font-weight: 720;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--panel);
  cursor: pointer;
  flex: 0 0 auto;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.screen {
  padding: 14px 12px 106px;
}

.screen.nested-screen {
  padding-bottom: 24px;
}

.hero-panel,
.block,
.stat-card,
.list-row,
.modal-sheet {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(120%);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
  border-radius: 22px;
  margin-bottom: 12px;
}

.hero-panel h1 {
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.05;
  font-weight: 760;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.block {
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 12px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head > div:first-child {
  min-width: 0;
}

.section-head h2,
.modal-sheet h2,
.block > h2 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.stack,
.list {
  display: grid;
  gap: 8px;
}

.list.embedded {
  margin-top: 2px;
}

.mailing-tools {
  margin-top: 12px;
}

.list-row {
  width: 100%;
  min-height: 62px;
  padding: 11px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.list-row:hover,
.list-row.active {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.list-row:active {
  transform: scale(0.99);
}

.account-row,
.static-row {
  cursor: default;
}

.account-row {
  align-items: flex-start;
}

.account-row:active,
.static-row:active {
  transform: none;
}

.list-row.dashed,
.add-button {
  border-style: dashed;
}

.muted-row {
  opacity: 0.65;
}

.row-icon,
.nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--icon-bg);
  color: var(--icon-color);
}

.row-icon svg,
.nav-icon svg,
.list-row > svg {
  width: 18px;
  height: 18px;
}

.list-row > svg {
  color: var(--subtle);
  flex: 0 0 auto;
}

.row-content {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
}

.row-title {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.row-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.mini-action {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.mini-icon-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--control-soft);
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
}

.mini-icon-action svg {
  width: 18px;
  height: 18px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--control-soft);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pill.good {
  color: var(--good);
}

.pill.muted {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stats-grid.compact,
.stats-grid.slot-stats {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card {
  border-radius: 18px;
  padding: 13px;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 760;
}

.stat-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.details {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
  font-size: 13px;
}

.detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.message-preview {
  margin: 0;
  color: var(--icon-color);
  font-size: 14px;
  line-height: 1.45;
}

.form {
  display: grid;
  gap: 12px;
}

.form.nested {
  padding-top: 12px;
}

.form label {
  display: grid;
  gap: 7px;
}

.form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--control-bg);
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  min-height: 128px;
  resize: none;
  line-height: 1.42;
}

input[type="number"] {
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--control-bg);
}

.segmented.tabs {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}

.theme-switcher {
  margin-bottom: 0;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.segmented button.active {
  background: var(--primary);
  color: var(--primary-text);
}

.filter-strip {
  display: flex;
  gap: 8px;
  width: auto;
  max-width: none;
  margin: 0 -12px 12px;
  padding: 0 12px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  transform: translateZ(0);
  cursor: grab;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-strip.dragging {
  cursor: grabbing;
  user-select: none;
}

.filter-strip button {
  flex: 0 0 auto;
  min-height: 36px;
  max-width: 220px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-soft);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 650;
}

.filter-strip button.active {
  border-color: var(--line-strong);
  background: var(--primary);
  color: var(--primary-text);
}

.account-picker {
  display: grid;
  gap: 8px;
}

.pick-row {
  width: 100%;
  min-height: 56px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--control-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.pick-row.active {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.pick-row strong,
.pick-row small {
  display: block;
}

.pick-row strong {
  font-size: 13px;
  line-height: 1.25;
}

.pick-row small,
.picker-caption {
  color: var(--muted);
  font-size: 12px;
}

.template-picker .pick-row {
  min-height: 64px;
}

.template-row {
  align-items: flex-start;
}

.template-row .mini-icon-action {
  margin-top: 4px;
}

.template-row .row-subtitle {
  display: -webkit-box;
  max-height: 48px;
  overflow: hidden;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.template-card {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--control-soft);
}

.template-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.check-dot {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--control-bg);
}

.pick-row.active .check-dot {
  background: var(--primary);
  color: var(--primary-text);
}

.check-dot svg {
  width: 15px;
  height: 15px;
}

.advanced {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px;
  background: var(--control-soft);
}

.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.qr-box {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 12px 0;
}

.qr-placeholder {
  width: 172px;
  height: 172px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, var(--qr-line) 10px, transparent 10px) 0 0 / 24px 24px,
    linear-gradient(var(--qr-line) 10px, transparent 10px) 0 0 / 24px 24px,
    var(--qr-bg);
  color: var(--qr-text);
  font-size: 28px;
  font-weight: 800;
}

.code-input {
  text-align: center;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: 0;
}

.code-input::placeholder {
  letter-spacing: 0;
}

.switch {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  padding: 3px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.switch::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--subtle);
  transition: transform 160ms ease, background 160ms ease;
}

.switch.on::before {
  transform: translateX(18px);
  background: var(--primary);
}

.primary-button,
.secondary-button,
.danger-button,
.add-button,
.text-button {
  min-height: 46px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 660;
}

.primary-button {
  border: 1px solid var(--line-strong);
  background: var(--primary);
  color: var(--primary-text);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.danger-button {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.add-button {
  width: 100%;
  margin-bottom: 10px;
  border: 1px dashed var(--line-strong);
  background: var(--panel-soft);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.add-button svg {
  width: 18px;
  height: 18px;
}

.text-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 0;
  font-size: 13px;
}

.round-action {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
  text-decoration: none;
}

.round-action svg {
  width: 18px;
  height: 18px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.slot-hint {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.support-card {
  display: grid;
  gap: 12px;
}

.support-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--control-soft);
}

.support-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--icon-bg);
  color: var(--text);
  flex: 0 0 auto;
}

.support-icon svg {
  width: 20px;
  height: 20px;
}

.support-hero h3 {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.2;
}

.support-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 16px;
  text-decoration: none;
}

.link-button svg {
  width: 18px;
  height: 18px;
}

.bottom-nav {
  position: relative;
  flex: 0 0 auto;
  z-index: 50;
  width: auto;
  margin: 8px 12px max(12px, env(safe-area-inset-bottom));
  min-height: 68px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 24px;
  border: 1px solid var(--nav-border);
  background: var(--nav-bg);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(28px) saturate(170%);
}

.nav-item {
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 20px;
  display: grid;
  place-items: center;
  gap: 3px;
  background: transparent;
  color: var(--nav-text);
  cursor: pointer;
  font-size: 10px;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-item.active {
  color: var(--nav-active-text);
  border-color: var(--nav-active-border);
  background: var(--nav-active-bg);
}

.nav-item:active {
  transform: scale(0.97);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 0;
  background: transparent;
  color: currentColor;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.65;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 70;
  width: min(calc(100% - 24px), 492px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--toast-bg);
  padding: 12px 14px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: var(--float-shadow);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px 12px;
  background: var(--modal-overlay);
}

.modal-sheet {
  width: min(100%, 492px);
  max-height: min(520px, calc(100vh - 40px));
  overflow: auto;
  border-radius: 22px;
  padding: 16px;
  background: var(--modal-bg);
}

.modal-sheet p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.two-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hidden {
  display: none !important;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 24px;
  }

  .app-frame {
    height: calc(100dvh - 48px);
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--desktop-frame-line);
    border-radius: 24px;
    box-shadow: var(--frame-shadow);
  }

  .topbar,
  .bottom-nav {
    flex: 0 0 auto;
  }

  .screen {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 14px;
  }

  .bottom-nav {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    margin: 8px 12px 12px;
    transform: none;
  }
}

@media (max-width: 520px) {
  .account-row {
    flex-wrap: wrap;
  }

  .account-row .row-content {
    min-width: calc(100% - 48px);
  }

  .row-actions {
    width: 100%;
    padding-left: 47px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .stats-grid:not(.compact):not(.slot-stats) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-fields {
    grid-template-columns: 1fr;
  }

  .top-title {
    font-size: 16px;
  }
}

.screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 14px;
  overscroll-behavior-y: contain;
}

.mini-app .app-shell {
  height: var(--tg-viewport-stable-height, 100dvh);
  padding: 0;
  background: var(--frame-bg);
}

.mini-app .app-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  padding-left: var(--tg-content-safe-area-inset-left, 0px);
  padding-right: var(--tg-content-safe-area-inset-right, 0px);
}

.mini-app .bottom-nav {
  margin-bottom: max(12px, var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
}

.mini-app .topbar,
.mini-app .bottom-nav {
  backdrop-filter: none;
}

.block, .list-row { box-shadow: none; }
.slot-stats .stat-card { padding: 12px 10px; }
.stat-card span { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
