:root {
  color-scheme: light;
  --blue-900: #071d41;
  --blue-800: #133b75;
  --blue-700: #1f5aa6;
  --green-600: #16833a;
  --yellow-500: #f3c218;
  --gray-900: #1f2933;
  --gray-700: #4b5563;
  --gray-500: #748094;
  --gray-200: #d8dee8;
  --gray-100: #eef2f7;
  --white: #ffffff;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 10px 24px rgba(7, 29, 65, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #f6f8fb;
  color: var(--gray-900);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.topbar {
  align-items: center;
  background: var(--blue-900);
  border-bottom: 4px solid var(--yellow-500);
  color: var(--white);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 48px);
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.seal {
  align-items: center;
  background: linear-gradient(135deg, var(--green-600), var(--blue-700));
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  display: flex;
  flex: 0 0 44px;
  font-weight: 800;
  height: 44px;
  justify-content: center;
}

.portal-name {
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 700;
}

.portal-subtitle {
  color: #cdd8e6;
  font-size: 0.88rem;
  margin-top: 2px;
}

.status-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #e9f1fb;
  font-size: 0.85rem;
  padding: 6px 10px;
  white-space: nowrap;
}

.page-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px clamp(14px, 3vw, 32px) 36px;
}

.breadcrumbs {
  color: var(--gray-700);
  font-size: 0.88rem;
  margin: 2px 0 18px;
}

.layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: 300px minmax(0, 1fr);
}

.summary-card,
.content-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 18px;
  position: sticky;
  top: 16px;
}

.summary-title {
  border-bottom: 1px solid var(--gray-200);
  color: var(--blue-900);
  font-weight: 800;
  margin-bottom: 14px;
  padding-bottom: 10px;
}

.protocol-box {
  border-top: 1px solid var(--gray-200);
  margin-top: 18px;
  padding-top: 16px;
}

dl {
  margin: 0;
}

dt {
  color: var(--gray-500);
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 12px;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
}

.progress-block {
  margin-top: 20px;
}

.process-steps {
  border-top: 1px solid var(--gray-200);
  counter-reset: process;
  list-style: none;
  margin: 18px 0 0;
  padding: 16px 0 0;
}

.process-steps li {
  align-items: center;
  color: var(--gray-500);
  display: flex;
  font-size: 0.88rem;
  gap: 9px;
  margin-top: 10px;
}

.process-steps li::before {
  align-items: center;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  color: var(--gray-700);
  content: counter(process);
  counter-increment: process;
  display: inline-flex;
  flex: 0 0 24px;
  font-size: 0.76rem;
  font-weight: 800;
  height: 24px;
  justify-content: center;
}

.process-steps li.done {
  color: var(--gray-700);
}

.process-steps li.done::before {
  background: #e8f5ee;
  border-color: #b8dfc8;
  color: var(--success);
  content: "✓";
}

.process-steps li.active {
  color: var(--blue-900);
  font-weight: 800;
}

.process-steps li.active::before {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: var(--white);
}

.progress-label {
  color: var(--gray-700);
  display: flex;
  font-size: 0.9rem;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-track {
  background: var(--gray-100);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--green-600), var(--blue-700));
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.content-card {
  min-height: 540px;
  padding: clamp(20px, 4vw, 34px);
}

.eyebrow {
  color: var(--blue-700);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

h1,
h2 {
  color: var(--blue-900);
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
}

p {
  margin: 14px 0 0;
}

.lead {
  color: var(--gray-700);
  font-size: 1.08rem;
  max-width: 760px;
}

.notice {
  background: #fff8dd;
  border: 1px solid #f3d36c;
  border-radius: 6px;
  margin-top: 20px;
  padding: 14px 16px;
}

.notice strong {
  color: #6a5200;
}

.meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.meta-grid.single {
  grid-template-columns: 1fr;
}

.meta-item {
  background: var(--gray-100);
  border-left: 4px solid var(--blue-700);
  border-radius: 4px;
  padding: 12px;
}

.meta-label {
  color: var(--gray-500);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-value {
  display: block;
  font-weight: 700;
  margin-top: 3px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 5px;
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  background: var(--blue-700);
  border: 1px solid var(--blue-700);
  color: var(--white);
  padding: 11px 16px;
}

.primary-button:hover {
  background: var(--blue-800);
}

.secondary-button {
  background: var(--white);
  border: 1px solid var(--blue-700);
  color: var(--blue-700);
  padding: 11px 16px;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--blue-700);
  margin-top: 14px;
  padding: 0;
  text-align: left;
}

.language-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.language-row {
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px 14px;
}

.language-row.disabled {
  color: var(--gray-500);
}

.tag {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 9px;
  white-space: nowrap;
}

.tag.ok {
  background: #dcfce7;
  color: #166534;
}

.tag.wait {
  background: #eef2f7;
  color: var(--gray-700);
}

.regulation {
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-top: 20px;
  padding: 16px;
}

.regulation-title {
  color: var(--blue-900);
  font-weight: 800;
  margin-bottom: 8px;
}

.document-base-label {
  color: var(--gray-500);
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 14px;
  text-transform: uppercase;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.link-list a {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  color: var(--blue-700);
  font-size: 0.88rem;
  font-weight: 750;
  padding: 6px 10px;
  text-decoration: none;
}

.link-list a:hover {
  border-color: var(--blue-700);
  text-decoration: underline;
}

.sketch-box {
  background: #fff8dd;
  border: 1px solid #f3d36c;
  border-radius: 6px;
  margin-top: 16px;
  padding: 14px;
}

.sketch-title {
  color: #6a5200;
  font-weight: 800;
  margin-bottom: 6px;
}

.ticket-head {
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.ticket-count {
  color: var(--gray-500);
  font-weight: 800;
  white-space: nowrap;
}

.question-box {
  border-left: 4px solid var(--yellow-500);
  margin-top: 22px;
  padding: 2px 0 2px 14px;
}

.answer-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-width: 560px;
}

.answer-form label {
  font-weight: 750;
}

.answer-form input {
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  min-height: 44px;
  padding: 10px 12px;
}

.answer-form input:focus {
  border-color: var(--blue-700);
  outline: 3px solid rgba(31, 90, 166, 0.16);
}

.message {
  border-radius: 5px;
  font-weight: 700;
  margin-top: 14px;
  padding: 12px 14px;
}

.message.error {
  background: #fee4e2;
  color: var(--danger);
}

.message.success {
  background: #dcfce7;
  color: var(--success);
}

.message.checking {
  background: #eaf6ff;
  color: var(--blue-800);
}

.backpack-game {
  display: grid;
  gap: 22px;
  margin-top: 20px;
}

.situation-list {
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin: 10px 0 0;
  padding: 14px 18px 14px 34px;
}

.situation-list li + li {
  margin-top: 8px;
}

.item-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 10px;
}

.item-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  color: var(--gray-900);
  cursor: pointer;
  min-height: 86px;
  padding: 12px;
  text-align: left;
}

.item-card span {
  color: var(--blue-900);
  display: block;
  font-weight: 800;
}

.item-card small {
  color: var(--gray-700);
  display: block;
  margin-top: 4px;
}

.item-card:hover:not(:disabled) {
  border-color: var(--blue-700);
}

.item-card.selected {
  background: #eaf6ff;
  border-color: var(--blue-700);
  box-shadow: inset 0 0 0 2px rgba(31, 90, 166, 0.12);
}

.item-card:disabled:not(.selected) {
  cursor: not-allowed;
  opacity: 0.48;
}

.backpack-panel {
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 16px;
}

.bag-items {
  color: var(--gray-700);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.bag-items span {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  color: var(--blue-900);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 5px 10px;
}

.biome-game {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.biome-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  padding: 12px;
}

.biome-place {
  color: var(--blue-900);
  font-weight: 800;
}

.biome-row a {
  color: var(--blue-700);
  display: inline-block;
  font-size: 0.9rem;
  margin-top: 3px;
}

.biome-row label {
  display: grid;
  gap: 5px;
}

.biome-row label span {
  color: var(--gray-500);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.biome-row select {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  min-height: 42px;
  padding: 9px 10px;
}

.biome-row select:focus {
  border-color: var(--blue-700);
  outline: 3px solid rgba(31, 90, 166, 0.16);
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .ticket-head {
    flex-direction: column;
  }

  .biome-row {
    grid-template-columns: 1fr;
  }
}
