/* GramyLex Word task pane.
 *
 * A deliberately small token set drawn from the house palette in
 * src/index.css - Counsel Violet accent, warm paper ground, and the brand
 * gradient - restated here rather than imported because the pane ships as its
 * own client under /addin/ and must not couple itself to the app bundle's
 * hashed assets. Values are kept in step with the `:root` blocks of
 * src/index.css by hand; the pane uses only these few.
 */
:root {
  --ground: #faf7f2;
  --surface: #ffffff;
  --ink: #2b2140;
  --inkSoft: #5c5470;
  --line: #e3dcd2;
  --accent: #6d3fd4;
  --accentDark: #52207e;
  --accentSoft: rgba(109, 63, 212, .10);
  --onAccent: #ffffff;
  --danger: #a03232;
  --brandGradient: linear-gradient(135deg, #8750ee 0%, #2e6fd9 52%, #217d8d 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #201a2e;
    --surface: #2a2338;
    --ink: #efeaf6;
    --inkSoft: #b5acc9;
    --line: #453a5c;
    --accent: #a277f1;
    --accentDark: #8750ee;
    --accentSoft: rgba(162, 119, 241, .16);
    --onAccent: #1c1428;
    --danger: #e08c8c;
    --brandGradient: linear-gradient(135deg, #a277f1 0%, #5b8fe1 52%, #2fb0c7 100%);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  font: 14px/1.5 "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--ground);
}

.paneHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  border-image: var(--brandGradient) 1;
  background: var(--surface);
}

.brandLine {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brandName {
  font-weight: 600;
  letter-spacing: .01em;
}

.hostBadge {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accentSoft);
  color: var(--accent);
  font-weight: 600;
}

#paneMain {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

h1 {
  font-size: 18px;
  margin: 4px 0 6px;
}

.viewIntro {
  margin: 0 0 14px;
  color: var(--inkSoft);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--inkSoft);
  margin: 10px 0 4px;
}

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea { resize: vertical; }

.buttonRow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

button { font: inherit; cursor: pointer; }

.primaryButton {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  background: var(--accentDark);
  color: var(--onAccent);
  font-weight: 600;
}

.primaryButton:disabled { opacity: .6; cursor: default; }

.secondaryButton {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
}

.linkButton {
  border: none;
  background: none;
  color: var(--accent);
  padding: 2px 4px;
  font-size: 13px;
}

.formError {
  color: var(--danger);
  margin: 10px 0 0;
}

.progressLine {
  margin: 10px 0 0;
  color: var(--inkSoft);
  font-style: italic;
}

/* Conversation */
.conversation { margin-top: 14px; }

.turn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.turn.user {
  background: var(--accentSoft);
  border-color: transparent;
}

.turnRole {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--inkSoft);
  margin-bottom: 4px;
}

.turnActions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.turnActions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--accent);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* Answer dialect */
.answerBody h2 { font-size: 15px; margin: 12px 0 6px; }
.answerBody h3 { font-size: 13.5px; margin: 10px 0 4px; }
.answerBody p { margin: 6px 0; }
.answerBody ul, .answerBody ol { margin: 6px 0; padding-left: 22px; }
.answerBody blockquote {
  margin: 8px 0;
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accentSoft);
}
.answerBody pre {
  overflow-x: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ground);
}
.answerBody table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}
.answerBody th, .answerBody td {
  border: 1px solid var(--line);
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
}
.answerBody th { background: var(--accentSoft); }
.answerBody a { color: var(--accent); overflow-wrap: anywhere; }
.authorityRef { color: var(--accent); font-weight: 600; }
.authorities h3 { font-size: 13px; margin: 10px 0 4px; }
.authorities ol { margin: 4px 0; padding-left: 22px; }
.authorityStatus { color: var(--inkSoft); font-size: 12px; }

/* Authority check results */
.authorityResults {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
}
.authorityResults h2 { font-size: 14px; margin: 0 0 6px; }
.verdict { margin: 6px 0; }
.verdict .citationText { font-weight: 600; }
.verdict.recorded .citationText { color: var(--accent); }
.verdict.unrecorded .citationText { color: var(--danger); }
.verdict ul { margin: 4px 0 0; padding-left: 20px; font-size: 13px; }

.complianceLine {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--inkSoft);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.srOnly {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Installation help page (help.html) — same tokens, reading-page layout. */
.helpPage { height: auto; min-height: 100%; }
.helpMain {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}
.helpMain h1 { font-size: 20px; margin: 0 0 8px; }
.helpSection {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 16px;
}
.helpSection h2 { font-size: 15px; margin: 0 0 6px; }
.helpSection ol { margin: 6px 0; padding-left: 22px; }
.helpSection li { margin: 4px 0; }
.helpMain code {
  font-size: 12px;
  background: var(--accentSoft);
  border-radius: 4px;
  padding: 1px 4px;
  overflow-wrap: anywhere;
}
.helpMain a { color: var(--accent); }
.helpFootnote { font-size: 12px; color: var(--inkSoft); margin-top: 18px; }
