:root {
  --bg: #f6f3ef;
  --panel: #ffffff;
  --text: #2c231c;
  --muted: #6f6258;
  --brand: #e67e22;
  --brand-dark: #c66b1d;
  --line: #e8e0d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(45deg, #f0c27b, #e67e22);
  color: #fff;
}

h1, h2, h3 {
  margin: 0.2rem 0;
}

.subtitle {
  margin: 0;
}

.lang-wrap {
  display: grid;
  gap: 0.3rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.grid-form {
  display: grid;
  gap: 0.5rem;
}

input, textarea, select, button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid #cfc5bc;
  padding: 0.55rem 0.65rem;
  width: 100%;
}

textarea {
  min-height: 66px;
}

button {
  background: var(--brand);
  color: #fff;
  border: 0;
  cursor: pointer;
}

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

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

.actions {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.actions.wrap {
  flex-wrap: wrap;
  align-items: center;
}

.cards {
  display: grid;
  gap: 0.45rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem;
  background: #fffcf8;
}

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

.results, .insights {
  margin-top: 0.6rem;
  padding: 0.65rem;
  border-radius: 8px;
  background: #fcf9f4;
  border: 1px dashed #dacaba;
}

.chart-wrap {
  margin: 0.5rem 0 1rem;
}

canvas {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}

.footer a {
  color: inherit;
}

.pro-panel {
  opacity: 0.95;
}

@media (max-width: 720px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }
}

html[dir="rtl"] body {
  direction: rtl;
}
