:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f5f8;
  color: #172033;
  --accent: #2855d9;
  --border: #dfe4ee;
  --muted: #68738a;
  --danger: #b42318;
  --success: #16794c;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button, .button { border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; text-decoration: none; }
button { background: var(--accent); color: #fff; }
button.secondary, .button.secondary { background: #e8edfb; color: #1c3c9e; }
button.ghost { background: transparent; color: var(--accent); }
button:disabled, .button.disabled { opacity: .5; pointer-events: none; }
input { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 10px 11px; background: #fff; color: inherit; }
label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }

.shell { max-width: 1180px; margin: 0 auto; padding: 34px 18px 60px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .14em; margin: 0 0 5px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 5vw, 42px); }
h2 { margin-bottom: 6px; font-size: 19px; }
.subtitle, .section-heading p, .login-card p, .settings-card p { color: var(--muted); font-size: 14px; margin-bottom: 0; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 18px; box-shadow: 0 5px 18px rgba(25, 42, 76, .04); }
.login-card { max-width: 540px; }
.inline-form, .settings-form, .subscription-row, .actions, .toolbar { display: flex; gap: 10px; align-items: end; }
.inline-form input { flex: 1; }
.settings-form { margin-top: 18px; }
.settings-form label { flex: 1; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.toolbar { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.providers-list { display: grid; gap: 12px; }
.provider-row { border: 1px solid var(--border); border-radius: 10px; padding: 15px; display: grid; gap: 12px; }
.provider-grid { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(260px, 2fr) 120px; gap: 10px; align-items: end; }
.provider-grid .wide { grid-column: span 2; }
.provider-options, .provider-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.provider-options label { display: flex; flex-direction: row; align-items: center; gap: 7px; color: #39445b; }
.provider-options input[type="checkbox"] { width: auto; }
.provider-status { font-size: 13px; color: var(--muted); }
.provider-status.ready { color: var(--success); }
.provider-status.failed { color: var(--danger); }
.provider-warning { color: #9a6500; font-size: 12px; }
.actions { justify-content: flex-end; margin-top: 18px; }
.empty { border: 1px dashed var(--border); padding: 28px; border-radius: 10px; text-align: center; color: var(--muted); }
.status { font-size: 13px; color: var(--muted); }
.status.ready { color: var(--success); }
.status.error { color: var(--danger); }
.message { border-radius: 8px; padding: 11px 13px; margin-bottom: 14px; font-size: 14px; }
.message.error { color: var(--danger); background: #fff0ee; }
.message.success { color: var(--success); background: #eaf8f0; }
.subscription-row input { flex: 1; }
.hidden { display: none !important; }

@media (max-width: 760px) {
  .provider-grid { grid-template-columns: 1fr; }
  .provider-grid .wide { grid-column: auto; }
  .section-heading, .settings-form, .subscription-row { align-items: stretch; flex-direction: column; }
  .toolbar, .actions { justify-content: stretch; }
  .toolbar button, .actions button, .subscription-row button, .subscription-row .button { flex: 1; text-align: center; }
}
