/**
 * Service detail — enterprise marketplace layout.
 *
 * Tokens come from public/css/tokens.css (loaded via enterprise.css). Every value
 * has a literal fallback so the page still renders correctly if this sheet is ever
 * served without the token layer.
 *
 * Class names consumed by public/js/service-detail.js and public/js/buyer-detail.js
 * are load-bearing and must not be renamed:
 *   [data-service-detail] [data-buybox] [data-package-tab] [data-package-panel]
 *   [data-gallery-thumb] .service-gallery-thumb .is-active .package-tab
 *   .service-continue-btn .service-extra-checkbox .service-detail-buybox.is-sticky
 */

/* ---------------------------------------------------------------- page shell */

/* The section used to sit bare inside <main class="site-main">, which has no
   max-width — so the whole page ran edge to edge on every viewport. .container is
   the platform's existing shell (public/css/layout.css); no new width rule here. */
.service-detail-shell {
  padding-block: var(--space-5, 24px) var(--space-7, 48px);
}

.service-detail.buyer-detail {
  padding-block: 0;
}

/* ---------------------------------------------------------------- breadcrumb */

.service-detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2, 8px);
  font-size: var(--font-size-sm, 0.875rem);
  margin-bottom: var(--space-4, 16px);
  color: var(--color-text-muted, #6c6c6c);
}

.service-detail-breadcrumb a {
  color: var(--color-text-muted, #6c6c6c);
  text-decoration: none;
}

.service-detail-breadcrumb a:hover {
  color: var(--color-primary, #8c0605);
  text-decoration: underline;
}

.service-detail-breadcrumb__sep {
  color: #c4c4c4;
}

.service-detail-breadcrumb__current {
  color: var(--color-text, #333);
  font-weight: 500;
  /* Long titles must not push the row into a second line on mobile. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- header */

.service-detail-header {
  margin-bottom: var(--space-5, 24px);
}

.service-detail-title {
  margin: 0 0 var(--space-4, 16px);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-text, #333);
}

.service-detail-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-3, 12px);
}

.service-detail-identity__text {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
}

.avatar-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f2f2;
  flex: 0 0 auto;
}

.service-detail-seller-name {
  font-weight: 600;
  color: var(--color-text, #333);
  text-decoration: none;
}

.service-detail-seller-name:hover {
  color: var(--color-primary, #8c0605);
}

.service-detail-seller-name.is-muted,
.is-muted {
  color: var(--color-text-muted, #6c6c6c);
  font-weight: 500;
}

.service-detail-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border, #d0d0d0);
}

.service-detail-rating,
.service-detail-orders {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text, #333);
}

.service-stars {
  color: #f5a623;
  display: inline-flex;
  gap: 2px;
}

.service-stars--lg {
  font-size: 1.1rem;
}

.service-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}

/* ------------------------------------------------------------------- badges */

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full, 100px);
  background: #f4f4f5;
  color: #52525b;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.service-badge--outline {
  background: transparent;
  border: 1px solid var(--color-border, #d0d0d0);
}

.service-badge--soft {
  background: var(--color-primary-light, #fae6e7);
  color: var(--color-primary, #8c0605);
}

.service-badge--verified {
  background: #e7f6ec;
  color: #1a7f37;
}

.service-badge--ai {
  background: #ede9fe;
  color: #6d28d9;
}

/* -------------------------------------------------------------------- panels */

/* Replaces the generic .card/.card-body pairing the page used before: same white
   surface, but a consistent radius, a softer border and one shared title style. */
.service-panel {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  padding: var(--space-5, 24px);
  margin-bottom: var(--space-5, 24px);
}

.service-panel__title {
  margin: 0 0 var(--space-4, 16px);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text, #333);
}

.service-note {
  margin: 0;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-muted, #6c6c6c);
}

/* --------------------------------------------------------------------- grid */

.service-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-5, 24px);
  align-items: start;
}

/* minmax(0, …) on the main column is what stops a wide child (a long code block,
   a table, an oversized embedded image) from expanding the track and pushing the
   sidebar off-screen. */
.service-detail-main {
  min-width: 0;
}

.service-detail-grid .service-detail-buybox.is-sticky {
  position: sticky;
  top: var(--space-4, 16px);
  align-self: start;
}

/* ------------------------------------------------------------------ gallery */

.service-detail-gallery {
  padding: var(--space-3, 12px);
}

/* Fixed aspect box + object-fit: contain. The previous rule used `cover` on a
   16/10 box, which cropped portrait artwork and blew up single wide images. A
   contained image is never stretched and never cropped — it letterboxes onto the
   neutral backdrop instead, at one predictable height for every service. */
.service-gallery-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  background: #f7f7f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Placeholder keeps the identical stage box so a media-less service does not
   collapse the column or shift everything below it. */
.service-gallery-stage--empty img {
  width: auto;
  height: 45%;
  opacity: 0.45;
}

.service-gallery-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.service-gallery-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.service-gallery-video.is-hidden {
  display: none;
}

.service-gallery-thumbs {
  display: flex;
  gap: var(--space-2, 8px);
  margin-top: var(--space-3, 12px);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.service-gallery-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 86px;
  height: 60px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: #f7f7f8;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.18s ease, opacity 0.18s ease;
  opacity: 0.75;
}

.service-gallery-thumb:hover {
  opacity: 1;
}

.service-gallery-thumb.is-active {
  border-color: var(--color-primary, #8c0605);
  opacity: 1;
}

.service-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.service-gallery-thumb__video {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #1f2937;
  color: #fff;
  font-size: 1.1rem;
}

/* -------------------------------------------------------------- rich text */

/* The description and the requirements block are seller-authored HTML. Without
   these rules headings, lists and tables inherited the page defaults and the copy
   read as one undifferentiated wall of text. */
.service-rich-text {
  font-size: 1rem;
  line-height: 1.75;
  color: #3f3f46;
  overflow-wrap: break-word;
}

.service-rich-text > *:first-child {
  margin-top: 0;
}

.service-rich-text > *:last-child {
  margin-bottom: 0;
}

.service-rich-text p {
  margin: 0 0 1.05em;
}

.service-rich-text h1,
.service-rich-text h2,
.service-rich-text h3,
.service-rich-text h4 {
  margin: 1.7em 0 0.6em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text, #333);
  letter-spacing: -0.01em;
}

.service-rich-text h1 { font-size: 1.35rem; }
.service-rich-text h2 { font-size: 1.2rem; }
.service-rich-text h3 { font-size: 1.08rem; }
.service-rich-text h4 { font-size: 1rem; }

.service-rich-text ul,
.service-rich-text ol {
  margin: 0 0 1.05em;
  padding-left: 1.35rem;
}

.service-rich-text li {
  margin-bottom: 0.45em;
}

.service-rich-text a {
  color: var(--color-primary, #8c0605);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.service-rich-text strong,
.service-rich-text b {
  font-weight: 600;
  color: var(--color-text, #333);
}

.service-rich-text blockquote {
  margin: 1.2em 0;
  padding: 0.6em 0 0.6em 1.1em;
  border-left: 3px solid var(--color-primary-light, #fae6e7);
  color: #52525b;
  font-style: italic;
}

.service-rich-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f4f4f5;
  border-radius: 4px;
  padding: 0.15em 0.4em;
}

.service-rich-text pre {
  margin: 1.2em 0;
  padding: var(--space-4, 16px);
  background: #1f2937;
  color: #f4f4f5;
  border-radius: var(--radius-sm, 8px);
  /* Code and tables scroll inside their own box — the page body never scrolls
     sideways because of seller-pasted content. */
  overflow-x: auto;
}

.service-rich-text pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.service-rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm, 8px);
  display: block;
  margin: 1.2em 0;
}

.service-rich-text table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 0.94rem;
  display: block;
  overflow-x: auto;
}

.service-rich-text th,
.service-rich-text td {
  border: 1px solid #ececec;
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.service-rich-text th {
  background: #fafafa;
  font-weight: 600;
}

.service-pdf-link {
  margin-top: var(--space-4, 16px);
}

/* --------------------------------------------------------------- fact list */

.service-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3, 12px) var(--space-5, 24px);
  margin: 0;
}

.service-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: var(--space-3, 12px);
  border-bottom: 1px solid #f2f2f2;
  min-width: 0;
}

.service-fact dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #6c6c6c);
}

.service-fact dd {
  margin: 0;
  font-weight: 500;
  color: var(--color-text, #333);
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------------- packages */

.service-package-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-4, 16px);
}

.service-package-tabs .package-tab {
  border: 1px solid var(--color-border, #d0d0d0);
  background: #fff;
  border-radius: var(--radius-full, 100px);
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: var(--font-size-sm, 0.875rem);
  color: #52525b;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.service-package-tabs .package-tab:hover {
  border-color: var(--color-primary, #8c0605);
}

.service-package-tabs .package-tab.is-active,
.service-package-tabs .package-tab.active {
  border-color: var(--color-primary, #8c0605);
  background: var(--color-primary, #8c0605);
  color: #fff;
  font-weight: 600;
}

.service-package-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-2, 8px);
}

.service-package-panel__head h3 {
  margin: 0;
}

.service-package-panel__desc {
  margin: 0 0 var(--space-3, 12px);
  color: #52525b;
}

.service-package-features,
.service-requirements-list {
  margin: 0 0 var(--space-4, 16px);
  padding-left: 1.25rem;
  line-height: 1.7;
}

.service-requirements-list li {
  margin-bottom: 0.4rem;
}

.service-req-flag {
  margin-left: 0.4rem;
  font-size: 0.78rem;
  color: var(--color-primary, #8c0605);
}

/* Desktop buys from the sticky sidebar; the inline comparison block is the
   narrow-viewport fallback and is switched on in the media query below. */
.service-detail-packages-inline {
  display: none;
}

/* ------------------------------------------------------------------ extras */

.service-extras-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.service-extra-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: var(--space-3, 12px) 0;
  border-bottom: 1px solid #f2f2f2;
}

.service-extra-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.service-extra-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2, 8px);
  cursor: pointer;
  min-width: 0;
}

.service-extra-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.service-extra-desc {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-muted, #6c6c6c);
}

.service-extra-price {
  font-weight: 600;
  color: var(--color-primary, #8c0605);
  white-space: nowrap;
}

/* --------------------------------------------------------------------- FAQ */

.service-faq-item {
  border-bottom: 1px solid #f2f2f2;
}

.service-faq-item:last-child {
  border-bottom: 0;
}

.service-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: var(--space-4, 16px) 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.service-faq-item summary::-webkit-details-marker {
  display: none;
}

.service-faq-item summary i {
  color: var(--color-text-muted, #6c6c6c);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.service-faq-item[open] summary i {
  transform: rotate(180deg);
}

.service-faq-answer {
  padding: 0 0 var(--space-4, 16px);
  color: #52525b;
  line-height: 1.7;
}

/* ----------------------------------------------------------------- reviews */

.service-reviews-summary {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: var(--space-5, 24px);
  align-items: center;
  padding-bottom: var(--space-4, 16px);
  margin-bottom: var(--space-4, 16px);
  border-bottom: 1px solid #f2f2f2;
}

.service-reviews-score {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.service-reviews-score__value {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text, #333);
}

.service-rating-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.service-rating-bar {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) 2rem;
  gap: var(--space-2, 8px);
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-muted, #6c6c6c);
}

.service-rating-bar .bar {
  background: #f0f0f0;
  border-radius: var(--radius-full, 100px);
  height: 8px;
  overflow: hidden;
}

.service-rating-bar .bar > span {
  display: block;
  height: 100%;
  background: #f5a623;
  border-radius: inherit;
}

.service-rating-bar__count {
  text-align: right;
}

.service-reviews-list {
  display: flex;
  flex-direction: column;
}

.service-review-item {
  display: flex;
  gap: var(--space-3, 12px);
  padding: var(--space-4, 16px) 0;
  border-bottom: 1px solid #f2f2f2;
}

.service-review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f2f2;
  flex: 0 0 auto;
}

.service-review-body {
  min-width: 0;
  flex: 1;
}

.service-review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2, 8px);
  margin-bottom: 2px;
}

.service-review-name {
  font-weight: 600;
  color: var(--color-text, #333);
}

.service-review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2, 8px);
  font-size: 0.82rem;
  color: var(--color-text-muted, #6c6c6c);
  margin-bottom: 0.45rem;
}

.service-review-text {
  margin: 0;
  line-height: 1.7;
  color: #3f3f46;
  overflow-wrap: break-word;
}

/* ------------------------------------------------------------- seller card */

.seller-profile-card {
  display: flex;
  gap: var(--space-4, 16px);
  align-items: flex-start;
}

.seller-profile-card__avatar {
  position: relative;
  flex: 0 0 auto;
}

.avatar-md {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f2f2;
  display: block;
}

.seller-online-dot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

.seller-profile-card__body {
  min-width: 0;
  flex: 1;
}

.seller-profile-card__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2, 8px);
  margin: 0 0 var(--space-3, 12px);
  font-size: 1.05rem;
  font-weight: 700;
}

.seller-profile-card__name a {
  color: var(--color-text, #333);
  text-decoration: none;
}

.seller-profile-card__name a:hover {
  color: var(--color-primary, #8c0605);
}

.seller-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3, 12px);
  margin: 0 0 var(--space-4, 16px);
}

.seller-stats dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #6c6c6c);
}

.seller-stats dd {
  margin: 2px 0 0;
  font-weight: 500;
  color: var(--color-text, #333);
}

.seller-profile-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}

/* ------------------------------------------------------------------ buybox */

.service-buybox-card {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
  padding: var(--space-5, 24px);
}

.service-buybox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-2, 8px);
}

.service-buybox-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--color-text, #333);
}

.service-buybox-card .buyer-price {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-text, #333);
  line-height: 1.1;
  white-space: nowrap;
}

.service-buybox-desc {
  margin: 0 0 var(--space-3, 12px);
  font-size: var(--font-size-sm, 0.875rem);
  color: #52525b;
  line-height: 1.6;
}

.service-buybox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px) var(--space-4, 16px);
  list-style: none;
  margin: 0 0 var(--space-4, 16px);
  padding: 0;
  font-size: var(--font-size-sm, 0.875rem);
  color: #3f3f46;
}

.service-buybox-meta li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.service-buybox-meta i {
  color: var(--color-text-muted, #6c6c6c);
}

.service-buybox-features {
  list-style: none;
  margin: 0 0 var(--space-4, 16px);
  padding: 0;
  font-size: var(--font-size-sm, 0.875rem);
  line-height: 1.75;
}

.service-buybox-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.service-buybox-features i {
  color: #1a7f37;
  margin-top: 0.35em;
  flex: 0 0 auto;
}

.service-buybox-chat {
  margin-top: var(--space-2, 8px);
}

.service-buybox-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--space-3, 12px);
  padding-top: var(--space-3, 12px);
  border-top: 1px solid #f2f2f2;
}

/* buyer-actions.php ships its own .btn-group spacing; centre its row and let the
   favourite heart and share button share one line. */
.service-buybox-actions .buyer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 8px);
  margin: 0;
}

.service-buybox-trust {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: var(--space-3, 12px) 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted, #6c6c6c);
  text-align: center;
  justify-content: center;
}

/* -------------------------------------------------------- related services */

/* The grid, card chrome and hover state all come from wah-gallery.css — the same
   sheet the homepage and /services galleries use. Nothing is redefined here. */
.service-related {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .service-detail-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 900px) {
  .service-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Sidebar drops below the content on narrow screens; sticky is removed by JS
     as well, but this guarantees it even if the script never runs. */
  .service-detail-buybox {
    order: 3;
    position: static !important;
  }

  .service-detail-packages-inline {
    display: block;
  }

  /* One purchase surface at a time: with the inline comparison visible, the
     sidebar's own tab strip would be a duplicate control. */
  .service-detail-buybox .service-package-tabs {
    display: none;
  }
}

@media (max-width: 640px) {
  .service-detail-shell {
    padding-block: var(--space-4, 16px) var(--space-6, 32px);
  }

  .service-panel {
    padding: var(--space-4, 16px);
    border-radius: var(--radius-sm, 8px);
  }

  .service-buybox-card {
    padding: var(--space-4, 16px);
  }

  .service-gallery-stage {
    aspect-ratio: 4 / 3;
  }

  .service-reviews-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-detail-identity {
    gap: var(--space-2, 8px);
  }

  /* Vertical rules read as clutter once the row wraps onto three lines. */
  .service-detail-divider {
    display: none;
  }

  .service-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-extra-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2, 8px);
  }
}

/* Motion is decorative here — respect the user's system preference. */
@media (prefers-reduced-motion: reduce) {
  .service-gallery-thumb,
  .service-package-tabs .package-tab,
  .service-faq-item summary i {
    transition: none;
  }
}

/* ---- STAR RATING (partial-fill) ----
   "N.NN out of 5" readout for the service page's aggregate score and per-review
   stars: a text-glyph 5-star row whose filled portion is clipped to the exact
   decimal (4.33 reveals 4 full stars + ~33% of the 5th) instead of rounding to the
   nearest whole star. See views/components/reviews/star_rating.php. Same
   orange/gray convention as the existing .service-stars component above. */
.star-rating-inline { display: inline-flex; align-items: center; gap: 6px; }
.star-rating { position: relative; display: inline-block; font-size: 1.1rem; line-height: 1; letter-spacing: 2px; }
.star-rating__bg { color: #d0d0d0; }
.star-rating__fg { position: absolute; top: 0; left: 0; color: #f5a623; overflow: hidden; white-space: nowrap; }
.star-rating-value { font-weight: 700; }

/* ---- REVIEW FRAME (single Fiverr-style buyer+seller-response card) ----
   One outer bordered frame per completed order: buyer feedback on top, the
   seller's response underneath a divider — never two separate/unrelated cards.
   See views/components/reviews/review_pair.php. Mobile-safe: avatars are
   fixed-size circles, identity text wraps, nothing can force horizontal scroll. */
.review-frame { display: flex; flex-direction: column; gap: 12px; }
.review-frame__listing { margin: 0; }
.review-frame__side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.review-frame__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-frame__avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.review-frame__avatar--sm { width: 36px; height: 36px; }
.review-frame__identity { display: flex; flex-direction: column; min-width: 0; }
.review-frame__username { word-break: break-word; }
.review-frame__role { align-self: flex-start; font-size: .75rem; }
.review-frame__response-label { font-weight: 700; font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.review-frame__rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-frame__text { margin: 0; word-wrap: break-word; overflow-wrap: break-word; }
.review-frame__divider { border: none; border-top: 1px solid #e5e7eb; margin: 0; }
.review-frame__side--seller { padding-left: 12px; }
@media (max-width: 480px) {
  .review-frame__side--seller { padding-left: 0; }
}

/* ---- AI SELLER — pre-purchase requirement chat panel (2026-09-12) ----
   Task 3 / re-audit #20. The THREAD, BUBBLES, COMPOSER and CARD are NOT styled here:
   they reuse public/css/chat-offers.css's unscoped .chat-thread / .chat-bubble /
   .chat-compose / .offer-card* rules, loaded alongside this file by
   ServiceController::renderDetailView(). (chat-messaging.css re-declares those same class
   names under a .chat-page ancestor, so it would not apply on this page and is deliberately
   not loaded.) What follows is only the delta that file cannot provide: the collapsible
   panel shell, and the capability-verdict colours, which are specific to the requirement
   lock and have no equivalent in the human-chat offer card. */
.service-ai-seller-chat__head { margin: 0; }
.service-ai-seller-chat__toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.service-ai-seller-chat__toggle-label { flex: 1; min-width: 0; }
.service-ai-seller-chat__chevron { transition: transform .18s ease; flex-shrink: 0; font-size: .8em; }
.service-ai-seller-chat__toggle[aria-expanded="true"] .service-ai-seller-chat__chevron { transform: rotate(180deg); }
.service-ai-seller-chat__toggle:focus-visible { outline: 2px solid var(--color-primary, #8c0605); outline-offset: 3px; }
.service-ai-seller-chat__body { margin-top: var(--space-4, 16px); }
.service-ai-seller-chat__intro { color: var(--color-text-muted, #6c6c6c); margin: 0 0 var(--space-4, 16px); }
/* The thread is scroll-contained so a long conversation can never push the buybox or the
   rest of the page out of reach; it grows to a readable height first, then scrolls. */
.service-ai-seller-chat__thread {
  min-height: 120px; max-height: 420px; overflow-y: auto;
  padding: var(--space-3, 12px); border: 1px solid var(--color-border, #d0d0d0); border-radius: 8px;
}
.service-ai-seller-chat__thread:empty { display: none; }
.service-ai-seller-chat__status { margin: var(--space-3, 12px) 0 0; font-size: .875rem; color: var(--color-text-muted, #6c6c6c); }
.service-ai-seller-chat__status--error { color: var(--color-primary, #8c0605); font-weight: 600; }
.service-ai-seller-chat__empty { color: var(--color-text-muted, #6c6c6c); margin: 0; }

/* Capability verdict. cannot_deliver is styled as a FINAL state, not an error to retry:
   the verdict is server-authoritative and such a lock can never reach confirmed. */
.ai-seller-verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .8125rem; }
.ai-seller-verdict--can { color: var(--color-success, #00b22d); }
.ai-seller-verdict--partial { color: #b26a00; }
.ai-seller-verdict--cannot { color: var(--color-primary, #8c0605); }
.ai-seller-card__requirement,
.ai-seller-card__capability { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; margin: 0; }
.ai-seller-card__label {
  display: block; font-weight: 600; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--color-text-muted, #6c6c6c); margin-bottom: 4px;
}
.ai-seller-card__section + .ai-seller-card__section { margin-top: var(--space-3, 12px); }
.ai-seller-card__final { margin: var(--space-3, 12px) 0 0; font-weight: 600; }
.service-buybox-ai-chat { margin-bottom: var(--space-2, 8px); }
