/* TimePromise parent H5 — Kids visual skin
   Load after ../styles.css and scope it to <body class="kids-theme">.
   Business controls and DOM structure remain owned by app.js.
*/
.kids-theme {
  --bg: #fbf7f9;
  --card: #ffffff;
  --ink: #3f2d37;
  --muted: #8b7481;
  --line: #eee3e9;
  --pink: #d96487;
  --pink-soft: #fdf0f4;
  --violet: #9c86d6;
  --mint: #4fa88b;
  --orange: #e0a154;
  --danger: #c94f63;
  --shadow: 0 1px 2px rgba(63, 45, 55, 0.04);
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.kids-theme {
  color: var(--ink);
  background: linear-gradient(180deg, #fff8fb 0, #fbf7f9 260px, #fbf7f9 100%);
  font-size: 14px;
  line-height: 1.5;
}

.kids-theme .card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.kids-theme .card.hero,
.kids-theme .family-hero {
  background: linear-gradient(135deg, #fff7fa 0%, #fcfaff 100%);
  border-color: #f3e6ec;
}

.kids-theme h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.kids-theme h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.kids-theme h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.kids-theme .family-hero h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.kids-theme .kids-hero-metrics {
  display: flex;
  align-items: flex-end;
  gap: clamp(10px, 3vw, 28px);
  flex-wrap: nowrap;
}

.kids-theme .kids-hero-metric {
  flex: 1 1 0;
  min-width: 0;
}

.kids-theme .kids-hero-metric .sub {
  margin: 0 0 2px;
  white-space: nowrap;
}

.kids-theme .kids-hero-metric h2 {
  margin: 0;
  white-space: nowrap;
  font-size: clamp(20px, 5.4vw, 30px);
}

.kids-theme .kids-hero-metrics + .family-stats {
  margin-top: 10px;
}

.kids-theme .state-time {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.kids-theme .sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.kids-theme .brand-name {
  font-weight: 700;
}

.kids-theme .device .name {
  font-size: 14px;
  font-weight: 600;
}

.kids-theme .device .meta {
  display: flex;
  flex-wrap: wrap;
  font-size: 10.5px;
  font-weight: 400;
}

.kids-theme .device .meta span + span::before {
  content: " · ";
}

.kids-theme .bar-value {
  font-weight: 600;
}

.kids-theme .wheel-item.active {
  font-weight: 700;
}

.kids-theme main {
  gap: 10px;
}

.kids-theme .card {
  padding: 14px 16px;
}

.kids-theme .stack {
  gap: 10px;
}

.kids-theme .device-list {
  gap: 8px;
}

.kids-theme .actions {
  gap: 6px;
}

.kids-theme input,
.kids-theme select,
.kids-theme textarea {
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.kids-theme input:focus,
.kids-theme select:focus,
.kids-theme textarea:focus {
  border-color: rgba(226, 128, 169, 0.72);
  box-shadow: 0 0 0 3px rgba(244, 127, 164, 0.12);
}

.kids-theme select {
  -webkit-appearance: none;
  appearance: none;
  height: 46px;
  padding: 0 42px 0 14px;
  border: 1px solid #e9dce4;
  border-radius: 12px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b7481' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  box-shadow: 0 1px 2px rgba(63, 45, 55, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kids-theme select.device-select {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b7481' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b99fae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2.5' width='14' height='19' rx='2.6'/%3E%3Cpath d='M10.5 18.5h3'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: right 14px center, left 14px center;
  background-size: 14px 14px, 16px 16px;
}

.kids-theme select:hover {
  border-color: #ddc7d3;
}

.kids-theme select:focus {
  border-color: #e39ab3;
  box-shadow: 0 0 0 3px rgba(217, 100, 135, 0.1);
}

.kids-theme select option {
  color: var(--ink);
  background: #fff;
}

/* Custom select: native option lists cannot be styled, so the parent console
   uses a styled listbox for devices and app limits. */
.kids-theme .tp-select {
  position: relative;
  min-width: 0;
}

.kids-theme .tp-select-trigger {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px 0 14px;
  border: 1px solid #eadde4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #fdfafc);
  box-shadow: 0 1px 2px rgba(63, 45, 55, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.kids-theme .tp-select-trigger:hover {
  border-color: #ddc7d3;
  background: #fff;
}

.kids-theme .tp-select-trigger:focus-visible,
.kids-theme .tp-select.open .tp-select-trigger {
  border-color: #e39ab3;
  box-shadow: 0 0 0 3px rgba(217, 100, 135, 0.1);
  outline: none;
}

.kids-theme .tp-select-trigger[disabled] {
  opacity: 0.62;
  cursor: default;
}

.kids-theme .tp-select-selected {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.kids-theme .tp-select-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kids-theme .tp-select-label.placeholder {
  color: var(--muted);
  font-weight: 500;
}

.kids-theme .tp-select-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b99fae;
}

.kids-theme .tp-select-icon svg {
  width: 18px;
  height: 18px;
}

.kids-theme .tp-select-icon .app-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
  font-size: 11px;
}

.kids-theme .tp-select-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: #8b7481;
  transition: transform 0.18s ease;
}

.kids-theme .tp-select.open .tp-select-chevron {
  transform: rotate(180deg);
}

.kids-theme .tp-select-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  padding: 6px;
  border: 1px solid #f0e3ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(63, 45, 55, 0.16), 0 2px 8px rgba(63, 45, 55, 0.06);
  max-height: 296px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #e9d6df transparent;
  animation: tp-menu-in 0.16s ease;
}

.kids-theme .tp-select-menu::-webkit-scrollbar {
  width: 6px;
}

.kids-theme .tp-select-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #e9d6df;
}

.kids-theme .tp-select.open .tp-select-menu {
  display: block;
}

.kids-theme .tp-select.drop-up .tp-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
  animation-name: tp-menu-in-up;
}

.kids-theme .tp-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.kids-theme .tp-select-option + .tp-select-option {
  margin-top: 1px;
}

.kids-theme .tp-select-option:hover,
.kids-theme .tp-select-option:focus-visible {
  background: #fdf2f7;
  outline: none;
}

.kids-theme .tp-select-option.is-selected {
  background: linear-gradient(135deg, #fdeef4, #fbf3fc);
  color: #b23f6b;
}

.kids-theme .tp-select-option.is-selected:hover {
  background: linear-gradient(135deg, #fce7f0, #f9eefb);
}

.kids-theme .tp-select-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kids-theme .tp-select-option-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kids-theme .tp-select-option-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #9b8792;
  font-size: 11px;
  font-weight: 500;
}

.kids-theme .tp-select-check {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: none;
  color: #d96487;
}

.kids-theme .tp-select-check svg {
  width: 16px;
  height: 16px;
}

.kids-theme .tp-select-option.is-selected .tp-select-check {
  display: flex;
}

.kids-theme .tp-status {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #d8ccd3;
}

.kids-theme .tp-status.online {
  background: #4bbf8a;
  box-shadow: 0 0 0 2px rgba(75, 191, 138, 0.16);
}

.kids-theme .limit-add .tp-select,
.kids-theme .limit-add .device-picker {
  flex: 1;
  min-width: 0;
}

.kids-theme .app-select .tp-select-trigger {
  height: 44px;
}

.kids-theme .pin-modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kids-theme .pin-modal input {
  height: 48px;
  border-radius: 12px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.34em;
}

@keyframes tp-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tp-menu-in-up {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.kids-theme button:not(.secondary):not(.ghost):not(.danger):not(.danger-outline):not(.tab-btn):not(.seg-btn):not(.password-eye):not(.mic-btn):not(.voice-bubble):not(.device-pill):not(.rec-cancel):not(.back):not(.time-pill):not(.install-link):not(.message-device):not(.tp-select-trigger):not(.tp-select-option):not(.tp-select-check):not([data-cmd="add_time"]):not(.account-chip):not(.account-menu-item):not(.device-tab) {
  border-radius: 12px;
  background: var(--pink);
  color: #fff;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.kids-theme button.secondary,
.kids-theme button.ghost {
  border-radius: 12px;
  color: #5f4652;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
}

.kids-theme button.danger {
  border-radius: 12px;
  background: var(--danger);
  color: #fff;
}

.kids-theme button.danger-outline {
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ecc3cc;
  color: var(--danger);
}

.kids-theme .actions button {
  min-height: 40px;
  padding: 9px 8px;
  font-size: 12.5px;
}

.kids-theme .actions [data-cmd="add_time"] {
  border-radius: 10px;
  background: #fdf1f5;
  border: 1px solid #f3cfda;
  color: #b24a6c;
  font-weight: 600;
  box-shadow: none;
}

.kids-theme .tabbar {
  border-color: var(--line);
  border-radius: 12px;
  background: #f7eff3;
  backdrop-filter: none;
}

.kids-theme .tab-btn {
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.kids-theme .tab-btn.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(63, 45, 55, 0.08);
}

.kids-theme .segmented {
  background: #f7eff3;
  border-color: var(--line);
  border-radius: 12px;
}

.kids-theme .seg-btn {
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.kids-theme .seg-btn.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(63, 45, 55, 0.08);
}

.kids-theme .seg-btn:hover {
  color: var(--ink);
}

.kids-theme .message-device {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.kids-theme .message-device-text strong {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.kids-theme .message-device-text small,
.kids-theme .message-device .chevron {
  color: var(--muted);
}

.kids-theme .device-pill {
  background: #fff;
  border: 1px solid var(--line);
  color: #6b5260;
  font-weight: 600;
}

.kids-theme .device-pill.active {
  background: #4a3541;
  border-color: #4a3541;
  color: #fff;
}

.kids-theme .chip {
  border-color: var(--line);
  background: #fff;
  font-weight: 600;
}

.kids-theme .chip.ok {
  color: #2f846c;
  background: #eef7f3;
  border-color: #d9ece4;
}

.kids-theme .chip.off {
  color: #b24a5f;
  background: #fdf0f3;
  border-color: #f3dbe1;
}

.kids-art {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.kids-hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.kids-hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.kids-hero-art {
  flex: 0 0 auto;
  width: clamp(112px, 34vw, 190px);
  max-height: 150px;
}

.kids-inline-art {
  flex: 0 0 auto;
  width: 76px;
  max-height: 82px;
}

.kids-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
}

.kids-empty-art {
  width: min(190px, 55vw);
  max-height: 180px;
  margin: 0 auto 4px;
}

.kids-report-head,
.kids-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kids-footer-art {
  display: block;
  width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

.kids-theme .install-link {
  padding: 4px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #b94a6b;
  font-size: 11px;
  font-weight: 700;
}

.kids-theme .topbar #install-top {
  padding: 6px 12px;
  border-radius: 999px;
  background: #ffe3ed;
  color: #a83f60;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
}

.kids-theme .family-hero {
  overflow: hidden;
}

@media (max-width: 430px) {
  .kids-hero-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .kids-hero-art {
    align-self: flex-end;
    width: 96px;
    max-height: 108px;
  }
}

@media (max-width: 380px) {
  .kids-hero-art {
    width: 88px;
    max-height: 100px;
  }
  .kids-theme .card {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kids-theme *,
  .kids-theme *::before,
  .kids-theme *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Parent-console specifics. app.js adds these classes around the existing
   markup; every rule stays scoped to body.kids-theme.
   --------------------------------------------------------------------------- */

.kids-theme .kids-hero-layout {
  position: relative;
}

.kids-theme .back {
  width: auto;
  padding: 0 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  justify-self: start;
}

.kids-theme .device-tabs {
  margin-top: 2px;
}

.kids-theme .time-pill {
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.kids-theme .time-pill .time-value {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kids-theme .time-pill .time-hint {
  color: var(--muted);
  font-size: 10px;
}

.kids-theme .device .numbers b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kids-theme .battery {
  color: #2f846c;
  font-variant-numeric: tabular-nums;
}

.kids-theme .battery.low {
  color: #c94f63;
}

.kids-theme .battery > span:not(.bolt-slot) {
  min-width: 29px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kids-theme .bolt-slot {
  display: inline-flex;
  width: 11px;
  justify-content: center;
}

.kids-theme .kids-family-hero {
  display: block;
}

.kids-theme .kids-family-hero .kids-hero-copy {
  min-width: 0;
}

.kids-theme .kids-sticker {
  position: absolute;
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
}

.kids-theme .kids-sticker-star {
  top: 10px;
  right: 14px;
  width: 26px;
  height: 26px;
  opacity: 0.85;
}

.kids-theme .kids-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: fit-content;
  gap: 8px;
  margin-top: 6px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 11px;
}

.kids-theme .kids-state-art {
  width: 52px;
  height: 46px;
}

.kids-theme .kids-empty-state .kids-empty-art {
  max-height: 150px;
}

.kids-theme .chat-card .kids-empty-art {
  max-height: 120px;
}

.kids-theme .chat-card {
  padding: 0;
  overflow: hidden;
}

.kids-theme .chat-head {
  padding: 15px 18px 12px;
  background: linear-gradient(180deg, #fff9fb, #fffdfd);
}

.kids-theme .kids-rule-head {
  align-items: stretch;
}

.kids-theme .kids-rule-head .switch-row {
  padding-right: 6px;
}

.kids-theme .kids-rule-head .kids-inline-art {
  width: 62px;
  max-height: 66px;
  align-self: center;
}

.kids-theme .kids-report-head .kids-inline-art {
  width: 58px;
  max-height: 62px;
}

.kids-theme .brand-mark {
  border-radius: 11px;
}

.kids-theme .foot {
  margin-top: 4px;
}

.kids-theme .pair-row .pair-input {
  flex: 1 1 120px;
  min-width: 0;
}

@media (max-width: 380px) {
  .kids-theme .kids-sticker {
    width: 22px;
    height: 22px;
  }
  .kids-theme .kids-state-badge {
    font-size: 10px;
  }
  .kids-theme .kids-state-art {
    width: 38px;
    height: 36px;
  }
  .kids-theme .kids-family-hero .kids-hero-art {
    width: 96px;
  }
  .kids-theme .kids-family-hero h2 {
    font-size: 23px;
  }
  .kids-theme .time-pill .time-hint {
    display: none;
  }
  .kids-theme .pair-row {
    flex-wrap: wrap;
  }
  .kids-theme .pair-row .pair-input {
    flex: 1 1 100%;
  }
  .kids-theme .device-model {
    display: none;
  }
}
