/* Shared contact colors across cards, tables, map popups and chat. */
html[data-theme] .btn.btn-contact-pin{background:#234563!important;color:#fff!important;border:1px solid #426b91!important;box-shadow:none}
html[data-theme] .btn.btn-contact-pin:hover{background:#2d577c!important;color:#fff!important;border-color:#76a6d1!important}
html[data-theme] #viewRoot#viewRoot .btn.btn-contact-pin :is(span,strong,small,svg),html[data-theme] .btn-contact-pin .icon{color:#fff!important}
html[data-theme] .btn-contact-pin:focus-visible{outline:3px solid #a7ceff;outline-offset:3px}
html[data-theme="dark"] .contact-choice-profile{background:#20334c;border-color:#405672}
html[data-theme="dark"] .contact-choice{background:#20334c;color:#eef4ff;border-color:#405672}
html[data-theme="dark"] .contact-choice:hover{background:#294461;border-color:#6c9cd8}
html[data-theme="dark"] .contact-choice strong{color:#eef4ff}html[data-theme="dark"] .contact-choice small{color:#b9cce2}
html[data-theme="dark"] .contact-choice.is-disabled{background:#172638;color:#91a1b6;opacity:.7}
html[data-theme="dark"] .contact-choice.is-call>.icon:first-child{background:#234b79;color:#b3d7ff}
html[data-theme="dark"] .contact-choice.is-whatsapp>.icon:first-child{background:#194b3d;color:#93e9be}
html[data-theme="dark"] .contact-choice.is-message>.icon:first-child{background:#543143;color:#ffb9c4}
/* Keep button text readable inside the light-red header bands. */
html[data-theme] #viewRoot#viewRoot :is(.page-head,.card-header,.replay-heading,.chat-panel-head) .btn-primary :is(span,strong,small,svg){color:#fff!important}
html[data-theme] #viewRoot#viewRoot :is(.page-head,.card-header,.replay-heading,.chat-panel-head) .btn-secondary :is(span,strong,small,svg){color:#f2f5fb!important}
html[data-theme] #viewRoot#viewRoot :is(.page-head,.card-header) .search-box .icon{color:#bdcde1!important}

html[data-theme] .btn.btn-contact-pin{border-radius:10px;gap:7px;color:#dbedff!important;font-weight:600;transition:background .15s,border-color .15s}
html[data-theme="dark"] .contact-choice-profile{background:#16263a;border-color:#32465e;border-radius:14px}
html[data-theme="dark"] .contact-choice{background:#1b2e44;border-color:#324a65;border-radius:12px;box-shadow:none;min-height:84px}
html[data-theme="dark"] .contact-choice:hover{background:#263e58;transform:none}
html[data-theme="dark"] .contact-choice strong{font-size:13px}html[data-theme="dark"] .contact-choice small{font-size:11px;line-height:1.5}
html[data-theme="dark"] .contact-choice.is-disabled{opacity:.65}
html[data-theme="dark"] .card{box-shadow:0 4px 18px #020b151c}
html[data-theme="dark"] .btn-primary{background:#c84150;border-color:#dc5a67;color:#fff;border-radius:10px;box-shadow:none}
html[data-theme="dark"] .btn-primary:hover{background:#ad3544;border-color:#ed7781}
html[data-theme="dark"] .btn-secondary{background:#21334a!important;border-color:#3b506a!important;border-radius:10px}
html[data-theme="dark"] .btn-danger-soft{background:#3a2836;color:#ffb9c3;border-color:#63404e}
html[data-theme="dark"] .badge-success,html[data-theme="dark"] .badge-active{background:#183c34;color:#9ee0c3;border-color:#316452}
html[data-theme="dark"] .badge-pending{background:#403624;color:#f2d299;border-color:#6a5939}
html[data-theme="dark"] .badge-neutral{background:#29384d;color:#c9d5e5;border-color:#42546d}
html[data-theme] .notification-button{background:#34293b!important;color:#ffa8b4!important;border-color:#624153!important}
html[data-theme] .notification-button .icon{color:#ffa8b4!important}
.family-child-heading{background:#223349;border-top-color:#d96672}.family-child-heading .avatar{border-color:#6383a9}.family-child-info{border-color:#31455e;background:#132338}.family-child-info dt{color:#9bafc8}.family-children-summary strong{background:#394059;color:#f5d6dc}.v28-parent-drivers .entity-main{background:#223349;border-inline-start-color:#d96672}.v28-parent-drivers .eyebrow{color:#c0a6b8}
@media(pointer:coarse){html[data-theme] .parent-contact-actions .btn.btn-contact-pin{min-height:44px;padding:9px 13px;font-size:12px}}
@media(max-width:600px){.contact-choice-grid{grid-template-columns:1fr}.contact-choice{min-height:70px}html[data-theme] #viewRoot#viewRoot .page-head{padding:16px}.contact-choice small{white-space:normal}}

/* Keep every signed-in role on the same readable dark palette.  A few older
   profile, location, history and billing components still carried their
   light-theme surface and muted-text values. */
html[data-theme="dark"]{
  --text-muted:#b8c8db;
  --ink-600:#c3d2e3;
  --ink-800:#e4edf7;
  --gray-500:#b3c3d6;
  --nav-ink:#eef4fb;
}
html[data-theme="dark"] #viewRoot,
html[data-theme="dark"] #modalHost .modal{color:#eef3fb}

html[data-theme="dark"] :is(#viewRoot,#modalHost) :is(.upload-card,.map-picker,.coordinate-entry,.map-controls){
  background:#132238!important;
  border-color:#3b506a!important;
  color:#eef3fb!important;
}
html[data-theme="dark"] :is(#viewRoot,#modalHost) .upload-preview{
  background:#1b2d44!important;
  color:#bed0e4!important;
  box-shadow:inset 0 0 0 1px #405875;
}
html[data-theme="dark"] :is(#viewRoot,#modalHost) .upload-copy strong{color:#f3f7fc!important}
html[data-theme="dark"] :is(#viewRoot,#modalHost) :is(
  .upload-copy span,
  .coordinate-entry label span,
  .map-coords,
  .help-text,
  .v28-pagination,
  .v28-loading,
  .billing-summary small,
  .billing-summary span,
  .billing-student small
){color:#b8c8db!important}

html[data-theme="dark"] :is(#viewRoot,#modalHost) .section-label{color:#eaf2fc!important}
html[data-theme="dark"] :is(#viewRoot,#modalHost) .section-label::after{background:#3b506a!important}
html[data-theme="dark"] :is(#viewRoot,#modalHost) .btn-soft{
  background:#294564!important;
  border-color:#52749a!important;
  color:#dcecff!important;
}
html[data-theme="dark"] :is(#viewRoot,#modalHost) .btn-soft:hover{
  background:#355878!important;
  border-color:#6c91b8!important;
  color:#fff!important;
}
html[data-theme="dark"] :is(#viewRoot,#modalHost) :is(.btn-soft,.btn-soft:hover) :is(span,strong,small,svg){color:inherit!important}

html[data-theme="dark"] #viewRoot .playback-page .form-field>label,
html[data-theme="dark"] #viewRoot :is(.replay-empty,.replay-tools small,.history-driver-self small){color:#b8c8db!important}
html[data-theme="dark"] #viewRoot .replay-tools{
  background:#132238!important;
  border-color:#3b506a!important;
}
html[data-theme="dark"] #viewRoot .geofence-radius-visual{
  background:#173e36!important;
  border-color:#49cfa4!important;
  color:#69e1bb!important;
}
html[data-theme="dark"] #viewRoot .geofence-radius-visual.is-school{
  background:#21334a!important;
  border-color:#6f8fb4!important;
  color:#dce9f7!important;
}
html[data-theme="dark"] #viewRoot .st-zone-pagination{color:#b8c8db!important}
html[data-theme="dark"] :is(#viewRoot,#modalHost) .required{color:#ff8c97!important}

/* Directory and message dialogs were authored as light cards.  Keep their
   complete surface/text pair dark so names, grades and schools stay legible. */
html[data-theme="dark"] #modalHost :is(
  .v28-family-student,
  .message-recipient,
  .message-review-recipients span,
  .message-preview
){
  background:#1b2d44!important;
  border-color:#405875!important;
  color:#eef3fb!important;
}
html[data-theme="dark"] #modalHost .v28-family-student :is(strong,.v28-family-school strong){color:#f4f7fc!important}
html[data-theme="dark"] #modalHost .v28-family-student :is(.table-entity span,.v28-family-school span){color:#bed0e4!important}
html[data-theme="dark"] #modalHost .v28-family-student .avatar{
  background:#314760!important;
  border-color:#607b9c!important;
  color:#fff!important;
}
html[data-theme="dark"] #modalHost :is(.v28-family-summary span,.v28-family-note,.v28-family-empty,.message-recipient small){color:#bed0e4!important}
html[data-theme="dark"] #modalHost .v28-family-search input{
  background:#101d30!important;
  border-color:#405875!important;
  color:#f1f5fb!important;
}
html[data-theme="dark"] #modalHost .v28-family-search input::placeholder{color:#9fb4cc!important}
html[data-theme="dark"] #modalHost .v28-rating-stars input:checked+span{
  background:#443820!important;
  border-color:#d9a833!important;
  color:#ffe19a!important;
}

/* Red remains the shared action color, with enough contrast for white labels. */
html[data-theme="dark"] :is(#viewRoot,#modalHost) .btn-primary{
  background:#bd3042!important;
  border-color:#da5261!important;
  color:#fff!important;
}
html[data-theme="dark"] :is(#viewRoot,#modalHost) .btn-primary:hover{
  background:#a62638!important;
  border-color:#ed7781!important;
}
