html.scc-modal-open,
html.scc-modal-open body {
  overflow: hidden;
}

:root {
  --scc-brand: #103868;
  --scc-brand-hover: #0b2f59;
  --scc-brand-soft: #eef4fb;
  --scc-brand-border: #d8e4f2;
  --scc-brand-ring: rgba(16, 56, 104, 0.14);
}

.scc-home-card {
  width: 100%;
  min-height: 168px;
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.scc-home-card:hover,
.scc-home-card:focus-visible {
  border-color: var(--scc-brand);
  background: #f8fafc;
  outline: none;
  transform: translateY(-1px);
}

.scc-card-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  display: block;
  border: 1px solid var(--scc-brand-border);
  border-radius: 8px;
  background: var(--scc-brand-soft);
}

.scc-card-monogram {
  position: absolute;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  color: var(--scc-brand);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.scc-card-pulse {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  height: 12px;
  opacity: 0.58;
}

.scc-card-pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--scc-brand), var(--scc-brand)) left 6px top 6px / 6px 1.5px no-repeat,
    linear-gradient(135deg, transparent 0 40%, var(--scc-brand) 41% 52%, transparent 53%) left 11px top 2px / 8px 9px no-repeat,
    linear-gradient(var(--scc-brand), var(--scc-brand)) left 18px top 6px / 10px 1.5px no-repeat;
  opacity: 0.82;
}

.scc-card-content {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
}

.scc-card-kicker,
.scc-kicker {
  margin: 0;
  color: var(--scc-brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.scc-card-content strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.scc-card-status {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.scc-card-detail {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.scc-card-action {
  align-self: flex-end;
  margin-top: auto;
  padding: 8px 10px;
  border: 1px solid var(--scc-brand);
  border-radius: 8px;
  color: var(--scc-brand);
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}

.scc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.35);
}

.scc-dialog {
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
  animation: scc-dialog-enter 210ms ease both;
}

@keyframes scc-dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scc-dialog-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.scc-dialog-header h2 {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: 0;
}

.scc-attempt-counter {
  align-self: center;
  padding: 7px 10px;
  border: 1px solid var(--scc-brand-border);
  border-radius: 8px;
  background: var(--scc-brand-soft);
  color: var(--scc-brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.scc-close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.scc-close:hover,
.scc-close:focus-visible {
  border-color: var(--scc-brand);
  color: var(--scc-brand);
  outline: none;
}

.scc-dialog-body {
  overflow-y: auto;
  padding: 22px;
}

.scc-case-block,
.scc-clue,
.scc-answer-form,
.scc-resolution,
.scc-landing,
.scc-history {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.scc-case-block,
.scc-clue,
.scc-resolution,
.scc-landing,
.scc-history {
  padding: 16px;
}

.scc-case-block p:last-child,
.scc-clue p:last-child,
.scc-answer-block p:last-child,
.scc-landing p:last-child {
  margin-bottom: 0;
}

.scc-case-block p,
.scc-clue p,
.scc-answer-block p,
.scc-landing p,
.scc-resolution li {
  color: #334155;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
}

.scc-clue-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.scc-clue {
  animation: scc-clue-in 220ms ease both;
}

@keyframes scc-clue-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scc-muted,
.scc-history-empty,
.scc-meta-line {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.scc-feedback {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
}

.scc-feedback.is-correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
}

.scc-feedback strong {
  font-size: 14px;
  font-weight: 850;
}

.scc-feedback span {
  font-size: 13px;
  font-weight: 600;
}

.scc-answer-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
}

.scc-answer-label {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.scc-autocomplete {
  position: relative;
}

.scc-autocomplete input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  outline: none;
}

.scc-autocomplete input:focus {
  border-color: var(--scc-brand);
  box-shadow: 0 0 0 3px var(--scc-brand-ring);
}

.scc-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 2;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.scc-suggestion,
.scc-suggestion-empty {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.scc-suggestion:last-child {
  border-bottom: 0;
}

.scc-suggestion:hover,
.scc-suggestion.is-active,
.scc-suggestion:focus-visible {
  background: var(--scc-brand-soft);
  color: var(--scc-brand);
  outline: none;
}

.scc-primary {
  min-height: 42px;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #0f172a;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.scc-primary:hover,
.scc-primary:focus-visible {
  border-color: var(--scc-brand);
  background: var(--scc-brand);
  outline: none;
}

.scc-primary:disabled {
  cursor: not-allowed;
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #94a3b8;
}

.scc-resolution {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.scc-resolution-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
}

.scc-resolution h3 {
  margin: 3px 0 3px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
}

.scc-answer-block {
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.scc-answer-block ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.scc-performance {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--scc-brand-border);
  border-radius: 8px;
  background: var(--scc-brand-soft);
  color: var(--scc-brand-hover);
  font-size: 13px;
  font-weight: 750;
}

.scc-landing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.scc-landing p {
  margin: 0;
}

.scc-history {
  margin-top: 14px;
}

.scc-history-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.scc-history-header span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.scc-history-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.scc-history-item {
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.scc-history-item:hover,
.scc-history-item:focus-visible {
  border-color: var(--scc-brand);
  background: var(--scc-brand-soft);
  outline: none;
}

.scc-history-date {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.scc-history-main {
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scc-history-status {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.scc-history-status.is-solved {
  color: #047857;
}

@media (max-width: 760px) {
  .scc-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .scc-dialog {
    max-height: calc(100vh - 20px);
  }

  .scc-dialog-header {
    grid-template-columns: 1fr auto;
    padding: 16px;
  }

  .scc-attempt-counter {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .scc-dialog-body {
    padding: 14px;
  }

  .scc-answer-form {
    padding: 14px;
  }

  .scc-primary {
    width: 100%;
    justify-self: stretch;
  }

  .scc-resolution-grid,
  .scc-landing,
  .scc-history-item {
    grid-template-columns: 1fr;
  }

  .scc-landing {
    align-items: stretch;
  }

  .scc-history-status,
  .scc-history-main {
    white-space: normal;
  }
}
