body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f7fb;
  color: #222;
}

.page {
  max-width: 1100px;
  margin: 40px auto;
  padding: 20px;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

h2 {
  margin-top: 0;
  font-size: 20px;
}

.intro {
  margin-top: 0;
  margin-bottom: 24px;
  color: #666;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}

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

select,
textarea,
input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-sizing: border-box;
  background: #fff;
}

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

button {
  margin-top: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.results-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 28px;
}

.result-card {
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fafafa;
  padding: 16px;
}

.result-card-full {
  grid-column: 1 / -1;
}

#analysisOutput {
  min-height: 240px;
  white-space: pre-wrap;
  line-height: 1.6;
}

#fxOutput {
  min-height: 120px;
  line-height: 1.6;
  white-space: pre-wrap;
}

#sourcesOutput {
  min-height: 220px;
}

.source-item {
  padding: 12px 0;
  border-bottom: 1px solid #e5e5e5;
}

.source-item:last-child {
  border-bottom: none;
}

.source-title {
  font-weight: bold;
  display: block;
  margin-bottom: 4px;
}

.source-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 6px;
}

.source-link {
  word-break: break-word;
  font-size: 14px;
}

.loading {
  color: #666;
}

.error {
  color: #b00020;
}

.fx-rate {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 8px;
}

.fx-meta {
  color: #666;
  font-size: 14px;
}

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

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

  .result-card-full {
    grid-column: auto;
  }
}

.fx-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

.fx-table th,
.fx-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.fx-table th {
  background: #f0f3f8;
  font-weight: bold;
}

.fx-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.fx-table th,
.fx-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.fx-table th {
  background: #f0f3f8;
  font-weight: bold;
}

.fx-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 14px;
}

.fx-stat-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.fx-stat-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.fx-stat-value {
  font-size: 20px;
  font-weight: bold;
}

.fx-stat-sub {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.fx-chart-wrap {
  margin: 10px 0 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.fx-chart {
  width: 100%;
  height: 120px;
  display: block;
  color: #2563eb;
}

@media (max-width: 700px) {
  .fx-stats {
    grid-template-columns: 1fr;
  }
}
