:root {
  --bg: #140c10;
  --panel: #1d1216;
  --ink: #f7efe8;
  --muted: #b9a39a;
  --wine: #8b2e4a;
  --gold: #c9a227;
  --line: #3a242c;
  --yellow: #fff3c4;
  --err: #e35d6a;
}
@font-face {
  font-family: Play;
  src: url("fonts/Play-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Play;
  src: url("fonts/Play-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 Play, "Segoe UI", system-ui, sans-serif; }
button, input, select, textarea { font-family: Play, "Segoe UI", system-ui, sans-serif; }
a { color: var(--gold); }
.top, .layout { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; justify-content: space-between; align-items: end; padding-top: 28px; padding-bottom: 18px; }
h1 { margin: 0; font-size: 1.7rem; letter-spacing: .02em; }
h2 { margin: 0 0 12px; font-size: 1.05rem; color: var(--gold); }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--muted); margin: 0 0 6px; }
.lede, .hint, .fine, .meta { color: var(--muted); }
.hint { font-size: .9rem; margin-top: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 24px; padding-bottom: 60px; }
.panel section { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 8px; margin-bottom: 16px; }
label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 10px;
  border-radius: 10px; border: 1px solid var(--line); background: #2a181e; color: var(--ink);
}
textarea { resize: vertical; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.checks { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
.kink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.krow {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  min-height: 96px;
}
.krow .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.toy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.toy-grid .trow {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px;
}
.krow:hover { background: #2a181e; }
.krow .cat { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.krow .name { color: var(--ink); }
.krow.fav { outline: 1px solid var(--gold); }
.krow.yes { outline: 1px solid #6d3a4c; }
.pill { font-size: .72rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--muted); }
.pill.on { background: var(--wine); color: white; border-color: var(--wine); }
.limit-list { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
.trow, .lrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 4px; }
.lrow { grid-template-columns: auto 1fr; }
.preview { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.sticky { position: sticky; top: 16px; }
.preview textarea { background: #fff8f0; color: #1a1214; }
.btn {
  display: inline-block; margin: 8px 8px 12px 0; padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #2a181e; color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--wine); border-color: var(--wine); color: white; }
.ghost { color: var(--muted); text-decoration: none; }
.banner { padding: 8px 10px; border-radius: 10px; }
.banner.err { background: #3a151b; color: var(--err); }
.banner.warn { background: #3a3014; color: var(--yellow); }
.hidden { display: none; }
.gate { min-height: 100vh; display: grid; place-items: center; }
.gate-card { width: min(440px, 92vw); background: var(--panel); padding: 28px; border-radius: 20px; border: 1px solid var(--line); }
.or { text-align: center; color: var(--muted); }
@media (max-width: 900px) {
  .layout, .grid.two, .krow { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .krow { display: flex; flex-direction: column; }
  .shell { grid-template-columns: 1fr; }
  .sidemenu {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
  }
  .sidenav { flex-direction: column; gap: 8px; margin: 8px 0 12px; }
}
  .krow .cat { grid-column: 1 / -1; }
}
.nav { display: flex; gap: 14px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; }
.neg-list { display: flex; flex-direction: column; gap: 6px; }
.nrow {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) 130px 118px 78px minmax(80px, .8fr);
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}
.nrow .tiny.extra {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}
.nrow .tiny.extra input {
  display: inline-block;
  width: auto;
  margin: 0;
  accent-color: var(--gold);
}
.nrow.yes { background: #24151b; }
.nrow.limit { background: #1a1214; opacity: .85; }
.nact { font-size: .92rem; }
.tiny { font-size: .75rem; color: var(--muted); margin: 0; }
.stats { color: var(--ink); margin-bottom: 12px; }
.rank { font-size: .82rem; max-height: 280px; overflow: auto; }
.rrow { display: grid; grid-template-columns: 24px 1fr 36px 70px; gap: 6px; padding: 3px 0; color: var(--muted); }
.rrow.warn { color: var(--yellow); }
.listbox {
  white-space: pre-wrap; background: #2a181e; color: var(--ink);
  padding: 8px; border-radius: 8px; max-height: 140px; overflow: auto; font-size: .8rem;
}
/* App chrome: side menu + main column. Change grid width here. */
.shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}
.sidemenu {
  padding: 22px 18px 24px 24px;
  border-right: 1px solid var(--line);
  background: #120a0e;
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
}
.sidenav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 20px;
}
.sidemenu a,
.sidemenu a:visited {
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  line-height: 1.3;
  display: block;
}
.sidenav a.home,
.sidenav a.home:visited { font-weight: 700; color: var(--gold); }
.sidenav a.on:not(.home) { color: var(--ink); }
.side-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.side-out { margin-top: 0; }
.main { min-width: 0; padding-bottom: 40px; }
.top.in-shell { padding-left: 20px; padding-right: 20px; }
.logbox { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.logitem { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.logitem p { margin: 4px 0; white-space: pre-wrap; }
.visrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.visrow label { margin: 0; color: var(--ink); }
.admin-layout { align-items: start; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.statgrid div { background: #2a181e; border-radius: 12px; padding: 12px; }
.statgrid b { display: block; font-size: 1.4rem; color: var(--gold); }
.statgrid span { color: var(--muted); font-size: .8rem; }
.atable { width: 100%; border-collapse: collapse; font-size: .85rem; margin-bottom: 12px; }
.atable th, .atable td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.atable th { color: var(--gold); font-weight: 700; }
.edition { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.edition .btn { margin: 0 8px 8px 0; }
.key-list { list-style: none; margin: 0 0 16px; padding: 0; }
.key-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
  color: var(--ink);
}
.key-list .k { color: var(--gold); font-weight: 700; }
@media (max-width: 900px) {
  .nrow { grid-template-columns: 1fr 1fr; }
  .nact { grid-column: 1 / -1; }
}
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--wine); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.to-top.show { display: flex; }
.speech-debug {
  margin-top: 8px; max-height: 160px; overflow: auto;
  background: #10080c; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; font-size: 11px; color: #cbb; white-space: pre-wrap;
}
.age-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--ink); }
.age-row input { width: auto; }
