:root {
  --bg: #111418;
  --panel: #1b2128;
  --panel-2: #232b35;
  --text: #f3f6f9;
  --muted: #aab4bf;
  --line: #3a4552;
  --accent: #ffb020;
  --accent-2: #ff7a00;
  --warn-bg: #3a2a0e;
  --warn-border: #f6b64e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg, #0e1115 0%, var(--bg) 100%);
  color: var(--text);
}

.app {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 1rem 0.85rem 2rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 0.85rem;
}

.hero {
  background: linear-gradient(135deg, #202a33, #162029);
}

h1, h2 {
  margin: 0 0 0.45rem;
}

h1 {
  font-size: clamp(1.7rem, 7vw, 2.3rem);
}

h2 {
  font-size: 1.15rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.93rem;
}

input {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
}

input:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

button {
  border: 1px solid #7c5011;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #1e1508;
  font-weight: 700;
  border-radius: 10px;
  min-height: 46px;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

button.secondary {
  background: #2a323d;
  color: var(--text);
  border-color: #4b596a;
}

.results-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 0.7rem;
}

.metric-label {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-value {
  margin: 0;
  font-size: clamp(1.1rem, 5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.45rem;
  text-align: right;
  white-space: nowrap;
  font-size: 0.9rem;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #202833;
}

.warning {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.warning p {
  margin: 0;
  color: #ffe8b9;
  line-height: 1.45;
}

@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
