:root {
  --navy: #0f172a;
  --navy-mid: #2f3f56;
  --gold: #a9790f;
  --gold-light: #d8b674;
  --border: #d9dce3;
  --bg: #f6f5f1;
  --text-muted: #667085;
  --pass: #15803d;
  --fail: #dc2626;
}

* { box-sizing: border-box; }

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

header {
  padding: 46px 32px 40px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, var(--gold) 100%);
  color: #fff;
  text-align: center;
  position: relative;
  border-bottom: 3px solid var(--gold);
}

.brand {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-light);
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(216, 182, 116, 0.45);
}

header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.subtitle { margin: 12px auto 0; color: #f3e6c8; font-size: 15px; max-width: 640px; line-height: 1.5; }

main {
  max-width: 1100px;
  margin: 28px auto 60px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
}

.panel h2 { margin: 0 0 14px; font-size: 16px; color: var(--navy); }
.panel h3 { margin: 0 0 8px; font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.tool-row label {
  font-size: 13.5px;
  margin-right: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}
.tool-row input[type="radio"] { accent-color: var(--gold); margin-right: 6px; }

select, button, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

button {
  background: var(--gold);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
}
button:hover { background: #8f6209; }
button.secondary { background: var(--navy); }
button.secondary:hover { background: #1c2b45; }

.hint { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 8px; }

textarea, pre {
  width: 100%;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12.5px;
}

textarea { resize: vertical; }

pre {
  background: var(--navy);
  color: #e2e8f0;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
}

.manual-case { background: #fdf8ee; color: #4a3400; border: 1px solid #ecd9a8; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
@media (max-width: 800px) { .columns { grid-template-columns: 1fr; } }

.status { margin-left: 10px; font-size: 13px; color: var(--text-muted); }

.section-head-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-head-row h2 { margin: 0; }

.help-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.help-icon:hover { background: #1c2b45; }

.popover {
  border: 1px solid var(--gold-light);
  background: linear-gradient(135deg, #fdf8ee 0%, #fbf1db 100%);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13.5px;
  color: #4a3400;
  margin: -4px 0 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

#phrasings-list { padding-left: 20px; }
#phrasings-list li { margin-bottom: 3px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; }

#parse-preview { margin-top: 14px; }
#parsed-json { background: var(--navy); color: #e2e8f0; max-height: 240px; }

.no-run-note {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}

.no-run-note.warning {
  border: 1px solid #fca5a5;
  border-style: solid;
  background: #fef2f2;
  color: #991b1b;
}

footer {
  text-align: center;
  padding: 24px;
  font-size: 12.5px;
  color: var(--text-muted);
}
footer a { color: var(--gold); }
