:root {
  --bg: #eef3f1;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --ink: #16201d;
  --muted: #56635f;
  --line: #cbd8d3;
  --teal: #0f766e;
  --green: #4d8f45;
  --rose: #c54f8c;
  --blue: #2c6ea3;
  --warning-bg: #fff6df;
  --warning-line: #e3b85a;
  --shadow: 0 10px 30px rgba(22, 32, 29, 0.08);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Aptos", "Noto Sans JP", "Noto Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.hero {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--rose);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-portal {
  min-height: 360px;
}

.hero-topline,
.topbar,
.topbar-controls,
.lang-options,
.actions {
  display: flex;
  align-items: center;
}

.hero-topline,
.topbar {
  justify-content: space-between;
  gap: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 16px;
}

.eyebrow,
.metric-label,
.meta-list strong,
.lang-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--rose);
}

.hero-env-chip {
  width: fit-content;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.09);
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 820px;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
  line-height: 1.2;
}

.lead {
  max-width: 760px;
  font-size: 17px;
  line-height: 1.62;
  color: var(--muted);
}

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

.button,
.ghost-button,
.pill,
.lang-options button {
  min-height: 40px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
}

.button {
  background: var(--teal);
  color: #ffffff;
}

.ghost-button {
  border-color: var(--line);
  background: var(--surface-soft);
}

.language-switcher {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.language-switcher.compact {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
}

.lang-label {
  color: var(--muted);
}

.lang-options {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.lang-options button {
  border: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.lang-options button.is-active {
  background: var(--teal);
  color: #ffffff;
}

.hero-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(77, 143, 69, 0.28);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: #f4faf2;
}

.metric-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.metric-label {
  color: var(--green);
}

.metric-value,
.meta {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card p,
.note {
  color: var(--muted);
  line-height: 1.55;
}

.meta-list {
  display: grid;
  gap: 10px;
}

.meta-list strong {
  display: block;
  margin-bottom: 3px;
  color: var(--blue);
}

.language-card {
  border-top: 4px solid var(--rose);
}

.feature-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.frame-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-primary,
.topbar-controls {
  min-width: 0;
}

.topbar-primary {
  display: grid;
  gap: 2px;
}

.topbar-controls {
  gap: 12px;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  background: #e4ece8;
  font-size: 13px;
}

.notice-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--warning-line);
  background: var(--warning-bg);
  color: #5d4b18;
  font-size: 13px;
  line-height: 1.45;
}

.workarea {
  min-height: 0;
  background: #ffffff;
}

#swagger-ui,
#swagger-editor {
  min-height: calc(100vh - 110px);
}

#swagger-editor {
  height: calc(100vh - 110px);
  font-size: 13px;
  overflow: hidden;
}

#swagger-editor > div {
  height: 100%;
}

#swagger-editor .swagger-editor-standalone {
  height: auto;
}

#swagger-editor .swagger-editor {
  height: calc(100% - 78px);
  min-height: 0;
  position: relative;
}

#swagger-editor .swagger-editor .swagger-container,
#swagger-editor .swagger-editor .dropzone,
#swagger-editor .swagger-editor #editor-wrapper,
#swagger-editor .swagger-editor #ace-editor {
  height: 100% !important;
}

#swagger-editor .swagger-editor .SplitPane {
  height: 100% !important;
  overflow: hidden !important;
}

#swagger-editor .swagger-editor .Pane1,
#swagger-editor .swagger-editor .Pane2 {
  height: 100% !important;
  z-index: 1;
}

#swagger-editor .swagger-editor .Pane2 {
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

#swagger-editor .swagger-editor-standalone .dd-menu.long .dd-menu-items {
  width: min(420px, calc(100vw - 32px)) !important;
  max-width: min(420px, calc(100vw - 32px));
  transform: translateX(-18%);
}

#swagger-editor .swagger-editor-standalone .dd-menu.long .dd-menu-items .dd-items-left {
  display: block !important;
  flex-direction: unset !important;
  flex-wrap: nowrap !important;
  max-height: min(520px, calc(100vh - 230px));
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

#swagger-editor .swagger-editor-standalone .dd-menu.long .dd-menu-items li {
  width: 100%;
}

#swagger-editor .swagger-editor-standalone,
#swagger-editor .swagger-editor-standalone .topbar,
#swagger-editor .swagger-editor-standalone .topbar-wrapper,
#swagger-editor .swagger-editor-standalone .dd-menu {
  position: relative;
}

#swagger-editor .swagger-editor-standalone .topbar {
  z-index: 30;
}

#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items,
#swagger-editor .swagger-editor-standalone .modal.topbar-modal {
  z-index: 50 !important;
}

#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items ol,
#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items ul {
  background: #ffffff !important;
  color: #111827 !important;
}

#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items li,
#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items li > *,
#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items li > button {
  color: #111827 !important;
}

#swagger-editor .swagger-editor-standalone .dd-menu .separator,
#swagger-editor .swagger-editor-standalone .dd-menu [role="separator"] {
  background-color: #d1d5db !important;
}

#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items ol li:hover:not([role="separator"]):not(.separator),
#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items ol li > *:focus,
#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items ul li:hover:not([role="separator"]):not(.separator),
#swagger-editor .swagger-editor-standalone .dd-menu .dd-menu-items ul li > *:focus {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.code-block {
  margin: 0;
  padding: 14px;
  border-radius: 6px;
  background: #17211f;
  color: #eaf7ef;
  overflow-x: auto;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .hero-grid,
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 16px 12px 32px;
  }

  .hero {
    padding: 16px;
  }

  .hero-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .hero-topline,
  .topbar,
  .topbar-controls,
  .notice-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .language-switcher,
  .language-switcher.compact {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .lang-options {
    justify-content: stretch;
  }

  .lang-options button {
    flex: 1;
  }

  h1 {
    font-size: 32px;
  }
}
