/* keyboard.baby accounts.
   Same palette and the same round, chunky furniture as the toys, but calmer:
   this is the one page in the family aimed squarely at the grown-up, so it
   scrolls, it reads at a normal size, and nothing bounces. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #10496b;
  --ink-soft: #4a6b80;
  --accent: #ff8c42;
  --accent-2: #ffd166;
  --panel: #fffdf6;
  --danger: #c0392b;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: #4fb4f2;
  color: var(--ink);
  font-family: "Baloo 2", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------------------------- top */

.top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 4px solid var(--ink);
  background: linear-gradient(var(--accent-2), #ffbe3d);
}
.home {
  flex: 1; min-width: 0;
  font-weight: 900; font-size: 17px;
  color: #06405f; text-decoration: none;
}
.home:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ main */

#main {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 56px;
  display: flex; flex-direction: column; gap: 16px;
}

.card {
  padding: 18px;
  background: var(--panel);
  border: 4px solid var(--ink); border-radius: 20px;
  box-shadow: 0 6px 0 rgba(16, 73, 107, .3);
}
.card[hidden] { display: none; }
.card h1 { margin: 0 0 10px; font-size: 24px; }
.card h2 { margin: 0 0 10px; font-size: 18px; }
.card p { margin: 0 0 12px; line-height: 1.45; }
.card > :last-child { margin-bottom: 0; }

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

/* ---------------------------------------------------------------- facts */

.facts {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 7px 14px;
  margin: 0 0 14px;
  font-size: 14px;
}
.facts dt { font-weight: 800; color: var(--ink-soft); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.yes { font-weight: 800; color: #1d7a4c; }
.no { font-weight: 800; color: #a8641b; }

/* --------------------------------------------------------------- controls */

.row { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  font: inherit; font-weight: 800; font-size: 14px;
  padding: 9px 15px;
  border: 3px solid var(--ink); border-radius: 99px;
  background: #fff; color: var(--ink);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
  box-shadow: 0 4px 0 rgba(16, 73, 107, .3);
  text-decoration: none; display: inline-block;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(16,73,107,.3); }
.btn.go { background: linear-gradient(#ffb06a, var(--accent)); color: #4a2109; }
.btn.small { font-size: 12px; padding: 6px 12px; box-shadow: 0 3px 0 rgba(16,73,107,.25); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }

form { display: flex; flex-direction: column; gap: 9px; }
form[hidden] { display: none; }

.fld {
  font: inherit; font-weight: 700; font-size: 14px;
  padding: 10px 12px;
  border: 3px solid var(--ink); border-radius: 12px;
  background: #fff; color: var(--ink);
}
/* 16px on touch, or iOS zooms the page the moment a field is focused. */
@media (pointer: coarse) { .fld { font-size: 16px; } }
.fld::placeholder { color: var(--ink-soft); font-weight: 600; }
.fld[hidden] { display: none; }

.danger { border-color: var(--danger); box-shadow: 0 6px 0 rgba(192, 57, 43, .28); }
.danger h2 { color: var(--danger); }
.danger-btn { border-color: var(--danger); color: var(--danger); box-shadow: 0 4px 0 rgba(192,57,43,.3); }
.danger-btn:hover { background: #fdecea; }

/* ----------------------------------------------------------- saved toys */

.tool {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 2px dashed rgba(16, 73, 107, .2);
  font-size: 14px;
}
.tool:last-child { border-bottom: 0; }
.tool .ti { font-size: 20px; }
.tool .tn { flex: 1; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- badge */

.whoami { flex: none; }
.whoami[hidden] { display: none; }
.kba-badge {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  font-size: 18px; text-decoration: none;
  border: 3px solid var(--ink); border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 0 rgba(16, 73, 107, .3);
}
.kba-badge img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------- toast */

#toast {
  position: fixed; left: 50%; bottom: 22px;
  transform: translate(-50%, 18px);
  max-width: min(460px, 92vw);
  padding: 11px 17px;
  font-weight: 800; font-size: 14px; text-align: center;
  background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 99px;
  box-shadow: 0 5px 0 rgba(16, 73, 107, .3);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 80;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------- sign-in modal
   Rendered by auth.js, so these class names are that file's contract. */

.kba-back {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(6, 40, 60, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.kba-back[hidden] { display: none; }
body.kba-open { overflow: hidden; }

.kba {
  position: relative;
  width: min(360px, 100%);
  max-height: 92vh; overflow-y: auto;
  padding: 20px 20px 16px;
  background: var(--panel);
  border: 4px solid var(--ink); border-radius: 20px;
  box-shadow: 0 14px 0 rgba(16, 73, 107, .3);
}
.kba h2 { margin: 0 0 4px; font-size: 20px; }
.kba-x {
  position: absolute; top: 8px; right: 10px;
  font: inherit; font-weight: 900; font-size: 15px;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: none; color: var(--ink-soft); cursor: pointer;
}
.kba-x:hover { background: rgba(16, 73, 107, .1); color: var(--ink); }
.kba-why {
  margin: 0 0 12px;
  font-size: 13px; font-weight: 700; line-height: 1.35;
  color: #5a3a08;
  padding: 9px 11px;
  background: #ffeec2;
  border: 2px solid rgba(16, 73, 107, .25); border-radius: 12px;
}
.kba-why[hidden] { display: none; }
.kba-google { width: 100%; margin-top: 6px; }
.kba-or {
  margin: 11px 0 9px;
  text-align: center; text-transform: lowercase;
  font-size: 12px; color: var(--ink-soft);
}
.kba-form { display: flex; flex-direction: column; gap: 8px; }
.kba-fld {
  font: inherit; font-weight: 700; font-size: 14px;
  padding: 9px 11px;
  border: 3px solid var(--ink); border-radius: 10px;
  background: #fff; color: var(--ink);
}
@media (pointer: coarse) { .kba-fld { font-size: 16px; } }
.kba-fld::placeholder { color: var(--ink-soft); font-weight: 600; }
.kba-go { width: 100%; margin-top: 2px; }
.kba-swap { margin: 10px 0 0; font-size: 12px; color: var(--ink-soft); }
.kba-link {
  font: inherit; font-size: 12px; font-weight: 800;
  padding: 0; border: 0; background: none;
  color: var(--ink); text-decoration: underline; cursor: pointer;
}
.kba-fine { margin: 12px 0 0; font-size: 11px; line-height: 1.4; color: var(--ink-soft); }
