* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #f6f7f9;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.app-header {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid #d9dee7;
  background: #ffffff;
}

.brand {
  color: #1f2933;
  font-weight: 800;
  text-decoration: none;
}

.language-switcher {
  display: flex;
  gap: 8px;
}

.help-menu {
  position: relative;
}

.help-menu summary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #b8c1cf;
  border-radius: 6px;
  color: #1f2933;
  background: #ffffff;
  font: inherit;
  cursor: pointer;
  list-style: none;
}

.help-menu summary::-webkit-details-marker {
  display: none;
}

.help-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgb(31 41 51 / 14%);
}

.help-panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.help-panel p {
  margin: 0 0 10px;
  color: #52606d;
  font-size: 0.95rem;
  line-height: 1.45;
}

.help-panel p:last-child {
  margin-bottom: 0;
}

.language-switcher a,
.app-header button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #b8c1cf;
  border-radius: 6px;
  color: #1f2933;
  background: #ffffff;
  font: inherit;
  text-decoration: none;
}

.language-switcher a[aria-current="page"] {
  border-color: #1f6feb;
  color: #1f6feb;
  font-weight: 700;
}

.login-panel {
  width: min(420px, 100%);
  margin: 12vh auto 0;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
}

.login-panel h1 {
  margin: 0 0 20px;
  font-size: 1.5rem;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b8c1cf;
  border-radius: 6px;
  font: inherit;
}

.login-form button {
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: #1f6feb;
  font: inherit;
  font-weight: 700;
}

.error-message {
  padding: 10px 12px;
  border: 1px solid #d64545;
  border-radius: 6px;
  color: #8a1f1f;
  background: #fff2f2;
}

.empty-state {
  width: min(680px, 100%);
  padding: 24px 0;
}

.card-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 24px;
  align-items: start;
}

.scenario-panel,
.editor-panel {
  padding: 20px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #ffffff;
}

.scenario-panel dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.scenario-panel dt {
  color: #52606d;
  font-size: 0.85rem;
  font-weight: 700;
}

.scenario-panel dd {
  margin: 0;
}

.scenario-panel ul {
  margin: 0;
  padding-left: 20px;
}

.editor-panel {
  display: grid;
  gap: 18px;
}

.editor-panel label {
  display: grid;
  gap: 8px;
  color: #52606d;
  font-weight: 700;
}

.editor-panel textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid #b8c1cf;
  border-radius: 6px;
  color: #1f2933;
  font: inherit;
  font-weight: 400;
  line-height: 1.5;
}

.save-indicator {
  min-height: 20px;
  color: #52606d;
}

.save-indicator--saved {
  color: #147d64;
}

.save-indicator--error {
  color: #b83232;
}

.nav-footer {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  color: #52606d;
}

.case-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  white-space: nowrap;
}

.case-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.case-jump label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.case-jump input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid #b8c1cf;
  border-radius: 6px;
  font: inherit;
}

.case-jump button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #b8c1cf;
  border-radius: 6px;
  color: #1f2933;
  background: #ffffff;
  font: inherit;
}

.nav-link {
  color: #1f6feb;
  text-decoration: none;
}

.last-edited-link {
  color: #1f6feb;
  text-decoration: none;
}

.nav-footer > .nav-link:first-child {
  justify-self: start;
}

.nav-footer > .nav-link:last-child {
  justify-self: end;
}

.nav-link.is-disabled {
  color: #9aa5b1;
}
