/* Public service catalogue */
body.fs-dashboard:has(.svc-catalogue:not([hidden])) {
  background: #f5eee3;
}

.fs-dashboard:not(.in-admin) .fs-main:has(> .svc-catalogue:not([hidden])) {
  width: min(91%, 1280px);
  padding-bottom: 8px;
}

.fs-dashboard.v2 .fs-main:has(> .svc-catalogue:not([hidden])) > .wf-return {
  min-height: 44px;
  margin: 6px 0;
  padding: 8px 0;
  color: #684332;
  background: none;
  border: 0;
  border-radius: 2px;
}

.fs-dashboard.v2 .svc-catalogue {
  --svc-ink: #372116;
  --svc-body: #5d493a;
  --svc-rust: #8d4527;
  --svc-border: #dac8b3;
  --svc-paper: #fffaf2;
  display: block;
  min-width: 0;
  color: var(--svc-ink);
}

.svc-directory {
  min-width: 0;
}

.svc-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: clamp(178px, 16vw, 224px);
  padding: clamp(24px, 3.2vw, 46px);
  border: 1px solid #d4bda3;
  border-radius: 16px;
  background: #f6e5d0;
}

.svc-banner-art {
  pointer-events: none;
  position: absolute;
  z-index: -1;
  inset: 0 0 0 40%;
  background: linear-gradient(90deg, #f6e5d0, #f6e5d0e3 8%, #f6e5d000 38%),
              url('assets/catalogue-bench.webp') 78% 53% / cover no-repeat;
}

.svc-intro {
  width: 52%;
  min-width: 0;
}

.fs-dashboard.v2 .svc-intro h1 {
  margin: 0;
  color: var(--svc-ink);
  font-size: clamp(42px, 4.6vw, 68px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.048em;
  text-wrap: balance;
}

.svc-intro p {
  max-width: 42ch;
  margin: 14px 0 0;
  color: #563a28;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.5;
  text-wrap: pretty;
}

.svc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin: clamp(20px, 2.2vw, 32px) 0 16px;
}

.svc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.svc-tabs button,
.svc-support :is(a,button),
.svc-empty :is(a,button),
.svc-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-height: 46px;
  padding: 9px 16px;
  border: 1px solid var(--svc-border);
  border-radius: 6px;
  background: var(--svc-paper);
  color: #553523;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.28;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
}

.svc-tabs button[aria-pressed='true'],
.svc-actions .svc-primary {
  background: #512b1b;
  border-color: #512b1b;
  color: #fff9f1;
}

.svc-catalogue :is(.svc-tabs, .svc-actions, .svc-support, .svc-empty) svg {
  width: 19px;
  height: 19px;
  flex: none;
  --glyph-light: currentColor;
  --glyph-deep: currentColor;
}

.svc-filter-short { display: none; }

.svc-count {
  margin: 0;
  color: var(--svc-body);
  font-size: 15px;
  line-height: 1.4;
}

.svc-count strong {
  font-weight: 700;
  color: var(--svc-ink);
}

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.5vw, 22px);
}

.svc-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 1.65vw, 26px);
  border: 1px solid var(--svc-border);
  border-radius: 13px;
  background: var(--svc-paper);
  box-shadow: 0 3px 10px -8px #80543465;
}

.svc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.svc-category {
  min-width: 0;
  color: var(--svc-rust);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .02em;
}

.svc-object {
  display: grid;
  place-items: center;
  width: clamp(108px, 11.5vw, 158px);
  height: clamp(86px, 8.6vw, 118px);
  flex: 0 1 auto;
  min-width: 72px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  mix-blend-mode: multiply;
}

.svc-object--computers   { background-image: url('assets/service-computers.webp'); }
.svc-object--boards      { background-image: url('assets/service-boards.webp'); }
.svc-object--clusters    { background-image: url('assets/service-clusters.webp'); }
.svc-object--coding      { background-image: url('assets/service-coding.webp'); }
.svc-object--keys        { background-image: url('assets/service-keys.webp'); }
.svc-object--remap       { background-image: url('assets/service-remap.webp'); }
.svc-object--ecu         { background-image: url('assets/service-ecu.webp'); }
.svc-object--diagnostics { background-image: url('assets/service-diagnostics.webp'); }
.svc-object--tuition     { background-image: url('assets/service-tuition.webp'); }

.svc-object--generic svg {
  height: 56px;
  width: 56px;
  color: #885438;
}

.fs-dashboard.v2 .svc-card h2 {
  margin: 9px 0 0;
  color: var(--svc-ink);
  font-size: clamp(23px, 1.82vw, 29px);
  font-weight: 750;
  letter-spacing: -.032em;
  line-height: 1.14;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.svc-description {
  margin: 9px 0 0;
  color: var(--svc-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.svc-price {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
  padding-top: 20px;
}

.svc-price small {
  width: 100%;
  padding-top: 13px;
  border-top: 1px solid #e7d9c8;
  color: var(--svc-body);
  font-size: 14px;
  line-height: 1.35;
}

.svc-price strong {
  color: var(--svc-ink);
  font-size: clamp(32px, 2.7vw, 42px);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.034em;
  overflow-wrap: anywhere;
}

.svc-price .quote-label {
  font-size: clamp(25px, 2.05vw, 31px);
}

.svc-actions {
  display: grid;
  align-content: end;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding-top: 15px;
}

.svc-actions button {
  width: 100%;
  min-height: 49px;
  justify-content: space-between;
  padding: 10px 14px;
  text-align: left;
}

.svc-actions .svc-secondary {
  background: transparent;
}

.svc-support,
.svc-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 22px 0 0;
  padding: 19px clamp(18px, 2.5vw, 36px);
  border: 1px solid var(--svc-border);
  border-radius: 12px;
  background: #f0e2cf;
}

.fs-dashboard.v2 .svc-support h2,
.fs-dashboard.v2 .svc-empty :is(h2,h3) {
  flex: 1 1 220px;
  margin: 0 auto 0 0;
  color: var(--svc-ink);
  font-size: clamp(20px, 1.8vw, 27px);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.svc-empty {
  grid-column: 1 / -1;
  margin: 0;
}

.svc-catalogue #cluster-calculator {
  max-width: 750px;
  margin: 24px auto 0;
  min-width: 0;
  scroll-margin: 10px;
}

.svc-catalogue button:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.fs-dashboard .svc-catalogue :is(a,button,input):focus-visible {
  outline: 3px solid #80401e;
  outline-offset: 3px;
}

/* Share text and price baselines within each visual row; allow owner-edited copy to grow. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 641px) {
    .svc-card {
      display: grid;
      grid-row: span 5;
      grid-template-rows: subgrid;
      gap: 0;
    }
    .svc-price {
      margin-top: 0;
    }
  }
}

@media (hover: hover) {
  .svc-catalogue :is(.svc-tabs button,.svc-secondary,.svc-support a,.svc-support button,.svc-empty button):not(:disabled):hover {
    color: #4b2d1d;
    border-color: #b99574;
    background: #f2e4d2;
  }
  .svc-tabs button[aria-pressed='true']:not(:disabled):hover,
  .svc-actions .svc-primary:not(:disabled):hover {
    color: #fff9f1;
    border-color: #683a26;
    background: #683a26;
  }
}

@media (max-width: 1050px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 740px) {
  .svc-toolbar { gap: 10px; }
  .svc-tabs button { padding: 8px 12px; }
  .svc-support :is(a,button) { flex: 1 1 auto; }
  .fs-dashboard.v2 .svc-support h2 { flex-basis: 100%; }
}

@media (max-width: 640px) {
  .fs-dashboard:not(.in-admin) .fs-main:has(> .svc-catalogue:not([hidden])) {
    width: calc(100% - 28px);
  }
  .svc-banner { min-height: 146px; padding: 21px 18px; border-radius: 11px; }
  .svc-intro { width: 70%; }
  .fs-dashboard.v2 .svc-intro h1 { font-size: clamp(33px, 7vw, 44px); }
  .svc-intro p { margin-top: 10px; font-size: 15px; line-height: 1.43; }
  .svc-banner-art {
    left: 56%;
    background-image: linear-gradient(90deg, #f6e5d0, #f6e5d0d9 18%, #f6e5d000 70%), url('assets/catalogue-bench.webp');
  }
  .svc-toolbar { display: grid; margin: 17px 0 12px; }
  .svc-tabs { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 5px; }
  .svc-filter-long { display: none; }
  .svc-filter-short { display: inline; }
  .svc-tabs button { min-height: 47px; padding: 7px 10px; font-size: 15px; }
  .svc-tabs button svg { display: none; }
  .svc-count { font-size: 14px; }
  .svc-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .svc-card { padding: 18px; }
  .svc-object { width: 136px; height: 93px; }
  .fs-dashboard.v2 .svc-card h2 { margin-top: 4px; font-size: 26px; }
  .svc-price { padding-top: 14px; }
  .svc-actions button { min-height: 51px; }
  .svc-support { margin-top: 16px; }
}

/* Align the outer edges with the catalogue and leave its actions unobstructed. */
body.fs-dashboard:has(.svc-catalogue:not([hidden])) :is(.atelier-header-inner,.workshop-footer-inner) {
  width: min(91%, 1280px);
  max-width: 1280px;
}
body.fs-dashboard:has(.svc-catalogue:not([hidden])) #app > .chat-launch {
  display: none;
}
@media (max-width: 640px) {
  body.fs-dashboard:has(.svc-catalogue:not([hidden])) :is(.atelier-header-inner,.workshop-footer-inner) {
    width: calc(100% - 28px);
  }
}
