:root {
  --bg: #f4efe5;
  --bg-deep: #e5dcc8;
  --panel: rgba(255, 251, 245, 0.86);
  --ink: #202019;
  --muted: #6a665d;
  --line: rgba(32, 32, 25, 0.14);
  --accent: #9f2f16;
  --shadow: 0 20px 60px rgba(58, 38, 26, 0.14);
  font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(245, 178, 118, 0.45), transparent 30%),
    radial-gradient(circle at top right, rgba(159, 47, 22, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  min-height: 100vh;
}

.page-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.94), rgba(255, 240, 221, 0.85));
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  font-size: 18px;
  color: var(--muted);
}

.hero-actions,
.inline-actions,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tab-bar {
  display: flex;
  gap: 10px;
  margin: 20px 0 22px;
  flex-wrap: wrap;
}

.tab-button {
  background: rgba(32, 32, 25, 0.08);
  color: var(--ink);
}

.tab-button.active {
  background: var(--accent);
  color: #fff7ef;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

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

.report-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.toolbar-field {
  min-width: 140px;
  margin: 0;
}

label {
  display: block;
  margin-bottom: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  color: var(--muted);
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(32, 32, 25, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff7ef;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(32, 32, 25, 0.08);
  color: var(--ink);
}

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

.span-2 {
  grid-column: span 2;
}

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

.summary-card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(245, 240, 232, 0.88));
  border: 1px solid rgba(32, 32, 25, 0.08);
}

.summary-card strong {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-card span {
  font-size: 22px;
  font-weight: 700;
}

.code-block {
  margin: 0;
  min-height: 220px;
  padding: 16px;
  border-radius: 18px;
  background: #161613;
  color: #f6f1e8;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-list,
.report-shell {
  display: grid;
  gap: 18px;
}

.report-hero,
.report-card,
.report-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.section-head h3 {
  margin: 0;
  font-size: 22px;
}

.section-head span {
  color: var(--muted);
  font-weight: 700;
}

.report-grid {
  display: grid;
  gap: 18px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.report-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.report-card h3,
.report-hero h2 {
  margin: 0;
  font-size: 26px;
}

.report-card h3 span,
.report-hero h2 span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.report-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.report-score-row div,
.report-metrics div {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8f4ec;
  border: 1px solid #ece2d3;
}

.report-score-row strong,
.report-metrics dt {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.report-score-row span,
.report-metrics dd {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

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

.report-comment {
  margin: 16px 0 8px;
  line-height: 1.6;
}

.report-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

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

.result-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 240, 232, 0.9));
  border: 1px solid rgba(32, 32, 25, 0.1);
}

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

.result-head h3 {
  margin: 0;
  font-size: 22px;
}

.result-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge.buy {
  background: rgba(159, 47, 22, 0.12);
  color: var(--accent);
}

.badge.watch {
  background: rgba(32, 32, 25, 0.09);
  color: var(--ink);
}

.tuning-card .badge {
  min-width: 92px;
  text-align: center;
}

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

.metric-grid div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(32, 32, 25, 0.06);
}

.metric-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.agent-row {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(32, 32, 25, 0.04);
}

.agent-summary {
  font-weight: 600;
}

.agent-summary strong {
  display: inline-block;
  min-width: 72px;
}

.agent-reasons {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.agent-reasons li + li {
  margin-top: 4px;
}

.agent-empty {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.comment-block {
  margin-top: 12px;
  line-height: 1.6;
}

.report-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(32, 32, 25, 0.08);
}

.report-item button {
  padding: 10px 14px;
}

.hidden-panel {
  display: none;
}

@media (max-width: 900px) {
  .grid,
  .form-grid,
  .summary-cards,
  .result-grid,
  .metric-grid,
  .report-score-row,
  .report-metrics {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .report-toolbar {
    display: block;
  }
}
