:root {
  font-family: system-ui, sans-serif;
  color: #171a18;
  background: #fff;
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 8px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
h1 { margin: 0 0 12px; font-size: 1.75rem; line-height: 1.2; }
p { margin: 0 0 14px; }

.consent {
  max-width: 600px;
  margin: clamp(24px, 12vh, 120px) auto 24px;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid #222;
  border-radius: 10px;
}

#consent-text p { white-space: pre-wrap; }
#consent-text p:empty { display: none; }

.agree {
  margin-top: 10px;
  min-height: 46px;
  min-width: 108px;
  padding: 8px 22px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #17683d;
  color: white;
  font-weight: 650;
}

.agree:hover { background: #0e512e; }
:focus-visible { outline: 3px solid #17683d; outline-offset: 3px; }

.workspace {
  min-height: calc(100vh - 16px);
  padding: 15px clamp(10px, 2vw, 20px);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 118px));
  gap: clamp(6px, 2vw, 20px);
}

[role="tab"] {
  min-height: 48px;
  padding: 4px 8px;
  border: 1px solid #222;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font-size: 0.9375rem;
  line-height: 1.2;
}

[role="tab"]:hover { background: #f5f5f5; }
[role="tab"][aria-selected="true"] { background: #eceeec; font-weight: 650; }
[role="tabpanel"] { margin-top: 34px; }
[role="tabpanel"] p { color: #535953; }

#scenario > p {
  white-space: pre-wrap;
  tab-size: 2;
}

.model-scroll {
  max-width: 1107px;
  overflow-x: auto;
  padding: 4px;
}

.model-diagram {
  position: relative;
  min-width: 880px;
}

.model-diagram img {
  display: block;
  width: 100%;
  height: auto;
}

.model-node {
  position: absolute;
  width: 10.1001%;
  height: 7.739%;
  padding: 0;
  border: 0;
  background: transparent;
}

.model-node:hover {
  box-shadow: inset 0 0 0 2px #17683d;
}

.model-node:focus-visible {
  z-index: 1;
}

.model-scroll-hint {
  display: none;
  font-size: 0.875rem;
}

@media (max-width: 940px) {
  .model-scroll-hint { display: block; }
}

#requirement-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #bac4bc;
  border-radius: 12px;
  color: inherit;
  background: #fff;
}

#requirement-dialog::backdrop { background: rgb(16 24 20 / 55%); }

.requirement-toolbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e6e2;
}

.requirement-toolbar button {
  padding: 6px 13px;
  border: 1px solid #bac4bc;
  border-radius: 6px;
  background: #f6f8f6;
  color: inherit;
}

#requirement-details { padding: 20px clamp(16px, 5vw, 32px) 18px; }
#requirement-details h2 { margin: 0 0 18px; line-height: 1.25; }
#requirement-details h3 { margin: 18px 0 4px; font-size: 1rem; font-weight: 700; }
#requirement-details ul { margin: 0 0 14px; padding-inline-start: 1.4em; }
#requirement-details li + li { margin-top: 6px; }

.shell-example {
  margin: 0;
  width: fit-content;
  max-width: 100%;
}

.shell-example img {
  display: block;
  max-width: 100%;
  height: auto;
}

.shell-example figcaption {
  margin-top: 8px;
  text-align: center;
  color: #535953;
}

.shell-example + .shell-example {
  margin-top: 24px;
}

.fillable-shell {
  max-width: 1057px;
  margin-top: 32px;
}

.shell-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 24px;
  padding: 1px;
  background: #222;
}

.shell-field {
  display: grid;
  gap: 1px;
}

.shell-summary .shell-field {
  grid-template-rows: subgrid;
  grid-row: span 2;
}

.shell-body {
  display: grid;
  gap: 1px;
  padding: 1px;
  background: #222;
}

.shell-body .shell-field {
  grid-template-columns: minmax(92px, 1fr) 2fr;
}

.shell-field > label,
.shell-field > span {
  background: #b3e39e;
  padding: 8px;
  overflow-wrap: anywhere;
}

.shell-field > input,
.shell-field > textarea,
.shell-static {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 8px;
  background: #fcfaf1;
  color: inherit;
  font: inherit;
}

.shell-field > textarea { resize: vertical; }
.shell-static { text-align: center; }
.shell-field > :focus-visible { outline-offset: -3px; }
.shell-field > [aria-invalid="true"] { box-shadow: inset 0 0 0 2px #a12622; }

.shell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 12px;
}

#shell-error { margin: 0 auto 0 0; color: #a12622; }
.shell-send { margin: 0; }

#shell-success {
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid #bac4bc;
  border-radius: 12px;
  color: inherit;
}

#shell-success::backdrop { background: rgb(16 24 20 / 55%); }
#shell-success h2 { margin: 0 0 8px; }
#shell-success form { text-align: right; }

#admin-login {
  display: grid;
  justify-items: start;
  gap: 8px;
  max-width: 320px;
}

#admin-password {
  width: 100%;
  padding: 8px;
  border: 1px solid #535953;
  border-radius: 6px;
  font: inherit;
}

#admin-error { color: #a12622; }
button:disabled { opacity: 0.65; cursor: wait; }
.admin-lock { margin-bottom: 16px; }
.submission-card {
  max-width: 720px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #bac4bc;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.submission-card h2 { margin: 0; font-size: 1.25rem; }
.submission-card dl { margin: 12px 0 0; }
.submission-card dt { font-weight: 700; }
.submission-card dd { margin: 0 0 8px; white-space: pre-wrap; }
