.icegate-kb {
  --icegate-blue: #2f6fed;
  --icegate-blue-dark: #1748ad;
  --icegate-surface: rgba(255, 255, 255, 0.06);
  --icegate-border: rgba(255, 255, 255, 0.14);
}

.icegate-kb .btn-primary {
  color: #fff;
  border-color: var(--icegate-blue);
  background: linear-gradient(135deg, #3478f6, #1748ad);
  box-shadow: 0 12px 34px rgba(47, 111, 237, 0.25);
}

.icegate-kb .btn-secondary {
  color: var(--text);
  border: 1px solid var(--icegate-border);
  background: rgba(255, 255, 255, 0.07);
}

.icegate-search-hero,
.icegate-detail-hero {
  padding: 154px 0 88px;
  border-bottom: 1px solid var(--icegate-border);
  background:
    radial-gradient(circle at 80% 18%, rgba(47, 111, 237, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(217, 184, 108, 0.12), transparent 42%);
}

.icegate-search-hero h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 6vw, 6rem);
}

.icegate-search-form {
  position: relative;
  max-width: 820px;
  margin-top: 28px;
}

.icegate-search-form .input-group,
.detail-search .input-group {
  padding: 7px;
  border: 1px solid var(--icegate-border);
  border-radius: 12px;
  background: rgba(7, 8, 6, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.icegate-search-form .input-group-text,
.icegate-search-form .form-control,
.detail-search .form-control {
  color: var(--text);
  border: 0;
  background: transparent;
}

.icegate-search-form .input-group-text {
  color: var(--gold);
  font-weight: 800;
}

.icegate-search-form .form-control::placeholder,
.detail-search .form-control::placeholder {
  color: rgba(251, 248, 239, 0.48);
}

.icegate-search-form .form-control:focus,
.detail-search .form-control:focus {
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.icegate-search-form .form-control,
.detail-search .form-control {
  min-width: 0;
  min-height: 52px;
  position: relative;
  z-index: 1;
}

.icegate-search-form .btn,
.detail-search .btn {
  width: auto;
  flex: 0 0 auto;
}

.search-help {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.icegate-suggestions {
  position: absolute;
  z-index: 15;
  top: calc(100% - 25px);
  right: 0;
  left: 0;
  padding: 8px;
  border: 1px solid var(--icegate-border);
  border-radius: 10px;
  background: #121510;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.icegate-suggestions a {
  display: grid;
  grid-template-columns: minmax(76px, auto) 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 7px;
}

.icegate-suggestions a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icegate-suggestions strong {
  color: var(--gold);
}

.icegate-suggestions span {
  color: var(--text);
}

.icegate-kb mark {
  padding: 0;
  color: inherit;
  background: rgba(244, 217, 138, 0.28);
}

.example-searches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.example-chip {
  padding: 7px 11px;
  border: 1px solid var(--icegate-border);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.example-chip:hover {
  border-color: rgba(217, 184, 108, 0.55);
}

.icegate-direct-answer {
  padding: 30px;
  border: 1px solid rgba(47, 111, 237, 0.32);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(47, 111, 237, 0.16), rgba(255, 255, 255, 0.045));
}

.icegate-direct-answer strong {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 1.25rem;
}

.icegate-direct-answer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.icegate-search-status {
  margin-bottom: 18px;
  color: var(--muted);
}

.icegate-error-card {
  min-height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--icegate-border);
  border-radius: 10px;
  background: var(--icegate-surface);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icegate-error-card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 111, 237, 0.55);
  background: rgba(255, 255, 255, 0.085);
}

.error-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.error-code {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 7px;
  color: #dbe7ff;
  background: rgba(47, 111, 237, 0.18);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.category-badge {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: right;
}

.icegate-error-card h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.icegate-error-card p {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.card-link {
  margin-top: auto;
  color: var(--gold);
  font-weight: 800;
  font-size: 0.88rem;
}

.icegate-category-card {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--icegate-border);
  border-radius: 10px;
  color: var(--text);
  background: var(--icegate-surface);
}

.icegate-category-card:hover {
  border-color: rgba(217, 184, 108, 0.5);
}

.icegate-category-card strong,
.icegate-category-card span {
  display: block;
}

.icegate-category-card strong {
  margin: 28px 0 7px;
  font-size: 1.05rem;
}

.icegate-category-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.icegate-category-card .category-count {
  margin: 0;
  color: var(--gold);
  font-weight: 800;
}

.recent-search-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.recent-search-list a {
  padding: 18px;
  border: 1px solid var(--icegate-border);
  border-radius: 9px;
  background: var(--icegate-surface);
}

.recent-search-list strong,
.recent-search-list span {
  display: block;
}

.recent-search-list strong {
  margin-bottom: 6px;
  color: var(--gold);
}

.recent-search-list span {
  color: var(--muted);
  font-size: 0.88rem;
}

.icegate-empty-state {
  padding: 28px;
  border: 1px dashed var(--icegate-border);
  border-radius: 10px;
}

.icegate-empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
}

.icegate-breadcrumb {
  display: flex;
  gap: 9px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 0.88rem;
}

.icegate-breadcrumb a:hover {
  color: var(--gold);
}

.error-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.45fr);
  gap: 44px;
  align-items: end;
}

.error-header h1 {
  max-width: 850px;
  margin: 20px 0 16px;
  font-size: clamp(2.5rem, 5vw, 5.2rem);
}

.error-header p {
  max-width: 850px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.08rem;
}

.error-code-large {
  min-height: 42px;
  margin-right: 10px;
  padding: 0 16px;
  font-size: 1.08rem;
}

.detail-search {
  position: relative;
  padding: 22px;
  border: 1px solid var(--icegate-border);
  border-radius: 10px;
  background: var(--icegate-surface);
}

.detail-search label {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-weight: 800;
}

.detail-search-suggestions {
  top: 104px;
  right: 22px;
  left: 22px;
}

.detail-search-status {
  min-height: 20px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.detail-search-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.detail-search-results:empty {
  display: none;
}

.detail-search-result {
  display: grid;
  grid-template-columns: minmax(68px, auto) 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--icegate-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.detail-search-result:hover {
  border-color: rgba(47, 111, 237, 0.55);
  background: rgba(47, 111, 237, 0.09);
}

.detail-search-result > strong {
  color: var(--gold);
}

.detail-search-result span,
.detail-search-result b,
.detail-search-result small {
  display: block;
}

.detail-search-result b {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.88rem;
}

.detail-search-result small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.icegate-detail-stack {
  display: grid;
  gap: 16px;
}

.icegate-content-card,
.icegate-side-card,
.icegate-feedback-card,
.icegate-disclaimer {
  padding: 32px;
  border: 1px solid var(--icegate-border);
  border-radius: 10px;
  background: var(--icegate-surface);
}

.section-number {
  display: block;
  margin-bottom: 24px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.icegate-content-card h2,
.icegate-side-card h2,
.icegate-feedback-card h2,
.icegate-disclaimer h2 {
  font-size: clamp(1.45rem, 2.5vw, 2.2rem);
}

.lead-answer,
.icegate-content-card p,
.icegate-side-card li,
.icegate-disclaimer p {
  color: var(--muted);
  line-height: 1.75;
}

.practical-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.solution-list {
  display: grid;
  gap: 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: solution;
}

.solution-list li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  align-items: start;
  color: var(--muted);
  line-height: 1.65;
}

.solution-list li::before {
  counter-increment: solution;
  content: counter(solution);
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--icegate-blue);
  font-weight: 900;
}

.responsible-party {
  padding: 16px 18px;
  border-left: 3px solid var(--gold);
  color: var(--text) !important;
  background: rgba(217, 184, 108, 0.08);
  font-weight: 800;
}

.icegate-side-card {
  top: 96px;
}

.icegate-side-card ul {
  display: grid;
  gap: 10px;
  margin: 20px 0 26px;
  padding-left: 20px;
}

.icegate-feedback-card {
  display: grid;
  gap: 22px;
}

.feedback-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-actions .is-selected {
  outline: 3px solid rgba(217, 184, 108, 0.28);
}

.feedback-comment {
  display: grid;
  gap: 10px;
}

.feedback-comment[hidden] {
  display: none;
}

.feedback-comment .form-control {
  color: var(--text);
  border-color: var(--icegate-border);
  background: rgba(255, 255, 255, 0.06);
}

.feedback-message {
  min-height: 24px;
  margin: 0;
  color: var(--gold);
}

@media (max-width: 991px) {
  .error-header {
    grid-template-columns: 1fr;
  }

  .recent-search-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .icegate-search-hero,
  .icegate-detail-hero {
    padding: 118px 0 64px;
  }

  .icegate-search-form .input-group,
  .detail-search .input-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .icegate-search-form .input-group-text {
    min-height: auto;
    padding: 4px 10px 0;
  }

  .icegate-search-form .form-control,
  .detail-search .form-control {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--icegate-border);
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.08);
  }

  .icegate-search-form .btn,
  .detail-search .btn {
    width: 100%;
    min-height: 50px;
    margin-top: 0;
    border-radius: 8px !important;
  }

  .recent-search-list {
    grid-template-columns: 1fr;
  }

  .icegate-content-card,
  .icegate-side-card,
  .icegate-feedback-card,
  .icegate-disclaimer {
    padding: 23px;
  }
}

html[data-theme="light"] .icegate-kb {
  --icegate-surface: rgba(255, 255, 255, 0.9);
  --icegate-border: rgba(203, 213, 225, 0.92);
}

html[data-theme="light"] .icegate-search-form .input-group,
html[data-theme="light"] .detail-search .input-group,
html[data-theme="light"] .icegate-suggestions {
  background: #fff;
}

html[data-theme="light"] .icegate-search-form .form-control,
html[data-theme="light"] .detail-search .form-control {
  color: #172033;
}

html[data-theme="light"] .icegate-search-form .form-control::placeholder,
html[data-theme="light"] .detail-search .form-control::placeholder {
  color: #718096;
}

html[data-theme="light"] .icegate-suggestions span,
html[data-theme="light"] .icegate-category-card {
  color: #172033;
}

html[data-theme="light"] .error-code {
  color: #1748ad;
}

html[data-theme="light"] .feedback-comment .form-control {
  color: #172033;
  background: #fff;
}

html[data-theme="light"] .detail-search-result {
  background: #fff;
}

html[data-theme="light"] .detail-search-result b {
  color: #172033;
}
