:root {
  --ink: #20231f;
  --muted: #667064;
  --line: #d9ded4;
  --paper: #f7f6ef;
  --panel: #ffffff;
  --sage: #7f9877;
  --sage-dark: #3f5f4a;
  --clay: #b86f4a;
  --blue: #466c82;
  --gold: #c79a43;
  --shadow: 0 18px 40px rgba(41, 48, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(127, 152, 119, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(184, 111, 74, 0.16), transparent 30%),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.brand {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: center;
}

.mark {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(145deg, var(--sage-dark), var(--clay));
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--clay);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.progressBlock {
  display: grid;
  gap: 10px;
}

.progressText {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.progressText strong {
  color: var(--ink);
}

.progressTrack {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e8df;
}

.progressTrack span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage-dark), var(--gold));
  transition: width 0.2s ease;
}

.moduleNav {
  display: grid;
  gap: 8px;
}

.navButton {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.navButton:hover,
.navButton.active {
  border-color: var(--line);
  background: white;
}

.navButton:disabled {
  color: #9ba39a;
  cursor: not-allowed;
}

.navIndex {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  background: var(--sage);
  font-size: 0.8rem;
  font-weight: 800;
}

.navButton:disabled .navIndex {
  background: #b9bfb6;
}

.status {
  color: var(--muted);
  font-size: 0.78rem;
}

.note {
  margin-top: auto;
  padding: 16px;
  border-left: 4px solid var(--gold);
  background: #fffaf0;
}

.note h2 {
  font-size: 0.95rem;
}

.note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
}

.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: end;
  gap: 28px;
  padding: 48px clamp(22px, 5vw, 72px) 34px;
  color: white;
  background:
    linear-gradient(90deg, rgba(32, 35, 31, 0.9), rgba(32, 35, 31, 0.52)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='520' viewBox='0 0 1200 520'%3E%3Crect width='1200' height='520' fill='%237f9877'/%3E%3Cpath d='M0 390 C190 300 320 470 520 360 C710 255 820 120 1200 210 L1200 520 L0 520 Z' fill='%23b86f4a' opacity='.75'/%3E%3Cpath d='M0 140 C170 230 290 90 470 155 C680 230 820 290 1200 120 L1200 0 L0 0 Z' fill='%23466c82' opacity='.72'/%3E%3Ccircle cx='850' cy='255' r='110' fill='%23c79a43' opacity='.8'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.hero .eyebrow {
  color: #f6d996;
}

.hero h2 {
  max-width: 820px;
  color: #ffffff !important;
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

.hero p:not(.eyebrow) {
  max-width: 690px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.94) !important;
  font-size: 1.08rem;
  line-height: 1.55;
}

.heroPanel {
  display: grid;
  gap: 10px;
  align-self: stretch;
  align-content: end;
}

.heroPanel span {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(8px);
  font-weight: 700;
}

.contentBand,
.summaryBand,
.profileBand,
.aiBand {
  padding: 36px clamp(22px, 5vw, 72px);
}

.aiBand[hidden] {
  display: none !important;
}

.moduleHeader {
  display: grid;
  gap: 12px;
  max-width: 920px;
}

.moduleHeader h2 {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.moduleHeader p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.58;
}

.questionSet {
  display: grid;
  gap: 18px;
  max-width: 940px;
  margin-top: 28px;
}

.aiCirclePanel {
  max-width: 940px;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgba(70, 108, 130, 0.28);
  border-radius: 8px;
  background: #f4f8f8;
}

.aiCirclePanel.empty {
  color: var(--muted);
  background: #faf9f2;
}

.aiCirclePanel h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.aiCirclePanel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.question {
  display: grid;
  gap: 9px;
}

.question label {
  font-weight: 800;
}

.questionHelp {
  max-width: 850px;
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  background: #f2f7f8;
  font-size: 0.92rem;
  line-height: 1.45;
}

.choiceGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choicePill {
  position: relative;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  cursor: pointer;
}

.choicePill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choicePill span {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: 0.92rem;
  font-weight: 800;
}

.choicePill input:checked + span {
  color: white;
  border-color: var(--sage-dark);
  background: var(--sage-dark);
}

.choicePill input:focus + span {
  box-shadow: 0 0 0 3px rgba(127, 152, 119, 0.2);
}

.choiceExtra {
  min-height: 78px;
}

textarea,
input {
  width: 100%;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  resize: vertical;
  outline: none;
}

input {
  min-height: 46px;
}

textarea:focus,
input:focus {
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 3px rgba(127, 152, 119, 0.2);
}

.moduleActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

.primaryButton,
.ghostButton,
.iconButton {
  padding: 0 16px;
  font-weight: 800;
}

.primaryButton {
  color: white;
  background: var(--sage-dark);
}

.primaryButton:disabled {
  background: #aeb8aa;
  cursor: not-allowed;
}

.ghostButton,
.iconButton {
  color: var(--ink);
  border-color: var(--line);
  background: white;
}

.iconButton {
  width: 44px;
  padding: 0;
  font-size: 1.25rem;
}

.helper {
  color: var(--muted);
  font-size: 0.9rem;
}

.profileBand {
  border-top: 1px solid var(--line);
  background: rgba(247, 246, 239, 0.55);
}

.aiBand {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.aiIntro {
  max-width: 900px;
  margin: -10px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.aiResult {
  max-width: 980px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 20px rgba(41, 48, 38, 0.06);
}

.aiResult h3 {
  margin: 22px 0 8px;
  font-size: 1.15rem;
}

.aiResult h3:first-child {
  margin-top: 0;
}

.aiResult p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.62;
  white-space: pre-wrap;
}

.aiResult.empty {
  color: #9aa296;
  font-style: italic;
}

.manualAiBox {
  max-width: 980px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(70, 108, 130, 0.24);
  border-radius: 8px;
  background: #f4f8f8;
}

.manualAiBox h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.manualAiBox p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.manualActions {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.manualAiInput {
  min-height: 150px;
}

.shareBox {
  background: #fffaf0;
  border-color: rgba(199, 154, 67, 0.34);
}

.shareGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.shareGrid label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.shareGrid input {
  min-height: 44px;
  font-weight: 400;
}

.profileGrid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.profileCard {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 20px rgba(41, 48, 38, 0.06);
}

.profileCard.wide {
  grid-column: 1 / -1;
}

.profileCard h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

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

.profileCard p {
  margin: 8px 0 0;
}

.profileCard .sourceNote {
  margin: 0 0 12px;
  color: var(--clay);
  font-size: 0.9rem;
  font-weight: 800;
}

.profileCard strong {
  color: var(--ink);
}

.tricamCard {
  border-color: rgba(199, 154, 67, 0.55);
}

.aiIntegratedCard {
  border-color: rgba(70, 108, 130, 0.3);
  background: #f8fbfb;
}

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

.validationGrid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.validationGrid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.scoreRow {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.scoreRow > span {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 8px;
  color: white;
  background: var(--clay);
  font-weight: 900;
}

.scoreTrack {
  height: 12px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #ece7da;
}

.scoreTrack span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clay), var(--gold), var(--sage-dark));
}

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

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

.tag {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--sage-dark);
  background: #edf2ea;
  font-size: 0.85rem;
  font-weight: 800;
}

.circleGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ikigaiGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.circleGrid div,
.ikigaiGrid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.circleGrid strong,
.ikigaiGrid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--clay);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.summaryBand {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.summaryHeader {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.summaryHeader h2 {
  font-size: 1.8rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.summaryItem {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 20px rgba(41, 48, 38, 0.06);
}

.aiSummaryItem {
  grid-column: 1 / -1;
  border-color: rgba(70, 108, 130, 0.28);
  background: #f4f8f8;
}

.summaryItem h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.summaryItem p {
  margin: 0;
  color: var(--muted);
  line-height: 1.52;
  white-space: pre-wrap;
}

.empty {
  color: #9aa296;
  font-style: italic;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .heroPanel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summaryGrid {
    grid-template-columns: 1fr;
  }

  .profileGrid {
    grid-template-columns: 1fr;
  }

  .circleGrid {
    grid-template-columns: 1fr;
  }

  .validationGrid {
    grid-template-columns: 1fr;
  }

  .ikigaiGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand {
    grid-template-columns: 56px 1fr;
  }

  .mark {
    width: 56px;
    height: 56px;
  }

  .heroPanel {
    grid-template-columns: 1fr;
  }

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

  .actions {
    justify-content: flex-start;
  }

  .shareGrid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .sidebar,
  .hero,
  .contentBand,
  .profileBand,
  .actions {
    display: none;
  }

  .shell {
    display: block;
  }

  .summaryBand {
    padding: 0;
    border: 0;
    background: white;
  }

  .summaryGrid {
    grid-template-columns: 1fr;
  }

  .summaryItem {
    break-inside: avoid;
    box-shadow: none;
  }
}
