:root {
  --cream: #fffaf0;
  --bg: #f4faff;
  --ink: #2c3550;
  --ink-soft: #5b6480;
  --sky: #aad4f5;
  --sky-light: #d9edfd;
  --sky-dark: #6fb3e8;
  --sky-deep: #3d8fd1;
  --blush: #ffb6c9;
  --blush-light: #ffe1e9;
  --mint: #b8ecd0;
  --mint-light: #e1faec;
  --lavender: #d6c6f7;
  --lavender-light: #eee4fd;
  --sunshine: #ffd34d;
  --sunshine-light: #fff1c2;
  --danger: #d6455d;
  --card: #ffffff;
  --line: #e3ecf6;
  --radius: 24px;
  --shadow: 0 10px 30px -12px rgba(44, 53, 80, 0.18);
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, var(--sky-light) 0, transparent 40%),
    radial-gradient(circle at 95% 20%, var(--blush-light) 0, transparent 35%),
    radial-gradient(circle at 50% 100%, var(--lavender-light) 0, transparent 45%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky-deep); }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1100px; margin: 0 auto; padding: 18px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; border-radius: 14px; box-shadow: var(--shadow); }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.brand small { display: block; font-family: var(--font-body); font-weight: 700; font-size: .75rem; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }
.pill-link {
  font-family: var(--font-display); font-weight: 600; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; background: #fff; color: var(--ink);
  box-shadow: var(--shadow); white-space: nowrap;
}
.pill-link:hover { background: var(--sky-light); }

/* ---------- layout ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }
.hero {
  display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center;
  margin: 8px 0 28px;
}
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr .9fr; }
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sunshine-light); color: #7a5a00;
  font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  padding: 6px 14px; border-radius: 999px;
}
.badge img { width: 18px; height: 18px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 14px 0 12px; }
.hero h1 .accent { color: var(--sky-deep); }
.hero p { font-size: 1.1rem; color: var(--ink-soft); margin: 0; max-width: 34rem; }
.mascot {
  position: relative; justify-self: center; width: min(300px, 70vw);
}
.mascot .frame {
  border-radius: 40% 40% 36px 36px; overflow: hidden; background: var(--sky-light);
  box-shadow: var(--shadow); border: 6px solid #fff;
}
.mascot .bubble {
  position: absolute; top: 8%; left: -12%;
  background: #fff; padding: 10px 16px; border-radius: 20px 20px 20px 6px;
  font-family: var(--font-display); font-weight: 600; box-shadow: var(--shadow);
  animation: float 4s ease-in-out infinite;
}
@media (max-width: 520px) { .mascot .bubble { left: 0; } }
.mascot .sticker { position: absolute; width: 46px; animation: float 5s ease-in-out infinite; }
.mascot .s1 { right: -6%; top: 4%; animation-delay: -1s; }
.mascot .s2 { left: -4%; bottom: 12%; animation-delay: -2.5s; }
.mascot .s3 { right: -2%; bottom: 22%; animation-delay: -3.2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- card + form ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
}
.form { max-width: 760px; margin: 0 auto; }
.q { border: 0; margin: 0; padding: 0 0 26px; }
.q + .q { padding-top: 22px; border-top: 2px dashed var(--line); }
.q legend, .q > .title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; padding: 0; margin-bottom: 4px; display: block;
}
.q .hint { color: var(--ink-soft); font-size: .95rem; margin: 0 0 14px; }
.req { color: var(--danger); }
.opt { color: var(--ink-soft); font-weight: 400; font-size: .9rem; font-family: var(--font-body); }

.faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.face input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.face span {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 4px 10px; border-radius: 20px; background: var(--bg); border: 3px solid transparent;
  cursor: pointer; transition: transform .15s, background .15s, border-color .15s;
  font-weight: 700; font-size: .8rem; color: var(--ink-soft); text-align: center;
}
.face span b { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1; font-weight: 400; }
.face span:hover { transform: translateY(-3px); background: var(--sky-light); }
.face input:checked + span { background: var(--sunshine-light); border-color: var(--sunshine); color: var(--ink); transform: scale(1.06); }
.face input:focus-visible + span, .chip input:focus-visible + span { outline: 3px solid var(--sky-dark); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; background: var(--bg); border: 2px solid var(--line);
  font-weight: 700; transition: background .15s, border-color .15s;
}
.chip span:hover { background: var(--sky-light); }
.chip input:checked + span { background: var(--sky-light); border-color: var(--sky-dark); }
.chip.mint input:checked + span { background: var(--mint-light); border-color: #59c48a; }
.chip.blush input:checked + span { background: var(--blush-light); border-color: #f08aa6; }

textarea, input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg);
}
textarea { min-height: 110px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--sky-dark); background: #fff; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: .95rem; color: var(--ink-soft); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--sky-deep); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  padding: 14px 28px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--sky-deep); color: #fff; box-shadow: 0 6px 0 #2a6ea6;
  transition: transform .1s, box-shadow .1s, background .15s; text-decoration: none;
}
.btn:hover { background: #3584c4; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #2a6ea6; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:hover { background: var(--sky-light); }
.btn.small { font-size: .95rem; padding: 9px 16px; }
.btn.danger { background: var(--danger); box-shadow: 0 4px 0 #a32c41; }
.submit-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding-top: 10px; }
.submit-row p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.error {
  background: var(--blush-light); color: #8f1f36; border-radius: 14px; padding: 10px 14px; font-weight: 700; margin: 0 0 14px;
}

.thanks { text-align: center; max-width: 560px; margin: 0 auto; }
.thanks img.mascot-sm { width: 180px; margin: 0 auto 16px; border-radius: 50%; border: 6px solid #fff; box-shadow: var(--shadow); background: var(--sky-light); }
.thanks h2 { font-size: 2.2rem; margin-bottom: 8px; }
.thanks p { color: var(--ink-soft); font-size: 1.1rem; }
.thanks .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.confetti { display: flex; justify-content: center; gap: 12px; margin-bottom: 8px; }
.confetti img { width: 36px; animation: float 3s ease-in-out infinite; }
.confetti img:nth-child(2) { animation-delay: -1s; }
.confetti img:nth-child(3) { animation-delay: -2s; }

footer.foot { text-align: center; color: var(--ink-soft); font-size: .9rem; padding: 10px 20px 30px; }

/* ---------- admin ---------- */
.login { max-width: 420px; margin: 6vh auto 0; text-align: center; }
.login img.mascot-sm { width: 130px; margin: 0 auto 12px; border-radius: 50%; border: 5px solid #fff; box-shadow: var(--shadow); background: var(--sky-light); }
.login h1 { font-size: 1.8rem; margin-bottom: 4px; }
.login p { color: var(--ink-soft); margin: 0 0 18px; }
.login form { display: grid; gap: 12px; text-align: left; }
.login .btn { width: 100%; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.notice {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--sunshine-light); border: 2px solid var(--sunshine); border-radius: 18px; padding: 12px 16px; margin-bottom: 20px; font-weight: 700;
}
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
@media (min-width: 860px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 16px 18px; }
.kpi .label { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.kpi .value { font-family: var(--font-display); font-weight: 700; font-size: 2rem; margin-top: 2px; }
.kpi .sub { font-size: .85rem; color: var(--ink-soft); }
.kpi:nth-child(1) { background: var(--sky-light); }
.kpi:nth-child(2) { background: var(--sunshine-light); }
.kpi:nth-child(3) { background: var(--mint-light); }
.kpi:nth-child(4) { background: var(--lavender-light); }

.panels { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 860px) { .panels { grid-template-columns: repeat(3, 1fr); } }
.panel { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 18px; }
.panel h3 { font-size: 1.1rem; margin-bottom: 12px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 34px; gap: 8px; align-items: center; font-size: .9rem; margin-bottom: 8px; }
.bar-row .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--sky-dark); border-radius: 999px; min-width: 2px; }
.bar-row .n { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.empty { color: var(--ink-soft); font-size: .95rem; }

.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.list-head h2 { font-size: 1.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters input { width: 220px; padding: 9px 14px; }
.filters select { width: auto; padding: 9px 14px; }
.entries { display: grid; gap: 12px; }
.entry { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 16px 18px; }
.entry header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.entry .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.entry .face-lg { font-size: 1.7rem; line-height: 1; }
.tag { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); }
.tag.mint { background: var(--mint-light); color: #1f7a4a; }
.tag.blush { background: var(--blush-light); color: #8f1f36; }
.tag.sun { background: var(--sunshine-light); color: #7a5a00; }
.tag.sky { background: var(--sky-light); color: #1f5d90; }
.entry time { font-size: .85rem; color: var(--ink-soft); }
.entry .qa { margin: 8px 0 0; }
.entry .qa b { display: block; font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.entry .qa p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry .contact { margin-top: 10px; font-size: .9rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--ink-soft); font: inherit; font-size: .85rem; font-weight: 700; padding: 4px 8px; border-radius: 10px; }
.icon-btn:hover { background: var(--blush-light); color: var(--danger); }

dialog { border: 0; border-radius: var(--radius); padding: 0; box-shadow: var(--shadow); width: min(440px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(44, 53, 80, .35); }
dialog form { padding: 24px; display: grid; gap: 12px; }
dialog h2 { font-size: 1.4rem; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.ok { background: var(--mint-light); color: #1f7a4a; border-radius: 14px; padding: 10px 14px; font-weight: 700; margin: 0; }

/* keep legends inside the fieldset instead of sitting on the dashed divider */
.q legend { float: left; width: 100%; }
.q legend + * { clear: both; }
.q legend + .faces, .q legend + .chips { padding-top: 10px; }

/* round mascot avatars: crop to a square instead of squashing */
img.mascot-sm { aspect-ratio: 1; height: auto; object-fit: cover; object-position: 50% 22%; }
.mascot .frame img { width: 100%; height: auto; }
