/* Squiggle page shell (site/page.html): pricing, legal, boards, team, billing and the account pages.
   Builds on site.css tokens. The generic classes (.card, .btn-primary, .btn-quiet, .lede, .row, .pill-tag,
   tables and form fields) are the ones the page templates already use. */
.sq-app { min-height: 100%; display: flex; flex-direction: column; }
.sq-app main.site-main { flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 24px 88px; }

/* Header */
.sq-topbar { background: #fff; border-bottom: 1.5px solid var(--sq-line); }
.sq-topbar .sq-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; max-width: 1280px; }
.sq-topbar .sq-wordmark { font-size: 22px; }
.sq-topbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.sq-tabs { display: flex; gap: 4px; font-size: 15px; font-weight: 600; }
.sq-site .sq-tabs a { color: var(--sq-ink); text-decoration: none; padding: 10px 14px; border-radius: 10px; }
.sq-site .sq-tabs a:hover { background: #f4f2ec; color: var(--sq-ink); }
.sq-site .sq-tabs a[aria-current="page"] { color: var(--sq-action-text); background: var(--sq-action-tint); }
.sq-topbar .sq-nav-links .sq-btn { padding: 10px 20px; }

/* Account menu: a <details> disclosure, so it works without JavaScript */
.sq-account { position: relative; }
.sq-account > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px 0 4px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.sq-account > summary::-webkit-details-marker { display: none; }
.sq-account > summary:hover, .sq-account[open] > summary { background: #f1eee7; }
.sq-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--sq-voice), var(--sq-ideas)); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; text-transform: uppercase; }
.sq-account .who { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-account .chev { transition: transform .2s; }
.sq-account[open] .chev { transform: rotate(180deg); }
.sq-account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 280px; max-width: calc(100vw - 32px); background: #fff; border: 1.5px solid var(--sq-line); border-radius: 18px; box-shadow: 0 24px 50px -20px rgba(30,30,46,.35); padding: 8px; display: flex; flex-direction: column; }
.sq-account-menu .head { padding: 10px 12px 12px; font-size: 13px; color: var(--sq-muted); overflow-wrap: anywhere; }
.sq-account-menu .head strong { display: block; font-size: 15px; color: var(--sq-ink); }
.sq-site .sq-account-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--sq-ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.sq-site .sq-account-menu a:hover { background: #f4f2ec; color: var(--sq-ink); }
.sq-site .sq-account-menu a.danger { color: #b42318; font-weight: 600; }
.sq-account-menu hr { border: 0; height: 1.5px; background: var(--sq-line-soft); margin: 6px 4px; }

/* Footer */
.sq-app-footer { border-top: 1.5px solid var(--sq-line); }
.sq-app-footer .sq-wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; font-size: 14px; color: var(--sq-muted); max-width: 1280px; }
.sq-app-footer nav { display: flex; gap: 20px; }
.sq-site .sq-app-footer a { color: var(--sq-muted); }
.sq-app-footer.is-dark { background: var(--sq-night); border-top-color: var(--sq-night-line); }
.sq-app-footer.is-dark .sq-wrap, .sq-site .sq-app-footer.is-dark a { color: var(--sq-night-muted); }
.sq-site .sq-app-footer.is-dark a:hover { color: #fff; }

/* Page type */
.sq-app h1 { font-family: var(--sq-hand); font-weight: 400; font-size: clamp(34px, 4vw, 46px); line-height: 1.1; margin: 0 0 8px; }
.sq-app h2 { font-size: 20px; font-weight: 700; margin: 36px 0 12px; }
.sq-app .card h2 { margin-top: 0; }
.sq-app .lede { color: var(--sq-muted); font-size: 17px; line-height: 1.55; margin: 0 0 24px; }
.sq-app .page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.sq-app .page-head .lede { margin: 0; }
.sq-app .page-head h1 { margin: 0 0 6px; }

/* Cards */
.sq-app .card { background: #fff; border: 1.5px solid var(--sq-line); border-radius: 20px; padding: 26px 28px; }
.sq-app .card.narrow { max-width: 440px; margin: 24px auto; padding: 32px; }
.sq-app .stack { margin-top: 20px; }

/* Buttons */
.sq-app .btn-primary, .sq-app button[type="submit"]:not(.btn-quiet) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px;
  background: var(--sq-action); color: #fff; border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: filter .15s; }
.sq-app .btn-primary:hover, .sq-app button[type="submit"]:not(.btn-quiet):hover { color: #fff; filter: brightness(1.08); }
.sq-app .btn-quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; background: #fff; color: var(--sq-ink); border: 1.5px solid #dad6cc; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sq-app .btn-quiet:hover { background: #f4f2ec; }
.sq-app .btn-danger { color: #b42318; border-color: #f4c7c3; }
.sq-app .btn-danger:hover { background: #fef3f2; }

/* Form fields */
.sq-app input[type="email"], .sq-app input[type="text"], .sq-app input[type="password"], .sq-app input[type="number"],
.sq-app input[type="search"], .sq-app input:not([type]), .sq-app select, .sq-app textarea {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #dad6cc; background: #fff;
  color: var(--sq-ink); font: inherit; font-size: 16px; }
.sq-app textarea { padding: 12px 14px; }
.sq-app input:focus-visible, .sq-app select:focus-visible, .sq-app textarea:focus-visible { outline: 3px solid #a99fff; outline-offset: 1px; border-color: var(--sq-action); }
.sq-app input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--sq-action); vertical-align: middle; }
.sq-app label { display: block; font-size: 14px; font-weight: 600; color: var(--sq-ink); margin-bottom: 6px; }
.sq-app form p, .sq-app form .field { margin: 0 0 16px; }
.sq-app .helptext, .sq-app .errorlist { font-size: 13px; color: var(--sq-muted); }
.sq-app .errorlist { color: #b42318; list-style: none; padding: 0; margin: 6px 0 0; }
.sq-app .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sq-app .row > input, .sq-app .row > select { width: auto; flex: 1; min-width: 160px; }
.sq-app .small-input, .sq-app .row > input.small-input { width: 110px; flex: 0 0 110px; min-width: 0; }

/* Tables */
.sq-app table { width: 100%; border-collapse: collapse; }
.sq-app th, .sq-app td { text-align: left; padding: 12px 10px; border-bottom: 1.5px solid var(--sq-line-soft); font-size: 15px; vertical-align: middle; }
.sq-app th { color: var(--sq-muted); font-weight: 600; font-size: 13px; }
.sq-app tbody tr:last-child td { border-bottom: 0; }
.sq-app .table-scroll { overflow-x: auto; }

/* Tags */
.sq-app .pill-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #f1eee7; color: var(--sq-body); vertical-align: middle; }
.sq-app .pill-tag.violet { background: var(--sq-action-tint); color: var(--sq-action-text); }
.sq-app .pill-tag.teal { background: #e7f8f5; color: #0e6e64; }
.sq-app .pill-tag.amber { background: #fef3c7; color: #92400e; }
.sq-app .pill-tag.red { background: #fef3f2; color: #b42318; }

/* Banners (inline states on a page) */
.sq-banner { display: flex; gap: 14px; align-items: flex-start; border-radius: 16px; padding: 16px 20px; border: 1.5px solid; margin-bottom: 20px; font-size: 15px; line-height: 1.55; }
.sq-banner .ic { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.sq-banner > div { flex: 1 1 auto; min-width: 0; }
.sq-banner form { margin-top: 10px; }
.sq-banner.info { background: #eef4ff; border-color: #c9dafb; color: #1e3a8a; }
.sq-banner.info .ic { background: var(--sq-ideas); }
.sq-banner.warn { background: #fef3c7; border-color: #f5d98b; color: #78350f; }
.sq-banner.warn .ic { background: #b45309; }
.sq-banner.error { background: #fef3f2; border-color: #f4c7c3; color: #7a1a12; }
.sq-banner.error .ic { background: #b42318; }

/* Meter */
.sq-app .meter { height: 10px; border-radius: 999px; background: var(--sq-line-soft); overflow: hidden; margin: 12px 0 8px; }
.sq-app .meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sq-voice), var(--sq-ideas)); }
.sq-app .meter.warn > span { background: #d97706; }
.sq-app .meter.over > span { background: #b42318; }

/* Toasts: Django messages */

@media (max-width: 640px) {
  .sq-app main.site-main { padding: 28px 16px 64px; }
  .sq-app .card { padding: 22px 18px; }
  .sq-account .who { display: none; }
  .sq-topbar .sq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .sq-topbar .sq-logo { min-width: 0; }
  .sq-topbar .sq-logo svg { flex: 0 0 auto; }
  .sq-topbar .sq-wordmark { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; }
  .sq-topbar-left { display: contents; }
  .sq-topbar .sq-tabs { grid-column: 1 / -1; grid-row: 2; }
  .sq-topbar .sq-account { grid-column: 2; grid-row: 1; }
  .sq-topbar .sq-nav-links { grid-column: 1 / -1; }
}

/* Account pages (allauth's default markup) */
.sq-app .btn-quiet { text-decoration: none; }
.sq-app form p:has(> input[type="checkbox"]) { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; }
.sq-app form p:has(> input[type="radio"]) { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--sq-line-soft); border-radius: 12px; }
.sq-app form p:has(> input[type="checkbox"]) label, .sq-app form p:has(> input[type="radio"]) label { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.sq-app form p:has(> input[type="radio"]) strong { margin-left: 6px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f1eee7; color: var(--sq-body); }
.sq-app input[type="radio"] { width: 18px; height: 18px; accent-color: var(--sq-action); flex: 0 0 auto; margin: 0; }
.sq-app .card.narrow form > button { margin: 0 6px 8px 0; }
.sq-app .card.narrow button[name="action_primary"], .sq-app .card.narrow button[name="action_send"], .sq-app .card.narrow button[name="action_remove"] {
  background: #fff; color: var(--sq-ink); border: 1.5px solid #dad6cc; min-height: 40px; padding: 0 16px; font-size: 14px; }
.sq-app .card.narrow button[name="action_primary"]:hover, .sq-app .card.narrow button[name="action_send"]:hover { background: #f4f2ec; filter: none; color: var(--sq-ink); }
.sq-app .card.narrow button[name="action_remove"] { color: #b42318; border-color: #f4c7c3; }
.sq-app .card.narrow button[name="action_remove"]:hover { background: #fef3f2; filter: none; color: #b42318; }
.sq-app .card.narrow hr { border: 0; height: 1.5px; background: var(--sq-line-soft); margin: 22px 0 16px; }
.sq-app .card.narrow h1 { font-size: clamp(32px, 3.6vw, 40px); }
.sq-app .card.narrow > p:first-of-type { color: var(--sq-muted); }
.sq-app .helptext a { font-size: 13px; }

/* Signed-in header: minutes meter and the richer account menu */
.sq-topbar-right { display: flex; align-items: center; gap: 12px 18px; }
.sq-site .sq-meter-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--sq-line); border-radius: 999px; color: var(--sq-ink); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.sq-site .sq-meter-pill:hover { background: #f4f2ec; color: var(--sq-ink); }
.sq-meter-pill .bar, .sq-account-menu .usage .bar { display: block; height: 6px; border-radius: 999px; background: var(--sq-line-soft); overflow: hidden; }
.sq-meter-pill .bar { width: 72px; }
.sq-meter-pill .bar > span, .sq-account-menu .usage .bar > span { display: block; height: 100%; background: var(--sq-action); border-radius: 999px; }
.sq-meter-pill .bar.warn > span, .sq-account-menu .usage .bar.warn > span { background: #d97706; }
.sq-meter-pill .up { color: var(--sq-action-text); }
.sq-account-menu { width: 300px; }
.sq-account-menu .head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 14px; }
.sq-account-menu .head .id { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--sq-muted); }
.sq-account-menu .head .id strong { font-size: 15px; color: var(--sq-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-account-menu .head .id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-avatar.big { width: 44px; height: 44px; font-size: 18px; }
.sq-account-menu .usage { margin: 0 4px 8px; padding: 12px; background: #f6f4ff; border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.sq-account-menu .usage .row1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--sq-body); }
.sq-account-menu .usage .row1 strong { color: var(--sq-ink); font-weight: 600; }
.sq-site .sq-account-menu .usage a.up { display: inline; min-height: 0; padding: 0; font-size: 13px; font-weight: 600; color: var(--sq-action-text); background: none; }
.sq-site .sq-account-menu .usage a.up:hover { background: none; text-decoration: underline; }
.sq-site .sq-account-menu a { gap: 12px; }
.sq-site .sq-account-menu a svg { color: var(--sq-muted); flex: 0 0 auto; }
.sq-site .sq-account-menu a.danger svg { color: currentColor; }
@media (max-width: 640px) {
  .sq-meter-pill .bar, .sq-meter-pill .up { display: none; }
  .sq-topbar .sq-topbar-right { grid-column: 2; grid-row: 1; }
}
.sq-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) { .sq-topbar.is-app .sq-wordmark { display: none; } }

/* Workspace switcher in page eyebrows (templates/site/_workspace_switch.html). */
.sq-ws { position: relative; display: inline-block; }
.sq-ws > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin: -4px -10px; border-radius: 999px; color: var(--sq-ink); }
.sq-ws > summary::-webkit-details-marker { display: none; }
.sq-ws > summary:hover, .sq-ws[open] > summary { background: #f1eee7; }
.sq-ws[open] > summary svg { transform: rotate(180deg); }
.sq-ws-menu { position: absolute; left: -10px; top: calc(100% + 10px); z-index: 40; width: 300px; max-width: calc(100vw - 32px); background: #fff; border: 1.5px solid var(--sq-line); border-radius: 18px; box-shadow: 0 24px 50px -20px rgba(30,30,46,.35); padding: 8px; display: flex; flex-direction: column; gap: 2px; margin: 0; }
.sq-ws-menu .lbl { padding: 8px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--sq-muted); }
.sq-app .sq-ws-menu button[type="submit"] { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--sq-ink); font-size: 15px; font-weight: 600; text-align: left; box-shadow: none; }
.sq-app .sq-ws-menu button[type="submit"]:hover { background: #f4f2ec; color: var(--sq-ink); filter: none; }
.sq-app .sq-ws-menu button[type="submit"][aria-current] { color: var(--sq-action-text); background: var(--sq-action-tint); }
.sq-ws-menu .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-ws-menu .k { font-size: 12px; font-weight: 600; color: var(--sq-muted); }
