/* Dawn - the plain-English checker tool. Its own scoped stylesheet, loaded
   only on /tools/dawn/ (pw-append in dawn.php), the same way
   ai-search-tool.css is. Everything lives under .dawn-app so nothing here
   touches the pop page chrome (nav, footer, breadcrumb) around it.
   Light only, sentence case only (no text-transform: uppercase, per the
   Design system page). Category colours are the tool's own functional
   highlight palette; --accent is Dawn's warm green. */

.dawn-app {
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --tx: #1b1a16;
  --tx-muted: #6e6a5e;
  --line: #e4e1d6;
  --accent: #4f6b1b;
  --accent-tx: #ffffff;
  --c-structure: #2660a4;
  --c-words: #8a5d00;
  --c-sentences: #6e4c9e;
  --c-verbs: #0f7b6c;
  --c-inclusive: #b23a6a;
  --c-house: #9a5b2a;
  --c-structure-bg: #dceaf9;
  --c-words-bg: #f3e6c9;
  --c-sentences-bg: #e8e0f5;
  --c-verbs-bg: #d5efea;
  --c-inclusive-bg: #f6dde8;
  --c-house-bg: #f3e4d3;
  --shadow: 0 1px 2px rgba(24, 22, 16, .06), 0 8px 24px rgba(24, 22, 16, .06);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bitter", Georgia, "Times New Roman", serif;
  color: var(--tx);
  font-size: 15px;
  line-height: 1.55;
}
.dawn-app *, .dawn-app *::before, .dawn-app *::after { box-sizing: border-box; }

.dawn-app .bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.dawn-app .bar .lbl { font-family: var(--display); font-weight: 600; font-size: 12px; color: var(--tx-muted); letter-spacing: .02em; }
.dawn-app .bar .spacer { flex: 1; }
.dawn-app .mini, .dawn-app select.mini { font: inherit; font-size: 12.5px; color: var(--tx-muted); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.dawn-app .mini:hover { color: var(--tx); border-color: var(--tx-muted); }
.dawn-app .mode-tag { font-size: 11.5px; color: var(--tx-muted); }
.dawn-app .mode-tag b { color: var(--accent); font-weight: 600; }

.dawn-app .grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 940px) { .dawn-app .grid { grid-template-columns: 1fr; } }

.dawn-app .title-input { width: 100%; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--tx); padding: 11px 14px; }
.dawn-app .title-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; position: relative; z-index: 3; }
.dawn-app .title-input::placeholder { color: var(--tx-muted); font-weight: 500; }

.dawn-app .doc-wrap { position: relative; height: min(68vh, 740px); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); overflow: hidden; }
.dawn-app .doc-metrics { font-family: var(--mono); font-size: 13.5px; line-height: 1.7; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; scrollbar-gutter: stable; border: 0; margin: 0; letter-spacing: 0; }
.dawn-app #backdrop { position: absolute; inset: 0; overflow: hidden; color: var(--tx); pointer-events: none; z-index: 0; }
.dawn-app #src { position: absolute; inset: 0; width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden; background: transparent; color: transparent; caret-color: var(--accent); -webkit-text-fill-color: transparent; resize: none; z-index: 1; }
.dawn-app #src:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.dawn-app #src::selection { background: var(--accent); -webkit-text-fill-color: var(--accent-tx); color: var(--accent-tx); }
.dawn-app #src::-moz-selection { background: var(--accent); color: var(--accent-tx); }

.dawn-app #preview { position: absolute; inset: 0; overflow-y: auto; scrollbar-gutter: stable; z-index: 2; background: var(--surface); font-family: var(--sans); font-size: 14.5px; line-height: 1.6; padding: 18px 22px; }
.dawn-app #preview h1 { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 0 0 12px; line-height: 1.25; }
.dawn-app #preview h2 { font-family: var(--display); font-weight: 600; font-size: 16px; margin: 18px 0 7px; }
.dawn-app #preview h3 { font-family: var(--display); font-weight: 600; font-size: 13.5px; margin: 14px 0 5px; color: var(--tx-muted); }
.dawn-app #preview p { margin: 0 0 11px; }
.dawn-app #preview ul { margin: 0 0 11px; padding-left: 20px; list-style: disc; }
.dawn-app #preview li { margin: 0 0 3px; }
.dawn-app #preview .blk-flag { border-left: 3px solid var(--line); padding-left: 11px; margin-left: -14px; }
.dawn-app #preview .blk-flag[data-cat="structure"] { border-left-color: var(--c-structure); }
.dawn-app #preview .blk-flag[data-cat="sentences"] { border-left-color: var(--c-sentences); }

.dawn-app mark { border-radius: 2px; padding: .06em 0; color: inherit; text-decoration: underline; text-decoration-style: wavy; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.dawn-app mark[data-cat="structure"] { background: var(--c-structure-bg); text-decoration-color: var(--c-structure); }
.dawn-app mark[data-cat="words"] { background: var(--c-words-bg); text-decoration-color: var(--c-words); }
.dawn-app mark[data-cat="sentences"] { background: var(--c-sentences-bg); text-decoration-color: var(--c-sentences); }
.dawn-app mark[data-cat="verbs"] { background: var(--c-verbs-bg); text-decoration-color: var(--c-verbs); }
.dawn-app mark[data-cat="inclusive"] { background: var(--c-inclusive-bg); text-decoration-color: var(--c-inclusive); }
.dawn-app mark[data-cat="house"] { background: var(--c-house-bg); text-decoration-color: var(--c-house); }
.dawn-app #preview mark { cursor: pointer; }
/* "You are here" - stays on until something else is picked, rather than a
   pulse that fades before you have looked back at the document. Bright and
   deliberately not one of the category colours, so it reads as "selected",
   not as another kind of flag. Overrides the category background/underline
   it sits on top of. */
.dawn-app mark.active { background: #ffe066 !important; color: #1b1a16; text-decoration: none; box-shadow: 0 0 0 2px #f2b800; border-radius: 3px; }
.dawn-app .finding.active { border-color: #f2b800; border-width: 2px; background: #fffaeb; }

.dawn-app .doc-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--tx-muted); }
.dawn-app .doc-foot button { font: inherit; font-size: 12px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.dawn-app details.gloss { margin-top: 12px; }
.dawn-app details.gloss > summary { cursor: pointer; font-size: 12.5px; color: var(--tx-muted); list-style: none; padding: 4px 0; }
.dawn-app details.gloss > summary::-webkit-details-marker { display: none; }
.dawn-app details.gloss > summary::before { content: "\25B8  "; }
.dawn-app details.gloss[open] > summary::before { content: "\25BE  "; }
.dawn-app .gloss textarea { width: 100%; min-height: 60px; resize: vertical; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--tx); font-family: var(--mono); font-size: 12px; padding: 7px 9px; }
.dawn-app .gloss .hint { font-size: 11.5px; color: var(--tx-muted); margin-top: 5px; }

.dawn-app .panel { position: sticky; top: 14px; }
@media (max-width: 940px) { .dawn-app .panel { position: static; } }
.dawn-app .tabbar { display: flex; gap: 4px; }
.dawn-app .tabbar button { font-family: var(--display); font-weight: 600; font-size: 13px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--tx-muted); border-radius: 9px 9px 0 0; cursor: pointer; }
.dawn-app .tabbar button[aria-selected="true"] { background: var(--surface); color: var(--tx); border-bottom-color: var(--surface); }
.dawn-app .tabbar .n { font-variant-numeric: tabular-nums; opacity: .8; }
.dawn-app .panel-body { border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 14px; max-height: calc(100vh - 90px); overflow-y: auto; }
@media (max-width: 940px) { .dawn-app .panel-body { max-height: none; } }

.dawn-app .count-line { font-family: var(--display); font-weight: 700; font-size: 15px; margin-bottom: 9px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.dawn-app .step-tag { color: var(--accent); }
.dawn-app .step-sep { color: var(--tx-muted); font-weight: 400; margin: 0 1px; }
.dawn-app .muted-note { font-size: 11.5px; color: var(--tx-muted); font-style: italic; padding: 1px 2px 8px; }
.dawn-app .stage-locked { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px dashed var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--tx-muted); }
.dawn-app .no-score { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: .03em; color: var(--tx-muted); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 9px; }
.dawn-app .why-score { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; padding: 0; }
.dawn-app .why-box { font-size: 12px; color: var(--tx-muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.dawn-app .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.dawn-app .chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--tx-muted); cursor: pointer; }
.dawn-app .chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dawn-app .chip[data-cat="structure"] { color: var(--c-structure); }
.dawn-app .chip[data-cat="words"] { color: var(--c-words); }
.dawn-app .chip[data-cat="sentences"] { color: var(--c-sentences); }
.dawn-app .chip[data-cat="verbs"] { color: var(--c-verbs); }
.dawn-app .chip[data-cat="inclusive"] { color: var(--c-inclusive); }
.dawn-app .chip[data-cat="house"] { color: var(--c-house); }
.dawn-app .chip.off { opacity: .38; }
.dawn-app .chip .n { color: var(--tx); font-variant-numeric: tabular-nums; }

.dawn-app .fgroup { margin-bottom: 15px; }
.dawn-app .fgroup > h3 { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .01em; margin: 0 0 7px; display: flex; align-items: center; gap: 8px; }
.dawn-app .fgroup[data-cat="structure"] > h3 { color: var(--c-structure); }
.dawn-app .fgroup[data-cat="words"] > h3 { color: var(--c-words); }
.dawn-app .fgroup[data-cat="sentences"] > h3 { color: var(--c-sentences); }
.dawn-app .fgroup[data-cat="verbs"] > h3 { color: var(--c-verbs); }
.dawn-app .fgroup[data-cat="inclusive"] > h3 { color: var(--c-inclusive); }
.dawn-app .fgroup[data-cat="house"] > h3 { color: var(--c-house); }
.dawn-app .fgroup > h3 .bar2 { flex: 1; height: 1px; background: var(--line); }
.dawn-app .finding { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-bottom: 7px; cursor: pointer; }
.dawn-app .finding:hover { border-color: var(--tx-muted); background: var(--surface-2); }
.dawn-app .finding .ftitle { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.dawn-app .finding .fmsg { font-size: 12.5px; color: var(--tx-muted); }
.dawn-app .finding .fsuggest { font-size: 12px; margin-top: 5px; }
.dawn-app .finding .fsuggest b { color: var(--accent); }
.dawn-app .allclear { text-align: center; padding: 30px 16px; color: var(--tx-muted); }
.dawn-app .allclear .big { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--tx); margin-bottom: 4px; }

.dawn-app .guide-verdict { border: 1px solid var(--line); border-radius: 9px; padding: 12px 13px; margin-bottom: 13px; font-size: 13px; line-height: 1.55; background: var(--surface-2); }
.dawn-app .guide-verdict b { color: var(--accent); }
.dawn-app .guide-verdict .kind { font-family: var(--display); font-weight: 700; font-size: 14px; display: block; margin-bottom: 4px; }
.dawn-app h4.gp-h { font-family: var(--display); font-size: 11px; letter-spacing: .02em; color: var(--tx-muted); margin: 15px 0 7px; font-weight: 700; }
.dawn-app .gp-list { list-style: none; counter-reset: gp; padding: 0; margin: 0; }
.dawn-app .gp-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 7px; }
.dawn-app .gp-item::before { counter-increment: gp; content: counter(gp); flex: none; width: 21px; height: 21px; border-radius: 50%; background: var(--accent); color: var(--accent-tx); font-weight: 700; font-size: 11px; display: grid; place-items: center; margin-top: 1px; }
.dawn-app .gp-item.leftover::before { content: "\2013"; background: var(--surface-2); color: var(--tx-muted); }
.dawn-app .gp-body { min-width: 0; }
.dawn-app .gp-label { font-weight: 700; font-size: 13px; }
.dawn-app .gp-from { font-size: 11.5px; color: var(--tx-muted); }
.dawn-app .gp-flag { font-size: 12px; margin-top: 3px; color: var(--c-words); }
.dawn-app .gp-side { margin-left: auto; font-size: 11.5px; color: var(--tx-muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 6px; }
.dawn-app .guide-note { font-size: 12px; color: var(--tx-muted); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
