:root {
  color-scheme: light;
  --ink: #17201a;
  --muted: #667067;
  --line: #d9e1d7;
  --panel: #f8faf5;
  --surface: #ffffff;
  --accent: #28745f;
  --accent-strong: #145944;
  --gold: #c9902f;
  --red: #b44b4b;
  --blue: #4267a8;
  --shadow: 0 18px 45px rgba(28, 44, 35, 0.12);
  --app-bg:
    radial-gradient(circle at 14% 8%, rgba(127, 179, 154, 0.22), transparent 0 28%),
    radial-gradient(circle at 88% 18%, rgba(210, 180, 107, 0.16), transparent 0 30%),
    linear-gradient(180deg, #edf4ee 0%, #f8f4ed 46%, #eef4f5 100%);
  --panel-bg: rgba(255, 255, 255, 0.9);
  --soft-bg: #edf3ee;
  --chat-panel-bg: rgba(255, 255, 255, 0.96);
  --chat-feed-bg: #f4f6f1;
  --hint-bg: rgba(255, 255, 255, 0.96);
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
}

body.theme-dark {
  color-scheme: dark;
  --ink: #edf3ee;
  --muted: #aeb8af;
  --line: #3d4841;
  --panel: #1e2822;
  --surface: #151c18;
  --accent: #7fb39a;
  --accent-strong: #b6d7c6;
  --gold: #d2b46b;
  --red: #d47c7c;
  --blue: #8fa8d6;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --app-bg:
    radial-gradient(circle at 14% 8%, rgba(127, 179, 154, 0.16), transparent 0 30%),
    radial-gradient(circle at 88% 18%, rgba(210, 180, 107, 0.12), transparent 0 32%),
    linear-gradient(180deg, #121915 0%, #1a241f 48%, #111713 100%);
  --panel-bg: rgba(25, 34, 29, 0.94);
  --soft-bg: #202b25;
  --chat-panel-bg: rgba(22, 30, 25, 0.98);
  --chat-feed-bg: #101713;
  --hint-bg: rgba(32, 43, 37, 0.96);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--app-bg);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.app-shell {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.control-panel,
.results-panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
}

.results-panel {
  min-width: 0;
  padding: 24px;
}

.brand-row,
.section-head,
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.backup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -6px 0 18px;
}

.backup-actions button {
  min-height: 38px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 8px;
  margin: -8px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-bg);
}

.theme-toggle-button {
  min-width: 112px;
  min-height: 44px;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 700;
}

.mode-button {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  font-weight: 700;
}

.mode-button.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.auto-save-status {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 12px;
}

.site-links a,
.install-pwa-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  text-align: center;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  word-break: keep-all;
}

.site-links a:hover,
.install-pwa-button:hover {
  border-color: var(--accent);
}

.install-pwa-button {
  width: 100%;
  margin: 0 0 14px;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.starter-preset-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-bg);
}

.starter-preset-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.starter-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.starter-preset-grid label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 0.86rem;
}

.starter-preset-panel p {
  margin: 0;
}

body.mode-simple [data-mode-detail] {
  display: none !important;
}

body:not(.mode-major) .major-symbol-simulator {
  display: none !important;
}

body.mode-major #simulationForm,
body.mode-major #inputQualityWarning,
body.mode-major .cashflow-event-editor,
body.mode-major .holdings-editor,
body.mode-major .order-rule-editor,
body.mode-major .allocation-editor,
body.mode-major .assumption-editor,
body.mode-major .correlation-editor,
body.mode-major .stress-editor {
  display: none !important;
}

body.mode-major .major-symbol-simulator {
  display: block !important;
}

.luna-chatbot {
  position: fixed;
  right: clamp(8px, 1.6vw, 24px);
  bottom: 24px;
  z-index: 30;
  width: min(420px, calc(100vw - 20px));
  pointer-events: none;
}

.luna-chat-toggle,
.luna-chat-panel {
  pointer-events: auto;
}

.luna-chat-toggle {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 210px;
  padding: 12px 16px;
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: var(--shadow);
}

.luna-chat-toggle span {
  font-size: 0.78rem;
  opacity: 0.86;
}

.luna-chat-toggle strong {
  grid-column: 2;
  font-size: 1rem;
}

.luna-chat-toggle > span:not(.luna-toggle-avatar) {
  grid-column: 2;
}

.luna-toggle-avatar,
.luna-header-avatar {
  width: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, 0.72);
}

.luna-chat-panel {
  display: none;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chat-panel-bg);
  box-shadow: var(--shadow);
}

.luna-chatbot.is-open .luna-chat-panel {
  display: block;
}

.luna-chatbot.is-open .luna-chat-toggle {
  display: none;
}

.luna-chat-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.luna-chat-header > div:first-of-type {
  min-width: 0;
}

.luna-chat-header h2 {
  overflow: hidden;
  margin-bottom: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.luna-chat-header .eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.luna-window-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.luna-window-actions .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.3rem;
}

.luna-chatbot.is-minimized {
  width: min(300px, calc(100vw - 20px));
}

.luna-chatbot.is-minimized .luna-mode-select,
.luna-chatbot.is-minimized .luna-messages,
.luna-chatbot.is-minimized .luna-quick-actions,
.luna-chatbot.is-minimized .luna-chat-form {
  display: none;
}

.luna-chatbot.is-minimized .luna-chat-panel {
  cursor: pointer;
}

.luna-chatbot.is-minimized .luna-chat-header {
  border-bottom: 0;
}

.luna-mode-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.luna-mode-button {
  min-height: 36px;
  font-weight: 700;
}

.luna-mode-button.active {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.luna-messages {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  background: var(--chat-feed-bg);
}

.luna-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.luna-message.user {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.luna-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background-color: #fff8ea;
  background-size: cover;
  box-shadow: 0 6px 14px rgba(28, 44, 35, 0.12);
}

.luna-avatar.bot {
  background-image: url("assets/noctia-luna-expressions.png");
  background-size: 200% 200%;
}

.luna-avatar.luna-0 {
  background-position: 0 0;
}

.luna-avatar.luna-1 {
  background-position: 100% 0;
}

.luna-avatar.luna-2 {
  background-position: 0 100%;
}

.luna-avatar.luna-3 {
  background-position: 100% 100%;
}

.luna-avatar.user-avatar {
  grid-column: 2;
  grid-row: 1;
  background-image: url("assets/user-rabbit-avatar.png");
}

.luna-bubble {
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.luna-message.user .luna-bubble {
  justify-self: end;
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.luna-bubble small {
  color: inherit;
  opacity: 0.72;
  font-weight: 700;
}

.luna-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  background: var(--chat-feed-bg);
}

.luna-quick-actions button {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.luna-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--chat-panel-bg);
}

.field-help-hint {
  position: fixed;
  z-index: 80;
  max-width: min(220px, calc(100vw - 24px));
  padding: 5px 9px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hint-bg);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chat-panel-bg);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.45;
  transform: translateX(-50%);
}

.settings-grid label,
.settings-grid legend,
.section-head h2,
.results-panel h2,
.results-panel h3,
th,
dt {
  position: relative;
}

.settings-grid label:hover::after,
.settings-grid label:focus-within::after,
.settings-grid legend:hover::after,
.section-head h2:hover::after,
.results-panel h2:hover::after,
.results-panel h3:hover::after,
th:hover::after,
dt:hover::after {
  content: "ダブルクリックで説明";
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 25;
  width: max-content;
  max-width: min(220px, calc(100vw - 24px));
  padding: 5px 9px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hint-bg);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: 1.45rem;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

legend {
  padding: 0 6px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: #344139;
  font-size: 0.9rem;
}

input,
select {
  min-width: 0;
  width: 100%;
  border: 1px solid #cdd7ce;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(40, 116, 95, 0.2);
  border-color: var(--accent);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.preset-row,
.save-controls {
  display: grid;
  gap: 8px;
  align-items: end;
}

.preset-row {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.preset-row label {
  margin-top: 0;
}

.save-controls {
  grid-template-columns: minmax(130px, 1fr) auto;
}

.scenario-save-fields {
  display: grid;
  gap: 8px;
}

.scenario-save-fields textarea {
  min-height: 60px;
  resize: vertical;
}

.assumption-preset-box {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 1fr) auto minmax(100px, 1fr) minmax(120px, 1.2fr) repeat(5, auto);
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.assumption-preset-box label {
  margin: 0;
}

.assumption-preset-box button {
  min-height: 38px;
  padding: 8px 10px;
}

.assumption-preset-box textarea {
  min-height: 38px;
  resize: vertical;
}

.holding-rows {
  display: grid;
  gap: 10px;
}

.holding-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.holding-row label {
  margin-top: 0;
}

.holding-row-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.holding-row-actions button {
  min-height: 42px;
  padding: 8px 10px;
}

.holding-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.import-preset-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.price-source-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.price-source-box label {
  margin-top: 0;
}

.price-source-box button {
  min-height: 42px;
  padding: 8px 10px;
}

.price-source-box p {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  font-size: 0.84rem;
}

.file-input {
  display: none;
}

.cashflow-event-rows {
  display: grid;
  gap: 10px;
}

.cashflow-event-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(72px, 0.55fr) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.cashflow-event-row label {
  margin-top: 0;
}

.cashflow-event-row button {
  min-height: 42px;
  padding: 8px 10px;
}

.cashflow-event-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

#cashflowEventSummary {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.holding-hint {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

#holdingSummary {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.price-history-head {
  margin-top: 14px;
}

.price-history-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.price-history-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(76px, auto);
  gap: 4px 8px;
  padding: 9px 10px;
  background: var(--surface);
  font-size: 0.84rem;
}

.price-history-row strong,
.price-history-row time {
  grid-column: 1 / -1;
}

.price-history-row span,
.price-history-row time {
  color: var(--muted);
}

.toggle-row {
  grid-template-columns: 20px 1fr;
  align-items: center;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.conditional-fields {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.conditional-fields label {
  margin-top: 0;
}

.is-hidden {
  display: none !important;
}

.holdings-editor,
.order-rule-editor,
.major-symbol-simulator,
.allocation-editor,
.assumption-editor,
.correlation-editor,
.stress-editor {
  margin-top: 18px;
}

.major-symbol-inputs,
.major-symbol-rules,
.major-symbol-results {
  display: grid;
  gap: 12px;
}

.major-symbol-inputs {
  margin: 14px 0;
}

.major-symbol-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  align-items: end;
}

.major-symbol-row strong {
  display: flex;
  min-height: 44px;
  align-self: center;
  align-items: center;
}

.major-symbol-rules {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.major-symbol-simulator .input-row {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.major-symbol-simulator input,
.major-symbol-simulator select {
  min-height: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.major-symbol-simulator .input-row span {
  min-width: max-content;
  white-space: nowrap;
}

.major-symbol-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.major-symbol-summary article,
.major-symbol-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.major-symbol-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.major-symbol-summary strong {
  font-size: 1.1rem;
}

.section-head button,
.tab {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.allocation-rows {
  display: grid;
  gap: 10px;
}

.asset-row,
.assumption-editor-row {
  display: grid;
  grid-template-columns: 24px minmax(88px, 1fr) minmax(84px, 0.8fr);
  gap: 8px;
  align-items: center;
}

.assumption-editor-row .input-row,
.correlation-row .input-row {
  grid-template-columns: minmax(96px, 1fr) max-content;
  min-width: 0;
}

.assumption-editor-row input,
.correlation-row input {
  min-width: 0;
  width: 100%;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.asset-row label,
.assumption-editor-row label {
  margin: 0;
}

.allocation-suggestions {
  margin-top: 14px;
}

.allocation-suggestion-list {
  display: grid;
  gap: 10px;
}

.allocation-suggestion {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.allocation-suggestion.current {
  background: var(--surface);
}

.allocation-suggestion > div:first-child {
  display: grid;
  gap: 4px;
}

.allocation-suggestion > div:first-child span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.allocation-suggestion dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.allocation-suggestion dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.allocation-suggestion dt {
  color: var(--muted);
}

.allocation-suggestion dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.allocation-suggestion button {
  min-height: 36px;
}

.assumption-editor-rows,
.correlation-editor-rows,
.order-rule-rows,
.stress-editor-rows {
  display: grid;
  gap: 10px;
}

.editor-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.correlation-editor-rows {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.correlation-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(96px, 1fr) minmax(132px, 0.85fr);
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.correlation-row > span:first-child,
.correlation-row > span:nth-child(2) {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.order-rule-row,
.assumption-editor-row,
.stress-editor-row {
  grid-template-columns: 18px minmax(84px, 1fr) minmax(82px, 0.8fr) minmax(82px, 0.8fr);
}

.order-rule-row {
  display: grid;
  grid-template-columns: 18px minmax(82px, 1fr) minmax(86px, 0.85fr) minmax(76px, 0.75fr);
  gap: 8px;
  align-items: center;
}

.order-rule-row strong {
  font-size: 0.9rem;
}

.order-rule-row label {
  margin: 0;
}

.rule-hint {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.stress-editor-row {
  display: grid;
  grid-template-columns: 18px minmax(84px, 1fr) minmax(92px, 0.9fr);
  gap: 8px;
  align-items: center;
}

.assumption-editor-row strong,
.stress-editor-row strong {
  font-size: 0.9rem;
}

.stress-editor label {
  margin-top: 12px;
}

.stress-editor-row label {
  margin: 0;
}

.warning {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 0.88rem;
}

.input-quality-warning {
  margin: -4px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 95, 95, 0.22);
  border-radius: 6px;
  background: rgba(180, 95, 95, 0.08);
}

.input-quality-warning:empty {
  display: none;
}

.muted {
  color: var(--muted);
}

.simulation-disclaimer {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.attention-ring {
  outline: 3px solid rgba(40, 116, 95, 0.38);
  outline-offset: 5px;
  transition: outline-color 0.2s ease;
}

.view-tabs {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4ed;
}

.tab {
  border-color: transparent;
  background: transparent;
}

.tab.active {
  color: #ffffff;
  background: var(--accent);
}

#headlineValue {
  margin-bottom: 6px;
  font-size: clamp(2rem, 4vw, 4.3rem);
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.metric-grid article {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.chart-wrap {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf9;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 320px;
}

.projection-table-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.projection-yearly-table {
  display: grid;
  gap: 1px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.projection-row {
  display: grid;
  grid-template-columns: 70px repeat(6, minmax(108px, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 880px;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 0.88rem;
}

.projection-row span,
.projection-row strong {
  text-align: right;
}

.projection-row span:first-child,
.projection-row strong:first-child {
  text-align: left;
}

.projection-head {
  color: var(--muted);
  background: var(--panel);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
  margin-top: 18px;
}

.detail-grid section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.action-insights-section {
  grid-column: 1 / -1;
}

.current-summary {
  margin-bottom: 10px;
}

.current-summary article {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.current-summary article > div {
  display: grid;
  gap: 4px;
  align-content: start;
}

.current-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.current-summary strong {
  font-size: 1rem;
}

.current-summary p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.current-summary small {
  color: var(--muted);
  font-size: 0.78rem;
}

.current-summary dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.current-summary dl div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.current-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.current-summary dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.current-summary dd.positive,
.current-summary dd.negative,
.current-summary dd.neutral {
  font-weight: 800;
}

.premise-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.premise-check {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.premise-check-summary {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
}

.premise-check-summary div {
  display: grid;
  gap: 4px;
}

.premise-check-summary strong {
  font-size: 0.94rem;
}

.premise-check-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.premise-check-summary span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: right;
}

.premise-check-summary.caution {
  border-left-color: #c9902f;
}

.premise-check-summary.negative {
  border-left-color: var(--red);
}

.premise-check strong {
  font-size: 0.86rem;
}

.premise-check p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.premise-check.positive {
  border-color: rgba(40, 116, 95, 0.35);
}

.premise-check.caution {
  border-color: rgba(201, 144, 47, 0.45);
}

.premise-check.negative {
  border-color: rgba(180, 95, 95, 0.5);
}

.action-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-insight {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  background: var(--panel);
}

.action-insight span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(95, 107, 118, 0.1);
  font-size: 0.76rem;
  font-weight: 700;
}

.action-insight strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.action-insight p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.action-insight.positive {
  border-left-color: var(--accent);
}

.action-insight.caution {
  border-left-color: #c9902f;
}

.action-insight.negative {
  border-left-color: var(--red);
}

.improvement-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.improvement-options-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.improvement-options-head strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.improvement-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.improvement-option {
  display: grid;
  gap: 10px;
  min-height: 152px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.improvement-option.current {
  background: #f8faf6;
}

.improvement-option > div:first-child {
  display: grid;
  gap: 4px;
}

.improvement-option strong {
  font-size: 0.98rem;
}

.improvement-option span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.improvement-option dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.improvement-option dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.improvement-option dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.improvement-option dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
}

.improvement-option button {
  align-self: end;
  width: 100%;
}

.compact-head {
  align-items: center;
  margin-bottom: 12px;
}

.compact-head h3 {
  margin-bottom: 0;
}

.data-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.data-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.data-list dt {
  color: var(--muted);
}

.data-list dd {
  margin: 0;
  font-weight: 700;
}

.nisa-usage-history {
  margin-top: 16px;
}

.nisa-usage-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.nisa-usage-row {
  display: grid;
  grid-template-columns: 54px repeat(4, minmax(74px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  background: var(--surface);
  font-size: 0.84rem;
}

.nisa-usage-head {
  color: var(--muted);
  background: var(--panel);
  font-weight: 700;
}

.nisa-usage-note {
  margin: 0;
  padding: 9px 10px;
  background: var(--surface);
  font-size: 0.82rem;
}

.assumption-list {
  display: grid;
  gap: 8px;
}

.assumption-row {
  display: grid;
  grid-template-columns: 16px minmax(100px, 1fr) repeat(2, minmax(70px, auto));
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}

.assumption-row span:last-child {
  color: var(--muted);
}

.contribution-panel,
.risk-contribution-panel {
  margin-top: 16px;
}

.contribution-list,
.risk-contribution-list {
  display: grid;
  gap: 8px;
}

.contribution-row,
.risk-contribution-row {
  display: grid;
  grid-template-columns: 16px minmax(94px, 1fr) minmax(80px, 1.1fr) minmax(58px, auto);
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}

.contribution-track,
.risk-contribution-track {
  height: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.contribution-track span,
.risk-contribution-track span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--accent);
}

.contribution-track span.negative,
.risk-contribution-track span.negative {
  background: var(--red);
}

.contribution-row > span:last-child,
.risk-contribution-row > span:last-child {
  text-align: right;
}

.rebalance-section,
.stress-section,
.backtest-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.rebalance-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.rebalance-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) repeat(4, minmax(80px, 1fr));
  gap: 0;
  align-items: center;
  background: var(--surface);
}

.rebalance-row > * {
  min-width: 0;
  padding: 10px;
  overflow-wrap: anywhere;
}

.rebalance-head {
  color: var(--muted);
  background: var(--panel);
  font-size: 0.82rem;
  font-weight: 700;
}

.rebalance-row strong {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

.purchase-plan {
  margin-top: 14px;
}

.purchase-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

.purchase-summary span {
  color: var(--muted);
  text-align: right;
}

.purchase-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--line);
}

.purchase-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
}

.purchase-row span {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rebalance-orders {
  margin-top: 14px;
}

.order-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

.order-summary span {
  color: var(--muted);
  text-align: right;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--line);
}

.order-grid section {
  padding: 12px;
  background: var(--surface);
}

.order-grid h4 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.order-list {
  display: grid;
  gap: 8px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--panel);
}

.order-row.buy {
  border-left-color: var(--accent);
}

.order-row.sell {
  border-left-color: var(--red);
}

.order-row span {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ticker-trade-plan {
  margin-top: 14px;
}

.ticker-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

.ticker-summary span {
  color: var(--muted);
  text-align: right;
}

.ticker-trade-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--line);
}

.ticker-trade-row {
  display: grid;
  grid-template-columns: 54px minmax(130px, 1.4fr) minmax(84px, 0.9fr) minmax(92px, 1fr) minmax(92px, 1fr) minmax(118px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
}

.trade-order {
  color: var(--muted);
  font-size: 0.9rem;
}

.trade-type {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
}

.ticker-trade-row.buy .trade-type {
  background: var(--accent);
}

.ticker-trade-row.sell .trade-type {
  background: var(--red);
}

.stress-grid,
.backtest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stress-card,
.backtest-card {
  min-height: 176px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stress-card > span,
.backtest-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.stress-card strong,
.backtest-card strong {
  display: block;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  font-size: 1.25rem;
}

.stress-card dl,
.backtest-card dl {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.stress-card div,
.backtest-card div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
}

.stress-card dt,
.backtest-card dt {
  color: var(--muted);
}

.stress-card dd,
.backtest-card dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.stress-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.comparison-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.comparison-head {
  align-items: center;
  margin-bottom: 12px;
}

.comparison-head h3 {
  margin-bottom: 0;
}

.button-cluster {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-template-control {
  display: grid;
  grid-template-columns: auto minmax(86px, 1fr);
  gap: 6px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.report-template-control select {
  min-height: 34px;
  padding: 6px 8px;
}

.scenario-comparison {
  display: grid;
  gap: 12px;
}

.scenario-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.best-scenario-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 2fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.best-scenario-summary > div {
  display: grid;
  gap: 6px;
  align-content: start;
}

.best-scenario-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.best-scenario-summary strong {
  font-size: 1rem;
}

.best-scenario-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.best-scenario-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.best-scenario-summary dl div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.best-scenario-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.best-scenario-summary dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.scenario-diff {
  margin-bottom: 14px;
}

.scenario-diff-chart {
  margin-bottom: 14px;
}

.diff-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

.diff-chart-head span {
  color: var(--muted);
  font-size: 0.86rem;
}

.diff-chart-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--line);
}

.diff-chart-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
}

.diff-chart-card h4 {
  margin: 0;
  font-size: 0.92rem;
}

.diff-bar-row {
  display: grid;
  grid-template-columns: 78px minmax(120px, 1fr) minmax(92px, auto);
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}

.diff-bar-row > span {
  color: var(--muted);
}

.diff-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf1eb;
  overflow: hidden;
}

.diff-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--muted);
}

.diff-bar.positive {
  background: var(--accent);
}

.diff-bar.negative {
  background: var(--red);
}

.scenario-path-chart {
  margin-bottom: 14px;
}

.path-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

.path-chart-head span {
  color: var(--muted);
  font-size: 0.86rem;
}

.path-chart-wrap {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--surface);
}

.path-chart-wrap svg {
  display: block;
  width: 100%;
  min-height: 220px;
}

.path-grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.path-grid text,
.path-chart-wrap text {
  fill: var(--muted);
  font-size: 12px;
}

.path-lines polyline {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.path-bands polygon {
  opacity: 0.14;
}

.path-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.path-chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.path-chart-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.scenario-yearly-diff {
  margin-bottom: 14px;
}

.yearly-diff-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

.yearly-diff-head span {
  color: var(--muted);
  font-size: 0.86rem;
}

.yearly-diff-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--line);
}

.yearly-diff-row {
  display: grid;
  grid-template-columns: 64px repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 0.86rem;
}

.yearly-diff-header {
  color: var(--muted);
  background: var(--panel);
  font-weight: 700;
}

.yearly-diff-note {
  margin: 0;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 0.82rem;
}

.diff-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.diff-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.35fr) repeat(4, minmax(92px, 1fr));
  gap: 0;
  background: var(--surface);
}

.diff-row > * {
  min-width: 0;
  padding: 10px;
  overflow-wrap: anywhere;
}

.diff-head {
  color: var(--muted);
  background: var(--panel);
  font-size: 0.82rem;
  font-weight: 700;
}

.diff-row strong {
  font-size: 0.88rem;
}

.positive {
  color: var(--accent-strong);
  font-weight: 700;
}

.negative {
  color: var(--red);
  font-weight: 700;
}

.caution {
  color: #9b6a16;
  font-weight: 700;
}

.neutral {
  color: var(--muted);
}

.scenario-card {
  min-height: 170px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scenario-card > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.scenario-card dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.scenario-card div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
}

.scenario-card dt {
  color: var(--muted);
}

.scenario-card dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.scenario-score-breakdown {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.scenario-score-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.scenario-score-breakdown strong {
  color: var(--ink);
  white-space: nowrap;
}

.scenario-score-advice {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.scenario-score-advice strong {
  color: var(--ink);
}

.scenario-score-advice em {
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 700;
}

.scenario-win-comment {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.scenario-memo,
.scenario-premise {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.scenario-memo {
  color: var(--ink);
}

.scenario-name-field {
  display: block;
  min-height: 42px;
  margin: 0 0 10px;
}

.scenario-name-field input {
  padding: 8px 9px;
  font-weight: 700;
}

.scenario-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.scenario-actions button {
  min-height: 34px;
  padding: 6px 8px;
}

.scenario-actions button:first-child,
.scenario-actions button:last-child {
  grid-column: span 2;
}

.scenario-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.growth-hub,
.ad-placeholder,
.site-footer {
  width: min(1520px, 100%);
  margin: 20px auto 0;
}

.growth-hub,
.ad-placeholder {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.growth-copy h2,
.ad-placeholder h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.growth-copy p,
.ad-placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.growth-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.growth-card {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

.growth-card:hover {
  border-color: var(--accent);
}

.growth-card span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.growth-card strong {
  font-size: 1.05rem;
}

.growth-card small {
  color: var(--muted);
  line-height: 1.6;
}

.ad-placeholder {
  border-style: dashed;
  box-shadow: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding: 0 24px 28px;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.marketing-page {
  display: grid;
  gap: 22px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.marketing-hero,
.marketing-section,
.article-card,
.legal-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.marketing-hero {
  display: grid;
  gap: 14px;
  padding: 26px;
}

.marketing-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
}

.marketing-hero p,
.marketing-section p,
.article-card p,
.legal-box p,
.legal-box li {
  color: var(--muted);
  line-height: 1.8;
}

.marketing-actions,
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.marketing-actions a,
.article-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  font-weight: 700;
}

.marketing-actions a.primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.marketing-section {
  padding: 22px;
}

.marketing-section h2,
.legal-box h2 {
  margin: 0 0 12px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.article-card,
.legal-box {
  padding: 18px;
}

.article-card h3 {
  margin: 0 0 8px;
}

.article-card p {
  margin: 0;
}

.article-read-link {
  justify-self: start;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.article-page {
  width: min(980px, 100%);
}

.article-body {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.article-body h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.12;
}

.article-body h2 {
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.article-body h3 {
  margin: 0 0 8px;
}

.article-body p,
.article-body li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.article-body a {
  color: var(--accent);
  font-weight: 900;
}

.article-lead {
  color: var(--ink) !important;
  font-size: clamp(1.08rem, 2vw, 1.28rem) !important;
  font-weight: 700;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-meta span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.article-trust-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.luna-guide-card,
.article-luna-visual {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 62%),
    var(--surface);
  box-shadow: 0 12px 30px rgba(28, 44, 35, 0.08);
}

.luna-guide-card .luna-avatar,
.article-luna-visual .luna-avatar {
  width: 72px;
  height: 72px;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.luna-guide-card strong,
.article-luna-visual strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1rem;
}

.luna-guide-card p,
.article-luna-visual p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.article-luna-visual {
  margin: 2px 0 4px;
}

.article-mini-visual {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), color-mix(in srgb, var(--gold) 6%, var(--surface))),
    var(--surface);
}

.article-mini-visual-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}

.article-mini-visual-head strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.article-mini-visual-head span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.article-mini-chart {
  display: grid;
  gap: 10px;
}

.article-mini-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.36fr) minmax(0, 1fr) minmax(48px, auto);
  gap: 10px;
  align-items: center;
}

.article-mini-row span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.article-mini-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 62%, var(--surface));
}

.article-mini-fill {
  width: var(--mini-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--gold) 62%, var(--accent)));
}

.article-mini-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.article-mini-step {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.article-mini-step b {
  color: var(--accent);
}

.article-mini-step span {
  color: var(--muted);
  line-height: 1.55;
}

.article-mini-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.article-visual {
  display: grid;
  grid-template-columns: minmax(140px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 28px 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--gold) 7%, transparent)),
    var(--surface);
}

.article-visual h2 {
  margin-top: 0;
}

.article-visual p {
  margin-bottom: 0;
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(18px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 132px;
  padding: 16px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--line) 32%, transparent);
}

.mini-chart span {
  display: block;
  min-height: 24px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 78%, white), var(--accent));
  box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 16%, transparent);
}

.article-trust-box strong {
  color: var(--ink);
}

.article-trust-box ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.1em;
}

.article-trust-box li {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.article-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.article-comparison section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.article-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.article-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.article-cta a.primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.article-action-blocks {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.article-checklist,
.article-note-upsell {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.article-checklist ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-checklist li {
  position: relative;
  padding-left: 30px;
  color: var(--ink);
  font-weight: 800;
}

.article-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05em;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.8rem;
}

.article-note-upsell {
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
  background: color-mix(in srgb, var(--gold) 8%, var(--surface));
}

.article-note-upsell h2,
.article-note-upsell p {
  margin: 0;
}

.related-articles {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.related-articles .section-head a {
  color: var(--accent);
  text-decoration: none;
}

.related-article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-article-grid a {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.related-article-grid a:hover {
  border-color: var(--accent);
}

.related-article-grid span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.marketing-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
}

.marketing-nav a {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.marketing-nav a[aria-current="page"],
.marketing-nav a:hover {
  color: #ffffff;
  background: var(--accent);
}

.marketing-hero {
  overflow: hidden;
  position: relative;
}

.marketing-hero::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: min(240px, 34%);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 58%),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--line) 56%, transparent) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--line) 48%, transparent) 0 1px, transparent 1px 18px);
  opacity: 0.5;
  pointer-events: none;
}

.marketing-hero.luna-led {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  align-items: center;
}

.marketing-hero.luna-led > :not(.luna-hero-guide) {
  grid-column: 1;
}

.luna-hero-guide {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: stretch;
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 220px;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.luna-hero-guide .luna-avatar {
  width: 88px;
  height: 88px;
}

.luna-hero-guide strong {
  font-size: 1.1rem;
}

.luna-hero-guide p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reader-guide-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reader-guide-panel article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feedback-teaser .article-comparison {
  margin-bottom: 14px;
}

.feedback-theme-grid .article-card {
  min-height: 180px;
}

.feedback-board,
.feedback-form-section {
  scroll-margin-top: 24px;
}

.feedback-review-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feedback-review-list article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feedback-review-list span,
.feedback-review-list small {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.feedback-review-list h3,
.feedback-review-list p {
  margin: 0;
}

.feedback-review-list p {
  color: var(--muted);
  line-height: 1.7;
}

.feedback-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feedback-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.feedback-form textarea {
  resize: vertical;
  line-height: 1.7;
}

.feedback-wide,
.feedback-actions,
.feedback-form .muted {
  grid-column: 1 / -1;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-actions button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.feedback-actions button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.glossary-term-grid,
.news-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.glossary-term-card {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.glossary-term-card span,
.news-topic-grid .article-rank {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.glossary-term-card h3 {
  margin: 0;
  font-size: 1.22rem;
}

.glossary-term-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.glossary-term-card a {
  align-self: end;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.editorial-template {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.editorial-template ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 1.4em;
}

.editorial-template li {
  color: var(--ink);
  font-weight: 800;
}

.editorial-template span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.7;
}

.note-draft-layout,
.sns-template-grid,
.carousel-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-copy {
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--ink) !important;
  font-weight: 700;
}

.content-checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.content-checklist li {
  position: relative;
  padding: 12px 12px 12px 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.6;
}

.content-checklist li::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--accent);
  font-weight: 900;
}

.faq-list,
.roadmap-steps {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.faq-list summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 900;
}

.faq-list details[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq-list p {
  margin: 0;
  padding: 14px 16px 16px;
  color: var(--muted);
  line-height: 1.8;
}

.roadmap-steps {
  counter-reset: roadmap;
}

.roadmap-step {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.roadmap-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-weight: 900;
}

.roadmap-step h3,
.roadmap-step p {
  margin: 0;
}

.roadmap-step p {
  color: var(--muted);
  line-height: 1.6;
}

.roadmap-step a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.media-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.media-metric-grid article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.media-metric-grid strong {
  color: var(--accent);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}

.media-metric-grid span {
  color: var(--muted);
  font-weight: 800;
}

.launch-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.launch-check-grid ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.ledger-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ledger-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.ledger-table th,
.ledger-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ledger-table th {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-weight: 900;
}

.ledger-table td {
  color: var(--muted);
  line-height: 1.6;
}

.reader-guide-panel span,
.trend-card span,
.article-rank {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reader-guide-panel strong {
  font-size: 1.05rem;
}

.reader-guide-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.article-route-finder {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 38%),
    color-mix(in srgb, var(--surface) 94%, var(--accent));
}

.route-finder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.route-finder-grid article {
  display: grid;
  gap: 10px;
  min-height: 230px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, #ffffff);
}

.route-finder-grid span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.route-finder-grid h3,
.route-finder-grid p {
  margin: 0;
}

.route-finder-grid h3 {
  font-size: 1.18rem;
}

.route-finder-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.route-finder-grid a {
  align-self: end;
}

.content-filter {
  display: grid;
  gap: 12px;
}

.content-filter input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.article-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-filter-tabs button {
  min-height: 36px;
  padding: 6px 12px;
  font-weight: 800;
}

.article-filter-tabs button.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.featured-article-grid,
.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.featured-article {
  min-height: 210px;
}

.featured-article h3,
.trend-card h3 {
  font-size: 1.18rem;
}

.trend-card {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}

.trend-card a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

[data-article][hidden] {
  display: none !important;
}

.site-chatbot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(430px, calc(100vw - 24px));
}

.site-chat-toggle,
.site-chat-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chat-panel-bg);
  box-shadow: var(--shadow);
}

.site-chat-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  padding: 10px;
  font-weight: 800;
}

.site-chat-toggle strong {
  margin-left: auto;
}

.site-chat-panel {
  display: grid;
  overflow: hidden;
}

.site-chatbot.is-minimized .site-chat-panel {
  display: none;
}

.site-chatbot:not(.is-minimized) .site-chat-toggle {
  display: none;
}

.site-chat-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.site-chat-header h2,
.site-chat-header p {
  margin: 0;
}

.site-chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.site-chat-messages {
  display: grid;
  gap: 12px;
  max-height: min(420px, 48vh);
  overflow: auto;
  padding: 14px;
  background: var(--chat-feed-bg);
}

.site-chat-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.site-chat-message.user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.site-chat-message > div {
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.site-chat-message.user > div {
  background: var(--soft-bg);
}

.site-chat-message strong,
.site-chat-message p {
  margin: 0;
}

.site-chat-message p {
  margin-top: 4px;
  line-height: 1.65;
}

.site-chat-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
}

.site-chat-link:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.site-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.site-chat-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-weight: 800;
}

.site-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.site-chat-form input {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

.site-chat-form button {
  min-width: 72px;
  font-weight: 800;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
    max-height: none;
  }

  .metric-grid,
  .premise-checks,
  .action-insights,
  .improvement-option-grid,
  .stress-grid,
  .backtest-grid,
  .major-symbol-rules,
  .major-symbol-summary,
  .scenario-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .best-scenario-summary {
    grid-template-columns: 1fr;
  }

  .growth-card-grid,
  .article-grid,
  .reader-guide-panel,
  .route-finder-grid,
  .featured-article-grid,
  .trend-grid,
  .glossary-term-grid,
  .news-topic-grid,
  .note-draft-layout,
  .sns-template-grid,
  .carousel-plan-grid,
  .media-metric-grid,
  .launch-check-grid,
  .related-article-grid,
  .feedback-review-list {
    grid-template-columns: 1fr;
  }

  .current-summary article {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .control-panel,
  .results-panel {
    padding: 16px;
  }

  .site-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .growth-hub,
  .ad-placeholder {
    padding: 16px;
  }

  .site-footer {
    padding: 0 12px 20px;
  }

  .marketing-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px;
  }

  .marketing-nav,
  .marketing-hero,
  .marketing-section,
  .article-card,
  .legal-box,
  .article-body {
    max-width: 100%;
    min-width: 0;
  }

  .marketing-hero > *,
  .marketing-section > *,
  .article-card > *,
  .article-body > * {
    min-width: 0;
  }

  .section-head,
  .compact-head {
    flex-wrap: wrap;
  }

  .marketing-hero::after {
    width: 160px;
    opacity: 0.25;
  }

  .marketing-hero.luna-led {
    grid-template-columns: 1fr;
  }

  .marketing-hero.luna-led > :not(.luna-hero-guide),
  .luna-hero-guide {
    grid-column: 1;
  }

  .luna-hero-guide {
    grid-row: auto;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .luna-guide-card,
  .article-luna-visual {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .article-visual {
    grid-template-columns: 1fr;
  }

  .feedback-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .feedback-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .luna-guide-card .luna-avatar,
  .article-luna-visual .luna-avatar {
    width: 56px;
    height: 56px;
  }

  .article-mini-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .article-mini-steps {
    grid-template-columns: 1fr;
  }

  .site-chatbot {
    right: 8px;
    bottom: 10px;
    width: calc(100vw - 16px);
  }

  .roadmap-step {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .article-note-upsell {
    grid-template-columns: 1fr;
  }

  .results-header,
  .brand-row {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .detail-grid,
  .premise-checks,
  .action-insights,
  .improvement-option-grid,
  .stress-grid,
  .backtest-grid,
  .starter-preset-grid,
  .major-symbol-rules,
  .major-symbol-summary,
  .scenario-card-grid {
    grid-template-columns: 1fr;
  }

  .best-scenario-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .current-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .premise-check-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .premise-check-summary span {
    text-align: left;
  }

  .asset-row,
  .holding-row,
  .cashflow-event-row,
  .order-rule-row,
  .assumption-editor-row,
  .correlation-row,
  .stress-editor-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .correlation-row {
    grid-template-columns: 1fr;
  }

  .assumption-editor-row {
    grid-template-columns: 1fr;
  }

  .assumption-editor-row .swatch {
    display: none;
  }

  .assumption-editor-row strong,
  .assumption-editor-row label {
    grid-column: 1 / -1;
  }

  .assumption-editor-row label {
    display: grid;
    grid-template-columns: minmax(88px, 0.45fr) minmax(150px, 1fr);
    gap: 8px;
    align-items: center;
  }

  .assumption-editor-row .input-row,
  .correlation-row .input-row {
    grid-template-columns: minmax(120px, 1fr) max-content;
  }

  .holding-row,
  .cashflow-event-row,
  .holding-actions {
    grid-template-columns: 1fr;
  }

  .price-source-box {
    grid-template-columns: 1fr;
  }

  .preset-row,
  .save-controls,
  .assumption-preset-box {
    grid-template-columns: 1fr;
  }

  .asset-row label,
  .order-rule-row label,
  .stress-editor-row label {
    grid-column: 2 / -1;
  }

  .diff-row {
    grid-template-columns: 1fr;
  }

  .diff-chart-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .yearly-diff-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .yearly-diff-row {
    grid-template-columns: 1fr;
  }

  .contribution-row,
  .risk-contribution-row {
    grid-template-columns: 16px minmax(0, 1fr) minmax(52px, auto);
  }

  .contribution-track,
  .risk-contribution-track {
    grid-column: 2 / -1;
  }

  .diff-bar-row {
    grid-template-columns: 1fr;
  }

  .rebalance-row {
    grid-template-columns: 1fr;
  }

  .rebalance-head,
  .nisa-usage-head {
    display: none;
  }

  .nisa-usage-row {
    grid-template-columns: 1fr;
  }

  .purchase-summary,
  .purchase-row,
  .order-summary,
  .order-row,
  .ticker-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-summary span,
  .order-summary span,
  .ticker-summary span {
    text-align: left;
  }

  .order-grid {
    grid-template-columns: 1fr;
  }

  .ticker-trade-row {
    grid-template-columns: 1fr;
  }

  .diff-head {
    display: none;
  }

  .view-tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .assumption-row {
    grid-template-columns: 16px minmax(90px, 1fr) minmax(64px, auto);
  }

  .major-symbol-row {
    grid-template-columns: 1fr;
  }

  .assumption-row span:last-child {
    grid-column: 2 / -1;
  }

  .luna-chatbot {
    right: 8px;
    bottom: 12px;
    width: calc(100vw - 16px);
  }

  .luna-chat-header {
    grid-template-columns: 38px minmax(0, 1fr) max-content;
    gap: 8px;
    padding: 10px;
  }

  .luna-header-avatar {
    width: 38px;
    height: 38px;
  }

  .luna-window-actions .icon-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .luna-messages {
    max-height: 300px;
  }
}
