:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f4f2;
  --text: #1d2321;
  --muted: #62706a;
  --line: #dce4df;
  --red: #bd1e2d;
  --green: #24745a;
  --blue: #2e5d8a;
  --amber: #9b6422;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

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

.page {
  min-height: 100vh;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--amber);
}

.grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.section {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.compact-section {
  padding-top: 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 92px;
}

.metric strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.panel + .panel {
  margin-top: 14px;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

.panel-title h3 {
  margin-bottom: 4px;
}

.panel-title p {
  margin: 0;
}

.action-panel {
  background: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.row:first-child {
  border-top: 0;
}

.row small,
.muted {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.tag.green {
  color: var(--green);
}

.tag.blue {
  color: var(--blue);
}

.tag.red {
  color: var(--red);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn.primary {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

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

.checklist {
  display: grid;
  gap: 10px;
}

.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
}

.box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
}

.box.done {
  background: var(--green);
  border-color: var(--green);
}

.result-line {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.error-line {
  color: var(--red);
}

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

.commercial-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.commercial-grid strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.usage-list {
  display: grid;
  gap: 10px;
}

.usage-item {
  display: grid;
  gap: 6px;
}

.usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.usage-head strong {
  color: var(--text);
}

.usage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.usage-bar span {
  display: block;
  height: 100%;
  background: var(--red);
}

.commercial-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.commercial-row:first-child {
  border-top: 0;
}

.stacked-form {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.download-result {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .shell {
    padding: 16px;
  }

  .topbar,
  .grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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