:root {
  --bg: #fff9f2;
  --ink: #2e2250;
  --muted: #6f6282;
  --line: #eadfce;
  --panel: #ffffff;
  --accent: #7d34d8;
  --accent-2: #ff9f25;
  --accent-3: #20a6e8;
  --pink: #ff4f93;
  --green: #62bf4e;
  --blue-soft: #dff0ff;
  --purple-soft: #eee5ff;
  --green-soft: #e8f8e4;
  --pink-soft: #ffe8f2;
  --yellow-soft: #fff2cf;
  --good: #35b869;
  --bad: #e84d55;
  --soft: #f4eaff;
  --wash: url("milipifi/acuarela.png");
  color-scheme: light;
  font-family:
    "Comic Sans MS", "Trebuchet MS", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 250, 244, 0.9), rgba(255, 250, 244, 0.86)),
    var(--wash) center / cover fixed,
    linear-gradient(150deg, #f7eaff 0%, #fff7e6 45%, #e9fbff 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 10%, rgba(93, 166, 255, 0.2), transparent 24rem),
    radial-gradient(circle at 90% 20%, rgba(255, 211, 93, 0.2), transparent 22rem),
    radial-gradient(circle at 70% 90%, rgba(255, 79, 147, 0.16), transparent 24rem);
  z-index: -1;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(109, 53, 217, 0.9), rgba(34, 166, 216, 0.78)),
    var(--wash) center / cover;
  border-right: 0;
  box-shadow: 14px 0 38px rgba(89, 43, 155, 0.16);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 76px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 24px rgba(46, 34, 80, 0.22);
}

.brand-mark img {
  width: 64px;
  max-height: 34px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(46, 34, 80, 0.28);
}

.brand p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
}

.mode-switch button,
.nav-button,
.chip,
.icon-button,
.primary,
.ghost,
.danger {
  min-height: 40px;
  border-radius: 10px;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.mode-switch button {
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.mode-switch button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(46, 34, 80, 0.18);
}

.surface-badge {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.admin-session {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.api-sync {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  color: #31515b;
  font-size: 11px;
  white-space: nowrap;
}

.api-sync.online {
  background: #e5f8ec;
  color: #16733a;
}

.api-sync.guardant,
.api-sync.connectant {
  background: #fff6d8;
  color: #8a5a00;
}

.api-sync.local {
  background: #fff0f1;
  color: #b72332;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
  text-align: left;
  font-weight: 750;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(46, 34, 80, 0.14);
}

.nav-ico {
  width: 28px;
  text-align: center;
  font-size: 20px;
}

.content {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 36px);
}

.content > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.content > .topbar {
  max-width: 1180px;
}

.app-shell.mode-kid {
  grid-template-columns: 1fr;
}

.app-shell.mode-kid .sidebar {
  display: none;
}

.app-shell.mode-kid .content {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 18px;
}

.phone-stage {
  width: min(100%, 430px);
  display: grid;
  gap: 12px;
}

.phone-mode-row {
  display: grid;
  gap: 8px;
}

.phone-mode-row .mode-switch {
  margin: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(89, 43, 155, 0.1);
}

.phone-mode-row .mode-switch button {
  color: var(--muted);
}

.phone-mode-row .mode-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #c03fe0);
}

.phone-mode-row .api-sync {
  justify-self: center;
}

.device-alarm {
  width: min(390px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 auto;
  padding: 12px;
  border: 2px solid #ffcf4d;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff2cf, #ffe8f2);
  box-shadow: 0 16px 34px rgba(232, 77, 85, 0.18);
}

.device-alarm strong,
.device-alarm span {
  display: block;
}

.device-alarm strong {
  font-size: 18px;
}

.device-alarm span {
  color: var(--muted);
  font-weight: 850;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 4px 2px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-3);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 0.96;
  letter-spacing: 0;
  color: var(--ink);
}

.subtitle {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
}

.milipifi-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  align-items: center;
  gap: 18px;
  min-height: 260px;
  margin-bottom: 18px;
  padding: 28px 32px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(118, 52, 217, 0.92), rgba(255, 79, 147, 0.72) 42%, rgba(255, 159, 37, 0.68)),
    var(--wash) center / cover;
  color: #fff;
  box-shadow: 0 18px 44px rgba(89, 43, 155, 0.22);
}

.milipifi-hero::after {
  content: "";
  position: absolute;
  inset: auto -4% -28px -4%;
  height: 70px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 250, 244, 0.95);
}

.milipifi-hero > div,
.milipifi-hero img {
  position: relative;
  z-index: 1;
}

.milipifi-hero h2 {
  max-width: 540px;
  margin: 10px 0 10px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: 0 3px 14px rgba(46, 34, 80, 0.22);
}

.milipifi-hero p {
  max-width: 520px;
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.hero-kicker {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 900;
}

.milipifi-hero img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(46, 34, 80, 0.22);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.panel,
.stat-card,
.list-card,
.task-card,
.reward-card,
.user-card {
  background:
    linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.9)),
    var(--wash) center / cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(89, 43, 155, 0.08);
}

.panel {
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.stat-card {
  padding: 16px;
  min-height: 110px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(244, 234, 255, 0.92)),
    var(--wash) center / cover;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.primary,
.ghost,
.danger,
.chip,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 850;
}

.primary {
  background: linear-gradient(135deg, var(--accent), #c03fe0);
  color: #fff;
  box-shadow: 0 12px 24px rgba(125, 52, 216, 0.24);
}

.mode-admin.view-points {
  --accent: #55b947;
  --soft: var(--green-soft);
}

.mode-admin.view-events {
  --accent: #ee4a9a;
  --soft: var(--pink-soft);
}

.mode-admin.view-calendar {
  --accent: #7a5ce6;
  --soft: var(--purple-soft);
}

.mode-kid.view-rewards {
  --accent: #7d34d8;
  --soft: var(--purple-soft);
}

.mode-kid.view-extras {
  --accent: #ee4a9a;
  --soft: var(--pink-soft);
}

.mode-kid.view-race {
  --accent: #ff9f25;
  --soft: var(--yellow-soft);
}

.primary:hover,
.ghost:hover,
.danger:hover,
.icon-button:hover,
.nav-button:hover {
  transform: translateY(-1px);
}

.ghost {
  background: #fff;
  color: var(--accent);
  border: 2px solid color-mix(in srgb, var(--accent) 38%, white);
}

.file-button {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.danger {
  background: #fff0f1;
  color: #b72332;
}

.chip {
  min-height: 32px;
  padding: 0 10px;
  background: #f5ecff;
  color: var(--accent);
  font-size: 13px;
}

.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff;
}

.state-icon {
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.state-icon.yes {
  background: #e5f8ec;
  color: var(--good);
}

.state-icon.no {
  background: #fff0f1;
  color: var(--bad);
  opacity: 0.72;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: #fff;
  color: var(--accent);
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(89, 43, 155, 0.1);
}

.upload-icon {
  position: relative;
  vertical-align: middle;
}

.upload-icon input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.evidence-thumb {
  width: 44px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  margin-left: 8px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  vertical-align: middle;
}

.evidence-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.avatar,
.avatar-lg {
  display: grid;
  place-items: center;
  border: 3px solid var(--user-color, #ffbe3d);
  border-radius: 999px;
  background: color-mix(in srgb, var(--user-color, #ffbe3d) 18%, white);
  color: #13252c;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(35, 70, 82, 0.16);
}

.avatar {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.avatar-lg {
  width: 96px;
  height: 96px;
  font-size: 44px;
}

.avatar img,
.avatar-lg img,
.big-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.user-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 14px;
  align-items: center;
  min-width: 0;
}

.login-panel {
  max-width: 520px;
}

.login-stack {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.first-admin-panel {
  max-width: 720px;
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 251, 255, 0.92)),
    var(--wash) center / cover;
}

.first-admin-panel .chip {
  background: var(--purple-soft);
  color: var(--accent);
}

.kid-login-card {
  min-height: 190px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--user-color, #2f9fbd) 12%, white);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(35, 70, 82, 0.1);
}

.kid-login-card .primary {
  width: 100%;
}

.kid-login-card strong {
  font-size: 20px;
}

.kid-login-card span {
  color: var(--muted);
  font-weight: 800;
}

.kid-pin-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.admin-manage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
}

.admin-action-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-action-tabs button {
  min-height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent);
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(89, 43, 155, 0.08);
}

.admin-action-tabs button.active {
  background: linear-gradient(135deg, var(--accent), #c03fe0);
  color: #fff;
}

.compact-tabs {
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.compact-tabs button {
  min-height: 38px;
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
}

.admin-section {
  border-top: 4px solid var(--accent);
}

.small-action {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

.panel-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.auth-admin-section {
  border-top-color: #7b61ff;
}

.auth-admin-card .big-icon {
  background: linear-gradient(135deg, #7b61ff, #c03fe0);
  color: #fff;
  font-weight: 950;
}

.round-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.round-prize strong {
  font-size: 18px;
}

.quick-points-card .task-actions {
  margin-top: 8px;
}

.quick-points-card .task-actions button {
  min-width: 58px;
}

.event-entity-card {
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto);
}

.event-entity-card .event-progress {
  max-width: 260px;
  margin-top: 8px;
}

.event-active-choice {
  align-self: end;
}

.event-edit-form .form-actions {
  justify-content: flex-end;
}

.task-manage-section .filters {
  margin: 12px 0;
}

.task-entity-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.task-entity-card .task-meta {
  margin-top: 8px;
}

.task-edit-form {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
}

.block-entity-card .big-icon {
  font-weight: 950;
}

.block-slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.block-slot-row span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #f3f8fa;
  color: #31515b;
  font-size: 12px;
  font-weight: 850;
}

.block-calendar-panel {
  border-top-color: var(--accent-3);
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.block-calendar-weekdays,
.block-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.block-calendar-weekdays {
  margin-top: 12px;
  margin-bottom: 6px;
}

.block-calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.block-day {
  min-height: 86px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--block-color, #2f9fbd) 28%, white);
  border-radius: 10px;
  background: color-mix(in srgb, var(--block-color, #2f9fbd) 14%, white);
}

.block-day.empty-day {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.46);
}

.block-day.today {
  box-shadow: inset 0 0 0 2px var(--block-color, #2f9fbd);
}

.block-day strong {
  color: var(--ink);
  font-size: 18px;
}

.block-day span {
  overflow: hidden;
  color: #31515b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.block-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.block-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #31515b;
  font-size: 12px;
  font-weight: 900;
}

.block-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--block-color);
}

.admin-crud-stack {
  display: grid;
  gap: 18px;
}

.entity-list {
  display: grid;
  gap: 10px;
}

.entity-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.entity-card h3 {
  margin: 0;
}

.entity-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.entity-actions button {
  min-width: 92px;
}

.section-create {
  width: 100%;
  margin-top: 12px;
}

.entity-create-form {
  margin-top: 12px;
}

.admin-home-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-home-summary .stat-card {
  min-height: 78px;
  padding: 12px;
  box-shadow: none;
}

.admin-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.admin-home-panel {
  box-shadow: none;
}

.admin-home-panel .section-head {
  margin-bottom: 10px;
}

.admin-home-panel .round-summary {
  gap: 8px;
}

.admin-home-panel .round-summary .stat-card {
  min-height: 70px;
  padding: 10px;
  box-shadow: none;
}

.user-edit-list {
  gap: 14px;
}

.admin-manage-grid > .panel,
.grid > .panel {
  min-width: 0;
}

.inline-edit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.team-edit {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.user-edit {
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
}

.reward-edit {
  grid-template-columns: auto minmax(160px, 1fr) 76px 120px minmax(130px, 0.8fr) auto auto auto;
}

.reward-entity-card .big-icon {
  width: 58px;
  height: 58px;
}

.device-edit {
  display: grid;
  grid-template-columns: auto 1fr 140px auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.device-edit input,
.device-edit select,
.admin-filters select {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.full-row {
  grid-column: 1 / -1;
}

.inline-edit input,
.inline-edit select {
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.inline-edit input[type="file"] {
  max-width: 100%;
  font-size: 12px;
}

.file-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.kid-device-panel {
  padding: 12px;
}

.device-pair-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  text-align: left;
}

.device-pair-card h3 {
  margin: 4px 0 6px;
  color: #1a1b4b;
}

.pair-code {
  display: inline-flex;
  max-width: 100%;
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px dashed #8b5cf6;
  border-radius: 10px;
  background: #f7f3ff;
  color: #4f46e5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.pair-qr-wrap {
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 47, 93, 0.12);
}

.pair-qr {
  display: block;
  width: 148px;
  height: 148px;
}

.pair-qr-fallback {
  width: 148px;
  min-height: 148px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed #c7d2fe;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}

.pair-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.pair-input-row input {
  width: 100%;
}

.qr-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.7);
}

.qr-scan-card {
  width: min(420px, 100%);
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.qr-scan-card video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #101828;
}

.file-chip input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.inline-edit .avatar,
.inline-edit .big-icon {
  justify-self: start;
}

.inline-edit button {
  width: 100%;
}

.compact-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.duration-field {
  outline: 2px solid rgba(47, 159, 189, 0.18);
  outline-offset: 4px;
  border-radius: 8px;
}

.user-card h3,
.task-card h3,
.reward-card h3,
.list-card h3 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.task-card,
.reward-card {
  padding: 16px;
}

.mobile-frame .reward-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 0;
  background: linear-gradient(145deg, #58b9ff, #844de8);
  color: #fff;
}

.mobile-frame .reward-card:nth-child(2n) {
  background: linear-gradient(145deg, #9a62f2, #ff72b4);
}

.mobile-frame .reward-card:nth-child(3n) {
  background: linear-gradient(145deg, #ffd25c, #ff9f25);
}

.mobile-frame .reward-card:nth-child(4n) {
  background: linear-gradient(145deg, #68d96a, #29b5d6);
}

.mobile-frame .reward-card h3,
.mobile-frame .reward-card .points {
  color: #fff;
}

.mobile-frame .reward-card .big-icon {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.36);
}

.mobile-frame .reward-card button {
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  box-shadow: none;
}

.mobile-frame .panel[style*="text-align:center"] {
  border: 0;
  background: rgba(255, 255, 255, 0.92);
}

.task-top,
.reward-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.big-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #f1fbff;
  border: 1px solid var(--line);
  font-size: 30px;
}

.big-icon.mini {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 22px;
}

.points {
  color: #8a5a00;
  font-weight: 950;
}

.task-meta,
.tabs,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-meta {
  margin-top: 12px;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #31515b;
  font-size: 13px;
  font-weight: 850;
}

.field input,
.field select,
.field textarea {
  min-height: 42px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.signed-number {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.signed-number input {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}

.signed-number button {
  min-width: 58px;
  padding: 0 10px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.message-form {
  grid-template-columns: 1fr;
}

.message-card {
  align-items: flex-start;
}

.message-card.unread {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, white);
}

.message-card.read {
  opacity: 0.78;
}

.message-card p {
  margin: 4px 0 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.choice {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #31515b;
  font-weight: 850;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-state {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.choice-state::before {
  content: "×";
}

.choice input:checked + .choice-state {
  background: var(--good);
}

.choice input:checked + .choice-state::before {
  content: "✓";
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: #31515b;
  font-size: 13px;
  text-transform: uppercase;
}

.progress-track {
  position: relative;
  height: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0f2;
}

.progress-fill {
  height: 100%;
  width: var(--pct);
  border-radius: inherit;
  background: var(--user-color);
}

.race {
  display: grid;
  gap: 12px;
}

.race-row {
  display: grid;
  grid-template-columns: 54px 1fr 70px;
  align-items: center;
  gap: 10px;
}

.objective-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.objective-tabs button {
  min-height: 42px;
  border-radius: 11px;
  background: transparent;
  color: #6a62a0;
  font-weight: 950;
}

.objective-tabs button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(89, 43, 155, 0.12);
}

.objective-target {
  margin-bottom: 12px;
}

.objective-chart {
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px 10px;
  border: 1px solid rgba(102, 132, 188, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.objective-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 28px 180px auto;
  gap: 8px;
  justify-items: center;
  align-items: end;
}

.objective-points {
  color: var(--ink);
  font-size: 18px;
}

.vertical-track {
  width: 28px;
  height: 180px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0f2;
  box-shadow: inset 0 0 0 1px rgba(102, 132, 188, 0.16);
}

.vertical-fill {
  width: 100%;
  height: var(--pct);
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--user-color) 72%, #fff), var(--user-color));
}

.objective-marker {
  max-width: 100%;
  display: grid;
  gap: 5px;
  justify-items: center;
  text-align: center;
}

.objective-marker .avatar,
.objective-marker .avatar-lg {
  width: 48px;
  height: 48px;
}

.objective-marker span {
  max-width: 100%;
  overflow: hidden;
  color: #31515b;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.objective-team-icon {
  background: var(--user-color);
  color: #fff;
  font-weight: 950;
}

.mobile-frame {
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  padding: 18px;
  min-height: 690px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(102, 132, 188, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--user-color, #7d34d8) 18%, #dff0ff), rgba(255, 255, 255, 0.94) 34%),
    var(--wash) center / cover;
  box-shadow: 0 22px 58px rgba(89, 43, 155, 0.15);
}

.kid-user-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.kid-user-switch button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 2px transparent;
}

.kid-user-switch button.active {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--user-color), 0 8px 14px rgba(89, 43, 155, 0.12);
}

.kid-view-race {
  background:
    linear-gradient(180deg, var(--yellow-soft), rgba(255, 255, 255, 0.96) 36%),
    var(--wash) center / cover;
}

.kid-view-rewards {
  background:
    linear-gradient(180deg, var(--purple-soft), rgba(255, 255, 255, 0.96) 36%),
    var(--wash) center / cover;
}

.kid-view-extras {
  background:
    linear-gradient(180deg, var(--pink-soft), rgba(255, 255, 255, 0.96) 36%),
    var(--wash) center / cover;
}

.kid-view-profile {
  background:
    linear-gradient(180deg, var(--blue-soft), rgba(255, 255, 255, 0.96) 36%),
    var(--wash) center / cover;
}

.kid-avatar-panel {
  margin-top: 12px;
}

.kid-avatar-panel .section-head {
  margin-bottom: 10px;
}

.kid-avatar-panel .section-head h3 {
  margin: 0;
}

.kid-avatar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 10px;
  text-align: left;
}

.kid-avatar-form .field.full {
  grid-column: 1 / -1;
}

.kid-avatar-form input[type="file"] {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

.kid-avatar-form .form-actions {
  justify-content: stretch;
}

.kid-avatar-form .form-actions button {
  flex: 1 1 130px;
}

.kid-screen-body {
  flex: 1 1 auto;
  min-height: 0;
}

.mobile-frame .grid.cols-2,
.mobile-frame .grid.cols-3,
.mobile-frame .grid.cols-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-frame .panel {
  padding: 12px;
}

.mobile-frame .stat-card {
  min-width: 0;
  padding: 12px 8px;
  box-shadow: none;
}

.mobile-frame .stat-card strong {
  font-size: 26px;
}

.mobile-frame .stat-card span {
  font-size: 12px;
}

.kid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 4px 2px 0;
}

.kid-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.kid-title p {
  margin: 3px 0 0;
  color: rgba(46, 34, 80, 0.72);
  font-weight: 850;
}

.bottom-tabs {
  position: static;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 4px;
  margin: 14px -8px -8px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.bottom-tabs button {
  min-width: 0;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 12px;
  background: transparent;
  color: #6a62a0;
  font-size: 20px;
  font-weight: 900;
}

.bottom-tabs button span {
  line-height: 1;
}

.bottom-tabs button small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.bottom-tabs button.active {
  outline: 0;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(89, 43, 155, 0.14);
}

.current-context {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(89, 43, 155, 0.08);
}

.current-context span,
.current-context small {
  color: rgba(46, 34, 80, 0.72);
  font-weight: 800;
}

.current-context strong {
  color: var(--ink);
}

.current-context small {
  grid-column: 1 / -1;
  font-size: 12px;
}

.time-progress {
  grid-column: 1 / -1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 36, 43, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.time-progress-fill {
  width: var(--time-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--user-color), var(--pink), #ffcf4d);
  transition: width 240ms ease;
}

.current-context .time-left {
  justify-self: end;
  color: #31515b;
}

.kid-task-card {
  border-radius: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.86)),
    var(--wash) center / cover;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(89, 43, 155, 0.1);
}

.event-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.event-pill {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(89, 43, 155, 0.08);
}

.event-pill span {
  font-size: 22px;
}

.event-pill small {
  color: var(--muted);
  font-weight: 800;
}

.event-progress {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 36, 43, 0.12);
}

.event-alarm {
  grid-column: 1 / -1;
  min-height: 34px;
}

.event-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffcf4d, var(--pink), var(--user-color));
}

.kid-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kid-task-card.done {
  opacity: 0.72;
}

.kid-task-button {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 46px 1fr auto 28px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.kid-task-card.square {
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.kid-task-button.square {
  min-height: 100%;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto auto;
  place-items: center;
  padding: 12px;
  text-align: center;
}

.kid-task-button.square strong {
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 14px;
  line-height: 1.15;
}

.kid-task-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: color-mix(in srgb, var(--user-color, #7d34d8) 20%, white);
  font-size: 24px;
}

.kid-task-icon.square {
  width: 58px;
  height: 58px;
  font-size: 32px;
  box-shadow: inset 0 -10px 18px rgba(89, 43, 155, 0.08);
}

.kid-task-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.kid-task-main strong,
.kid-task-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kid-task-main strong {
  font-size: 15px;
}

.kid-task-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.kid-task-points {
  color: #8a5a00;
  font-size: 15px;
  font-weight: 950;
}

.kid-task-status {
  min-width: 58px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--user-color), var(--accent));
  color: #fff;
  border: 0;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 950;
}

.kid-history-row {
  grid-template-columns: auto 1fr auto;
}

.kid-task-flags {
  display: flex;
  gap: 5px;
  padding: 0 8px 8px 56px;
}

.kid-task-flags .state-icon {
  min-width: 24px;
  min-height: 24px;
  padding: 0 5px;
  font-size: 12px;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 0;
  }

  .brand {
    margin-bottom: 14px;
  }

  .milipifi-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .milipifi-hero img {
    max-height: 180px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-button {
    justify-content: center;
  }

  .nav-label {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .admin-manage-grid,
  .admin-home-summary,
  .admin-home-grid,
  .admin-action-tabs,
  .form,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: block;
  }

  .list-card {
    grid-template-columns: auto 1fr;
  }

  .entity-card {
    grid-template-columns: auto 1fr;
  }

  .entity-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .entity-actions button,
  .form-actions button {
    flex: 1 1 130px;
  }

  .list-card > :last-child {
    grid-column: 1 / -1;
  }

  .inline-edit {
    grid-template-columns: 1fr;
  }

  .team-edit,
  .user-edit,
  .reward-edit,
  .device-edit {
    grid-template-columns: 1fr;
  }

  .device-pair-card,
  .pair-input-row {
    grid-template-columns: 1fr;
  }

  .pair-qr-wrap {
    justify-self: center;
  }
}

/* Milipifi app reference refresh */
body {
  background: #ffffff;
}

body::before {
  content: none;
}

.panel,
.stat-card,
.list-card,
.task-card,
.reward-card,
.user-card,
.entity-card,
.task-edit-form {
  background: #ffffff;
  border: 1px solid #e7ecfb;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(31, 47, 93, 0.08);
}

.primary {
  background: linear-gradient(135deg, #6654e8, #8b5cf6);
  box-shadow: 0 10px 22px rgba(102, 84, 232, 0.24);
}

.ghost {
  border: 1px solid #dfe5fb;
  color: var(--accent);
  background: #ffffff;
}

.danger {
  border: 0;
  background: #fff0f4;
  color: #d21b5f;
}

.chip {
  min-height: 28px;
  border-radius: 8px;
  background: #f1edff;
  color: #6654e8;
}

.mode-admin .content {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 28px 16px;
  background: #ffffff;
}

.app-shell.mode-admin {
  grid-template-columns: 1fr;
}

.app-shell.mode-admin .sidebar {
  display: none;
}

.admin-app-stage {
  width: min(100%, 448px);
}

.admin-mobile-frame {
  min-height: 760px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid #d9d3ff;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #efeaff 0, #ffffff 150px),
    #ffffff;
  box-shadow: 0 22px 60px rgba(65, 58, 140, 0.12);
}

.admin-view-calendar,
.admin-view-tasks,
.admin-view-users,
.admin-view-rewards {
  background:
    linear-gradient(180deg, #f0ebff 0, #ffffff 150px),
    #ffffff;
}

.admin-view-points,
.admin-view-stats {
  border-color: #cfebc8;
  background:
    linear-gradient(180deg, #eaf8e4 0, #ffffff 150px),
    #ffffff;
}

.admin-view-events,
.admin-view-messages {
  border-color: #ffd1e4;
  background:
    linear-gradient(180deg, #ffe8f2 0, #ffffff 150px),
    #ffffff;
}

.admin-screen-body {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-mobile-frame .topbar {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 0;
}

.admin-mobile-frame .eyebrow {
  margin-bottom: 4px;
  color: #211a86;
  font-size: 12px;
  text-transform: none;
}

.admin-mobile-frame .title {
  font-size: 24px;
  line-height: 1.05;
  color: #211a86;
}

.admin-mobile-frame .subtitle {
  max-width: 100%;
  margin-top: 5px;
  color: #6a6f8e;
  font-size: 12px;
  font-weight: 750;
}

.admin-mobile-frame .topbar-actions {
  justify-content: flex-start;
  margin-top: 10px;
}

.admin-mobile-frame .topbar-actions .ghost,
.admin-mobile-frame .topbar-actions .file-button,
.admin-mobile-frame .topbar-actions .admin-session {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
}

.admin-mobile-frame .grid.cols-2,
.admin-mobile-frame .grid.cols-3,
.admin-mobile-frame .grid.cols-4,
.admin-mobile-frame .admin-manage-grid,
.admin-mobile-frame .admin-crud-stack {
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-mobile-frame .panel {
  padding: 12px;
}

.admin-mobile-frame .stat-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.admin-mobile-frame .stat-card strong {
  margin: 0;
  color: #101b4f;
  font-size: 20px;
}

.admin-mobile-frame .stat-card span {
  color: #596079;
  font-size: 12px;
}

.admin-mobile-frame .section-head h2 {
  color: #211a86;
  font-size: 16px;
}

.admin-mobile-frame .entity-card,
.admin-mobile-frame .list-card,
.admin-mobile-frame .user-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.admin-mobile-frame .entity-actions,
.admin-mobile-frame .task-actions,
.admin-mobile-frame .form-actions {
  grid-column: 1 / -1;
  justify-content: stretch;
}

.admin-mobile-frame .entity-actions button,
.admin-mobile-frame .task-actions button,
.admin-mobile-frame .form-actions button {
  flex: 1 1 88px;
  min-width: 0;
  min-height: 36px;
}

.admin-mobile-frame .form,
.admin-mobile-frame .choice-grid {
  grid-template-columns: 1fr;
}

.category-panel .category-create-form {
  margin-top: 12px;
}

.category-card .big-icon {
  background: #f0edff;
  color: #6654e8;
  font-size: 18px;
}

.server-sync-panel {
  border-top-color: #45b8d8;
}

.server-status.ok {
  background: #e5f8ec;
  color: #16733a;
}

.server-status.pending {
  background: #fff6d8;
  color: #8a5a00;
}

.server-status.bad {
  background: #fff0f4;
  color: #d21b5f;
}

.server-sync-details {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.server-sync-details p {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  color: #596079;
  font-size: 11px;
}

.server-sync-details strong {
  color: #101b4f;
}

.server-sync-details span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.server-error span {
  color: #d21b5f;
}

.server-actions {
  justify-content: stretch;
}

.admin-bottom-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(56px, 1fr);
  gap: 3px;
  overflow-x: auto;
  margin: auto -8px -8px;
  padding: 7px;
  border: 1px solid #edf0fb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.admin-bottom-tabs button {
  min-width: 0;
  min-height: 50px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 11px;
  background: transparent;
  color: #6f76a0;
  font-size: 18px;
  font-weight: 900;
}

.admin-bottom-tabs button small {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 9px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-bottom-tabs button.active {
  background: #f0edff;
  color: #6654e8;
}

.phone-stage {
  width: min(100%, 390px);
}

.phone-mode-row {
  margin-bottom: 2px;
}

.mobile-frame {
  min-height: 735px;
  padding: 14px;
  border: 1px solid #bedaff;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #bfe2ff 0, #eaf6ff 118px, #ffffff 255px),
    #ffffff;
  box-shadow: 0 22px 60px rgba(40, 94, 160, 0.16);
}

.kid-view-race {
  background:
    linear-gradient(180deg, #d9edff 0, #ffffff 255px),
    #ffffff;
}

.kid-view-rewards {
  background:
    linear-gradient(180deg, #dceeff 0, #ffffff 255px),
    #ffffff;
}

.kid-view-extras {
  border-color: #ffd1e4;
  background:
    linear-gradient(180deg, #ffe5f1 0, #ffffff 255px),
    #ffffff;
}

.kid-view-profile {
  background:
    linear-gradient(180deg, #c8e7ff 0, #ffffff 245px),
    #ffffff;
}

.kid-user-switch {
  margin-bottom: 8px;
}

.kid-user-switch button {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 16px;
}

.kid-header {
  align-items: center;
  margin-bottom: 12px;
}

.kid-title h2 {
  color: #101b4f;
  font-size: 20px;
}

.kid-title p {
  color: #596079;
  font-size: 12px;
}

.kid-home-hero {
  min-height: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 18px 16px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(185, 225, 255, 0.96), rgba(226, 244, 255, 0.92)),
    #dff1ff;
  box-shadow: 0 14px 30px rgba(66, 128, 198, 0.16);
}

.kid-home-hero h3 {
  margin: 0 0 5px;
  color: #101b4f;
  font-size: 22px;
}

.kid-home-hero p {
  margin: 0;
  color: #2d385a;
  font-size: 12px;
  font-weight: 850;
}

.kid-home-hero .avatar-lg {
  width: 74px;
  height: 74px;
  background: #ffd34d;
}

.current-context,
.event-pill,
.mobile-frame .panel[style*="text-align:center"] {
  border: 0;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 47, 93, 0.08);
}

.current-context {
  border-radius: 14px;
}

.time-progress {
  height: 9px;
  background: #e8edf9;
}

.time-progress-fill {
  background: linear-gradient(90deg, #5ac8fa, #6654e8);
}

.kid-task-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.kid-task-card {
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 47, 93, 0.08);
}

.kid-task-button.square {
  min-height: 58px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  justify-items: stretch;
  text-align: left;
}

.kid-task-button.square strong {
  align-self: center;
  color: #101b4f;
  font-size: 13px;
}

.kid-task-icon.square {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eef6ff;
  font-size: 22px;
  box-shadow: none;
}

.kid-task-status {
  min-width: 42px;
  height: 32px;
  border-radius: 999px;
  background: #65cb4f;
  font-size: 10px;
}

.points-hero {
  display: grid;
  place-items: center;
  gap: 8px;
  margin: 6px 0 18px;
  text-align: center;
}

.points-hero .big-icon {
  width: 54px;
  height: 54px;
  border: 0;
  background: #ffc93d;
  color: #ffffff;
  font-size: 32px;
  box-shadow: 0 12px 24px rgba(255, 183, 30, 0.24);
}

.points-hero small {
  display: block;
  color: #101b4f;
  font-weight: 900;
}

.points-hero strong {
  color: #101b4f;
  font-size: 28px;
}

.mobile-frame .reward-card {
  min-height: 132px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(76, 64, 160, 0.14);
}

.event-hero-card {
  min-height: 198px;
  display: grid;
  place-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #9ff2d7, #5ccfad);
  color: #101b4f;
  text-align: center;
  box-shadow: 0 16px 34px rgba(70, 181, 147, 0.2);
}

.event-hero-card .big-icon {
  width: 82px;
  height: 82px;
  border: 0;
  background: rgba(255, 255, 255, 0.42);
  font-size: 46px;
}

.event-hero-card h3 {
  margin: 0;
  font-size: 16px;
}

.event-hero-card strong {
  color: #ffffff;
  font-size: 18px;
}

.event-confetti {
  color: #6654e8;
  font-weight: 950;
}

.bottom-tabs {
  border: 1px solid #edf0fb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -4px 18px rgba(31, 47, 93, 0.06);
}

.bottom-tabs button {
  min-height: 50px;
  color: #6f76a0;
}

.bottom-tabs button.active {
  background: #f0edff;
  color: #6654e8;
}

.mobile-frame .objective-chart {
  min-height: 238px;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 4px;
  padding: 10px 6px;
}

.mobile-frame .objective-column {
  grid-template-rows: 20px 148px auto;
  gap: 5px;
}

.mobile-frame .objective-points {
  font-size: 12px;
}

.mobile-frame .vertical-track {
  width: 18px;
  height: 148px;
}

.mobile-frame .objective-marker {
  gap: 3px;
}

.mobile-frame .objective-marker .avatar,
.mobile-frame .objective-marker .avatar-lg {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.mobile-frame .objective-marker span {
  font-size: 9px;
}

/* Navigation and Milipifi brand polish */
.admin-mobile-frame,
.mobile-frame {
  height: min(840px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.admin-screen-body,
.kid-screen-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.admin-bottom-tabs,
.bottom-tabs {
  flex: 0 0 auto;
  margin-top: 8px;
}

.admin-mobile-frame {
  background:
    linear-gradient(180deg, rgba(125, 52, 216, 0.20) 0, rgba(32, 166, 232, 0.13) 95px, rgba(255, 255, 255, 0.96) 260px),
    var(--wash) center top / 1050px auto,
    #ffffff;
  border-color: rgba(125, 52, 216, 0.26);
}

.admin-view-tasks,
.admin-view-users,
.admin-view-rewards,
.admin-view-calendar {
  background:
    linear-gradient(180deg, rgba(125, 52, 216, 0.18), rgba(255, 255, 255, 0.96) 245px),
    var(--wash) center top / 1050px auto,
    #ffffff;
}

.admin-view-points,
.admin-view-stats {
  background:
    linear-gradient(180deg, rgba(98, 191, 78, 0.18), rgba(255, 255, 255, 0.96) 245px),
    var(--wash) center top / 1050px auto,
    #ffffff;
}

.admin-view-events,
.admin-view-messages {
  background:
    linear-gradient(180deg, rgba(255, 79, 147, 0.18), rgba(255, 255, 255, 0.96) 245px),
    var(--wash) center top / 1050px auto,
    #ffffff;
}

.admin-brand-card {
  position: relative;
  min-height: 126px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(125, 52, 216, 0.96), rgba(255, 79, 147, 0.74) 48%, rgba(255, 159, 37, 0.86)),
    var(--wash) center / cover;
  color: #fff;
  box-shadow: 0 16px 34px rgba(125, 52, 216, 0.18);
}

.admin-brand-card h2 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1;
}

.admin-brand-card .hero-kicker {
  background: rgba(255, 255, 255, 0.22);
}

.admin-brand-card img {
  width: 190px;
  height: 124px;
  object-fit: cover;
  object-position: left center;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(46, 34, 80, 0.22);
}

.mobile-frame {
  background:
    linear-gradient(180deg, rgba(32, 166, 232, 0.24) 0, rgba(255, 79, 147, 0.10) 92px, rgba(255, 255, 255, 0.96) 260px),
    var(--wash) center top / 1000px auto,
    #ffffff;
  border-color: rgba(32, 166, 232, 0.28);
}

.kid-view-race,
.kid-view-rewards,
.kid-view-extras,
.kid-view-profile {
  background:
    linear-gradient(180deg, rgba(32, 166, 232, 0.22), rgba(255, 255, 255, 0.96) 250px),
    var(--wash) center top / 1000px auto,
    #ffffff;
}

.kid-home-hero {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 128px;
  background:
    linear-gradient(135deg, rgba(32, 166, 232, 0.92), rgba(125, 52, 216, 0.62) 54%, rgba(255, 159, 37, 0.76)),
    var(--wash) center / cover;
  color: #fff;
}

.kid-home-hero h3,
.kid-home-hero p {
  color: #fff;
}

.kid-character-art {
  width: 154px;
  height: 100px;
  object-fit: cover;
  object-position: left center;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(46, 34, 80, 0.20);
}

.current-context,
.event-pill,
.kid-task-card,
.mobile-frame .panel,
.admin-mobile-frame .panel,
.admin-mobile-frame .stat-card,
.admin-mobile-frame .entity-card,
.admin-mobile-frame .list-card {
  border-color: rgba(125, 52, 216, 0.12);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.admin-bottom-tabs,
.bottom-tabs {
  border-color: rgba(125, 52, 216, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 24px rgba(46, 34, 80, 0.08);
}

.admin-bottom-tabs button.active,
.bottom-tabs button.active {
  background: linear-gradient(135deg, #7d34d8, #20a6e8);
  color: #fff;
  box-shadow: 0 8px 18px rgba(125, 52, 216, 0.22);
}

.admin-mobile-frame .stat-card:nth-child(1),
.mobile-frame .reward-card:nth-child(1n) {
  border-top: 4px solid #20a6e8;
}

.admin-mobile-frame .stat-card:nth-child(2),
.mobile-frame .reward-card:nth-child(2n) {
  border-top: 4px solid #ff4f93;
}

.admin-mobile-frame .stat-card:nth-child(3),
.mobile-frame .reward-card:nth-child(3n) {
  border-top: 4px solid #ff9f25;
}

.admin-mobile-frame .stat-card:nth-child(4),
.mobile-frame .reward-card:nth-child(4n) {
  border-top: 4px solid #62bf4e;
}

@media (max-width: 520px) {
  .mode-admin .content,
  .app-shell.mode-kid .content {
    padding: 8px;
  }

  .admin-mobile-frame,
  .mobile-frame {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .admin-brand-card {
    grid-template-columns: 1fr 116px;
    min-height: 112px;
  }

  .admin-brand-card img {
    width: 140px;
    height: 100px;
  }

  .kid-home-hero {
    grid-template-columns: 1fr 108px;
  }

  .kid-character-art {
    width: 130px;
    height: 92px;
  }
}

/* Milipifi Kids app navigation refresh */
:root {
  --ink: #10215c;
  --muted: #66719b;
  --line: #e6edfb;
  --panel: #ffffff;
  --accent: #6b4cf6;
  --accent-2: #ffb72d;
  --accent-3: #18c5d7;
  --pink: #ff5c9b;
  --green: #5ac84c;
  --blue-soft: #dff4ff;
  --purple-soft: #efeaff;
  --green-soft: #eaf9df;
  --pink-soft: #ffe8f2;
  --yellow-soft: #fff1c8;
}

.app-shell,
.app-shell.mode-kid {
  min-height: 100dvh;
  grid-template-columns: 1fr;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.9)),
    var(--wash) center / cover fixed,
    #fffdf9;
}

.sidebar {
  display: none;
}

.content,
.app-shell.mode-kid .content,
.mode-admin .content {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.admin-app-stage,
.phone-stage {
  width: min(100%, 430px);
  margin: 0 auto;
}

.admin-mobile-frame,
.mobile-frame {
  position: relative;
  width: min(100%, 430px);
  height: min(860px, calc(100dvh - 32px));
  min-height: 0;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(76, 135, 214, 0.24);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(221, 247, 255, 0.96) 0, rgba(255, 255, 255, 0.94) 250px),
    var(--wash) center top / 900px auto,
    #ffffff;
  box-shadow: 0 30px 80px rgba(35, 58, 125, 0.16);
}

.admin-mobile-frame {
  background:
    linear-gradient(180deg, rgba(238, 233, 255, 0.98) 0, rgba(255, 255, 255, 0.95) 250px),
    var(--wash) center top / 900px auto,
    #ffffff;
}

.admin-view-points,
.kid-view-rewards {
  background:
    linear-gradient(180deg, rgba(255, 242, 199, 0.98) 0, rgba(255, 255, 255, 0.95) 250px),
    var(--wash) center top / 900px auto,
    #ffffff;
}

.admin-view-events,
.kid-view-extras {
  background:
    linear-gradient(180deg, rgba(232, 252, 237, 0.98) 0, rgba(255, 255, 255, 0.95) 250px),
    var(--wash) center top / 900px auto,
    #ffffff;
}

.admin-view-users,
.kid-view-profile {
  background:
    linear-gradient(180deg, rgba(226, 246, 255, 0.98) 0, rgba(255, 255, 255, 0.95) 250px),
    var(--wash) center top / 900px auto,
    #ffffff;
}

.frame-brand-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 8px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
}

.frame-logo {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.frame-logo img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(107, 76, 246, 0.18);
}

.frame-logo strong {
  display: block;
  max-width: 190px;
  overflow: hidden;
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
  color: transparent;
  background: linear-gradient(90deg, #14bfe4, #6b4cf6 43%, #ff5c9b 72%, #ffb72d);
  -webkit-background-clip: text;
  background-clip: text;
  white-space: nowrap;
}

.frame-logo strong span {
  color: #10215c;
  background: none;
}

.frame-logo small {
  display: block;
  margin-top: 2px;
  max-width: 190px;
  overflow: hidden;
  color: #2b4382;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-characters {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
}

.frame-right-tools {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 4px;
}

.frame-characters > span {
  margin-left: -8px;
}

.frame-characters .avatar,
.frame-characters .avatar-lg {
  width: 31px;
  height: 31px;
  border: 2px solid #fff;
  font-size: 15px;
  box-shadow: 0 7px 14px rgba(35, 58, 125, 0.12);
}

.frame-sync-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.server-pill,
.frame-sync-button {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.server-pill {
  padding: 0 8px;
  color: #2d407d;
  background: #edf6ff;
  border: 1px solid #dceafd;
}

.server-pill.online {
  color: #16733a;
  background: #e6f8ec;
  border-color: #c6ecd2;
}

.server-pill.guardant,
.server-pill.connectant {
  color: #9a6700;
  background: #fff2cf;
  border-color: #ffe0a1;
}

.server-pill.local {
  color: #bd174e;
  background: #ffe9f1;
  border-color: #ffd0df;
}

.frame-sync-button {
  padding: 0 9px;
  color: #ffffff;
  background: linear-gradient(135deg, #20c6d8, #6b4cf6);
  box-shadow: 0 7px 13px rgba(107, 76, 246, 0.18);
}

.frame-subnav {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 12px 10px;
  background: rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid rgba(230, 237, 251, 0.9);
  scrollbar-width: none;
}

.frame-subnav::-webkit-scrollbar {
  display: none;
}

.frame-subnav button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 13px;
  border-radius: 999px;
  background: #ffffff;
  color: #33427d;
  border: 1px solid #e5ebfb;
  box-shadow: 0 7px 14px rgba(35, 58, 125, 0.06);
  font-size: 12px;
  font-weight: 950;
}

.frame-subnav button.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #20c6d8, #6b4cf6 68%, #ff5c9b);
  box-shadow: 0 10px 18px rgba(107, 76, 246, 0.22);
}

.admin-screen-body,
.kid-screen-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 96px;
  scrollbar-width: thin;
}

.admin-screen-body > .admin-action-tabs,
.kid-screen-body > .objective-tabs {
  display: none !important;
}

.admin-bottom-tabs,
.bottom-tabs {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 7px;
  border: 1px solid rgba(221, 230, 250, 0.94);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -8px 26px rgba(35, 58, 125, 0.13);
  backdrop-filter: blur(18px);
}

.admin-bottom-tabs button,
.bottom-tabs button {
  min-width: 0;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 15px;
  background: transparent;
  color: #7480ad;
  font-size: 20px;
  font-weight: 950;
}

.admin-bottom-tabs button small,
.bottom-tabs button small {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 9px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-bottom-tabs button.active,
.bottom-tabs button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #20c6d8, #6b4cf6);
  box-shadow: 0 9px 18px rgba(107, 76, 246, 0.24);
}

.topbar {
  margin-bottom: 12px;
}

.topbar .title,
.kid-title h2 {
  color: #10215c;
  font-size: 25px;
  line-height: 1;
}

.kid-title {
  flex: 0 0 auto;
  padding: 10px 14px 0;
}

.kid-header {
  margin-bottom: 8px;
  padding: 4px 14px 0;
}

.kid-header .kid-title {
  padding: 0;
}

.kid-user-switch {
  flex: 0 0 auto;
  gap: 6px;
  overflow-x: auto;
  margin: 0;
  padding: 8px 12px 0;
  scrollbar-width: none;
}

.kid-user-switch::-webkit-scrollbar {
  display: none;
}

.kid-user-switch button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.78);
}

.kid-user-switch button.active {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px var(--user-color), 0 8px 16px rgba(35, 58, 125, 0.12);
}

.panel,
.stat-card,
.list-card,
.task-card,
.reward-card,
.user-card,
.entity-card,
.current-context,
.event-pill,
.kid-task-card {
  border-color: rgba(230, 237, 251, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(35, 58, 125, 0.08);
}

.section-head h2 {
  color: #10215c;
}

.primary {
  background: linear-gradient(135deg, #21bfd2, #6b4cf6 68%, #bd43e5);
  box-shadow: 0 12px 24px rgba(107, 76, 246, 0.24);
}

.ghost {
  color: #3153a3;
  background: #eef8ff;
}

.danger {
  color: #bd174e;
  background: #ffe9f1;
}

.kid-home-hero {
  min-height: 122px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(28, 196, 215, 0.9), rgba(107, 76, 246, 0.48) 52%, rgba(255, 183, 45, 0.76)),
    var(--wash) center / cover;
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(26, 151, 205, 0.22);
}

.kid-home-hero h3,
.kid-home-hero p {
  color: #ffffff;
}

.kid-character-art {
  width: 142px;
  height: 98px;
  border-radius: 20px;
}

.kid-task-card {
  border: 0;
  background: #ffffff;
}

.kid-task-icon.square {
  background: linear-gradient(135deg, #e8f9ff, #fff3c8);
}

.kid-task-status {
  background: linear-gradient(135deg, #5ac84c, #20c6d8);
}

.points-hero .big-icon {
  background: linear-gradient(135deg, #ffcf4d, #ff9c25);
}

.event-hero-card {
  background:
    linear-gradient(180deg, rgba(176, 246, 214, 0.98), rgba(82, 207, 175, 0.92)),
    var(--wash) center / cover;
  border-radius: 24px;
}

@media (max-width: 520px) {
  .content,
  .app-shell.mode-kid .content,
  .mode-admin .content {
    padding: 0;
  }

  .admin-app-stage,
  .phone-stage,
  .admin-mobile-frame,
  .mobile-frame {
    width: 100vw;
  }

  .admin-mobile-frame,
  .mobile-frame {
    height: 100dvh;
    max-height: 100dvh;
    border-width: 0;
    border-radius: 0;
  }

  .frame-logo strong {
    max-width: 150px;
    font-size: 21px;
  }

  .frame-logo small {
    max-width: 150px;
  }

  .frame-characters .avatar,
  .frame-characters .avatar-lg {
    width: 28px;
    height: 28px;
  }

  .frame-sync-tools {
    gap: 4px;
  }

  .server-pill {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .admin-screen-body,
  .kid-screen-body {
    padding-inline: 12px;
  }

  .admin-bottom-tabs,
  .bottom-tabs {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}
