:root {
  --ink: #22302f;
  --muted: #66736f;
  --paper: #fffdf7;
  --surface: #f7f1e6;
  --line: #ded6c8;
  --forest: #17443b;
  --jade: #2f7d67;
  --coral: #c96f5f;
  --gold: #b9944d;
  --blue: #425d8b;
  --shadow: 0 18px 50px rgba(34, 48, 47, 0.14);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 68, 59, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(66, 93, 139, 0.05) 1px, transparent 1px),
    #f4efe6;
  background-size: 36px 36px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.control-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px;
  background: rgba(255, 253, 247, 0.96);
  border-right: 1px solid var(--line);
}

.brand-mark {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.kicker {
  margin: 0 0 4px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

h2 {
  margin: 0;
  font-size: 24px;
}

.app-icon {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(185, 148, 77, 0.26);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eee6d8;
}

.tab,
.view-button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.tab.is-active,
.view-button.is-active {
  color: var(--paper);
  background: var(--forest);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d5ccbb;
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fffaf0;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(47, 125, 103, 0.16);
}

.field-row,
.item-grid,
.area-input-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.panel-note {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbf7ed;
  font-size: 13px;
  line-height: 1.7;
}

.privacy-note {
  padding: 13px;
  border: 1px solid rgba(23, 68, 59, 0.22);
  border-radius: 8px;
  color: var(--forest);
  background: #edf7f1;
  font-size: 13px;
  line-height: 1.7;
}

.privacy-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--forest);
  font-size: 14px;
}

.privacy-note p {
  margin: 0;
}

.neutral-note {
  color: #5e523d;
  background: #fbf7ed;
}

.neutral-note strong {
  color: #5e523d;
}

.import-status {
  padding: 12px;
  border: 1px solid rgba(47, 125, 103, 0.25);
  border-radius: 8px;
  color: var(--forest);
  background: #eef7f2;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.convert-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.convert-steps span {
  min-height: 46px;
  padding: 8px 6px;
  border: 1px solid rgba(47, 125, 103, 0.18);
  border-radius: 8px;
  color: var(--forest);
  background: #eef7f2;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.conversion-summary {
  padding: 13px;
  border: 1px solid rgba(66, 93, 139, 0.25);
  border-radius: 8px;
  background: #f0f4fb;
  color: #334360;
  font-size: 13px;
  line-height: 1.7;
}

.conversion-summary strong {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
}

.conversion-summary p {
  margin: 0;
}

.conversion-summary p + p {
  margin-top: 4px;
}

.items-header,
.actions,
.toolbar,
.view-controls,
.meta-strip {
  display: flex;
  align-items: center;
}

.program-reference-list,
.program-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.program-reference-list span,
.program-chip-row span {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--forest);
  background: #e3efe9;
  font-size: 12px;
  font-weight: 800;
}

.items-header,
.actions,
.toolbar {
  justify-content: space-between;
  gap: 12px;
}

.items-header {
  color: var(--ink);
  font-weight: 800;
}

.item-list {
  display: grid;
  gap: 12px;
}

.analysis-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
}

.remove-item {
  margin-top: 8px;
  min-height: 32px;
  border: 1px solid #d8c6b8;
  border-radius: 6px;
  color: #8a3d34;
  background: #fff4ee;
  font-weight: 700;
}

.actions {
  position: sticky;
  bottom: -24px;
  margin: 22px -24px -24px;
  padding: 14px 24px 24px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0), var(--paper) 22%);
}

.primary,
.secondary,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary {
  padding: 0 18px;
  color: #fffdf7;
  background: var(--forest);
}

.secondary {
  padding: 0 14px;
  color: var(--forest);
  background: #fffaf0;
  border-color: var(--line);
}

.icon-button {
  width: 42px;
  color: var(--paper);
  background: var(--jade);
}

.preview-area {
  padding: 28px;
  overflow: auto;
}

.toolbar {
  max-width: 980px;
  margin: 0 auto 20px;
  justify-content: flex-end;
}

.view-controls {
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
}

.view-button {
  padding: 0 12px;
}

.report-paper {
  max-width: 980px;
  margin: 0 auto;
  padding: 42px;
  border: 1px solid rgba(34, 48, 47, 0.12);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.report-paper.mobile-view {
  max-width: 390px;
  padding: 24px;
}

.cover {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 28px;
  align-items: center;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.cover h2 {
  margin: 8px 0 12px;
  font-size: 42px;
  line-height: 1.18;
  color: var(--forest);
}

.lead {
  margin: 0;
  color: #475651;
  font-size: 16px;
  line-height: 1.9;
}

.report-image {
  width: 168px;
  aspect-ratio: 1;
  border: 1px solid rgba(185, 148, 77, 0.76);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 18px 44px rgba(185, 148, 77, 0.22);
}

.meta-strip {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.meta-pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fbf7ed;
  font-size: 12px;
  font-weight: 700;
}

.report-section {
  margin-top: 30px;
}

.section-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  color: var(--forest);
  font-size: 22px;
}

.section-heading::before {
  content: "";
  width: 9px;
  height: 24px;
  border-radius: 999px;
  background: var(--coral);
}

.report-section p {
  margin: 0 0 12px;
  line-height: 1.9;
}

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

.insight-card,
.metric-card,
.note-box,
.closing-box,
.area-card,
.layer-card,
.method-card,
.program-guide-box,
.meridian-report,
.aura-profile,
.aura-map-card,
.potency-table > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
}

.insight-card {
  padding: 16px;
}

.insight-card strong,
.metric-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
}

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

.metric-card {
  padding: 14px;
}

.metric-value {
  display: block;
  margin: 4px 0;
  color: var(--forest);
  font-size: 30px;
  font-weight: 900;
}

.metric-value.small {
  margin: 0;
  font-size: 24px;
}

.score-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8decf;
}

.score-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--gold));
}

.item-report {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 16px;
  border-left: 4px solid var(--jade);
  background: #f7fbf6;
}

.item-report h4 {
  margin: 0;
  color: var(--forest);
  font-size: 17px;
}

.item-report p {
  margin: 0;
}

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

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--forest);
  background: #e3efe9;
  font-size: 12px;
  font-weight: 800;
}

.note-box {
  padding: 18px;
  border-color: rgba(201, 111, 95, 0.38);
  background: #fff7f1;
}

.summary-box {
  padding: 18px;
  border: 1px solid rgba(66, 93, 139, 0.26);
  border-radius: 8px;
  background: #f5f8fd;
}

.summary-box p:last-child {
  margin-bottom: 0;
}

.therapist-message {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(185, 148, 77, 0.42);
  border-radius: 8px;
  background: #fff9ec;
}

.therapist-message strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 16px;
}

.therapist-message p {
  margin-bottom: 0;
}

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

.area-wheel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(47, 125, 103, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(47, 125, 103, 0.16) 0 3%, transparent 4% 100%),
    repeating-radial-gradient(circle at center, rgba(47, 125, 103, 0.16) 0 1px, transparent 1px 12px),
    #f2faf6;
}

.aura-map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.aura-map-card {
  padding: 16px;
  background: #fff7f1;
}

.aura-map-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--forest);
}

.potency-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.potency-table > div {
  border: 0;
  border-radius: 0;
  padding: 16px;
  background: #fbf7ed;
}

.potency-table strong {
  display: block;
  color: var(--forest);
  font-size: 28px;
  line-height: 1;
}

.potency-table span {
  display: block;
  margin: 6px 0 10px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 900;
}

.area-card {
  display: grid;
  gap: 6px;
  min-height: 126px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.9);
}

.area-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--forest);
  background: #e3efe9;
  font-weight: 900;
}

.area-card strong {
  color: var(--forest);
  font-size: 14px;
}

.area-score {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.area-card.is-strong .area-icon {
  background: #ffe7cf;
}

.area-card.is-steady .area-icon {
  background: #e5edf9;
}

.area-card.is-soft .area-icon {
  background: #f4ddec;
}

.layer-grid,
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

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

.layer-card,
.method-card {
  padding: 16px;
}

.layer-card strong {
  display: block;
  color: var(--forest);
  font-size: 30px;
  line-height: 1;
}

.layer-card span,
.method-label {
  display: block;
  margin: 5px 0 10px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 800;
}

.method-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--forest);
  font-size: 18px;
}

.method-card small {
  display: block;
  color: var(--muted);
  line-height: 1.7;
}

.program-guide-box {
  margin-top: 14px;
  padding: 16px;
  background: #f7fbf6;
}

.program-guide-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--forest);
  font-size: 18px;
}

.program-chip-row {
  margin-top: 10px;
}

.body-axis-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.body-axis-grid span {
  padding: 8px 6px;
  border-radius: 999px;
  color: var(--forest);
  background: #e3efe9;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.meridian-report {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 16px;
  border-left: 4px solid var(--coral);
  background: #fffaf0;
}

.aura-profile {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 16px;
  border-left: 4px solid var(--blue);
  background: #f7fbf6;
}

.meridian-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meridian-head h4 {
  margin: 0;
  color: var(--forest);
  font-size: 18px;
}

.muted-line {
  color: var(--muted);
  font-size: 13px;
}

.closing-box {
  padding: 22px;
  color: var(--forest);
  background: #eef7f2;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.8;
}

.soft-note {
  margin-top: 12px;
  background: #fffaf0;
}

.soft-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--forest);
}

.disclaimer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

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

  .control-panel {
    position: static;
    height: auto;
  }

  .cover,
  .insight-grid,
  .metric-grid,
  .care-list,
  .area-wheel,
  .aura-map-grid,
  .potency-table,
  .layer-grid,
  .method-grid,
  .body-axis-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .control-panel,
  .preview-area {
    padding: 16px;
  }

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

  .field-row,
  .item-grid,
  .area-input-grid {
    grid-template-columns: 1fr;
  }

  .report-paper {
    padding: 22px;
  }

  .cover h2 {
    font-size: 31px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .control-panel,
  .toolbar {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .preview-area {
    padding: 0;
  }

  .report-paper {
    max-width: none;
    padding: 18mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .report-section {
    break-inside: avoid;
  }
}
