:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dee8;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn-bg: #fff7ed;
  --warn-line: #fed7aa;
  --warn-ink: #9a3412;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

#statusLine {
  color: var(--muted);
  margin-top: 4px;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 21px;
}

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

.url-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

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

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

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

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

.grid-form button {
  grid-column: 1 / -1;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.warnings {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.loading-panel {
  align-items: center;
  display: flex;
  gap: 14px;
}

.loading-panel h2 {
  margin-bottom: 4px;
}

.loading-panel p {
  color: var(--muted);
}

.spinner {
  animation: spin 0.9s linear infinite;
  border: 3px solid #d7dee8;
  border-radius: 50%;
  border-top-color: var(--accent);
  flex: 0 0 auto;
  height: 32px;
  width: 32px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.warning {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 7px;
  padding: 10px 12px;
}

.summary,
.rates,
.damage,
.quote {
  display: grid;
  gap: 8px;
}

.admin-box {
  margin: 14px 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-box summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.summary-row,
.rate-row,
.quote-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f6;
  padding-bottom: 7px;
}

.summary-row span,
.rate-row span,
.quote-row span {
  color: var(--muted);
}

.quote {
  margin-top: 16px;
}

.quote-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  padding: 12px;
  font-weight: 700;
}

.send-button {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 780px) {
  .url-form,
  .two-column,
  .route-grid,
  .grid-form {
    grid-template-columns: 1fr;
  }

  .app {
    padding: 12px;
  }
}
