/* Discover area: home, catalogues (services, jobs, subcategory listing),
   categories, category detail, search. Colors come only from --k-* tokens,
   so dark mode follows kits.css automatically. */

.d-page{ background:var(--k-surface); }
.d-page h1, .d-page h2, .d-page h3, .d-page p{ margin:0; }
.d-band{ background:var(--k-bg); border-top:1px solid var(--k-line); border-bottom:1px solid var(--k-line); }

/* ---------- Page header ---------- */
.d-head{ border-bottom:1px solid var(--k-line); background:var(--k-surface); }
.d-head__in{ display:flex; flex-direction:column; gap:20px; padding-top:28px; padding-bottom:24px; }
.d-head__row{ display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; }
.d-head__text{ display:flex; flex-direction:column; gap:6px; min-width:0; max-width:720px; }
.d-head__title{ display:flex; gap:20px; align-items:flex-start; min-width:0; flex:999 1 520px; }
.d-h1{ font-size:clamp(30px, 4vw, 40px); line-height:1.1; letter-spacing:-.03em; font-weight:700; color:var(--k-ink); }
.d-lead{ color:var(--k-soft); font-size:16px; line-height:1.6; }
.d-lead--lg{ font-size:17px; max-width:640px; }
.d-count{ font-size:14px; color:var(--k-muted); }
.d-crumbs{ font-size:13px; }
.d-crumbs svg{ flex:none; color:var(--k-line-3); }
.d-crumbs [aria-current]{ color:var(--k-ink); }
.d-icon-tile{ flex:none; width:56px; height:56px; border-radius:16px; background:var(--k-brand-soft-2); color:var(--k-primary); display:flex; align-items:center; justify-content:center; }
.d-icon-tile--sm{ width:44px; height:44px; border-radius:12px; }
.d-icon-tile--xs{ width:36px; height:36px; border-radius:10px; }

/* toolbar: search + sort + filters button */
.d-toolbar{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.d-search{
  position:relative; flex:1 1 360px; min-width:0; display:flex; align-items:center; gap:10px; height:48px; padding:0 16px; box-sizing:border-box;
  background:var(--k-surface); border:1px solid var(--k-line-2); border-radius:var(--k-r); margin:0;
  transition:border-color .15s ease, box-shadow .2s ease;
}
.d-search:focus-within{ border-color:var(--k-brand); box-shadow:var(--k-focus); }
.d-search svg{ flex:none; color:var(--k-muted); }
.d-search input{ flex:1 1 auto; min-width:0; height:100%; border:0; outline:none; background:transparent; font:inherit; font-size:16px; color:var(--k-ink); }
.d-search--btn{ padding:4px 4px 4px 16px; }
.d-search--btn .k-btn{ height:40px; flex:none; }
.d-sort{ margin:0; }
.d-sort select{
  height:48px; padding:0 36px 0 14px; border:1px solid var(--k-line-2); border-radius:var(--k-r); background-color:var(--k-surface);
  color:var(--k-ink); font:inherit; font-size:15px; cursor:pointer; max-width:100%;
}
.d-sort select:focus{ outline:none; border-color:var(--k-brand); box-shadow:var(--k-focus); }
.d-chips{ display:flex; gap:8px; flex-wrap:wrap; }
.d-chips--scroll{ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; padding-bottom:4px; margin-bottom:-4px; }
.d-chips--scroll::-webkit-scrollbar{ display:none; }
.d-chips--scroll .k-chip{ flex:none; }
.d-chips .k-chip{ font-size:14px; }

/* filters button (opens the bottom sheet below 1024px) */
.d-filter-btn{
  display:none; align-items:center; gap:8px; height:48px; padding:0 14px; box-sizing:border-box; border-radius:var(--k-r);
  border:1px solid var(--k-line-2); background:var(--k-surface); color:var(--k-ink); font:inherit; font-size:15px; font-weight:600; cursor:pointer;
}
.d-filter-btn:hover{ border-color:var(--k-line-3); }
.d-filter-count{ display:inline-block; min-width:20px; height:20px; padding:0 6px; box-sizing:border-box; border-radius:999px; background:var(--k-primary); color:var(--k-on-primary); font-size:12px; font-weight:700; line-height:20px; text-align:center; }
.d-filter-count[hidden]{ display:none; }

/* ---------- Catalogue layout ---------- */
.d-layout{ display:grid; grid-template-columns:272px minmax(0, 1fr); gap:32px; align-items:start; padding-top:32px; padding-bottom:80px; }
.d-results{ display:flex; flex-direction:column; gap:20px; min-width:0; }
.d-results__bar{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; font-size:15px; color:var(--k-soft); }
.d-results__bar strong{ color:var(--k-ink); }

/* filters panel */
.d-filters{ display:flex; flex-direction:column; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); }
.d-filters__head{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 12px 12px 20px; border-bottom:1px solid var(--k-line); }
.d-filters__title{ font-size:16px; font-weight:600; color:var(--k-ink); }
.d-filters__clear{ display:inline-flex; align-items:center; min-height:44px; padding:0 8px; border-radius:var(--k-r-sm); font-size:14px; font-weight:600; text-decoration:none; color:var(--k-primary); }
.d-filters__clear:hover{ background:var(--k-surface-2); }
.d-fset{ margin:0; padding:0 20px 16px; border:0; border-bottom:1px solid var(--k-line); display:flex; flex-direction:column; gap:0; min-width:0; }
.d-fset:last-of-type{ border-bottom:0; }
.d-fset__legend{ float:none; padding:16px 0 8px; font-size:15px; font-weight:600; color:var(--k-ink); }
.d-range{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.d-range label{ display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--k-soft); min-width:0; }
.d-range input{
  width:100%; box-sizing:border-box; height:44px; padding:0 12px; border:1px solid var(--k-line-2); border-radius:10px;
  background:var(--k-surface); color:var(--k-ink); font:inherit; font-size:15px;
}
.d-range input:focus{ outline:none; border-color:var(--k-brand); box-shadow:var(--k-focus); }
.d-fset .k-btn{ margin-top:8px; }
.d-check{ display:flex; align-items:center; gap:10px; min-height:40px; font-size:15px; color:var(--k-ink); cursor:pointer; }
.d-check input{ width:18px; height:18px; margin:0; flex:none; accent-color:var(--k-primary); }
.d-check--switch{ justify-content:space-between; min-height:44px; }
.d-catlist{ display:flex; flex-direction:column; gap:2px; margin:0 -8px; }
.d-catlist a{ display:flex; align-items:center; min-height:40px; padding:0 8px; border-radius:10px; color:var(--k-ink-2); font-size:15px; text-decoration:none; }
.d-catlist a:hover{ background:var(--k-surface-2); color:var(--k-ink); }
.d-catlist a.is-active{ background:var(--k-brand-soft-2); color:var(--k-brand-soft-ink); font-weight:600; }
.d-filters__foot{ padding:16px 20px 20px; display:flex; flex-direction:column; gap:10px; border-top:1px solid var(--k-line); }
.d-save{ margin:0; }
.d-save .k-btn{ width:100%; white-space:normal; height:auto; min-height:44px; padding:10px 14px; line-height:1.3; text-align:left; justify-content:flex-start; }
.d-sheet-head, .d-sheet-foot{ display:none; }

/* ---------- Cards ---------- */
.d-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap:20px; }
.d-grid--home{ grid-template-columns:repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.d-stretch{ color:inherit; text-decoration:none; }
.d-stretch::after{ content:""; position:absolute; inset:0; z-index:1; border-radius:inherit; }
.d-stretch:hover{ color:inherit; }
.d-stretch:focus-visible{ outline:none; }
.d-stretch:focus-visible::after{ outline:2px solid var(--k-brand); outline-offset:2px; }
.d-above{ position:relative; z-index:2; }

/* service card */
.d-svc{ position:relative; display:flex; flex-direction:column; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); overflow:hidden; transition:border-color .15s ease, box-shadow .2s ease; }
.d-svc:hover{ border-color:var(--k-line-2); box-shadow:var(--k-shadow-hover); }
.d-svc__media{ position:relative; aspect-ratio:4 / 3; background:var(--k-surface-2); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.d-svc__media img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.d-svc__icon{ width:56px; height:56px; border-radius:16px; background:var(--k-surface); color:var(--k-primary); display:flex; align-items:center; justify-content:center; box-shadow:0 1px 2px rgba(15,23,42,.06); }
.d-svc__sponsor{ position:absolute; left:12px; top:12px; }
.d-svc__tag{ position:absolute; left:12px; bottom:12px; max-width:calc(100% - 24px); overflow:hidden; text-overflow:ellipsis; background:var(--k-surface); color:var(--k-ink-2); }
.d-svc__body{ flex:1 1 auto; display:flex; flex-direction:column; gap:10px; padding:16px 16px 18px; }
.d-seller{ display:flex; align-items:center; gap:8px; font-size:14px; min-width:0; color:var(--k-ink); text-decoration:none; }
.d-seller:hover{ color:var(--k-ink); text-decoration:underline; }
.d-seller .k-avatar{ width:28px; height:28px; font-size:11px; }
.d-seller__name{ font-weight:500; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.d-svc__who{ display:flex; align-items:center; gap:8px; min-width:0; flex-wrap:wrap; }
.d-lvl{ height:22px; padding:0 8px; font-size:11px; }
.d-lvl--experienced{ background:var(--k-brand-soft); color:var(--k-brand-soft-ink); }
.d-lvl--top, .d-lvl--top_plus{ background:var(--k-dark-btn); color:var(--k-on-dark-btn); }
.d-svc__title{ font-size:16px; font-weight:600; line-height:1.4; color:var(--k-ink); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.d-svc__langs{ font-size:13px; color:var(--k-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.d-svc__foot{ margin-top:auto; padding-top:12px; border-top:1px solid var(--k-line); display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.d-meta{ display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--k-muted); }
.d-meta strong{ color:var(--k-ink); font-weight:600; }
.d-star{ flex:none; color:var(--k-star); }
.d-price{ font-size:13px; color:var(--k-muted); white-space:nowrap; }
.d-price strong{ font-size:17px; font-weight:700; color:var(--k-ink); }
.d-svc__msg{ display:inline-flex; align-items:center; gap:6px; align-self:flex-start; min-height:44px; margin:-10px 0 -12px; font-size:14px; font-weight:600; color:var(--k-primary); text-decoration:none; }
.d-svc__msg:hover{ text-decoration:underline; }

/* job card */
.d-jobs{ display:flex; flex-direction:column; gap:16px; }
.d-job{ position:relative; display:flex; flex-direction:column; gap:14px; padding:24px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); transition:border-color .15s ease, box-shadow .2s ease; }
.d-job:hover{ border-color:var(--k-line-2); box-shadow:var(--k-shadow-hover); }
.d-job__top{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px 24px; flex-wrap:wrap; }
.d-job__head{ flex:999 1 320px; min-width:0; display:flex; flex-direction:column; gap:6px; }
.d-job__kicker{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px; color:var(--k-muted); }
.d-job__title{ font-size:18px; line-height:1.35; font-weight:600; letter-spacing:-.01em; color:var(--k-ink); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.d-job__title a:hover{ text-decoration:underline; }
.d-job__budget{ flex:1 0 auto; display:flex; flex-direction:column; align-items:flex-end; text-align:right; }
.d-job__amount{ font-size:18px; font-weight:700; letter-spacing:-.01em; color:var(--k-ink); }
.d-job__desc{ color:var(--k-soft); font-size:15px; line-height:1.6; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.d-tags{ display:flex; gap:8px; flex-wrap:wrap; font-size:13px; }
.d-tag{ display:inline-flex; align-items:center; gap:6px; min-height:26px; padding:0 10px; border-radius:8px; background:var(--k-surface-2); color:var(--k-ink-2); }
.d-tag--outline{ background:transparent; border:1px solid var(--k-line); color:var(--k-soft); }
.d-job__foot{ display:flex; align-items:center; gap:6px 10px; flex-wrap:wrap; padding-top:12px; border-top:1px solid var(--k-line); font-size:14px; color:var(--k-muted); }
.d-job--compact{ padding:20px; gap:12px; }
.d-job--compact .d-job__title{ font-size:17px; }
/* .d-job__head's row-layout flex basis would be a 320px height in this column card. */
.d-job--compact .d-job__head{ flex:none; }
.d-job--compact .d-job__foot{ margin-top:auto; }

/* empty state (centered, from the artboards) */
.d-empty{ grid-column:1 / -1; display:flex; flex-direction:column; align-items:center; text-align:center; gap:14px; padding:56px 24px; border:1px solid var(--k-line); border-radius:var(--k-r-panel); background:var(--k-surface); }
.d-empty__icon{ width:56px; height:56px; border-radius:16px; background:var(--k-brand-soft); color:var(--k-primary); display:flex; align-items:center; justify-content:center; }
.d-empty__icon--muted{ background:var(--k-surface-2); color:var(--k-ink-2); }
.d-empty__title{ font-size:20px; line-height:1.3; font-weight:600; color:var(--k-ink); }
.d-empty__text{ max-width:470px; color:var(--k-soft); }
.d-empty__actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:6px; }
.d-empty--row{ flex-direction:row; flex-wrap:wrap; align-items:center; text-align:left; gap:24px 32px; padding:clamp(28px, 4vw, 48px); background:var(--k-bg); }
.d-empty--row .d-empty__body{ flex:999 1 380px; min-width:0; display:flex; flex-direction:column; gap:6px; }
.d-empty--row .d-empty__actions{ margin:0; justify-content:flex-start; }

.d-pages{ margin-top:12px; }

/* ---------- Mode switch (services / jobs) ---------- */
.mode-switch.d-mode{ align-self:flex-start; display:inline-flex; gap:4px; padding:4px; margin:0; width:auto; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r); }
.d-mode form{ margin:0; display:flex; }
.d-mode .mode-tab{
  height:40px; padding:0 16px; border:0; border-radius:9px; background:transparent; color:var(--k-soft);
  font:inherit; font-size:14px; font-weight:500; cursor:pointer; white-space:nowrap; box-shadow:none;
  transition:background-color .15s ease, color .15s ease;
}
.d-mode .mode-tab:hover{ color:var(--k-ink); background:var(--k-surface-2); }
.d-mode .mode-tab.active{ background:var(--k-dark-btn); color:var(--k-on-dark-btn); font-weight:600; box-shadow:none; }

/* ---------- Home ---------- */
.d-hero{ display:flex; flex-wrap:wrap; align-items:center; gap:56px; padding-top:clamp(32px, 4.5vw, 64px); padding-bottom:clamp(56px, 7vw, 96px); }
.d-hero__copy{ flex:999 1 520px; min-width:0; display:flex; flex-direction:column; gap:24px; }
.d-hero__title{ font-size:clamp(38px, 5vw, 56px); line-height:1.05; letter-spacing:-.035em; font-weight:700; color:var(--k-ink); }
.d-hero__sub{ max-width:540px; font-size:18px; line-height:1.6; color:var(--k-soft); }
.d-hero__search{
  position:relative; display:flex; align-items:center; gap:8px; max-width:600px; padding:6px 6px 6px 18px; box-sizing:border-box;
  background:var(--k-surface); border:1px solid var(--k-line-2); border-radius:var(--k-r-card);
  box-shadow:0 1px 2px rgba(15,23,42,.04), 0 12px 32px -16px rgba(15,23,42,.16);
  transition:border-color .15s ease, box-shadow .2s ease;
}
.d-hero__search:focus-within{ border-color:var(--k-brand); box-shadow:var(--k-focus); }
.d-hero__search > svg{ flex:none; color:var(--k-muted); }
.d-hero__search input{ flex:1 1 auto; min-width:0; height:48px; border:0; outline:none; background:transparent; font:inherit; font-size:16px; color:var(--k-ink); }
.d-hero__actions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.d-hero__offer{ display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 8px; color:var(--k-soft); font-size:15px; font-weight:500; text-decoration:none; }
.d-hero__offer:hover{ color:var(--k-ink); text-decoration:underline; }
.d-hero__panel{ flex:1 1 380px; min-width:0; max-width:520px; padding:20px; box-sizing:border-box; background:var(--k-bg); border:1px solid var(--k-line); border-radius:var(--k-r-xl); display:flex; flex-direction:column; gap:12px; }
.d-quick{ display:flex; gap:8px; flex-wrap:wrap; padding:4px 2px 0; }

/* suggestions dropdown under the hero search */
.d-suggest{ position:absolute; top:calc(100% + 8px); left:0; right:0; z-index:40; display:none; max-height:360px; overflow-y:auto; padding:6px; text-align:left; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); box-shadow:var(--k-shadow-pop); }
.d-suggest.open{ display:block; }
.d-suggest__row{ display:flex; align-items:center; gap:12px; min-height:48px; padding:6px 10px; border-radius:10px; color:var(--k-ink); text-decoration:none; }
.d-suggest__row:hover, .d-suggest__row.active{ background:var(--k-surface-2); color:var(--k-ink); }
.d-suggest__icon{ flex:none; width:34px; height:34px; border-radius:9px; background:var(--k-brand-soft-2); color:var(--k-primary); display:flex; align-items:center; justify-content:center; }
.d-suggest__row .k-avatar{ width:34px; height:34px; font-size:12px; }
.d-suggest__info{ display:flex; flex-direction:column; min-width:0; }
.d-suggest__title{ font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d-suggest__sub{ font-size:12px; color:var(--k-muted); }
.d-suggest__empty{ padding:14px; text-align:center; font-size:14px; color:var(--k-muted); }

.d-section{ padding-top:clamp(56px, 7vw, 96px); padding-bottom:clamp(56px, 7vw, 96px); display:flex; flex-direction:column; gap:32px; }
.d-section--tight{ padding-top:0; }
.d-section__head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.d-section__text{ display:flex; flex-direction:column; gap:8px; min-width:0; }
.d-h2{ font-size:28px; line-height:1.2; letter-spacing:-.02em; font-weight:700; color:var(--k-ink); }
.d-h2--sm{ font-size:20px; letter-spacing:-.01em; font-weight:600; }
.d-more{ display:inline-flex; align-items:center; gap:6px; min-height:44px; font-weight:600; font-size:15px; text-decoration:none; white-space:nowrap; }
.d-more:hover{ text-decoration:underline; }
.d-more svg{ flex:none; }
.d-modebar{ display:flex; justify-content:flex-start; padding-top:clamp(28px, 4vw, 40px); }

.d-cat-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap:16px; }
.d-cat{ display:flex; gap:16px; align-items:flex-start; padding:20px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); color:var(--k-ink); text-decoration:none; transition:border-color .15s ease, box-shadow .2s ease; }
.d-cat:hover{ border-color:var(--k-line-2); box-shadow:var(--k-shadow-hover); color:var(--k-ink); }
.d-cat__text{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.d-cat__name{ font-size:17px; font-weight:600; }
.d-cat__sub{ font-size:14px; color:var(--k-muted); }
.d-cat--cta{ flex-direction:column; justify-content:space-between; gap:12px; background:var(--k-dark-btn); border-color:var(--k-dark-btn); color:var(--k-on-dark-btn); }
.d-cat--cta:hover{ background:var(--k-dark-btn-hover); border-color:var(--k-dark-btn-hover); color:var(--k-on-dark-btn); }
.d-cat--cta .d-cat__name{ font-size:16px; line-height:1.4; }
.d-cat__go{ display:inline-flex; align-items:center; gap:6px; font-size:14px; font-weight:600; }

.d-steps{ margin:0; padding:0; list-style:none; display:grid; grid-template-columns:repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap:16px; }
.d-step{ display:flex; flex-direction:column; gap:12px; padding:24px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); }
.d-step__num{ font-size:13px; font-weight:700; color:var(--k-primary); font-variant-numeric:tabular-nums; }
.d-step__title{ font-size:18px; font-weight:600; color:var(--k-ink); }
.d-step__text{ color:var(--k-soft); font-size:15px; }

.d-dark{ display:flex; flex-wrap:wrap; gap:24px 40px; align-items:center; justify-content:space-between; padding:clamp(28px, 5vw, 56px); background:var(--k-dark-btn); color:var(--k-on-dark-btn); border-radius:var(--k-r-xl); }
.d-dark__text{ flex:999 1 420px; min-width:0; display:flex; flex-direction:column; gap:16px; }
.d-dark__title{ font-size:clamp(24px, 3.2vw, 34px); line-height:1.15; letter-spacing:-.025em; font-weight:700; color:var(--k-on-dark-btn); }
.d-dark__text p{ opacity:.82; max-width:560px; }
.d-dark__actions{ display:flex; gap:12px; flex-wrap:wrap; }
.d-dark__text .d-dark__actions{ margin-top:8px; }
.d-dark__list{ flex:1 1 320px; min-width:0; margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:14px; }
.d-dark__list li{ display:flex; gap:12px; align-items:flex-start; }
.d-dark__list svg{ flex:none; margin-top:2px; color:var(--k-brand); }
.d-help-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap:16px; }
.d-btn-light{ background:var(--k-surface); color:var(--k-ink); }
.d-btn-light:hover{ background:var(--k-bg); color:var(--k-ink); }
.d-btn-outline-light{ border-color:var(--k-ink-2); color:var(--k-on-dark-btn); }
.d-btn-outline-light:hover{ background:rgba(127,127,127,.18); color:var(--k-on-dark-btn); }
.d-dark--sm{ padding:clamp(24px, 4vw, 40px); border-radius:var(--k-r-panel); }
.d-dark--sm .d-dark__title{ font-size:22px; letter-spacing:-.015em; }

.d-link-card{ display:flex; align-items:center; gap:16px; padding:20px 24px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); color:var(--k-ink); text-decoration:none; transition:border-color .15s ease, box-shadow .2s ease; }
.d-link-card:hover{ border-color:var(--k-line-2); box-shadow:var(--k-shadow-hover); color:var(--k-ink); }
.d-link-card__icon{ flex:none; width:44px; height:44px; border-radius:12px; background:var(--k-surface-2); color:var(--k-ink-2); display:flex; align-items:center; justify-content:center; }
.d-link-card__text{ flex:1 1 auto; display:flex; flex-direction:column; min-width:0; }
.d-link-card__text strong{ font-weight:600; }
.d-link-card__text span{ font-size:14px; color:var(--k-muted); }
.d-link-card > svg:last-child{ flex:none; color:var(--k-muted); }

/* ---------- Categories page ---------- */
.d-catpage{ display:flex; flex-direction:column; gap:16px; padding-top:32px; padding-bottom:80px; }
.d-catsec{ display:grid; grid-template-columns:minmax(220px, 280px) minmax(0, 1fr); gap:24px 40px; padding:28px; border:1px solid var(--k-line); border-radius:var(--k-r-card); background:var(--k-surface); scroll-margin-top:96px; }
.d-catsec__info{ display:flex; flex-direction:column; gap:12px; align-items:flex-start; min-width:0; }
.d-catsec__title{ font-size:20px; line-height:1.3; letter-spacing:-.01em; font-weight:600; }
.d-catsec__title a{ color:var(--k-ink); text-decoration:none; }
.d-catsec__title a:hover{ text-decoration:underline; }
.d-catsec__meta{ font-size:14px; color:var(--k-muted); }
.d-sublinks{ margin:0; padding:0; list-style:none; display:grid; grid-template-columns:repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap:2px 12px; align-content:start; }
.d-sublinks a{ display:flex; align-items:center; min-height:44px; padding:0 12px; border-radius:10px; color:var(--k-ink-2); font-size:15px; text-decoration:none; }
.d-sublinks a:hover{ background:var(--k-surface-2); color:var(--k-ink); }
.d-jump{ display:flex; gap:8px; flex-wrap:wrap; }
.d-jump .k-chip{ font-size:14px; }
.d-catpage .d-dark{ margin-top:16px; }
.d-results-title{ font-size:20px; font-weight:600; letter-spacing:-.01em; margin:0 0 16px; color:var(--k-ink); }

/* ---------- Category detail ---------- */
.d-cd{ display:grid; grid-template-columns:240px minmax(0, 1fr); gap:32px; align-items:start; padding-top:32px; padding-bottom:64px; }
.d-catnav{ display:flex; flex-direction:column; gap:2px; }
.d-catnav__label{ padding:0 12px 8px; font-size:13px; font-weight:600; color:var(--k-muted); }
.d-catnav a{ display:flex; align-items:center; gap:10px; min-height:44px; padding:0 12px; border-radius:10px; color:var(--k-ink-2); font-size:15px; text-decoration:none; }
.d-catnav a svg{ flex:none; color:var(--k-muted); }
.d-catnav a:hover{ background:var(--k-surface-2); color:var(--k-ink); }
.d-catnav a[aria-current="page"]{ background:var(--k-brand-soft-2); color:var(--k-brand-soft-ink); font-weight:600; }
.d-catnav a[aria-current="page"] svg{ color:currentColor; }
.d-subs{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.d-subgrid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap:12px; }
.d-subtile{ display:flex; align-items:center; gap:12px; min-height:64px; box-sizing:border-box; padding:12px 14px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); color:var(--k-ink); text-decoration:none; transition:border-color .15s ease, box-shadow .2s ease; }
.d-subtile:hover{ border-color:var(--k-line-2); box-shadow:var(--k-shadow-hover); color:var(--k-ink); }
.d-subtile span:last-child{ font-size:15px; font-weight:600; line-height:1.35; }
.d-cd-list{ padding-bottom:80px; }
.d-cd-list__in{ display:flex; flex-direction:column; gap:24px; padding-top:32px; border-top:1px solid var(--k-line); }
.d-about{ display:grid; grid-template-columns:repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap:48px; align-items:start; padding-top:clamp(56px, 7vw, 96px); padding-bottom:clamp(56px, 7vw, 96px); }
.d-about__col{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.d-about__col p{ color:var(--k-soft); line-height:1.7; }
.d-faq{ border:1px solid var(--k-line); border-radius:var(--k-r-card); background:var(--k-surface); overflow:hidden; }
.d-faq details + details{ border-top:1px solid var(--k-line); }
.d-faq summary{ display:flex; justify-content:space-between; align-items:center; gap:16px; min-height:60px; padding:14px 20px; box-sizing:border-box; font-size:16px; font-weight:600; line-height:1.4; color:var(--k-ink); cursor:pointer; list-style:none; }
.d-faq summary::-webkit-details-marker{ display:none; }
.d-faq summary svg{ flex:none; color:var(--k-muted); transition:transform .2s ease; }
.d-faq details[open] summary svg{ transform:rotate(180deg); }
.d-faq details p{ padding:0 20px 20px; color:var(--k-soft); font-size:15px; line-height:1.65; }

/* ---------- Search results ---------- */
.d-sband{ background:var(--k-bg); border-bottom:1px solid var(--k-line); }
.d-sband__in{ display:flex; flex-direction:column; gap:20px; padding-top:32px; padding-bottom:32px; }
.d-sband .d-hero__search{ max-width:720px; box-shadow:none; }
.d-smain{ display:flex; flex-direction:column; gap:48px; padding-top:40px; padding-bottom:80px; }
.d-sgroup{ display:flex; flex-direction:column; gap:16px; }
.d-people{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap:12px; }
.d-person{ display:flex; align-items:center; gap:14px; padding:16px 18px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); color:var(--k-ink); text-decoration:none; transition:border-color .15s ease, box-shadow .2s ease; }
.d-person:hover{ border-color:var(--k-line-2); box-shadow:var(--k-shadow-hover); color:var(--k-ink); }
.d-person .k-avatar{ width:48px; height:48px; font-size:15px; }
.d-person__name{ font-weight:600; }
.d-didyou{ margin:0; font-size:16px; color:var(--k-soft); }
.d-didyou a{ font-weight:600; }

/* ---------- Favorites strips ---------- */
.d-favs{ display:flex; flex-direction:column; gap:12px; }
.d-fav{ display:grid; grid-template-columns:120px minmax(0, 1fr) auto auto; align-items:center; gap:20px; padding:12px 20px 12px 12px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); color:var(--k-ink); text-decoration:none; transition:border-color .15s ease, box-shadow .2s ease; }
.d-fav:hover{ border-color:var(--k-line-2); box-shadow:var(--k-shadow-hover); color:var(--k-ink); }
.d-fav__thumb{ position:relative; width:120px; aspect-ratio:4 / 3; border-radius:12px; overflow:hidden; background:var(--k-surface-2); color:var(--k-primary); display:flex; align-items:center; justify-content:center; }
.d-fav__thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.d-fav__main{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.d-fav__title{ font-size:16px; font-weight:600; line-height:1.4; }
.d-fav__meta{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:14px; color:var(--k-soft); }
.d-fav__info{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; font-size:13px; color:var(--k-muted); white-space:nowrap; }
.d-fav__price{ font-size:13px; color:var(--k-muted); text-align:right; white-space:nowrap; }
.d-fav__price strong{ font-size:17px; color:var(--k-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px){
  .d-layout{ grid-template-columns:minmax(0, 1fr); padding-top:20px; }
  .d-filter-btn{ display:inline-flex; }

  /* the filters panel becomes a bottom sheet (main.js toggles .sheet-open) */
  .d-filters{
    position:fixed; left:0; right:0; bottom:0; z-index:10002; max-height:88vh; overflow-y:auto; overscroll-behavior:contain;
    border-radius:20px 20px 0 0; border:0; box-shadow:0 -12px 32px -12px rgba(15,23,42,.3);
    transform:translateY(105%); visibility:hidden;
    transition:transform .3s var(--k-ease), visibility 0s linear .3s;
  }
  .d-filters.sheet-open{ transform:none; visibility:visible; transition:transform .3s var(--k-ease), visibility 0s; }
  .d-filters > .d-filters__head{ justify-content:flex-end; padding:4px 12px; border-bottom:0; }
  .d-filters > .d-filters__head .d-filters__title{ display:none; }
  .d-sheet-head{
    display:flex; align-items:center; gap:10px; position:sticky; top:0; z-index:2; min-height:60px; padding:14px 8px 8px 20px;
    background:var(--k-surface); border-bottom:1px solid var(--k-line);
  }
  .d-sheet-grip{ position:absolute; top:8px; left:50%; width:36px; height:4px; margin-left:-18px; border-radius:999px; background:var(--k-line-2); }
  .d-sheet-title{ font-size:20px; font-weight:600; letter-spacing:-.01em; color:var(--k-ink); }
  .d-sheet-head .k-icon-btn{ margin-left:auto; }
  .d-sheet-foot{ display:block; position:sticky; bottom:0; z-index:2; padding:12px 20px calc(16px + env(safe-area-inset-bottom)); background:var(--k-surface); border-top:1px solid var(--k-line); }
  .filter-backdrop{ position:fixed; inset:0; z-index:10001; background:var(--k-scrim); opacity:0; transition:opacity .25s ease; }
  .filter-backdrop.open{ opacity:1; }
  html.sheet-lock, html.sheet-lock body{ overflow:hidden; }

  .d-cd{ grid-template-columns:minmax(0, 1fr); gap:24px; }
  .d-catnav{ flex-direction:row; overflow-x:auto; scrollbar-width:none; gap:6px; }
  .d-catnav::-webkit-scrollbar{ display:none; }
  .d-catnav__label{ display:none; }
  .d-catnav a{ flex:none; white-space:nowrap; border:1px solid var(--k-line); border-radius:999px; }
}
@media (max-width: 767px){
  .d-head__in{ padding-top:20px; gap:16px; }
  .d-hero{ gap:32px; }
  .d-hero__search{ padding-left:14px; }
  .d-hero__search .k-btn{ padding:0 16px; }
  .d-catsec{ grid-template-columns:minmax(0, 1fr); padding:20px; }
  .d-toolbar .d-search{ flex-basis:100%; }
  .d-toolbar .d-sort{ flex:1 1 0; min-width:0; }
  .d-toolbar .d-sort select{ width:100%; }
  .d-job{ padding:20px; }
  .d-job__budget{ align-items:flex-start; text-align:left; }
  .d-fav{ grid-template-columns:88px minmax(0, 1fr); gap:12px 14px; }
  .d-fav__thumb{ width:88px; }
  .d-fav__info, .d-fav__price{ grid-column:2; align-items:flex-start; text-align:left; flex-direction:row; gap:10px; }
  .d-section__head .d-more{ margin-left:-2px; }
  .d-empty{ padding:40px 20px; }
  .d-dark{ border-radius:var(--k-r-panel); }
}
@media (prefers-reduced-motion: reduce){
  .d-filters, .filter-backdrop, .d-faq summary svg{ transition:none !important; }
}
.d-toolbar > .d-chips{ flex:1 1 360px; min-width:0; }
.d-listing-bar{ padding-top:24px; }
.d-sort-chips{ flex:1 1 100%; }
.d-layout--flush{ padding-top:24px; }
.d-search--wide{ flex:none; width:100%; max-width:600px; }
.d-catpage__list{ display:flex; flex-direction:column; gap:16px; }

/* Dark theme: the inverted "dark band" would become a light slab on a dark
   page, so in dark it sits on the brand-tinted surface instead. */
:root[data-theme="dark"] .d-dark{ background:var(--k-brand-soft); color:var(--k-ink); border:1px solid var(--k-line-2); }
:root[data-theme="dark"] .d-dark__title{ color:var(--k-ink); }
:root[data-theme="dark"] .d-btn-light{ background:var(--k-dark-btn); color:var(--k-on-dark-btn); }
:root[data-theme="dark"] .d-btn-light:hover{ background:var(--k-dark-btn-hover); color:var(--k-on-dark-btn); }
:root[data-theme="dark"] .d-dark__text p{ color:var(--k-soft); opacity:1; }
:root[data-theme="dark"] .d-btn-outline-light{ color:var(--k-ink); border-color:var(--k-line-3); }

.d-save-search-btn, .save-search-btn{ white-space:nowrap; }
:root[data-theme="dark"] .d-cat--cta{ background:var(--k-brand-soft); border-color:var(--k-line-2); color:var(--k-ink); }
:root[data-theme="dark"] .d-cat--cta:hover{ background:var(--k-brand-soft); border-color:var(--k-line-3); color:var(--k-ink); }
:root[data-theme="dark"] .d-cat--cta .d-cat__go{ color:var(--k-brand-soft-ink); }

/* Match pass: categories directory and catalogue sidebar widths */
.d-layout{ grid-template-columns:262px minmax(0, 1fr); }
.d-jump{ align-items:center; }
.d-jump__label{ font-size:13px; color:var(--k-muted); margin-right:4px; }
.d-catsec{ grid-template-columns:minmax(220px, 272px) minmax(0, 1fr); }
.d-catsec__meta{ line-height:1.5; }
.d-sublinks{ margin:0 0 0 -12px; gap:0 12px; }
.d-sublinks a{ min-height:42px; line-height:1.35; }
@media (min-width: 1024px){
  .d-sublinks{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1023px){
  .d-layout{ grid-template-columns:minmax(0, 1fr); }
}
@media (max-width: 767px){
  .d-catsec{ grid-template-columns:minmax(0, 1fr); }
}
.d-sgroup__h{ display:flex; align-items:baseline; gap:8px; }
.d-sgroup__count{ font-size:14px; font-weight:500; color:var(--k-muted); font-variant-numeric:tabular-nums; }
.d-grid--3{ grid-template-columns:repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }

/* Saved page rows: the title is the link (stretched over the row) so the
   Remove form can sit inside the row as a sibling. */
.d-favs__tabs{ margin-bottom:24px; }
.d-fav{ position:relative; grid-template-columns:120px minmax(0, 1fr) auto auto auto; }
.d-fav__titlerow{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.d-fav__link{ color:var(--k-ink); text-decoration:none; }
.d-fav__link::after{ content:""; position:absolute; inset:0; border-radius:inherit; }
.d-fav__link:focus-visible{ outline:none; }
.d-fav__link:focus-visible::after{ outline:2px solid var(--k-brand); outline-offset:2px; }
.d-fav__remove{ position:relative; z-index:1; margin:0; }
.d-fav__remove .k-btn{ color:var(--k-ink); }
.d-fav__remove svg{ color:var(--k-brand); }
.d-fav.is-gone{ background:var(--k-surface-2); }
.d-fav.is-gone .d-fav__thumb{ color:var(--k-muted); }
@media (max-width: 767px){
  .d-fav{ grid-template-columns:88px minmax(0, 1fr); }
  .d-fav__remove{ grid-column:2; }
}

/* Save heart on a service card (_save_button.html, save.js); sits above
   the card's stretched title link. */
.d-heart{ position:absolute; top:12px; right:12px; z-index:2; display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border:1px solid var(--k-line); border-radius:50%; background:var(--k-surface); color:var(--k-soft); cursor:pointer; transition:color .15s, border-color .15s; }
.d-heart:hover{ color:var(--k-ink); border-color:var(--k-line-2); }
.d-heart[aria-pressed="true"]{ color:var(--k-brand); }
.d-heart[aria-pressed="true"] svg{ fill:currentColor; }
.d-heart:focus-visible{ outline:2px solid var(--k-brand); outline-offset:2px; }
.d-heart:disabled{ opacity:.6; }

/* Home hero: the newest open project as an example brief. */
.d-brief{ gap:12px; }
.d-brief__card{ display:flex; flex-direction:column; gap:12px; padding:20px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); color:var(--k-ink); text-decoration:none; transition:border-color .15s; }
.d-brief__card:hover{ border-color:var(--k-line-2); color:var(--k-ink); }
.d-brief__top{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.d-brief__title{ font-size:18px; font-weight:600; line-height:1.35; overflow-wrap:anywhere; }
.d-brief__text{ font-size:14px; line-height:1.55; color:var(--k-soft); }
.d-brief__tags{ display:flex; flex-wrap:wrap; gap:6px; }
.d-brief__label{ padding:4px 4px 0; font-size:13px; font-weight:600; color:var(--k-soft); }
.d-prop{ display:flex; align-items:center; gap:12px; padding:14px 16px; background:var(--k-surface); border:1px solid var(--k-line); border-radius:var(--k-r-card); }
.d-prop__av{ background:var(--k-line); color:var(--k-ink); }
.d-prop__av--dark{ background:var(--k-dark-btn); color:var(--k-on-dark-btn); }
.d-prop__who{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
.d-prop__name{ font-size:15px; font-weight:600; color:var(--k-ink); }
.d-prop__meta{ font-size:13px; color:var(--k-muted); }

/* Small uppercase kicker above a heading (design: hero, dark band, example brief). */
.d-eyebrow{ font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--k-primary); }
.d-eyebrow--muted{ color:var(--k-muted); }
.d-eyebrow--on-dark{ color:var(--k-on-dark-accent); }

/* How it works: clients / freelancers switch. */
.d-how-switch{ display:inline-flex; padding:4px; gap:4px; border:1px solid var(--k-line); border-radius:var(--k-r); background:var(--k-surface); }
.d-how-switch button{ min-height:36px; padding:0 14px; border:0; border-radius:calc(var(--k-r) - 4px); background:transparent; font:inherit; font-size:14px; font-weight:600; color:var(--k-soft); cursor:pointer; }
.d-how-switch button[aria-selected="true"]{ background:var(--k-ink); color:var(--k-bg); }
.d-how-switch button:focus-visible{ outline:2px solid var(--k-brand); outline-offset:2px; }
.d-steps[hidden]{ display:none; }
/* On a job card the heart closes the footer row instead of floating. */
.d-job__foot .d-heart{ position:relative; top:auto; right:auto; margin-left:auto; }

/* Phones: a compact home, as in the design (the hero keeps its search and
   the two main actions; categories become a two-column grid of names). */
.d-cat--all{ display:none; }
@media (max-width: 767px){
  .d-hero__sub, .d-hero__offer, .d-hero__panel{ display:none; }
  .d-cat-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
  .d-cat{ align-items:center; gap:10px; padding:12px; }
  .d-cat .d-icon-tile--sm{ width:36px; height:36px; flex:none; }
  .d-cat__sub{ display:none; }
  .d-cat__name{ font-size:14px; line-height:1.3; }
  .d-cat--cta{ display:none; }
  .d-cat--all{ display:flex; background:var(--k-surface-2); }
}
