/* ===== CSS Variables ===== */
:root {
  --navy: #0A1A33;
  --gold: #F5A623;
  --blue: #00B8F4;
  --background: #F2F2F2;
  --white: #FFFFFF;
  --text: #1F1F1F;
  --border: #d9dee7;
  --muted: #687386;
  --radius: 10px;
  --shadow: 0 10px 28px rgba(10, 26, 51, .08);
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--text);
  background: var(--background);
}

/* ===== Reset ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--background); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, input:focus, select:focus, textarea:focus, a:focus-visible {
  outline: 3px solid rgba(0, 184, 244, .35);
  outline-offset: 3px;
}

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(10, 26, 51, .16);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
}
.logo-placeholder {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: "Roboto Mono", monospace;
}
.logo-placeholder img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 18px;
  flex: 1;
  text-align: center;
}
.main-nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 0;
  color: rgba(255, 255, 255, .88);
  background: transparent;
  font-size: .92rem;
  cursor: pointer;
}
.main-nav button:hover,
.main-nav button:focus-visible {
  border-bottom-color: var(--gold);
  color: var(--gold);
}
.search-header {
  flex: 0 0 auto;
  max-width: 420px;
  min-width: 280px;
}
.search-form-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--white);
}
.search-label-header {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}
.search-controls-header {
  display: flex;
  gap: 4px;
  align-items: center;
}
.search-controls-header input,
.search-controls-header select {
  padding: 4px 6px;
  font-size: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  height: 28px;
}
.search-controls-header input {
  flex: 1 1 80px;
  min-width: 60px;
}
.search-controls-header select {
  flex: 0 1 70px;
}
.search-controls-header .button {
  padding: 4px 10px;
  font-size: 0.7rem;
  min-height: 28px;
  flex: 0 0 auto;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1.2;
}
.search-controls-header .button:hover {
  background: #ffc057;
}

/* ===== Main ===== */
.site-main {
  min-height: calc(100vh - 152px);
  padding: 20px 0 88px;
}
.view[hidden] { display: none; }

/* ===== Hero ===== */
.hero {
  max-width: 960px;
  margin: 0 auto 30px;
  padding: 0;
}
.hero h1 {
  max-width: 760px;
  margin: 10px 0 18px;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.025em;
}
.hero-copy {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-family: "Roboto Mono", monospace;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ===== AI Assistant preview ===== */
.main-assistant {
  max-width: 85%;
  margin: 0 auto 20px;
}
.main-assistant .assistant-preview {
  padding: 12px 16px;
  border-top: 5px solid var(--blue);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.main-assistant .assistant-preview h2 {
  font-size: 1.4rem;
  margin: 0 0 2px;
  color: var(--navy);
}
.main-assistant .assistant-description {
  font-size: 0.85rem;
  max-width: 600px;
  color: var(--muted);
  margin-bottom: 6px;
}
.main-assistant .assistant-form {
  max-width: 100%;
  margin-top: 6px;
}
.main-assistant .assistant-form label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
}
.main-assistant .assistant-form textarea {
  font-size: 0.8rem;
  padding: 6px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  width: 100%;
  min-height: 70px;
  resize: vertical;
  box-sizing: border-box;
}
.main-assistant .button-large {
  font-size: 0.85rem;
  padding: 6px 14px;
  min-height: 32px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.main-assistant .button-large:hover {
  background: #ffc057;
}

/* ============================================================
   ЗБІЛЬШЕНИЙ НА 30% БЛОК ВІДПОВІДЕЙ АСИСТЕНТА
   Тепер ширина = 100% батьківського контейнера
   ============================================================ */
#assistant-preview-response,
#assistant-response {
  width: 100% !important;
  box-sizing: border-box;
  margin-top: 6px;
}

.assistant-results {
  width: 100%;
  padding: 5.2px 7.8px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  box-sizing: border-box;
}

.result-section {
  margin-bottom: 5.2px;
}
.result-section:last-of-type {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 2.6px 0;
  padding: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.6px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 3.9px;
  padding: 1.3px 5.2px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 3.9px;
  font-size: 0.91rem;
  cursor: pointer;
  transition: 0.15s;
}
.checkbox-card:hover {
  border-color: var(--blue);
  background: rgba(0,184,244,0.05);
}
.checkbox-card input[type="checkbox"] {
  width: 14.3px;
  height: 14.3px;
  accent-color: var(--blue);
  margin: 0;
  flex-shrink: 0;
}
.checkbox-card span {
  user-select: none;
  font-weight: 500;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 3.9px;
  margin-top: 5.2px;
}
.action-buttons .button {
  padding: 2.6px 13px;
  font-size: 0.91rem;
  font-weight: 700;
  border: none;
  border-radius: 5.2px;
  cursor: pointer;
  transition: 0.2s;
}
.action-buttons .button-primary {
  background: var(--gold);
  color: var(--navy);
}
.action-buttons .button-primary:hover {
  background: #ffc057;
}
.action-buttons .button-secondary {
  background: var(--blue);
  color: var(--white);
}
.action-buttons .button-secondary:hover {
  background: #0099cc;
}

.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 3.9px;
  margin-top: 5.2px;
}
.external-links .button {
  padding: 2.6px 13px;
  font-size: 0.91rem;
  border-radius: 5.2px;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
}
.external-links .button:hover {
  background: #1a2f4d;
}

.job-list {
  list-style: none;
  padding: 0;
  margin: 5.2px 0 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3.9px;
}

.job-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 5.2px;
  padding: 3.9px 7.8px;
  font-size: 0.91rem;
  display: flex;
  flex-direction: column;
  gap: 1.3px;
  transition: 0.15s;
}
.job-item:hover {
  border-color: var(--blue);
}
.job-item strong {
  font-weight: 700;
  color: var(--navy);
}
.job-item a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.job-item a:hover {
  text-decoration: underline;
}
.job-list li:only-child {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  background: transparent;
  border: none;
  padding: 5.2px 0;
}

/* ===== News ===== */
.section-block { margin-top: 60px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.section-heading h2,
.content-grid h2,
.view h2 {
  margin: 5px 0 0;
  color: var(--navy);
  line-height: 1.2;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.news-card {
  max-height: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--white);
  box-shadow: 0 4px 14px rgba(10, 26, 51, .04);
}
.news-card img {
  max-height: 100px;
  object-fit: cover;
  border-radius: 6px;
}
.news-card h2 {
  font-size: 1rem;
  margin: 6px 0 4px;
  color: var(--navy);
}
.news-card p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.news-card time {
  font-size: 0.7rem;
  color: var(--muted);
}
.news-card .button {
  font-size: 0.8rem;
  padding: 6px 12px;
  min-height: 32px;
  align-self: flex-start;
}

/* ===== Results & other cards ===== */
.results { display: grid; gap: 14px; margin-top: 28px; }
.results > h2 { margin: 0 0 4px; color: var(--navy); }
.result-card,
.content-grid article,
.news-detail,
.conversation-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--white);
  box-shadow: 0 4px 14px rgba(10, 26, 51, .04);
}
.result-card h3,
.news-detail h1 {
  margin: 0 0 10px;
  color: var(--navy);
}
.result-card p,
.news-detail p {
  color: var(--muted);
}
.result-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 14px;
  margin: 18px 0;
  font-size: .9rem;
}
.result-card dt {
  color: var(--navy);
  font-weight: 700;
}
.result-card dd {
  margin: 0;
  color: var(--muted);
}
.result-link {
  display: inline-flex;
  margin-top: 4px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}
.news-detail {
  max-width: 850px;
  margin: 28px auto 0;
}
.news-detail img {
  width: 100%;
  border-radius: 6px;
}
.news-source {
  color: var(--muted);
  font-family: "Roboto Mono", monospace;
  overflow-wrap: anywhere;
}
.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.news-tag {
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--navy);
  background: rgba(0, 184, 244, .15);
  font-size: .82rem;
}

/* ===== Social ===== */
.social-panel {
  border-top: 4px solid var(--gold);
  padding: 28px;
  background: var(--white);
  border-radius: var(--radius);
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--background);
  color: var(--navy);
  text-decoration: none;
  font-size: 0.9rem;
}
.social-links a:hover {
  border-color: var(--blue);
  background: rgba(0, 184, 244, .12);
}
.social-icon {
  height: 24px;
  width: auto;
  display: block;
}

/* ===== Career Assistant full page ===== */
.content-view > p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
}
.assistant-form {
  max-width: 720px;
  margin: 24px 0 0;
}
.assistant-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--navy);
}
.assistant-form textarea {
  display: block;
  margin-bottom: 12px;
  resize: vertical;
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--white);
  font-size: 1rem;
  box-sizing: border-box;
}
.assistant-form textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,184,244,.2);
}
.assistant-form .button {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.assistant-form .button:hover {
  background: #ffc057;
}
.assistant-response {
  width: 100%;
  max-width: 720px;
  min-height: 68px;
  margin: 16px 0 0;
  padding: 16px 20px;
  color: var(--text);
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  white-space: pre-wrap;
  box-shadow: var(--shadow);
  box-sizing: border-box;
}
.conversation-history {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.conversation-item {
  padding: 16px 20px;
  background: var(--white);
  border-left: 4px solid var(--blue);
}
.conversation-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
}
.conversation-item p {
  margin: 0;
  color: var(--muted);
}

/* ===== About / Contact ===== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.content-grid article p {
  color: var(--muted);
  line-height: 1.65;
}
.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ===== Footer ===== */
.site-footer {
  color: var(--white);
  background: var(--navy);
  margin-top: 60px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  font-size: .85rem;
  flex-wrap: wrap;
}
.footer-brand {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .04em;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
}
.footer-links a {
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--gold);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .search-header {
    max-width: 320px;
    min-width: 200px;
  }
  .search-controls-header input {
    flex: 1 1 50px;
    min-width: 40px;
  }
  .search-controls-header select {
    flex: 0 1 60px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
    gap: 12px;
  }
  .main-nav {
    width: 100%;
    justify-content: flex-start;
    flex: 0 1 auto;
  }
  .search-header {
    max-width: 100%;
    min-width: auto;
    width: 100%;
  }
  .search-form-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 6px 10px;
  }
  .search-label-header {
    font-size: 0.7rem;
    margin-right: 8px;
  }
  .search-controls-header {
    flex: 1;
    flex-wrap: wrap;
  }
  .search-controls-header input {
    flex: 1 1 100px;
  }
  .search-controls-header select {
    flex: 0 1 80px;
  }
  .content-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main-assistant {
    max-width: 100%;
  }
  .main-assistant .assistant-preview {
    padding: 16px;
  }
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .job-list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 700px) {
  .container { width: min(100% - 28px, 560px); }
  .site-main { padding-top: 12px; }
  .hero h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .card-grid,
  .content-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 0;
  }
  .footer-links {
    justify-content: flex-start;
  }
  .main-assistant .assistant-preview h2 {
    font-size: 1.4rem;
  }
  .main-assistant .button-large {
    width: 100%;
  }
  .search-header {
    max-width: 100%;
  }
  .search-form-header {
    flex-direction: column;
    align-items: stretch;
  }
  .search-label-header {
    margin-bottom: 4px;
  }
  .search-controls-header {
    flex-direction: column;
    gap: 4px;
  }
  .search-controls-header input,
  .search-controls-header select,
  .search-controls-header .button {
    width: 100%;
    flex: 1 1 auto;
  }
  .social-links a {
    padding: 4px 10px;
    font-size: 0.8rem;
  }
  .social-icon {
    height: 20px;
  }
  .checkbox-grid {
    grid-template-columns: 1fr !important;
  }
  .job-list {
    grid-template-columns: 1fr !important;
  }
}