.join { padding-top: 64px; padding-bottom: 96px; min-height: 70vh; }
.page-title { font-size: 48px; line-height: 1; letter-spacing: -0.02em; max-width: 680px; }
.h3 { font-size: 20px; line-height: 28px; }
.label { font-size: 12px; line-height: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin: 0; }
.small { font-size: 14px; line-height: 20px; margin: 0; }
.wide { width: 100%; }
@media (max-width: 720px) { .page-title { font-size: 36px; line-height: 40px; } }

.auth { display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 48px; align-items: start; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; gap: 32px; } }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel-2); border-radius: 12px; margin-bottom: 24px; }
.tab { flex: 1; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit;
  font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; transition: all 500ms var(--ease); }
.tab[aria-selected="true"] { background: var(--panel-3); color: var(--text); }

.app-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 32px; }
.app-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; } }
.wallet { position: sticky; top: 96px; }
.balance { font-size: 48px; line-height: 1; font-weight: 600; margin: 8px 0 4px; color: var(--accent); }
.wallet [data-refill] { margin-top: 12px; }
.history-title { margin-top: 24px; }
.ledger { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.ledger li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 20px; }
.ledger .plus { color: var(--ok); }
.ledger .minus { color: var(--muted); }

.bots { display: grid; gap: 16px; }
.bot-head { display: flex; align-items: center; gap: 12px; }
.swatch { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.bot-id { flex: 1; min-width: 0; }
.bot-id h2 { overflow: hidden; text-overflow: ellipsis; }
.bot-status { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.connect { margin-top: 16px; display: grid; gap: 8px; }
.code { margin: 0; padding: 12px; border-radius: 4px; background: var(--bg); font-family: var(--mono); font-size: 12px; line-height: 16px;
  white-space: pre-wrap; word-break: break-word; }
.connect .btn { justify-self: start; }
.edit { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.edit summary { cursor: pointer; font-weight: 600; }
.edit form { margin-top: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }
.color { padding: 4px; height: 42px; cursor: pointer; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0 0 16px; }
.create { margin-top: 16px; }
.create h2 { margin-bottom: 16px; }
.empty { text-align: center; padding: 48px 24px; }
.empty p { margin: 8px auto 0; max-width: 420px; }
.coach-box { margin-top: 16px; padding: 16px; }

/* Phones: wallet scrolls with the page and compacts; history folds to a short list; tighter cards. */
@media (max-width: 900px) {
  .wallet { position: static; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 16px; }
  .wallet .label:first-child { grid-column: 1 / -1; }
  .wallet .balance { font-size: 36px; margin: 0; }
  .wallet [data-refill] { margin: 0; grid-column: 1 / -1; justify-self: start; }
  .wallet .history-title, .wallet .ledger { grid-column: 1 / -1; }
  .ledger { max-height: 136px; }
}
@media (max-width: 600px) {
  .join { padding-top: 32px; }
  .card { padding: 16px; }
  .coach-box { padding: 12px; }
  .bot-head { align-items: start; }
  .bot-actions .btn { flex: 1 1 auto; }
  .app-head { margin-bottom: 24px; }
}
