/* jah.dk — кар'єрна сторінка компанії (jah.dk/<slug>), iframe-фолбек віджета, редактор.
   Токени — з design.css (--bg/--surface/--fg/--border…, темна тема там же); акцент компанії —
   --cs-accent (з companies.brand_color, валідований #RRGGBB) і --cs-accent-fg (контраст). */
:root {
  /* Без бренд-кольору компанії — акцент сайту; типографіка/відступи — з токенів design.css. */
  --cs-accent: var(--brand);
  --cs-accent-fg: var(--brand-fg);
}
.cs-body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans, inherit);
}
.cs-wrap {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 16px;
}
.cs-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.cs-header .cs-wrap {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cs-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-logo-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  flex: none;
}
.cs-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  flex: none;
}
.cs-langs a {
  padding: 4px 6px;
  border-radius: 6px;
}
.cs-langs a[aria-current="true"] {
  color: var(--fg);
  font-weight: 600;
}
.cs-langs a:hover {
  color: var(--fg);
}
.cs-icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--fg);
}
.cs-icon-btn:focus-visible,
.cs-langs a:focus-visible,
.cs-btn:focus-visible,
.cs-link:focus-visible {
  outline: 2px solid var(--cs-accent);
  outline-offset: 2px;
}

.cs-hero {
  position: relative;
  min-height: 180px;
  background: linear-gradient(
    135deg,
    var(--cs-accent),
    color-mix(in srgb, var(--cs-accent) 55%, #0b1120)
  );
  background-size: cover;
  background-position: center;
}
.cs-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cs-hero-emoji {
  position: absolute;
  right: 24px;
  bottom: 16px;
  font-size: 56px;
  line-height: 1;
  opacity: 0.9;
}
@media (min-width: 768px) {
  .cs-hero {
    min-height: 260px;
  }
}
.cs-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 16px;
}
/* Лого наїжджає на обкладинку, текст — завжди під нею (читабельний на будь-якому фото). */
.cs-head > .cs-logo {
  margin-top: -48px;
}
.cs-head > .cs-btn {
  margin-top: 14px;
}
.cs-logo {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-sm);
  flex: none;
}
.cs-logo-ph {
  display: grid;
  place-items: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--cs-accent-fg);
  background: var(--cs-accent);
}
.cs-head-txt {
  flex: 1 1 240px;
  min-width: 0;
  padding-top: 10px;
}
.cs-h1 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
@media (min-width: 768px) {
  .cs-h1 {
    font-size: 34px;
  }
}
.cs-tagline {
  margin-top: 4px;
  font-size: 17px;
  color: var(--fg-muted);
  overflow-wrap: anywhere;
}
.cs-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius, 10px);
  font-weight: 600;
  font-size: 15px;
  background: var(--cs-accent);
  color: var(--cs-accent-fg);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s;
}
.cs-btn:hover {
  filter: brightness(1.08);
}
.cs-btn-ghost {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
}
.cs-btn-ghost:hover {
  filter: none;
  background: var(--bg-subtle, #f1f5f9);
}
.cs-btn-block {
  width: 100%;
}
.cs-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.cs-link {
  color: var(--cs-accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Текстовий акцент: бренд-колір змішуємо з текстом, щоб і темний, і світлий бренд читались. */
:root {
  --cs-accent-text: color-mix(in srgb, var(--cs-accent) 70%, var(--fg));
}

.cs-section {
  margin-top: 40px;
}
.cs-h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cs-lead {
  margin-top: 8px;
  color: var(--fg-muted);
}
.cs-prose {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.cs-prose-html {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.cs-prose-html p,
.cs-prose-html ul,
.cs-prose-html ol {
  margin: 0 0 12px;
}
.cs-prose-html ul {
  list-style: disc;
  padding-left: 22px;
}
.cs-prose-html ol {
  list-style: decimal;
  padding-left: 22px;
}
.cs-prose-html h2,
.cs-prose-html h3 {
  font-weight: 700;
  margin: 18px 0 8px;
}
.cs-prose-html a {
  color: var(--cs-accent-text);
  text-decoration: underline;
}
.cs-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .cs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .cs-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.cs-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 16px);
  padding: 18px;
  min-width: 0;
}
.cs-tile h3 {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cs-tile p {
  margin-top: 6px;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.cs-tile-mark {
  display: inline-block;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--cs-accent);
  margin-bottom: 10px;
}

.cs-steps {
  margin-top: 16px;
  display: grid;
  gap: 0;
  counter-reset: step;
}
.cs-step {
  position: relative;
  padding: 0 0 20px 48px;
  min-width: 0;
}
.cs-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--cs-accent);
  color: var(--cs-accent-fg);
}
.cs-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
.cs-step h3 {
  font-weight: 600;
  padding-top: 5px;
  overflow-wrap: anywhere;
}
.cs-step p {
  margin-top: 4px;
  color: var(--fg-muted);
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.cs-faq {
  margin-top: 16px;
  border-top: 1px solid var(--border);
}
.cs-faq details {
  border-bottom: 1px solid var(--border);
}
.cs-faq summary {
  cursor: pointer;
  padding: 14px 32px 14px 0;
  font-weight: 600;
  position: relative;
  list-style: none;
  overflow-wrap: anywhere;
}
.cs-faq summary::-webkit-details-marker {
  display: none;
}
.cs-faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 12px;
  font-size: 20px;
  color: var(--fg-muted);
}
.cs-faq details[open] summary::after {
  content: "–";
}
.cs-faq .cs-faq-a {
  padding: 0 0 16px;
  color: var(--fg-muted);
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.cs-video {
  max-width: 48rem;
  margin-top: 16px;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--cs-accent) 80%, #000),
    #0b1120
  );
}
.cs-video button {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  padding: 16px;
  text-align: center;
}
.cs-video .cs-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0b1120;
  display: grid;
  place-items: center;
  font-size: 24px;
}
.cs-video small {
  font-weight: 400;
  opacity: 0.85;
  max-width: 32rem;
}
.cs-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.cs-filters {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .cs-filters {
    grid-template-columns: 2fr 1fr 1fr auto;
  }
}
.cs-jobs {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.cs-job {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 16px);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
  min-width: 0;
}
.cs-job:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.cs-job-title {
  font-weight: 600;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.cs-job-meta {
  margin-top: 4px;
  color: var(--fg-muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.cs-job-go {
  flex: none;
  color: var(--cs-accent-text);
  font-weight: 600;
  font-size: 14px;
}
.cs-compact .cs-job {
  padding: 10px 14px;
  border-radius: 10px;
}
.cs-empty {
  margin-top: 12px;
  padding: 24px;
  text-align: center;
  color: var(--fg-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl, 16px);
}

.cs-contacts {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .cs-contacts {
    grid-template-columns: repeat(2, 1fr);
  }
}
.cs-contact {
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
  overflow-wrap: anywhere;
}
.cs-contact b {
  flex: none;
  width: 5.5rem;
  font-weight: 500;
  color: var(--fg-muted);
  font-size: 14px;
}
.cs-socials {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  margin-top: 24px;
}
@media (min-width: 1024px) {
  .cs-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
  }
}
.cs-facts {
  display: grid;
  gap: 10px;
}
.cs-fact {
  font-size: 14px;
}
.cs-fact b {
  display: block;
  color: var(--fg-muted);
  font-weight: 500;
  font-size: 13px;
}
.cs-aside {
  align-self: start;
}
@media (min-width: 1024px) {
  .cs-aside {
    position: sticky;
    top: 16px;
  }
}

.cs-form {
  display: grid;
  gap: 14px;
}
.cs-form .cs-row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .cs-form .cs-row {
    grid-template-columns: 1fr 1fr;
  }
}
.cs-form label.cs-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.cs-req {
  color: var(--danger);
}
.cs-hint {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 4px;
}
.cs-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
}
.cs-check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--cs-accent);
}
.cs-err {
  color: var(--danger);
  font-size: 14px;
  margin-top: 4px;
}
.cs-alert {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--fg);
  font-size: 14px;
}
.cs-ok {
  padding: 28px;
  text-align: center;
}
.cs-ok-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: var(--cs-accent);
  color: var(--cs-accent-fg);
}
.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.cs-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 13px;
  color: var(--fg-muted);
}
.cs-footer .cs-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}
.cs-footer a:hover {
  color: var(--fg);
}
.cs-preview-bar {
  background: #fef3c7;
  color: #78350f;
  font-size: 14px;
  padding: 8px 16px;
  text-align: center;
}
.cs-frame {
  padding: 12px 4px;
}
.cs-frame .cs-wrap {
  padding: 0 8px;
}

/* Редактор у кабінеті */
.ed-list {
  display: grid;
  gap: 10px;
}
.ed-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.ed-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}
.ed-section {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 18px;
}
.ed-section > h2 {
  font-weight: 600;
  font-size: 17px;
}
.ed-section > p {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 2px;
}
.ed-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
}
.ed-cover {
  width: 100%;
  max-width: 360px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.ed-sticky {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 5;
  /* праворуч — місце під плаваючу кнопку AI-асистента */
  padding-right: 72px;
}
.ed-code {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
}
.ed-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ed-preview {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--bg);
  min-height: 200px;
}
.ed-hidden {
  display: none !important;
}
