/* Parent Remote Stylesheet */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

/* Header */
.topbar {
  background: #0f172a;
  color: #f8fafc;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-size: 2rem;
  line-height: 1;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.brand-sub {
  margin: 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tablet-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
}

.tablet-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
}

.tablet-badge.online {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.tablet-badge.online .dot {
  background: #22c55e;
}

.btn-outline {
  color: #f8fafc;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.room-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  font-size: 0.85rem;
}

.room-pill strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.room-switch-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.room-switch-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Join Room Screen */
.join-screen {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.join-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 32px 26px;
  max-width: 430px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.join-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 10px;
}

.join-card h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 900;
}

.join-sub {
  margin: 0 0 20px;
  font-size: 0.92rem;
  color: #475569;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.join-code-input {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.75rem !important;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px !important;
}

.join-error {
  margin: 10px 0 0;
  color: #dc2626;
  font-size: 0.86rem;
  font-weight: 700;
}

.join-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.join-or::before,
.join-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.08em;
  color: #0f172a;
}

/* Multi-Kid Family Switcher Bar */
.family-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.family-bar-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.family-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.kid-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.kid-tab:hover {
  border-color: #93c5fd;
}

.kid-tab.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.kid-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.kid-tab.online .kid-tab-dot {
  background: #22c55e;
}

.kid-tab-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.kid-tab-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.kid-tab-name {
  font-size: 0.86rem;
  font-weight: 800;
}

.kid-tab-time {
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #475569;
}

.kid-tab.running .kid-tab-time {
  color: #16a34a;
}

.kid-tab.finished .kid-tab-time {
  color: #dc2626;
}

.kid-tab-remove {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
  line-height: 1;
}

.kid-tab-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.family-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.all-kids-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid #e2e8f0;
}

.family-action-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}

.family-action-btn:hover {
  background: #f1f5f9;
}

.family-action-btn.add-btn {
  border-style: dashed;
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.family-action-btn.share-btn {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.announce-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 26px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.modal-card h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 900;
}

.modal-footer-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.modal-footer-btns .btn {
  flex: 1;
}

.share-qr-box {
  width: 180px;
  height: 180px;
  margin: 10px auto 0;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-qr-box svg {
  width: 100%;
  height: 100%;
}

/* Dashboard Layout */
.dashboard {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 860px) {
  .dashboard {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

.col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
}

.card-title {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 800;
}

.card-sub {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: #64748b;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

/* Live Mirror */
.mirror-card {
  background: linear-gradient(155deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border-color: #1e293b;
}

.mirror-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mirror-activity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mirror-emoji {
  font-size: 1.8rem;
}

.mirror-label {
  font-size: 1.25rem;
  font-weight: 800;
}

.status-pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #334155;
  color: #cbd5e1;
}

.status-pill.status-running {
  background: #16a34a;
  color: #ffffff;
}

.status-pill.status-paused {
  background: #d97706;
  color: #ffffff;
}

.status-pill.status-finished {
  background: #dc2626;
  color: #ffffff;
}

.mirror-time {
  text-align: center;
  font-size: clamp(3.2rem, 8vw, 4.6rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  margin: 12px 0;
  line-height: 1;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #22c55e;
  transition: width 0.25s linear, background-color 0.4s ease;
}

.transport-primary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.transport-primary .btn-primary {
  flex: 1.5;
}

.nudge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #94a3b8;
  margin-right: 4px;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-lg {
  padding: 13px 18px;
  font-size: 1rem;
}

.btn-primary {
  background: #22c55e;
  color: #ffffff;
}

.btn-primary.is-running {
  background: #f59e0b;
}

.btn-secondary {
  background: #334155;
  color: #ffffff;
}

.btn-accent {
  background: #38bdf8;
  color: #0f172a;
}

.btn-outline-dark {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
}

.btn-chip {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 7px 12px;
  font-size: 0.86rem;
  border-radius: 9px;
}

.card:not(.mirror-card) .btn-chip {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

/* Theme Grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  color: #0f172a;
}

.theme-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.theme-preview {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 2px;
}

.preview-pie { background: #fef3c7; }
.preview-rocket { background: #1e1b4b; }
.preview-rainbow { background: #bae6fd; }
.preview-ocean { background: #0369a1; }
.preview-ring { background: #0f172a; }

.theme-name {
  font-size: 0.86rem;
  font-weight: 800;
}

.theme-desc {
  font-size: 0.72rem;
  color: #64748b;
}

/* Presets Grid */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  color: #0f172a;
}

.preset-card:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
}

.preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.preset-emoji {
  font-size: 1.6rem;
}

.preset-del {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.preset-del:hover {
  background: #fee2e2;
  color: #dc2626;
}

.preset-name {
  font-size: 0.94rem;
  font-weight: 800;
}

.preset-meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

/* Custom Form */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.emoji-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field.grow {
  flex: 1;
}

.field.num-field {
  width: 76px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

input[type="text"], input[type="number"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.96rem;
  font-family: inherit;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: #2563eb;
}

.quick-mins {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

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

/* Intercom & Child Name */
.kid-name-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.section-divider {
  border-top: 1px solid #e2e8f0;
  margin: 0 0 12px;
}

.announce-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phrase-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.phrase-chip:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
}

/* Settings Toggles */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.toggle-row strong {
  display: block;
  font-size: 0.92rem;
}

.toggle-row small {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
}

.toggle-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #2563eb;
  flex-shrink: 0;
  cursor: pointer;
}

.milestones-block {
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
}

.milestones-block .row-label {
  display: block;
  color: #475569;
  margin-bottom: 8px;
}

.milestone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.milestone-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.milestone-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* Connect Card */
.connect-body {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.qr-box {
  width: 156px;
  height: 156px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 6px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qr-box svg {
  width: 100%;
  height: 100%;
}

.connect-details {
  flex: 1;
  min-width: 200px;
}

.url-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.url-copy-row code {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}

.connect-tip {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 100;
}
