/* Zgłoszenia (helpdesk) - frontend. Template-independent: the module reads the shared --cms-* tokens a template may
   define (AGENTS.md, section 23) and falls back to Bootstrap variables. Layout reacts to the width of the module or
   block (container queries). Link classes are written twice (".hd-x.hd-x") so template rules such as ".mn-template a"
   do not recolour them. */

.hd-module,.hd-block{
  --hd-accent:var(--cms-accent,var(--bs-primary,#0d6efd));
  --hd-accent-ink:var(--cms-accent-ink,var(--hd-accent));
  --hd-accent-soft:var(--cms-accent-soft,color-mix(in srgb,var(--hd-accent) 12%,transparent));
  --hd-text:var(--bs-body-color,#212529);
  --hd-muted:var(--bs-secondary-color,#6c757d);
  --hd-border:var(--bs-border-color,#dee2e6);
  --hd-surface:var(--cms-surface,var(--bs-body-bg,#fff));
  --hd-soft:var(--cms-surface-soft,var(--bs-tertiary-bg,#f8f9fa));
  --hd-line:var(--cms-surface-border-width,1px);
  --hd-radius:var(--cms-radius,12px);
  --hd-radius-sm:var(--cms-radius-sm,8px);
  container-type:inline-size;
}
:where(.hd-module,.hd-block) a:not([class]){color:var(--hd-accent-ink)}

.hd-module{margin-bottom:2rem}
.hd-crumbs{font-size:.85rem;color:var(--hd-muted);margin-bottom:.5rem}
.hd-crumbs a{color:inherit}
.hd-head{margin-bottom:1.25rem}
.hd-head__title{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;margin:0 0 .5rem;font-size:clamp(1.5rem,1.25rem + 1vw,2.1rem);line-height:1.2;overflow-wrap:anywhere}
.hd-head__lead{color:var(--hd-muted);max-width:72ch}
.hd-head__lead p:last-child{margin-bottom:0}
.hd-hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}

.hd-layout{display:grid;gap:1rem;align-items:start}
@container (min-width:52rem){.hd-layout{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr)}.hd-layout--even{grid-template-columns:1fr 1fr}}
.hd-side{display:grid;gap:1rem}
.hd-card{padding:1.1rem 1.2rem;border:var(--hd-line) solid var(--hd-border);border-radius:var(--hd-radius);background:var(--hd-surface);margin-bottom:1rem}
.hd-layout .hd-card,.hd-side .hd-card{margin-bottom:0}
.hd-card--soft{background:var(--hd-soft)}
.hd-card__title{display:flex;align-items:center;gap:.45rem;font-size:1.1rem;margin:0 0 .75rem}
.hd-card p:last-child{margin-bottom:0}
.hd-steps{margin:0;padding-left:1.2rem;font-size:.92rem}
.hd-steps li+li{margin-top:.3rem}

.hd-status{display:inline-flex;align-items:center;gap:.3rem;font-weight:600}
.hd-ticket__meta{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem 1rem;font-size:.88rem;color:var(--hd-muted)}
.hd-ticket__meta code{font-size:.85em}
.hd-thread{list-style:none;margin:0 0 1rem;padding:0;display:grid;gap:.75rem}
.hd-msg{padding:.85rem 1rem;border:var(--hd-line) solid var(--hd-border);border-radius:var(--hd-radius);background:var(--hd-surface);max-width:46rem}
.hd-msg--staff{margin-left:auto;background:var(--hd-accent-soft);border-color:color-mix(in srgb,var(--hd-accent) 35%,var(--hd-border))}
.hd-msg__head{display:flex;flex-wrap:wrap;justify-content:space-between;gap:.25rem .75rem;margin-bottom:.4rem;font-size:.9rem}
.hd-msg__date{color:var(--hd-muted);font-size:.8rem}
.hd-msg__body{overflow-wrap:anywhere}
.hd-msg__body p{margin:0 0 .5rem}
.hd-msg__body p:last-child{margin:0}

.hd-mine{list-style:none;margin:0;padding:0}
.hd-mine li{display:flex;flex-wrap:wrap;align-items:center;gap:.3rem .6rem;padding:.45rem 0;border-bottom:1px solid color-mix(in srgb,var(--hd-border) 70%,transparent)}
.hd-mine li:last-child{border-bottom:0}
.hd-mine__link.hd-mine__link{font-weight:600;color:var(--hd-accent-ink);text-decoration:none}
.hd-mine__date{margin-left:auto;font-size:.8rem;color:var(--hd-muted)}

/* Block */
.hd-block__text{font-size:.9rem;margin:0 0 .6rem}
.hd-block__form{display:flex;gap:.4rem;margin-bottom:.6rem}
.hd-block__form .form-control{min-width:0;font-family:var(--bs-font-monospace);font-size:.85rem}
.hd-block__links{display:flex;flex-wrap:wrap;gap:.3rem 1rem;font-size:.88rem;font-weight:600}
.hd-block__link.hd-block__link{color:var(--hd-accent-ink);text-decoration:none}
.hd-block__link.hd-block__link:hover{text-decoration:underline}
