:root {
  --bg: #fff7fb;
  --ink: #5b2f4c;
  --ink-soft: #8a6079;
  --line: #f6d9e6;
  --card: #ffffff;
  --pink: #ff8fb8;
  --pink-d: #e9679a;
  --lav: #b9a3f0;
  --lav-d: #8f78d6;
  --mint: #8fdcb8;
  --sky: #a8d8ff;
  --sun: #ffe08a;
  --danger: #d9486b;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--bg);
  background-image: radial-gradient(#ffe0ec 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  font: 16px/1.55 'Nunito', system-ui, sans-serif;
}
h1, h2, h3, .brand { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 48px); margin: 0 0 12px; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 0 0 8px; }
a { color: var(--pink-d); }
code, pre { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13.5px; }
code { background: #fbeaf2; padding: 1px 6px; border-radius: 6px; }
pre { background: #fdf2f7; border: 2px solid var(--line); border-radius: 14px; padding: 14px; overflow-x: auto; line-height: 1.45; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 247, 251, .88); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 22px; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; background: var(--pink); display: grid; place-items: center; font-size: 18px; box-shadow: inset -3px -4px 0 rgba(0,0,0,.08); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--ink-soft); font-weight: 700; padding: 7px 12px; border-radius: 999px; font-size: 15px; }
.nav-links a:hover, .nav-links a.on { background: #ffe6f0; color: var(--ink); }
.nav-links form { margin: 0; }
@media (max-width: 640px) { .nav .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; } .nav-links { margin-left: 0; } }

main { padding: 32px 0 64px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 6px 0 #f8e2ec; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.center { text-align: center; }
.spacer { flex: 1; }

.btn { appearance: none; border: 0; cursor: pointer; font: 700 15px/1 'Nunito', sans-serif; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px; border-radius: 999px; background: var(--pink); color: #fff; box-shadow: 0 4px 0 var(--pink-d); transition: transform .08s, box-shadow .08s; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pink-d); }
.btn.alt { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn.lav { background: var(--lav); box-shadow: 0 4px 0 var(--lav-d); }
.btn.danger { background: var(--danger); box-shadow: 0 4px 0 #a8304f; }
.btn.sm { padding: 7px 12px; font-size: 14px; }
.btn.twitch { background: #9146ff; box-shadow: 0 4px 0 #6a2fd0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=number], input[type=search], select, textarea { font: inherit; color: inherit; border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid #ffd1e2; border-color: var(--pink); }
input[type=range] { width: 100%; accent-color: var(--pink); }
input[type=checkbox] { accent-color: var(--pink); width: 18px; height: 18px; }
label { font-weight: 700; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
fieldset { border: 2px dashed var(--line); border-radius: 16px; padding: 14px; margin: 0; min-width: 0; }
legend { font-weight: 800; padding: 0 6px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: #ffe6f0; color: var(--pink-d); }
.pill.lav { background: #eee8ff; color: var(--lav-d); }
.pill.mint { background: #e1f7ec; color: #2f8a62; }
.pill.sun { background: #fff3cc; color: #9a6c00; }
.pill.gray { background: #f1edf0; color: #7d6b77; }

.flash { background: #e1f7ec; color: #24694b; border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.errors { background: #ffe9ee; border: 2px solid #ffc4d2; color: #8c2440; border-radius: 16px; padding: 12px 16px; }
.errors ul, .warnings ul { margin: 6px 0 0; padding-left: 20px; }
.warnings { background: #fff7dc; border: 2px solid #ffe3a0; color: #7b5600; border-radius: 16px; padding: 12px 16px; }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.lead { font-size: 19px; color: var(--ink-soft); max-width: 560px; }
.pet-card { text-align: center; text-decoration: none; color: inherit; display: block; }
.pet-card img { width: 128px; height: 128px; image-rendering: pixelated; border-radius: 18px; background: #fff0f6; }
.pet-card:hover { transform: translateY(-2px); }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .ico { font-size: 24px; width: 44px; height: 44px; flex: none; border-radius: 14px; background: #fff0f6; display: grid; place-items: center; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 2px solid #fbeef4; vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.table-scroll { overflow-x: auto; }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.stage-card { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow: hidden; }
.stage-card .sn-feed { position: static; width: 100%; max-width: 420px; margin: 0; min-height: 0; align-items: stretch; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.action-grid .btn { justify-content: center; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, monospace; font-size: 13px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 2px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 700 14px 'Nunito'; cursor: pointer; }
.tabs button.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.log { max-height: 220px; overflow: auto; font-size: 14px; background: #fdf6fa; border-radius: 12px; padding: 8px 10px; }
.log div + div { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 4px; }
.memory-book { list-style: none; padding: 0; margin: 0; }
.memory-book li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 2px dotted #fbe6ef; }
.memory-book time { color: var(--ink-soft); font-size: 13px; min-width: 88px; }
.pkg-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.pkg-pick label { cursor: pointer; border: 2px solid var(--line); border-radius: 16px; padding: 8px; text-align: center; font-size: 13px; display: block; }
.pkg-pick input { display: none; }
.pkg-pick input:checked + label { border-color: var(--pink); background: #fff0f6; box-shadow: 0 0 0 3px #ffd1e2; }
.pkg-pick img { width: 72px; height: 72px; image-rendering: pixelated; display: block; margin: 0 auto 4px; }
.act-table td, .act-table th { padding: 6px 4px; }
.act-table input[type=number] { width: 72px; padding: 5px 7px; }
.footer { border-top: 2px solid var(--line); padding: 24px 0 40px; color: var(--ink-soft); font-size: 14px; }
.state-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c9c0c6; margin-right: 6px; }
.state-dot.awake { background: #5fd39b; }
.state-dot.bedtime { background: var(--lav); }
.state-dot.away { background: var(--danger); }
.sheet-strip { image-rendering: pixelated; max-width: 100%; background: #fff0f6; border-radius: 10px; }
