:root {
  --bg: #0b0f14;
  --card: #111826;
  --text: #eaf2ff;
  --muted: #b4c0d4;
  --border: #243244;
  --btn: #2d6cdf;
  --btn2: #1f2937;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 18px; /* larger for low vision */
}

a { color: #8ab4ff; }
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid #ffd166;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #ffd166;
  color: #111;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 1000;
}
.skip-link:focus { left: 8px; }

.header {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.header-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.app-title {
  font-size: 22px;
  margin: 0;
}

.brand { min-width: 0; }
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-title {
  font-weight: 800;
  letter-spacing: 0.3px;
}
.brand-slogan {
  font-size: 13px;
  color: var(--muted);
  max-width: 520px;
}

.nav { list-style: none; display: flex; gap: 12px; margin: 0; padding: 0; }
.nav a { text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.nav a:hover { background: rgba(255,255,255,0.06); }

.audio-settings {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
}

.audio-settings > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.audio-settings > summary::-webkit-details-marker { display: none; }

.audio-settings[open] {
  background: rgba(255,255,255,0.04);
}

.audio-settings-form {
  margin-top: 10px;
  min-width: 280px;
  max-width: 360px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
}

.check-row label {
  display: inline;
  margin: 0;
  color: var(--text);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin: 14px 0;
}

label { display: block; margin-top: 12px; margin-bottom: 6px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0e1521;
  color: var(--text);
  font-size: 18px;
}

/* Do not force checkboxes/radios to full width. */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
}
textarea { resize: vertical; }

.btn {
  display: inline-block;
  background: var(--btn);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 18px;
  text-decoration: none;
  text-align: center;
}
.btn.secondary {
  background: var(--btn2);
  border: 1px solid var(--border);
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.help { color: var(--muted); margin-top: 10px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.flash { margin-bottom: 12px; }
.flash-item { padding: 10px 12px; border-radius: 14px; margin: 8px 0; }
.flash-item.error { background: rgba(255, 99, 99, 0.15); border: 1px solid rgba(255, 99, 99, 0.35); }
.flash-item.message { background: rgba(138, 180, 255, 0.12); border: 1px solid rgba(138, 180, 255, 0.3); }

.chat {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  max-height: 420px;
  overflow: auto;
  background: #0c121c;
}

.msg { padding: 12px; margin: 10px 0; border-radius: 16px; border: 1px solid var(--border); }
.msg.user { background: rgba(45,108,223,0.12); }
.msg.assistant { background: rgba(255,255,255,0.06); }
.msg-label { font-weight: 700; margin-bottom: 6px; }
.msg-text { white-space: pre-wrap; }

.chat-form { margin-top: 12px; }

.note {
  border-left: 6px solid #8ab4ff;
  padding-left: 12px;
  margin-top: 12px;
}

.list { padding-left: 22px; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px;
  background: #0c121c;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.table th, .table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}


