:root {
  --kec-navy: #0d2847;
  --kec-blue: #15549a;
  --kec-teal: #08786f;
  --kec-ink: #172538;
  --kec-muted: #56677b;
  --kec-line: #d6dee8;
  --kec-soft: #f3f7fb;
  --kec-warn: #8a4c00;
}

.kec-hero {
  padding: 76px 28px 82px;
  background: linear-gradient(132deg, #0c2542 0%, #154e7b 65%, #0b7069 100%);
  color: #fff;
}

.kec-hero-inner {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 56px;
  align-items: end;
}

.kec-kicker,
.kec-results-head p {
  margin: 0 0 10px;
  color: #72e2d6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}

.kec-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.08;
  letter-spacing: -.055em;
}

.kec-hero > div > div > p:last-child {
  max-width: 760px;
  margin: 0;
  color: #d7e8f5;
  font-size: 18px;
  line-height: 1.7;
}

.kec-hero aside {
  padding: 23px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 14px;
  background: rgba(4, 25, 45, .33);
  backdrop-filter: blur(8px);
}

.kec-hero aside p {
  margin: 8px 0 0;
  color: #dcebf5;
  font-size: 14px;
  line-height: 1.65;
}

.kec-current {
  display: flex;
  max-width: 1180px;
  margin: -31px auto 0;
  padding: 18px 22px;
  border: 1px solid #cbd7e4;
  border-left: 5px solid #0f9286;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 13px 34px rgba(17, 49, 82, .13);
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.kec-current > div {
  display: flex;
  gap: 13px;
  align-items: start;
}

.kec-current p {
  margin: 3px 0 0;
  color: var(--kec-muted);
  font-size: 13px;
}

.kec-live {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e3f5ec;
  color: #12623e;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.kec-live.is-static {
  background: #fff1d7;
  color: #8a4c00;
}

.kec-current-actions {
  align-items: center !important;
  flex-wrap: wrap;
  justify-content: end;
}

.kec-current-actions a {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--kec-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.kec-current-actions span {
  color: #657487;
  font-size: 11px;
}

.kec-shell {
  max-width: 1260px;
  margin: 0 auto;
  padding: 54px 28px 92px;
}

.kec-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--kec-line);
  border-radius: 15px;
  background: var(--kec-soft);
}

.kec-search-panel label {
  display: grid;
  gap: 7px;
  color: #24364b;
  font-weight: 900;
}

.kec-search-panel input[type="search"] {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid #7d8da1;
  border-radius: 8px;
  background: #fff;
  color: var(--kec-ink);
  font: inherit;
  font-size: 16px;
}

.kec-search-panel > button {
  min-height: 54px;
  align-self: end;
  padding: 0 18px;
  border: 1px solid var(--kec-blue);
  border-radius: 8px;
  background: var(--kec-blue);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.kec-quick {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.kec-quick button {
  padding: 7px 10px;
  border: 1px solid #9aa9ba;
  border-radius: 999px;
  background: #fff;
  color: #2c4b6e;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.kec-reading {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border-left: 4px solid var(--kec-blue);
  border-radius: 0 9px 9px 0;
  background: #e9f2fb;
}

.kec-reading[hidden],
.kec-answer[hidden],
.kec-empty[hidden] { display: none !important; }

.kec-reading strong { color: #173f6c; }
.kec-reading p { margin: 4px 0 0; color: #4a5e76; font-size: 13px; }
.kec-reading .is-caution { color: var(--kec-warn); }

.kec-workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 26px;
  margin-top: 27px;
}

.kec-filters {
  display: grid;
  align-self: start;
  gap: 22px;
  position: sticky;
  top: 84px;
}

.kec-filters > div {
  display: grid;
  gap: 8px;
}

.kec-filters strong {
  color: #26394f;
  font-size: 14px;
}

.kec-filters label,
.kec-filters button {
  display: flex;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--kec-line);
  border-radius: 8px;
  background: #fff;
  color: #45586d;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.kec-filters button {
  width: 100%;
  justify-content: space-between;
  cursor: pointer;
}

.kec-filters button.is-active {
  border-color: var(--kec-blue);
  background: #e9f1fa;
  color: #153f6c;
  font-weight: 900;
}

.kec-filters button span {
  color: #718095;
  font-size: 11px;
}

.kec-filters > p {
  margin: 0;
  padding: 13px;
  border: 1px solid #e3c589;
  border-radius: 9px;
  background: #fff8e7;
  color: #754d0c;
  font-size: 12px;
  line-height: 1.55;
}

.kec-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.kec-results-head p { color: #9c5500; }
.kec-results-head h2 { margin: 0; color: var(--kec-navy); font-size: 30px; }
.kec-results-head > strong { color: var(--kec-muted); font-size: 13px; }

.kec-answer {
  margin-bottom: 18px;
  padding: 22px;
  border: 2px solid #7399bd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 51, 86, .09);
}

.kec-answer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--kec-line);
}

.kec-answer-head h3 { margin: 0; color: var(--kec-navy); font-size: 23px; }
.kec-answer-head span { color: #16603d; font-size: 12px; font-weight: 900; }
.kec-answer > p { color: #41546a; font-size: 15px; line-height: 1.7; }

.kec-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.kec-answer-grid article {
  padding: 14px;
  border-radius: 9px;
  background: var(--kec-soft);
}

.kec-answer-grid strong { color: #234667; font-size: 13px; }
.kec-answer-grid p, .kec-answer-grid li { color: #506176; font-size: 13px; line-height: 1.6; }
.kec-answer-grid ul { margin: 8px 0 0; padding-left: 18px; }
.kec-answer-source { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.kec-answer-source a { padding: 9px 11px; border-radius: 7px; background: var(--kec-navy); color: #fff; font-size: 12px; font-weight: 900; text-decoration: none; }
.kec-answer-source a.secondary { border: 1px solid #8da0b5; background: #fff; color: #284867; }

.kec-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kec-card {
  display: grid;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--kec-line);
  border-radius: 12px;
  background: #fff;
  align-content: start;
  cursor: pointer;
}

.kec-card:hover { border-color: #7298bd; box-shadow: 0 8px 20px rgba(22, 55, 90, .08); }
.kec-card.is-planned { border-style: dashed; background: #fafbfc; }
.kec-card-top { display: flex; justify-content: space-between; gap: 10px; }
.kec-card-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.kec-card-badges span { padding: 3px 7px; border-radius: 4px; background: #e4f4e9; color: #17603c; font-size: 10px; font-weight: 900; }
.kec-card-badges .is-planned { background: #edf0f3; color: #626d7b; }
.kec-card small { color: #79531a; font-size: 11px; font-weight: 900; }
.kec-card h3 { margin: 13px 0 7px; color: #173d66; font-size: 18px; line-height: 1.4; }
.kec-card p { margin: 0; color: #536477; font-size: 13px; line-height: 1.6; }
.kec-card-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 16px; color: #6d7d90; font-size: 11px; }
.kec-card-footer b { color: #254b71; }

.kec-empty {
  padding: 34px;
  border: 1px dashed #94a3b5;
  border-radius: 12px;
  text-align: center;
}
.kec-empty p { color: var(--kec-muted); }
.kec-empty a { color: var(--kec-blue); font-weight: 900; }

@media (max-width: 900px) {
  .kec-hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .kec-current { margin-left: 20px; margin-right: 20px; }
  .kec-workspace { grid-template-columns: 1fr; }
  .kec-filters { position: static; }
  [data-kec-categories] { display: flex; overflow-x: auto; gap: 7px; }
  .kec-filters button { width: auto; flex: 0 0 auto; }
}

@media (max-width: 680px) {
  .kec-hero { padding: 58px 20px 70px; }
  .kec-hero h1 { font-size: 40px; }
  .kec-current, .kec-current > div { display: grid; }
  .kec-current-actions { justify-content: start; }
  .kec-shell { padding: 46px 20px 72px; }
  .kec-search-panel { grid-template-columns: 1fr; padding: 18px; }
  .kec-search-panel > button { width: 100%; }
  .kec-quick { display: grid; grid-template-columns: 1fr 1fr; }
  .kec-quick button { border-radius: 7px; text-align: left; }
  .kec-results-head { display: grid; }
  .kec-results, .kec-answer-grid { grid-template-columns: 1fr; }
}
