:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #64748b;
  --line: #d9e2ea;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --teal: #157c72;
  --teal-soft: #dff5ef;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --orange: #d97706;
  --orange-soft: #fff1d6;
  --green: #16834a;
  --green-soft: #e5f8ed;
  --red: #c24134;
  --red-soft: #fee2de;
  --shadow: 0 14px 38px rgba(24, 33, 43, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(223, 245, 239, 0.85), rgba(245, 247, 250, 0) 360px),
    var(--surface-soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body.android-app-shell .topbar {
  padding-top: 30px;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(217, 226, 234, 0.78);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 248px;
  color: inherit;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
  white-space: nowrap;
}

.tab-button,
.plain-button,
.primary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
  white-space: nowrap;
}

.tab-button {
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
}

.primary-button {
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
}

.plain-button {
  padding: 0 14px;
  background: #eef3f7;
  color: var(--ink);
}

.danger-button {
  padding: 0 14px;
  background: var(--red-soft);
  color: var(--red);
}

.tab-button:hover,
.plain-button:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.product-band {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.login-layout.login-single {
  grid-template-columns: minmax(280px, 480px);
  justify-content: center;
}

.login-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.intro-panel,
.screen-panel,
.feature-panel,
.mission-panel,
.store-panel,
.device-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 188px;
  gap: 22px;
  min-height: 330px;
  padding: 28px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: 46px;
  line-height: 1.04;
}

h2 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1.18;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.lead {
  max-width: 760px;
  color: #415163;
  font-size: 17px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-visual {
  align-self: center;
  display: grid;
  gap: 10px;
}

.child-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: var(--blue-soft);
}

.child-card img {
  width: 100%;
  border-radius: 8px;
}

.child-card strong {
  font-size: 18px;
}

.child-admin-row,
.family-admin-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.family-admin-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-grid {
  margin-top: 10px;
  grid-template-columns: minmax(180px, 240px) auto auto;
  align-items: center;
}

.child-admin-row img {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
}

.quick-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
}

.quick-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-stat strong {
  font-size: 20px;
}

.screen-panel {
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head p,
.muted {
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span {
  display: block;
  min-height: 32px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 31px;
}

.metric em {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 16px;
}

.feature-panel,
.mission-panel,
.store-panel,
.device-panel {
  padding: 20px;
}

.stack {
  display: grid;
  gap: 12px;
}

.compact-stack {
  gap: 8px;
}

.row-item,
.task-row,
.approval-row,
.alert-row,
.reward-row,
.device-row,
.history-row,
.timeline-row {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.row-item {
  color: inherit;
  text-align: left;
}

.task-row {
  grid-template-columns: minmax(0, 1fr) 116px;
  align-items: center;
}

.approval-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: var(--teal);
}

.dot.orange {
  background: var(--orange);
}

.dot.blue {
  background: var(--blue);
}

.dot.red {
  background: var(--red);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3f7;
  color: #415163;
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  background: var(--green-soft);
  color: var(--green);
}

.pill.warn {
  background: var(--orange-soft);
  color: #9a5a0a;
}

.pill.bad {
  background: var(--red-soft);
  color: var(--red);
}

.pill.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.progress-shell {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf2;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #7bbf68);
}

.kid-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.kid-hero img {
  width: 128px;
  height: 128px;
  border-radius: 8px;
  object-fit: cover;
}

.selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.child-select {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: #eef3f7;
  color: var(--ink);
  font-weight: 800;
}

.child-select.active {
  background: var(--teal);
  color: #fff;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reward-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reward-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  object-fit: cover;
}

.reward-card .primary-button {
  width: 100%;
}

.reward-actions {
  display: grid;
  gap: 8px;
}

.reward-actions .primary-button,
.reward-actions .danger-button {
  width: 100%;
}

.reward-manage-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
}

.device-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 16px;
  margin-top: 18px;
}

.safety-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-top: 18px;
}

.map-board {
  position: relative;
  min-height: 320px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 235, 0.1) 1px, transparent 1px),
    #eef7f5;
  background-size: 42px 42px;
}

.map-shell {
  display: grid;
  gap: 0;
  margin-bottom: 14px;
}

.real-map-board {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #dbe7ef;
}

.stable-map-board {
  min-height: 360px;
}

.map-board.satellite-map {
  cursor: pointer;
  background:
    radial-gradient(circle at 18% 22%, rgba(76, 130, 92, 0.7), transparent 24%),
    radial-gradient(circle at 72% 70%, rgba(52, 99, 70, 0.75), transparent 28%),
    radial-gradient(circle at 48% 42%, rgba(92, 119, 82, 0.58), transparent 34%),
    linear-gradient(135deg, #324a3d, #6f7f6b 42%, #344b55);
}

.map-board::before {
  content: "";
  position: absolute;
  inset: 70px 48px;
  border: 2px dashed rgba(21, 124, 114, 0.55);
  border-radius: 8px;
}

.map-road {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
}

.map-road-main {
  left: -8%;
  right: -8%;
  top: 52%;
  height: 18px;
  transform: rotate(-13deg);
}

.map-road-cross {
  left: 52%;
  top: -12%;
  bottom: -12%;
  width: 14px;
  transform: rotate(18deg);
}

.map-zone {
  position: absolute;
  z-index: 2;
  min-width: 86px;
  padding: 8px 10px;
  border: 1px solid rgba(21, 124, 114, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.map-zone-school {
  left: 58px;
  top: 44px;
}

.map-zone-home {
  right: 54px;
  bottom: 44px;
}

.map-zone-route {
  left: 45%;
  top: 132px;
}

.map-pin {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 2px;
  min-width: 84px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  text-align: left;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.map-pin.active {
  background: #157c72;
  outline: 2px solid rgba(255, 255, 255, 0.85);
}

.map-pin span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.map-pin small {
  color: #e2e8f0;
  font-size: 10px;
  font-weight: 800;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-legend strong {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.map-chip-list,
.app-inline-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.map-chip {
  display: grid;
  gap: 2px;
  min-width: 110px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.map-chip.active {
  border-color: #157c72;
  background: #eefbf8;
}

.map-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.location-accordion-list {
  display: grid;
  gap: 10px;
}

.location-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.app-accordion {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.app-summary-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.app-summary {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.app-summary::-webkit-details-marker {
  display: none;
}

.app-detail-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
  border-top: 1px solid #eef3f7;
}

.compact-controls {
  gap: 6px;
}

.compact-meta {
  gap: 6px;
  margin-top: 4px;
}

.compact-switch {
  transform: scale(0.92);
  transform-origin: right center;
}

.activation-step {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.activation-step.is-done {
  border-color: #a8dfbc;
  background: #f4fff8;
}

.activation-step.is-pending {
  border-color: #ead8a5;
  background: #fffdf6;
}

.activation-step-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.activation-step-head h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.activation-step-head p,
.activation-step-help,
.activation-step-path {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.activation-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.activation-step-path strong {
  color: var(--text);
}

.activation-step-actions {
  justify-content: flex-start;
}

.location-row img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.location-summary {
  padding: 10px 12px;
}

.location-summary-grid {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.location-summary-grid img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
}

.location-summary-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.accordion-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.location-history {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.location-history-line {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.emergency-row,
.emergency-child-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #f1b7af;
  border-radius: 8px;
  background: #fff8f7;
}

.sos-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.routine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 18px;
}

.routine-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.routine-list {
  display: grid;
  gap: 12px;
}

.routine-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.routine-row.is-locked {
  border-color: #f1b7af;
  background: #fff8f7;
}

.routine-row.is-open {
  border-color: #a8dfbc;
  background: #f4fff8;
}

.routine-actions,
.app-time-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.routine-actions {
  justify-content: flex-end;
}

.lock-reasons {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.lock-reasons span {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.app-time-controls {
  margin-top: 10px;
}

.routine-form {
  display: grid;
  gap: 12px;
}

.routine-form label {
  display: grid;
  gap: 7px;
}

.routine-form label > span,
.check-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.routine-form input,
.routine-form select,
.routine-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.routine-form input::placeholder,
.routine-form textarea::placeholder {
  color: rgba(100, 116, 139, 0.42);
}

.routine-form input:focus::placeholder,
.routine-form textarea:focus::placeholder {
  color: transparent;
}

.routine-form textarea {
  min-height: 84px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-line {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.quick-routine-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.game-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.game-box strong {
  display: block;
  font-size: 28px;
}

.game-box.is-running {
  border-color: #a8dfbc;
  background: #f4fff8;
}

.device-summary-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.device-summary-box > div:first-child strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.app-usage-list {
  display: grid;
  gap: 12px;
}

.app-usage-row {
  display: grid;
  gap: 8px;
}

.app-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.usage-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.device-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-grid;
  width: 54px;
  height: 30px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
  box-shadow: 0 3px 8px rgba(24, 33, 43, 0.22);
}

.switch input:checked + span {
  background: var(--red);
}

.switch input:checked + span::after {
  transform: translateX(24px);
}

.status-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.status-tile {
  min-height: 112px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.status-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-list .timeline-row {
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
}

.time-chip {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.time-chip small {
  display: block;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.range-control {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.range-control input {
  width: 100%;
  accent-color: var(--teal);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(420px, calc(100% - 40px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 18px;
  border: 1px dashed #b9c5d1;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-tabs {
    width: 100%;
  }

  .product-band,
  .login-layout,
  .intro-panel,
  .dashboard-grid,
  .device-layout,
  .safety-layout,
  .reward-manage-grid,
  .routine-layout {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: center;
  }

  .metrics-grid,
  .status-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reward-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .app-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 16px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 22px;
  }

  .intro-panel,
  .screen-panel,
  .feature-panel,
  .mission-panel,
  .store-panel,
  .device-panel {
    padding: 16px;
  }

  .metrics-grid,
  .status-board,
  .reward-grid,
  .hero-visual {
    grid-template-columns: 1fr;
  }

  .task-row,
  .approval-row,
  .device-row,
  .child-admin-row,
  .family-admin-row,
  .location-row,
  .routine-row,
  .form-grid,
  .schedule-list .timeline-row,
  .kid-hero {
    grid-template-columns: 1fr;
  }

  .routine-actions {
    justify-content: flex-start;
  }

  .kid-hero img {
    width: 104px;
    height: 104px;
  }

  .tab-button {
    padding: 0 12px;
  }
}
