/* WS-FABLE additions: shared styles. Colours come from the theme variables
   (style.css / chrome.css), so a switchable theme recolours them too. */
.score-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
.score-card { flex: 1 1 220px; border: 1px solid var(--line); border-radius: var(--radius, 14px);
  padding: 1rem 1.25rem; background: var(--surface, transparent); }
.score-card h3 { margin: 0 0 .25rem; font-size: .95rem; color: var(--mut); font-weight: 600; }
.score-value { font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.score-label { font-weight: 700; margin-top: .25rem; }
.score-bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: .6rem; }
.score-bar span { display: block; height: 100%; background: var(--grad); }
.score-high .score-label { color: #ff6b8b; }
.score-mid .score-label { color: #ffc35a; }
.score-low .score-label { color: #4ee0a6; }
.score-change { align-self: center; font-weight: 800; font-size: 1.4rem; }
.flagged-list { margin: .75rem 0 0; padding-left: 1.2rem; }
.flagged-list li { margin: .35rem 0; }
.signal-table { width: 100%; border-collapse: collapse; margin-top: .75rem; font-size: .92rem; }
.signal-table td { padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.muted-note { color: var(--mut); font-size: .9rem; }
.inline-form { display: inline; margin-left: .5rem; }
.btn-small { padding: .25rem .7rem; font-size: .85rem; }
#ai-score-section:not(:has(#ai-score-card:not(.hidden))):not(:has(#ai-score-error:not(.hidden))) { display: none; }

/* A4 click-to-rewrite panel */
.sentence-panel { position: absolute; z-index: 60; width: min(330px, calc(100vw - 16px));
  background: var(--surface, #10131f); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.45)); padding: .75rem; }
.sentence-panel.hidden { display: none; }
.sentence-panel-title { font-weight: 700; margin-bottom: .5rem; }
.sentence-options { display: flex; flex-direction: column; gap: .4rem; max-height: 260px; overflow: auto; }
.sentence-option { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem;
  background: transparent; color: inherit; cursor: pointer; font: inherit; line-height: 1.4; }
.sentence-option:hover, .sentence-option:focus { border-color: var(--cy, #2de0ff); outline: none; }
.sentence-actions { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .6rem; }
.sentence-error { color: #ff6b8b; margin: 0; }
.click-rewrite-toggle { font-size: .85rem; color: var(--mut); display: inline-flex; gap: .35rem; align-items: center; }

/* A5 import / export */
.import-panel { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin-top: .75rem;
  display: flex; flex-direction: column; gap: .45rem; }
.import-panel.hidden { display: none; }
.import-row { display: flex; gap: .5rem; }
.import-row input { flex: 1; min-width: 0; }
.download-format { max-width: 10.5rem; background: var(--input-bg, #0b0e18); color: inherit;
  border: 1px solid var(--line); border-radius: 999px; padding: .45rem .8rem; font: inherit; font-size: .85rem; }

/* A6 spintax extras */
.spintax-title-output { width: 100%; margin-bottom: .5rem; background: var(--input-bg, #0b0e18); color: inherit;
  border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; font-family: var(--font-mono, monospace); font-size: .9rem; }
.spintax-title-output.hidden, #spintax-stats.hidden { display: none; }

/* A7 WordPress extras */
.wp-extras { margin: .5rem 0 1rem; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; }
.wp-extras summary { cursor: pointer; font-weight: 600; }
.wp-extras[open] { display: flex; flex-direction: column; gap: .35rem; }
.wp-extras select[multiple] { min-height: 6rem; }
.schedule-sites { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; margin: .5rem 0; }
.schedule-sites .checkbox-label { display: flex; gap: .5rem; align-items: center; justify-content: flex-start; margin: .25rem 0; }
.schedule-sites .checkbox-label input { width: auto; margin: 0; }

/* A8 background jobs */
.bulk-background { display: flex; gap: .5rem; align-items: center; justify-content: center; margin: .25rem 0 1rem; }
.jobs-table { width: 100%; border-collapse: collapse; }
.jobs-table th, .jobs-table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.job-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.job-status { font-weight: 700; }
.job-done { color: #4ee0a6; } .job-error { color: #ff6b8b; } .job-running, .job-queued { color: #ffc35a; }
@media (max-width: 640px) {
  .jobs-table thead { display: none; }
  .jobs-table tr { display: block; border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .jobs-table td { display: block; border: 0; padding: .2rem 0; }
}

/* A9 presets */
.link-button { background: none; border: 0; padding: 0; color: var(--cy, #2de0ff); cursor: pointer; font: inherit; text-decoration: underline; }
.preset-form { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.voice-guide { border-left: 3px solid var(--cy, #2de0ff); padding-left: .75rem; margin: .5rem 0 .75rem; white-space: pre-line; }
.preset-card details summary { cursor: pointer; font-weight: 600; }

/* A10 public tools and guides */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin-top: 1rem; }
.stat-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; display: flex; flex-direction: column; }
.stat-grid span { font-size: 1.5rem; font-weight: 800; }
.stat-grid small { color: var(--mut); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sx-out li { margin: .4rem 0; }
.cta-card { text-align: center; }
.guide { line-height: 1.7; }
.guide-lead { font-size: 1.1rem; color: var(--mut); }
#free-result.hidden { display: none; }

/* A11 account settings */
.stack-form { display: flex; flex-direction: column; gap: .4rem; max-width: 520px; }
.ok-text { color: #4ee0a6; font-weight: 600; } .warn-text { color: #ffc35a; font-weight: 600; }
.danger-card { border-color: rgba(255, 107, 139, .45); }
.btn.danger { background: #c0392b; color: #fff; border: 0; }
.stack-form input[type=email], .stack-form input[type=password], .stack-form input[type=text],
.import-panel input[type=url], .wp-extras input, .schedule-modal input, #schedule-modal input[type=text],
#schedule-modal input[type=datetime-local] {
  width: 100%; background: var(--input-bg, #0b0e18); color: inherit; border: 1px solid var(--input-border, var(--line));
  border-radius: 10px; padding: .6rem .8rem; font: inherit; }

/* A12 plagiarism */
.plagiarism-sentences { line-height: 1.8; margin: .75rem 0; }
.plag-sentence.found { background: rgba(255, 107, 139, .22); border-bottom: 2px solid #ff6b8b; }
.plag-sources li { margin: .5rem 0; }
.plagiarism-full-toggle { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }

/* A13 ChatPDF conversation */
.chat-log { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; }
.chat-turn { display: flex; flex-direction: column; max-width: 92%; }
.chat-user { align-self: flex-end; }
.chat-assistant { align-self: flex-start; }
.chat-bubble { border-radius: 14px; padding: .65rem .9rem; white-space: pre-wrap; line-height: 1.55; border: 1px solid var(--line); }
.chat-user .chat-bubble { background: rgba(90, 123, 255, .18); }
.chat-cites { margin: .4rem 0 0 1.2rem; font-size: .9rem; color: var(--mut); }
.chat-cites li { margin: .25rem 0; }
.cite-page { font-weight: 700; color: var(--cy, #2de0ff); }

/* A14 grammar check */
.grammar-list { display: flex; flex-direction: column; gap: .5rem; padding-left: 1.2rem; }
.grammar-item { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.grammar-fix del { color: #ff6b8b; } .grammar-fix ins { color: #4ee0a6; text-decoration: none; font-weight: 600; }
.grammar-actions { display: flex; gap: .4rem; margin-top: .35rem; }

/* A18 article writer */
.writer-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin: .5rem 0; }
.writer-meters .stat-tile { display: flex; flex-direction: column; gap: .25rem; padding: .8rem 1rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg, #0b0e18); }
.writer-meters .stat-label { font-size: .85rem; opacity: .75; }
.writer-meters strong { font-size: 1.35rem; }
#writer-form textarea, #writer-form select { width: 100%; background: var(--input-bg, #0b0e18); color: inherit;
  border: 1px solid var(--input-border, var(--line)); border-radius: 10px; padding: .6rem .8rem; font: inherit; }
#writer-form textarea { min-height: 7rem; resize: vertical; }
#writer-form input[type=text], #writer-form textarea { max-width: 720px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; max-width: 720px; margin: .5rem 0; }
.form-row label { display: block; margin-bottom: .25rem; }
#writer-form .check { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; }
#writer-form .panel-actions { justify-content: flex-start; }
#writer-go { padding: .7rem 1.4rem; font-size: 1rem; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.pack-card { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: var(--input-bg, #0b0e18); }
.pack-card h3 { margin: 0 0 .4rem; }
.pack-card p { margin: .2rem 0; }
.pack-card .btn { margin-top: .6rem; width: 100%; }
.writer-article { line-height: 1.7; max-width: 760px; }
@media (max-width: 600px) { .jobs-table td, .jobs-table th { font-size: .9rem; } }

/* QW2 history and saved articles */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.history-filters, .articles-search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.history-filters input[type=search], .articles-search input[type=search] { flex: 1 1 220px; min-width: 0;
  background: var(--input-bg, #0b0e18); color: inherit; border: 1px solid var(--input-border, var(--line));
  border-radius: 10px; padding: .55rem .8rem; font: inherit; }
.history-filters select { background: var(--input-bg, #0b0e18); color: inherit; border: 1px solid var(--input-border, var(--line));
  border-radius: 10px; padding: .55rem .8rem; font: inherit; }
.history-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.history-actions .inline-form { margin-left: 0; }
.article-rename { margin-left: .4rem; }

/* QW3 first-run checklist and password hint */
.form-hint { display: block; font-size: .85rem; opacity: .75; margin-top: .25rem; }
.first-run-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.first-run-head h2 { margin: 0; }
.first-run-steps { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .6rem; }
.first-run-steps li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .75rem; align-items: center;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; }
.first-run-steps li p { margin: .15rem 0 0; }
.first-run-steps li.done { opacity: .65; }
.first-run-mark { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); font-weight: 700; }
.first-run-steps li.done .first-run-mark { background: rgba(78, 224, 166, .2); border-color: rgba(78, 224, 166, .6); }
@media (max-width: 600px) { .first-run-steps li { grid-template-columns: 2rem 1fr; } .first-run-steps li .btn { grid-column: 2; justify-self: start; } }

/* QW4 plans notes, FAQ, contact form */
.plans-notes ul { padding-left: 1.2rem; line-height: 1.65; }
.plans-notes li { margin: .5rem 0; }
.plans-faq details { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.plans-faq summary { cursor: pointer; font-weight: 600; }
.plans-faq details p { margin: .5rem 0 0; }
.contact-form select, .contact-form textarea { width: 100%; background: var(--input-bg, #0b0e18); color: inherit;
  border: 1px solid var(--input-border, var(--line)); border-radius: 10px; padding: .6rem .8rem; font: inherit; }
.contact-form label { display: block; margin-top: .6rem; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* QW8 WordPress site rows: wrap, and stack on phones */
.wp-site-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.wp-site-row .article-info { min-width: 0; flex: 1 1 260px; }
.wp-site-row .article-title-link { overflow-wrap: anywhere; }
.wp-site-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.wp-site-actions form { display: inline; margin: 0; }
@media (max-width: 600px) {
  .wp-site-row { flex-direction: column; align-items: stretch; }
  .wp-site-row .article-info { flex: none; }
  .wp-site-actions { display: grid; grid-template-columns: 1fr; }
  .wp-site-actions .btn { width: 100%; }
}

/* Long code samples wrap instead of widening the page. */
.guide pre {white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}
.guide code {overflow-wrap:anywhere}
.guide .table-scroll {max-width:100%;overflow-x:auto}
