/* 2026-10-13: Service editor — keep all fields and three options in one row
   when there is sufficient content width. Unlike the old fixed desktop grid,
   the two groups wrap together rather than overlapping each other. */
@media (min-width: 621px) {
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-grid {
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:wrap!important;
    align-items:flex-end!important;
    justify-content:flex-start!important;
    gap:10px!important;
    grid-template-areas:none!important;
    grid-template-columns:none!important;
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }

  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-fields {
    display:grid!important;
    flex:1 1 445px!important;
    grid-area:auto!important;
    grid-template-columns:minmax(118px,2.1fr) minmax(82px,.85fr) minmax(82px,.9fr) 76px!important;
    grid-template-areas:"name duration price color"!important;
    grid-template-rows:minmax(0,auto)!important;
    align-items:end!important;
    align-content:end!important;
    gap:8px!important;
    margin:0!important;
    padding:0!important;
    min-width:0!important;
    width:auto!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-fields > .form-field {
    grid-column:auto!important;
    grid-row:auto!important;
    position:static!important;
    min-width:0!important;
    max-width:100%!important;
    width:100%!important;
    align-self:end!important;
    box-sizing:border-box!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-name {grid-area:name!important}
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-duration {grid-area:duration!important}
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-price {grid-area:price!important}
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-color {grid-area:color!important}

  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-fields input:not([type="checkbox"]),
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-fields .service-color-control {
    min-width:0!important;
    max-width:100%!important;
    width:100%!important;
    box-sizing:border-box!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-color .service-color-control{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    min-height:42px!important;
    height:42px!important;
    padding:0 3px!important;
    gap:4px!important;
    overflow:hidden!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-color .service-color-input {
    flex:0 0 30px!important;
    width:30px!important;
    min-width:30px!important;
    max-width:30px!important;
    height:30px!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-color .service-color-value {
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:9px!important;
  }

  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options {
    display:grid!important;
    flex:1 1 480px!important;
    grid-area:auto!important;
    grid-template-columns:minmax(79px,.58fr) minmax(190px,1.5fr) minmax(159px,1.15fr)!important;
    grid-template-areas:"active availability online"!important;
    grid-template-rows:minmax(42px,auto)!important;
    align-items:end!important;
    align-content:end!important;
    justify-content:stretch!important;
    gap:8px!important;
    min-width:0!important;
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
    box-sizing:border-box!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options > label {
    position:static!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    flex:initial!important;
    gap:7px!important;
    grid-column:auto!important;
    grid-row:auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:42px!important;
    min-height:42px!important;
    max-height:none!important;
    margin:0!important;
    padding:6px 8px!important;
    border:1px solid #dce6ef!important;
    border-radius:9px!important;
    box-sizing:border-box!important;
    white-space:normal!important;
    overflow:visible!important;
    text-align:left!important;
    font-size:10.5px!important;
    line-height:1.2!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options > .service-edit-active {
    grid-area:active!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options > .service-edit-use-availability {
    grid-area:availability!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options > .service-edit-online {
    grid-area:online!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-use-availability > span {
    display:block!important;
    min-width:0!important;
    width:auto!important;
    line-height:1.3!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-use-availability strong {
    display:block!important;
    font-size:10.5px!important;
    font-weight:650!important;
    line-height:1.3!important;
    overflow-wrap:break-word!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-use-availability small {
    display:none!important; /* The full explanation remains in the label's title tooltip. */
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options input[type="checkbox"] {
    display:block!important;
    flex:0 0 17px!important;
    width:17px!important;
    min-width:17px!important;
    max-width:17px!important;
    height:17px!important;
    min-height:17px!important;
    margin:0!important;
    position:static!important;
  }
}
/* Tablet: keep the input and option groups separated when the page cannot fit
   both. They wrap cleanly, and controls themselves don't overlap. */
@media (min-width:621px) and (max-width:960px){
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-fields{
    flex-basis:100%!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 92px!important;
    grid-template-areas:"name name name" "duration price color"!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options{
    flex-basis:100%!important;
    grid-template-columns:90px minmax(0,1fr) minmax(150px,.9fr)!important;
    grid-template-areas:"active availability online"!important;
  }
}
@media (min-width:621px) and (max-width:760px){
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    grid-template-areas:"active online" "availability availability"!important;
    grid-template-rows:auto auto!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-use-availability small{
    display:block!important;
    font-size:10px!important;
    line-height:1.3!important;
  }
  html body[class] #settings #serviceSettingsCard details.service-manage-row .service-edit-options > .service-edit-use-availability{
    height:auto!important;
    min-height:50px!important;
  }
}

/* Service/therapy drag grip: compact, touch-friendly, no extra row height. */
#serviceSettingsList .service-order-row {
  display:grid;
  grid-template-columns:40px minmax(0,1fr);
  gap:7px;
  align-items:center;
  min-width:0;
}
#serviceSettingsList .service-order-row > details.service-manage-row {
  grid-column:2;
  grid-row:1;
  box-sizing:border-box;
  min-width:0;
  width:100%;
}
#serviceSettingsList .service-drag-handle {
  grid-column:1;
  grid-row:1;
  display:grid;
  place-items:center;
  width:40px;
  height:44px;
  padding:0;
  justify-self:center;
  color:#7b91a3;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  cursor:grab;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
}
#serviceSettingsList .service-drag-handle svg {
  width:22px;
  height:22px;
  fill:currentColor;
  pointer-events:none;
}
#serviceSettingsList .service-drag-handle:hover:not(:disabled),
#serviceSettingsList .service-drag-handle:focus-visible {
  background:#eef5fb;
  color:#3f789f;
  border-color:#d8e6f1;
}
#serviceSettingsList .service-drag-handle:focus-visible {
  outline:2px solid #2f80ed;
  outline-offset:1px;
}
#serviceSettingsList .service-drag-handle:active,
#serviceSettingsList .service-drag-handle[aria-grabbed="true"] {
  cursor:grabbing;
  color:#2f80ed;
  background:#e7f2fc;
}
#serviceSettingsList .service-drag-handle:disabled {opacity:.3;cursor:default}
#serviceSettingsList.service-dragging {user-select:none;-webkit-user-select:none}
#serviceSettingsList .service-drag-placeholder > details.service-manage-row {
  opacity:.26;
  outline:2px dashed #8db8d8;
  outline-offset:-2px;
  border-radius:12px;
  background:#eff7fd;
}
.service-drag-preview {
  position:fixed;
  z-index:2147482900;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  box-sizing:border-box;
  pointer-events:none;
  padding:11px 14px;
  min-height:64px;
  max-height:84px;
  overflow:hidden;
  opacity:.98;
  border:1px solid #9bc5e5;
  border-radius:12px;
  background:#fff;
  box-shadow:0 12px 28px rgba(27,65,97,.18);
}
.service-drag-preview-title {
  display:block;
  font:700 14px/1.25 Inter,system-ui,sans-serif;
  color:#254259;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.service-drag-preview-subtitle {
  display:block;
  font:500 12px/1.35 Inter,system-ui,sans-serif;
  color:#667d90;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.service-drag-preview-subtitle:empty {display:none}
@media (max-width:620px) {
  #serviceSettingsList .service-order-row {
    grid-template-columns:36px minmax(0,1fr);
    gap:5px;
  }
  #serviceSettingsList .service-drag-handle {
    width:36px;
    height:46px;
  }
}

#settings #serviceSettingsCard .service-public-profile-option{
  display:inline-flex;
  max-width:100%;
  min-height:36px;
  margin:8px 0 0;
  white-space:normal;
}

#settings #serviceSettingsCard .service-profile-description {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-weight: 600;
}
#settings #serviceSettingsCard .service-profile-description textarea {
  width: 100%;
  min-height: 66px;
  resize: vertical;
  font-weight: 400;
}

#settings #serviceSettingsCard .service-directory-options .service-profile-description {
  flex: 1 0 100%;
  margin: 0;
}
