:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --soft: #f9fafb;
  --tree-soft: #eef6ff;
  --tree-border: #bfdbfe;
  --destination-soft: #f0fdf4;
  --destination-border: #bbf7d0;
  --warm-soft: #fff7ed;
  --warm-border: #fed7aa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, #dbeafe 0, transparent 34%),
    radial-gradient(circle at top right, #dcfce7 0, transparent 30%),
    var(--bg);
  color: var(--text);
}

header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  padding: 22px 28px;
  backdrop-filter: blur(8px);
}

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

.language-box {
  min-width: 180px;
}

header h1 {
  margin: 0 0 8px 0;
  font-size: 26px;
}

header p {
  margin: 0;
  color: var(--muted);
}

.feedback-open-button {
  flex-shrink: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
}

.accent-tree {
  border-top: 6px solid #60a5fa;
}

.accent-destination {
  border-top: 6px solid #34d399;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0 0 6px 0;
  font-size: 20px;
}

.panel p {
  margin: 0;
  color: var(--muted);
}

.guidance-card,
.destination-wizard {
  display: grid;
  gap: 10px;
  background: var(--tree-soft);
  border: 1px solid var(--tree-border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
}

.destination-wizard {
  background: #ecfdf5;
  border-color: var(--destination-border);
  margin-top: 14px;
}

.file-analysis-box,
.auto-suggestion-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

.file-analysis-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
}

.auto-suggestion-box {
  display: grid;
  gap: 8px;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #064e3b;
}

.suggestion-reason {
  color: #065f46;
  font-size: 12px;
}

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

.breadcrumb {
  padding: 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--destination-border);
  font-weight: 700;
  word-break: break-word;
}

.step-question {
  color: #065f46;
  font-weight: 700;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-button,
.final-choice-button {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: left;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--destination-border);
}

.choice-button:hover,
.final-choice-button:hover {
  background: #dcfce7;
}

.choice-button span {
  color: var(--muted);
  font-size: 12px;
}

.final-choice-button {
  background: var(--success);
  color: white;
  text-align: center;
  justify-content: center;
}

.final-choice-button:hover {
  background: #15803d;
}

.final-destination-box {
  padding: 12px;
  border-radius: 12px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #14532d;
  font-weight: 700;
}

.guidance-card span {
  color: var(--muted);
  font-size: 14px;
}

.tree-container {
  overflow: auto;
  max-height: 46vh;
  padding-right: 6px;
}

.tree-node-wrapper {
  display: grid;
  gap: 8px;
}

.tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--tree-border);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-radius: 14px;
  padding: 10px 12px;
}

.main-category-node {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border: 1px solid #93c5fd;
  border-left: 6px solid #2563eb;
  padding: 14px 14px;
  margin-bottom: 4px;
}

.selected-destination-node {
  outline: 3px solid #22c55e;
  outline-offset: 2px;
}

.main-category-node .node-name {
  font-size: 17px;
}

.node-content {
  display: grid;
  gap: 3px;
}

.node-name {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.node-thinking-type,
.node-next-layer {
  font-size: 12px;
  color: var(--muted);
}

.node-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

button {
  border: none;
  background: var(--primary);
  color: white;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: #e5e7eb;
  color: var(--text);
}

button.secondary:hover {
  background: #d1d5db;
}

button.success {
  background: var(--success);
}

button.danger {
  background: var(--danger);
}

.small-button {
  padding: 7px 9px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.structure-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.output,
.advice-output {
  min-height: 220px;
  max-height: 40vh;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.output {
  background: #0f172a;
  color: #e5e7eb;
}

.advice-output {
  background: #052e16;
  color: #dcfce7;
  margin-top: 12px;
}

.destination-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,253,244,0.9));
}

.small-note {
  margin-top: 12px !important;
  font-size: 13px;
}

.site-footer {
  padding: 18px 28px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 18px;
  z-index: 20;
}

.modal.hidden,
.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
}

.feedback-modal-card {
  width: min(620px, 100%);
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

.icon-button:hover {
  background: #f3f4f6;
  color: var(--text);
}

.modal-card h2 {
  margin: 0 0 8px 0;
}

.feedback-intro {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft);
}

.feedback-intro span {
  color: var(--muted);
}

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

.modal-context,
.fixed-type {
  margin-bottom: 12px;
  color: var(--muted);
}

.fixed-type {
  padding: 10px;
  background: var(--warm-soft);
  border: 1px solid var(--warm-border);
  border-radius: 10px;
}

label {
  display: block;
  margin: 12px 0 6px 0;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 15px;
  font-family: inherit;
  background: white;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

#feedbackMessage {
  min-height: 150px;
}

.examples-box {
  margin-top: 12px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.example-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.example-tag {
  display: inline-flex;
  padding: 6px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
}

.example-tag:hover {
  background: #d1d5db;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

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

  .header-row {
    display: grid;
  }

  .feedback-open-button {
    justify-self: start;
  }

  .tree-container,
  .output,
  .advice-output {
    max-height: none;
  }
}