/* Happy Heart Software accounts: the company's colors, fonts and rainbow accent (shared with Heartcount and Heartforms). */
:root {
  --night: #1e1840;
  --ink: #1e1840;
  --muted: #625c7d;
  --line: #e4e0f0;
  --soft: #f4f2fa;
  --card: #ffffff;
  --violet: #5a3fd6;
  --violet-soft: #ece8fc;
  --red: #c2304a;
  --green: #2f7d57;
  --focus: #7c3aed;
  --rainbow: linear-gradient(90deg, #ff3cac, #ff8a00, #ffd23f, #34d399, #22d3ee, #7c3aed, #ff3cac);
  --radius: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--soft); color: var(--ink); font: 16px/1.55 'Plus Jakarta Sans', system-ui, sans-serif; }
h1, h2 { font-family: Sora, system-ui, sans-serif; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; margin-top: 8px; }
a { color: var(--violet); }
code { background: var(--soft); padding: 1px 5px; border-radius: 6px; font-size: 0.9em; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: var(--red); font-weight: 600; margin: 10px 0 0; }
.ok { color: var(--green); font-weight: 600; margin: 10px 0 0; }

.topbar { background: var(--night); background-image: linear-gradient(160deg, #2a1c4e 0%, #221f4e 35%, #173a3d 70%, #1d2346 100%); color: #fff; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { width: 40px; height: 40px; display: block; }
.brand-name { font-family: Fredoka, system-ui, sans-serif; font-weight: 600; font-size: 24px; line-height: 1; }
.brand-by { display: block; font-size: 12px; font-weight: 600; color: #c9c4da; letter-spacing: 0.02em; margin-top: 3px; }
.rainbow-bar { height: 4px; background: var(--rainbow); }

main { max-width: 1120px; margin: 0 auto; padding: 28px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.narrow { max-width: 440px; margin: 8px auto; }
.wide { max-width: 760px; margin: 8px auto; }
.narrow + .narrow, .wide + .wide { margin-top: 18px; }

label { display: block; font-weight: 700; font-size: 14px; margin-top: 14px; }
input, select, textarea { font: inherit; color: inherit; padding: 9px 12px; border: 1px solid #d6d0e8; border-radius: 10px; background: #fff; }
label input:not([type=checkbox]), label textarea { display: block; width: 100%; margin-top: 6px; }
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.btn { font: inherit; font-weight: 700; color: #fff; background: var(--violet); border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.block { width: 100%; margin-top: 18px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #d6d0e8; }
.btn.danger { background: var(--red); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn img { width: 18px; height: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 20px 0 4px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: 14px; }
.client { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--soft); border-radius: 12px; margin: 12px 0 4px; }
.client img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.client strong { display: block; }
.scopes { margin: 12px 0 0; padding-left: 1.2em; }
.scopes li { margin: 4px 0; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 10px 8px 6px 0; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.row-actions { text-align: right; white-space: nowrap; }
.chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.chip.warn { background: #fceedb; color: #8a4510; }
.secret { font-family: ui-monospace, monospace; font-size: 14px; background: var(--soft); padding: 10px 12px; border-radius: 10px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .hide-narrow { display: none; } .row-actions { white-space: normal; } }

.legal { max-width: 760px; margin: 0 auto; }
.legal h2 { font-size: 20px; margin-top: 24px; }
.legal table { margin: 8px 0; font-size: 15px; }
.foot { max-width: 1120px; margin: 0 auto; padding: 0 16px 32px; font-size: 14px; text-align: center; }

/* Admin page */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { font-weight: 700; text-decoration: none; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.api-picks { border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 0; padding: 4px 14px 12px; }
.api-picks .check { margin-top: 8px; }
.search { display: flex; gap: 8px; margin: 12px 0; }
.search input { flex: 1; min-width: 0; }
td .chip { margin: 4px 4px 0 0; }
.editor { background: var(--soft); border-radius: 12px; padding: 4px 14px 14px; margin-top: 8px; }
#api-form { margin-top: 24px; }
