* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: #17202f;
  background: #eef1f5;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Arial, sans-serif;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  padding: 28px 22px;
  color: #ffffff;
  background: #0d314b;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #08324b;
  background: #b9eadc;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: #b9c8d6;
  font-size: 12px;
  font-weight: 700;
}

.mode-nav {
  display: grid;
  gap: 10px;
}

.mode-button {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #eef7fb;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  cursor: pointer;
}

.mode-button span {
  color: #b9eadc;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.mode-button.active {
  border-color: #b9eadc;
  color: #082b43;
  background: #b9eadc;
}

.mode-button.active span {
  color: #0b5e78;
}

.side-note {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 20px;
}

.side-note b {
  font-size: 13px;
}

.side-note p {
  margin: 8px 0 0;
  color: #cbd7e2;
  font-size: 13px;
  line-height: 1.7;
}

.workspace {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #16856f;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.3;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid #bfd7e6;
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 14px;
  color: #375063;
  font-size: 12px;
  font-weight: 900;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.3fr);
  gap: 18px;
}

.input-panel,
.output-panel,
.insight-band {
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
}

.input-panel,
.output-panel {
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.4;
}

.panel-heading p {
  margin: 0;
  color: #53606f;
  font-size: 13px;
  line-height: 1.7;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #27384c;
  font-size: 13px;
  font-weight: 900;
}

textarea {
  display: block;
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  padding: 16px;
  color: #17202f;
  background: #fbfcfe;
  font-size: 14px;
  line-height: 1.7;
}

textarea:focus {
  outline: 3px solid rgba(22, 133, 111, 0.2);
  border-color: #16856f;
}

.control-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  border: 1px solid #0b5e78;
  color: #ffffff;
  background: #0b5e78;
}

.secondary-button {
  border: 1px solid #c8d2df;
  color: #1d364c;
  background: #ffffff;
}

.score-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.score-box {
  display: grid;
  place-items: center;
  min-height: 132px;
  border-radius: 8px;
  background: #e7f3f0;
  text-align: center;
}

.score-box span {
  color: #0b5e78;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
}

.score-box small {
  color: #53606f;
  font-size: 12px;
  font-weight: 900;
}

.summary-box {
  display: flex;
  align-items: center;
  min-height: 132px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 18px;
  color: #263241;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 800;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  min-height: 180px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 18px;
}

.result-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.result-card ul {
  margin: 0;
  padding-left: 18px;
}

.result-card li {
  margin-bottom: 8px;
  color: #3d4858;
  font-size: 13px;
  line-height: 1.65;
}

.insight-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
}

.insight-band div {
  padding: 18px 20px;
  background: #ffffff;
}

.insight-band span {
  display: block;
  margin-bottom: 6px;
  color: #16856f;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-band b {
  display: block;
  color: #17202f;
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .mode-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .work-grid,
  .insight-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .mode-nav,
  .score-row,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .control-row {
    flex-direction: column;
  }

  h1 {
    font-size: 25px;
  }
}
