/* Make Disciples public release 1.0 — Custom Theme visit-dialog isolation
   Removes the remaining Black & Gold visit-form styling from all five
   Custom Theme Studio palettes while preserving the selected component styles. */

/* Dialog frame and dividers use the active Studio palette. */
body.custom-theme .dialog{
  background:var(--custom-card)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  border-radius:var(--custom-radius-card)!important;
  box-shadow:var(--custom-shadow)!important;
}
body.custom-theme .dialog::before,
body.custom-theme .dialog::after{display:none!important}
body.custom-theme .dialog-head{border-bottom-color:var(--custom-line)!important}
body.custom-theme .dialog-head h3{color:var(--custom-text)!important;text-shadow:none!important}
body.custom-theme .dialog-body{color:var(--custom-muted)!important}
body.custom-theme .dialog-actions{border-top-color:var(--custom-line)!important}
body.custom-theme .dialog-close{
  background:var(--custom-card)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  box-shadow:none!important;
  text-shadow:none!important;
}

/* The three large Visit date / Publication shared / Next follow-up panels. */
body.custom-theme .visit-log-section{
  background:var(--custom-card)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  border-radius:var(--custom-radius-card)!important;
  box-shadow:var(--custom-shadow)!important;
}
body.custom-theme .visit-log-section::before,
body.custom-theme .visit-log-section::after{display:none!important}
body.custom-theme .visit-log-section>h4,
body.custom-theme .visit-log-section :is(.log-schedule-once,.log-schedule-weekly,.log-schedule-time)>h4{
  color:var(--custom-text)!important;
  text-shadow:none!important;
}
body.custom-theme .visit-section-note,
body.custom-theme .visit-toolbox-link>span{
  color:var(--custom-muted)!important;
  opacity:1!important;
}

/* Card-style choice also applies inside the visit form. */
body.custom-theme[data-card-style="soft"] .visit-log-section{
  background:linear-gradient(145deg,color-mix(in srgb,var(--custom-card) 96%,#fff),color-mix(in srgb,var(--custom-card) 90%,var(--custom-primary)))!important;
}
body.custom-theme[data-card-style="structured"] .visit-log-section{
  background:var(--custom-card)!important;
  border-width:1px!important;
}
body.custom-theme[data-card-style="minimal"] .visit-log-section{
  background:color-mix(in srgb,var(--custom-card) 80%,transparent)!important;
  border-color:color-mix(in srgb,var(--custom-text) 18%,transparent)!important;
  box-shadow:none!important;
}
body.custom-theme[data-card-style="ornate"] .visit-log-section{
  background:linear-gradient(145deg,var(--custom-card),color-mix(in srgb,var(--custom-card) 84%,var(--custom-metal)))!important;
  border:3px double var(--custom-metal)!important;
}
body.custom-theme[data-card-style="tech"] .visit-log-section{
  background:linear-gradient(180deg,color-mix(in srgb,var(--custom-card) 94%,#fff),var(--custom-card))!important;
  border-color:color-mix(in srgb,var(--custom-primary) 68%,transparent)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--custom-primary) 18%,transparent),var(--custom-shadow)!important;
}

/* Publication picker and its nested choices. */
body.custom-theme .visit-resource-dropdown{
  background:var(--custom-card-2)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  border-radius:var(--custom-radius-control)!important;
  box-shadow:none!important;
}
body.custom-theme .visit-resource-dropdown::before,
body.custom-theme .visit-resource-dropdown::after{display:none!important}
body.custom-theme .visit-resource-dropdown>summary{
  background:var(--custom-card)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  text-shadow:none!important;
}
body.custom-theme .visit-resource-dropdown[open]>summary{
  background:color-mix(in srgb,var(--custom-primary) 10%,var(--custom-card))!important;
  border-bottom-color:var(--custom-line)!important;
}
body.custom-theme .visit-resource-dropdown>summary svg{
  color:var(--custom-primary)!important;
  stroke:currentColor!important;
}
body.custom-theme .visit-resource-menu{background:var(--custom-card-2)!important}
body.custom-theme .visit-resource-choice{
  background:var(--custom-card)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  border-radius:var(--custom-radius-control)!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
body.custom-theme .visit-resource-choice strong{color:var(--custom-text)!important;text-shadow:none!important}
body.custom-theme .visit-resource-choice span{color:var(--custom-muted)!important}
body.custom-theme .visit-resource-choice.active{
  background:var(--custom-primary)!important;
  color:var(--custom-on-primary)!important;
  border-color:var(--custom-primary)!important;
}
body.custom-theme .visit-resource-choice.active strong,
body.custom-theme .visit-resource-choice.active span{color:var(--custom-on-primary)!important}
body.custom-theme .visit-resource-empty{
  background:var(--custom-card)!important;
  color:var(--custom-muted)!important;
  border-color:var(--custom-line)!important;
}
body.custom-theme .visit-resource-empty strong{color:var(--custom-text)!important}

/* Inputs and native date/time controls. */
body.custom-theme .visit-form :is(.form-control,.native-picker-field){
  background:var(--custom-card)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  border-radius:var(--custom-radius-control)!important;
  box-shadow:none!important;
}
body.custom-theme .visit-form .form-control::placeholder{color:var(--custom-muted)!important;opacity:.78!important}
body.custom-theme .visit-form .native-picker-icon{color:var(--custom-secondary)!important}
body.custom-theme .visit-form .native-picker-label{color:var(--custom-text)!important}

/* Visit choices and dialog actions: remove the hard-coded black/gold treatment. */
body.custom-theme :is(
  .visit-log-section .picker-choice,
  .visit-log-section .visit-choice,
  .visit-toolbox-link .action,
  .dialog-actions .action
){
  background:var(--custom-card)!important;
  color:var(--custom-text)!important;
  border-color:var(--custom-line)!important;
  border-radius:var(--custom-radius-control)!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
body.custom-theme :is(
  .visit-log-section .picker-choice,
  .visit-log-section .visit-choice,
  .visit-toolbox-link .action,
  .dialog-actions .action
)::before,
body.custom-theme :is(
  .visit-log-section .picker-choice,
  .visit-log-section .visit-choice,
  .visit-toolbox-link .action,
  .dialog-actions .action
)::after{display:none!important}

/* Preserve each selected Custom Theme Studio button treatment. */
body.custom-theme[data-button-style="soft"] :is(
  .visit-log-section .picker-choice:not(.active),
  .visit-log-section .visit-choice:not(.active),
  .visit-toolbox-link .action:not(.primary),
  .dialog-actions .action:not(.primary):not(.danger)
){
  background:linear-gradient(145deg,color-mix(in srgb,var(--custom-card) 96%,#fff),color-mix(in srgb,var(--custom-card) 88%,var(--custom-primary)))!important;
  box-shadow:0 7px 18px color-mix(in srgb,var(--custom-text) 10%,transparent)!important;
}
body.custom-theme[data-button-style="raised"] :is(
  .visit-log-section .picker-choice:not(.active),
  .visit-log-section .visit-choice:not(.active),
  .visit-toolbox-link .action:not(.primary),
  .dialog-actions .action:not(.primary):not(.danger)
){
  background:var(--custom-card)!important;
  box-shadow:0 4px 0 color-mix(in srgb,var(--custom-secondary) 55%,transparent),0 9px 17px color-mix(in srgb,var(--custom-text) 10%,transparent)!important;
}
body.custom-theme[data-button-style="embellished"] :is(
  .visit-log-section .picker-choice:not(.active),
  .visit-log-section .visit-choice:not(.active),
  .visit-toolbox-link .action:not(.primary),
  .dialog-actions .action:not(.primary):not(.danger)
){
  border:3px double var(--custom-metal)!important;
  background:linear-gradient(145deg,color-mix(in srgb,var(--custom-primary) 92%,#fff),color-mix(in srgb,var(--custom-primary) 72%,#000))!important;
  color:var(--custom-on-primary)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--custom-metal) 40%,transparent),0 8px 18px color-mix(in srgb,var(--custom-text) 16%,transparent)!important;
}
body.custom-theme[data-button-style="minimal"] :is(
  .visit-log-section .picker-choice:not(.active),
  .visit-log-section .visit-choice:not(.active),
  .visit-toolbox-link .action:not(.primary),
  .dialog-actions .action:not(.primary):not(.danger)
){
  background:transparent!important;
  border-color:color-mix(in srgb,var(--custom-text) 36%,transparent)!important;
  box-shadow:none!important;
}
body.custom-theme[data-button-style="tech"] :is(
  .visit-log-section .picker-choice:not(.active),
  .visit-log-section .visit-choice:not(.active),
  .visit-toolbox-link .action:not(.primary),
  .dialog-actions .action:not(.primary):not(.danger)
){
  background:var(--custom-card)!important;
  border-radius:min(var(--custom-radius-control),8px)!important;
  border-color:color-mix(in srgb,var(--custom-primary) 68%,transparent)!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--custom-primary) 18%,transparent),0 0 15px color-mix(in srgb,var(--custom-primary) 20%,transparent)!important;
}
body.custom-theme[data-button-style="classic"] :is(
  .visit-log-section .picker-choice:not(.active),
  .visit-log-section .visit-choice:not(.active),
  .visit-toolbox-link .action:not(.primary),
  .dialog-actions .action:not(.primary):not(.danger)
){
  background:var(--custom-card)!important;
  font-family:Georgia,"Times New Roman",serif!important;
  border-color:color-mix(in srgb,var(--custom-secondary) 38%,transparent)!important;
  box-shadow:0 3px 8px color-mix(in srgb,var(--custom-text) 10%,transparent)!important;
}

/* Selected choices and Save use the palette's primary color, not old gold. */
body.custom-theme :is(
  .visit-log-section .picker-choice.active,
  .visit-log-section .visit-choice.active,
  .dialog-actions .action.primary
){
  background:var(--custom-primary)!important;
  color:var(--custom-on-primary)!important;
  border-color:var(--custom-primary)!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
body.custom-theme :is(
  .visit-log-section .picker-choice.active,
  .visit-log-section .visit-choice.active,
  .dialog-actions .action.primary
) svg{color:currentColor!important;stroke:currentColor!important}

/* The Toolbox link remains a secondary action in the active palette. */
body.custom-theme .visit-toolbox-link .action svg{
  color:var(--custom-primary)!important;
  stroke:currentColor!important;
}
body.custom-theme .dialog-actions .action.primary svg{
  color:var(--custom-on-primary)!important;
  stroke:currentColor!important;
}
