:root {
  --bg-color: #edf3f9;
  --surface-color: #ffffff;
  --ink-color: #122540;
  --primary-blue: #1557a5;
  --copper-caution: #bd6415;
  --font-family: system-ui, -apple-system, sans-serif;
  --tabular-nums: tabular-nums;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--ink-color);
  line-height: 1.5;
  font-variant-numeric: var(--tabular-nums);
}

.hidden {
  display: none !important;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--surface-color);
  border-bottom: 1px solid #d0d7e2;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-weight: 700;
  font-size: 1.1rem;
}

.header-nav a {
  margin-left: 1.5rem;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.header-nav a:hover {
  text-decoration: underline;
}

#service-status {
  font-size: 0.8rem;
  color: #666;
}

.layout-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  gap: 2rem;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar h1 {
  font-size: 1.5rem;
  margin-top: 0;
  line-height: 1.2;
}

.subheading {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.quote-form fieldset {
  border: none;
  padding: 0;
  margin-bottom: 1rem;
}

.quote-form legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.radio-label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(21, 87, 165, 0.2);
}

.helper {
  display: block;
  font-size: 0.75rem;
  color: #777;
  margin-top: 0.25rem;
}

.chip-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip {
  padding: 0.25rem 0.75rem;
  border: 1px solid #ccc;
  background: #f5f5f5;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.85rem;
}

.chip[aria-pressed="true"] {
  background-color: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.chip:hover {
  background-color: #e0e0e0;
}

.chip[aria-pressed="true"]:hover {
  background-color: #104a8f;
}

#access-details summary {
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.note {
  font-size: 0.8rem;
  color: var(--copper-caution);
  margin-top: 0.5rem;
}

button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

button[type="submit"]:hover {
  background-color: #104a8f;
}

button[type="submit"]:disabled {
  background-color: #a0a0a0;
  cursor: not-allowed;
}

.results-area {
  min-width: 0;
  flex-grow: 1;
  background-color: var(--surface-color);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#result-summary h2 {
  margin-top: 0;
}

#status {
  font-size: 0.9rem;
  color: #555;
}

.chart-wrapper {
  margin: 1.5rem 0;
}

#chart {
  min-height: 230px;
  background-color: #f7faff;
  border: 1px solid #e3ebf4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #999;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background-color: #f5f7fa;
  font-weight: 600;
}

tr:hover {
  background-color: #f9f9f9;
}

.feasible { color: #2e7d32; }
.recommended { font-weight: bold; color: var(--primary-blue); }
.muted { color: #999; }
.warning { color: var(--copper-caution); }
.error { color: #d32f2f; }

#no-results {
  padding: 1rem;
  background-color: #fff3e0;
  border-radius: 4px;
  margin-bottom: 1rem;
}

#warnings h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

#warnings ul {
  padding-left: 1.2rem;
  margin-bottom: 0.5rem;
}

#warnings li {
  margin-bottom: 0.25rem;
}

.source-note {
  font-size: 0.8rem;
  color: #777;
  margin-top: 1rem;
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: center;
}

#export-json {
  padding: 0.5rem 1rem;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

#export-json:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#provider-link {
  color: var(--primary-blue);
  text-decoration: none;
}

#provider-link:hover {
  text-decoration: underline;
}

.disclaimer {
  font-size: 0.8rem;
  color: #777;
  margin-top: 1rem;
}

.content-section {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.content-section h2 {
  border-bottom: 2px solid var(--primary-blue);
  padding-bottom: 0.5rem;
}

pre {
  background-color: #f5f7fa;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9rem;
}

#copy-request {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

#copy-request:hover {
  background-color: #e0e0e0;
}

.scope-note {
  font-size: 0.9rem;
  font-style: italic;
  color: #555;
}

.site-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: #777;
  border-top: 1px solid #d0d7e2;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
    padding: 1rem;
  }
  .sidebar {
    width: 100%;
  }
  .site-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .header-nav a {
    margin: 0 0.5rem;
  }
}

:focus-visible { outline: 3px solid #bd6415; outline-offset: 3px; }
#chart svg { display: block; width: 100%; height: auto; }
.chart-grid { stroke: #dce5ef; stroke-width: 1; }
.chart-label { fill: #52647c; font: 12px system-ui,sans-serif; }
.chart-legend { display:flex; flex-wrap:wrap; gap:14px; padding:0 20px 16px; font-size:12px; color:#52647c; }
.series { font-weight:650; }
.series-0 {color:#1557a5}.series-1 {color:#a44b09}.series-2 {color:#38694c}.series-3 {color:#7954a6}
.best-row {background:#edf5ff}.muted {color:#697789}
#warnings {margin-top:24px;padding:18px 20px;background:#fff8ed;border-left:3px solid #bd6415;font-size:13px;color:#754519}
.actions {flex-wrap:wrap} td,th {white-space:nowrap} input,button {font-size:16px}
@media(max-width:768px){.results-area{padding:20px}.layout-container{gap:16px}.content-section{padding:0 20px}.sidebar h1{font-size:28px}.table-wrapper{margin-right:-4px}.chart-legend{font-size:11px;padding:0 10px 12px}}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
