:root {
  color-scheme: dark;
  --bg: #0f1210;
  --panel: #171c19;
  --panel-2: #202720;
  --text: #e7eee7;
  --muted: #93a094;
  --line: #303a32;
  --accent: #79d69b;
  --accent-2: #b8f3c7;
  --danger: #ff8f8f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, #1b2a21 0, transparent 34rem), var(--bg);
  color: var(--text);
}
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}
h1 {
  margin: 0 0 6px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.05;
}
.subtitle { margin: 0; color: var(--muted); }
.total-box {
  min-width: 176px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(23, 28, 25, 0.9);
  border-radius: 8px;
  text-align: right;
}
.total-label { display: block; color: var(--muted); font-size: 0.84rem; }
.total { display: block; font-size: 2.25rem; font-weight: 800; color: var(--accent-2); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}
.doc-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(23, 28, 25, 0.88);
  border-radius: 8px;
}
.icon-wrap {
  width: 74px;
  aspect-ratio: 1.02;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #2b342d;
  background: #101411;
}
.icon-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-label { display: block; font-weight: 600; color: var(--text); font-size: 0.95rem; }
.doc-metrics {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}
.metric-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.req-input, .have-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1411;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  width: 60px;
}
.stepper {
  display: flex;
  gap: 4px;
}
.stepper button {
  width: 28px;
  height: 32px;
  padding: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.stepper button:hover { border-color: var(--accent); color: var(--accent-2); }
.have-input {
  width: 50px;
}
.rem-group {
  align-items: flex-end;
  padding-bottom: 2px;
}
.rem-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  min-height: 38px;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button:hover { border-color: var(--accent); color: var(--accent-2); }
.helper {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(23, 28, 25, 0.9);
  border-radius: 8px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary { background: #244a30; border-color: #3e7d52; }
.danger { color: var(--danger); }
textarea {
  width: 100%;
  min-height: 86px;
  margin-top: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1411;
  color: var(--text);
  padding: 10px;
  font: 0.9rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (max-width: 660px) {
  header { align-items: stretch; flex-direction: column; }
  .total-box { text-align: left; }
  .doc-metrics {
    flex-wrap: wrap;
    gap: 12px;
  }
}