:root {
  color-scheme: dark;
  --bg: #07090b;
  --panel: #101418;
  --panel-2: #151b20;
  --line: #28313a;
  --text: #f4f7f7;
  --muted: #9aa8aa;
  --soft: #ced8d5;
  --green: #52d38d;
  --cyan: #57c7df;
  --yellow: #f4cf67;
  --red: #ff7d6e;
  --ink: #07110d;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(82, 211, 141, 0.08), transparent 36%),
    radial-gradient(circle at 78% 8%, rgba(87, 199, 223, 0.12), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px 10px;
}

.monitor-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 10px 14px;
  border: 1px solid #31525a;
  border-radius: 6px;
  color: #dff8ef;
  font-weight: 700;
  text-decoration: none;
}

.monitor-link:hover {
  border-color: #54d99a;
  background: #10251f;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #071013;
  box-shadow: 0 0 18px rgba(82, 211, 141, 0.22);
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.45;
}

.input-form {
  display: grid;
  gap: 18px;
}

.diagnosis-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 28px 28px;
}

.input-panel,
.navigator-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 20, 24, 0.88);
  box-shadow: var(--shadow);
}

.input-panel {
  align-self: stretch;
  padding: 26px;
}

.input-panel h2 {
  margin-bottom: 12px;
  font-size: 28px;
}

.hero-copy {
  margin-bottom: 22px;
  color: var(--soft);
  line-height: 1.8;
}

.navigator-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.8fr);
  grid-template-rows: auto 1fr;
  align-items: end;
  min-height: 360px;
  overflow: hidden;
  padding: 24px 18px 0 24px;
  background:
    linear-gradient(135deg, rgba(82, 211, 141, 0.12), transparent 42%),
    rgba(16, 20, 24, 0.88);
}

.speech-bubble,
.final-bubble {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(87, 199, 223, 0.34);
  border-radius: 8px;
  background: rgba(8, 14, 17, 0.86);
  padding: 18px;
  color: var(--soft);
  line-height: 1.8;
}

.top-speech {
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  width: min(620px, 72%);
  margin-bottom: 18px;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  right: 52px;
  bottom: -11px;
  width: 20px;
  height: 20px;
  border-right: 1px solid rgba(87, 199, 223, 0.34);
  border-bottom: 1px solid rgba(87, 199, 223, 0.34);
  background: rgba(8, 14, 17, 0.86);
  transform: rotate(45deg);
}

.speech-bubble p:last-child,
.final-bubble p:last-child {
  margin-bottom: 0;
}

.aira-character {
  position: relative;
  z-index: 0;
  grid-column: 2;
  grid-row: 2;
  width: min(330px, 100%);
  justify-self: center;
  align-self: end;
  filter: drop-shadow(0 24px 45px rgba(0, 0, 0, 0.38));
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #34404a;
  border-radius: 8px;
  background: #0b0f12;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(82, 211, 141, 0.14);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-action,
.secondary-action,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: var(--ink);
}

.secondary-action {
  min-height: 40px;
  padding: 0 14px;
  background: #213038;
  color: var(--text);
}

.icon-button {
  width: 40px;
  height: 40px;
  background: #213038;
  color: var(--text);
}

.button-icon {
  font-size: 18px;
}

.side-note {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  line-height: 1.7;
}

.side-note p {
  margin-bottom: 0;
}

.workspace {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px 28px;
  overflow: hidden;
  min-width: 0;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 20px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 20, 24, 0.78);
  color: var(--soft);
}

.status-message {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-action {
  flex: 0 0 auto;
  min-width: 136px;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(82, 211, 141, 0.8);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(82, 211, 141, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(82, 211, 141, 0);
  }
}

.score-overview {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) 1fr;
  gap: 18px;
  margin-bottom: 18px;
  min-width: 0;
}

.score-panel,
.radar-panel,
.report-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 20, 24, 0.86);
  box-shadow: var(--shadow);
}

.score-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.score-panel h2 {
  font-size: clamp(52px, 8vw, 92px);
  line-height: 0.92;
}

.score-panel p:last-child {
  margin: 12px 0 0;
  color: var(--soft);
}

.score-ring {
  position: relative;
  flex: 0 0 132px;
  width: 132px;
  height: 132px;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 10;
}

.ring-bg {
  stroke: #243039;
}

.ring-value {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 88;
  transition: stroke-dashoffset 0.45s ease;
}

.score-ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
}

.radar-panel {
  padding: 20px;
}

.score-bars {
  display: grid;
  gap: 11px;
}

.score-row {
  display: grid;
  grid-template-columns: 132px 1fr 40px;
  align-items: center;
  gap: 12px;
}

.score-row span {
  color: var(--soft);
  font-size: 13px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #243039;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-width: 0;
}

.report-section {
  padding: 22px;
  min-width: 0;
}

.has-aira {
  position: relative;
  overflow: hidden;
}

.has-aira > :not(.section-aira) {
  position: relative;
  z-index: 1;
}

.section-aira {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.32));
}

.summary-section.has-aira {
  padding-right: 220px;
}

.summary-pose {
  right: 18px;
  bottom: -38px;
  width: 190px;
  opacity: 0.82;
}

.compact-aira {
  min-height: 360px;
}

.analyze-pose,
.perception-pose {
  right: -10px;
  bottom: -38px;
  width: 150px;
  opacity: 0.45;
}

.roadmap-section {
  padding-right: 210px;
}

.strategy-pose {
  right: 16px;
  bottom: -48px;
  width: 185px;
  opacity: 0.78;
}

.report-section.wide,
.summary-section {
  grid-column: 1 / -1;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.lead-text {
  color: var(--soft);
  font-size: 16px;
  line-height: 1.85;
}

.aira-note {
  margin: -4px 0 18px;
  border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0;
  background: rgba(82, 211, 141, 0.07);
  color: var(--soft);
  padding: 10px 12px;
  line-height: 1.7;
}

.tag-list,
.content-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag,
.idea-chip {
  border: 1px solid #33434a;
  border-radius: 8px;
  padding: 9px 11px;
  background: #0b1013;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
}

td {
  color: var(--text);
  line-height: 1.55;
}

.stars {
  color: var(--yellow);
  white-space: nowrap;
}

.possibility {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.insight-list,
.action-plan,
.perception-list {
  display: grid;
  gap: 12px;
}

.insight-item,
.action-item,
.perception-item,
.profile-item {
  border: 1px solid #2c3841;
  border-radius: 8px;
  padding: 14px;
  background: #0c1114;
}

.insight-item h3,
.action-item h3,
.perception-item h3,
.profile-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.insight-item p,
.action-item p,
.perception-item p,
.profile-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 13px;
}

.profile-item p {
  color: var(--text);
}

.perception-item {
  border-color: rgba(87, 199, 223, 0.32);
}

.perception-item h3 {
  color: var(--text);
}

.warning .insight-item {
  border-color: rgba(255, 125, 110, 0.35);
}

.action-plan {
  grid-template-columns: repeat(4, 1fr);
}

.action-item strong {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--green);
}

.idea-chip {
  color: var(--text);
}

.navigator-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: end;
  gap: 18px;
  border: 1px solid rgba(87, 199, 223, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(87, 199, 223, 0.12), transparent 44%),
    rgba(16, 20, 24, 0.9);
  padding: 18px 22px 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.summary-aira {
  width: 170px;
  align-self: end;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.34));
}

.final-bubble {
  align-self: center;
  margin-bottom: 20px;
}

.final-bubble h2 {
  margin-bottom: 10px;
}

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

  .navigator-card {
    grid-template-columns: 1fr minmax(180px, 260px);
  }

  .top-speech {
    width: min(580px, 82%);
  }

  .score-overview,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .action-plan {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .topbar,
  .diagnosis-hero,
  .workspace {
    padding: 18px;
  }

  .diagnosis-hero {
    padding-top: 8px;
  }

  .field-grid,
  .action-plan,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .score-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .navigator-card {
    grid-template-columns: 1fr;
    padding: 18px 18px 0;
  }

  .top-speech {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .speech-bubble::after {
    display: none;
  }

  .aira-character {
    grid-column: 1;
    grid-row: auto;
    width: min(270px, 86%);
  }

  .navigator-summary {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .summary-aira {
    display: none;
  }

  .summary-section.has-aira,
  .roadmap-section {
    padding-right: 22px;
  }

  .section-aira {
    display: none;
  }

  .secondary-action {
    width: 100%;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .score-row {
    grid-template-columns: 96px 1fr 34px;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #ffffff;
    color: #111111;
  }

  .top-action,
  .diagnosis-hero,
  .status-strip,
  .icon-button,
  .section-aira,
  .summary-aira {
    display: none !important;
  }

  .topbar,
  .workspace {
    max-width: none;
    padding: 12px 0;
  }

  .score-panel,
  .radar-panel,
  .report-section,
  .navigator-summary,
  .insight-item,
  .action-item,
  .perception-item,
  .profile-item {
    background: #ffffff;
    border-color: #d7dde2;
    box-shadow: none;
    color: #111111;
  }

  .lead-text,
  .aira-note,
  .insight-item p,
  .action-item p,
  .perception-item p,
  .profile-item p {
    color: #333333;
  }

  .report-grid,
  .score-overview {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 0;
  }
}
