/* LogUnfold: shared tokens for the reader, local assets and both themes. */
:root {
  color-scheme:light;
  --bg:#F8FAFC; --surface:#FFFFFF; --surface-raised:#F1F5F9; --hover:#E8EEF5;
  --border:#CBD5E1; --control-border:#64748B; --line:#E2E8F0; --text:#0F172A; --muted:#475569;
  --accent:#047857; --accent-hover:#065F46; --accent-soft:#ECFDF5; --on-accent:#FFFFFF;
  --error:#B91C1C; --warn:#92400E; --info:#1D4ED8; --debug:#6D28D9; --trace:#475569;
  --notice:#0369A1; --critical:#9F1239; --alert:#9F1239; --unknown:#475569;
  --mark-bg:#FDE68A; --mark-text:#422006; --parameter-bg:#EDE9FE; --parameter-text:#5B21B6;
  --focus:#047857; --chevron:url('/src/chevron.svg');
  --font:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --mono:ui-monospace,SFMono-Regular,Consolas,'Liberation Mono',monospace;
  --radius:8px; --radius-sm:5px; --space:8px; --reader-font:12px;
}
:root[data-theme=dark] {
  color-scheme:dark;
  --bg:#0F172A; --surface:#1E293B; --surface-raised:#243247; --hover:#2A3A51;
  --border:#334155; --line:#334155; --text:#F1F5F9; --muted:#94A3B8;
  --accent:#10B981; --accent-hover:#34D399; --accent-soft:#163C36; --on-accent:#052E26;
  --error:#F87171; --warn:#FBBF24; --info:#60A5FA; --debug:#C4B5FD; --trace:#CBD5E1;
  --notice:#7DD3FC; --critical:#FDA4AF; --alert:#FDA4AF; --unknown:#94A3B8;
  --mark-bg:#FDE68A; --mark-text:#422006; --parameter-bg:#35334F; --parameter-text:#DDD6FE;
  --focus:#34D399; --chevron:url('/src/chevron-dark.svg');
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
html { scroll-padding-top:16px; }
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.5 var(--font); }
button,input,select,textarea { font:inherit; color:inherit; }
button,select,input[type=number] { min-height:34px; border:1px solid var(--control-border); border-radius:var(--radius-sm); background:var(--surface); }
button { padding:6px 12px; cursor:pointer; font-weight:500; line-height:1.4; }
button:hover:not(:disabled) { background:var(--hover); }
button:disabled { opacity:.55; cursor:default; }
button.primary { background:var(--accent); border-color:var(--accent); color:var(--on-accent); font-weight:650; }
button.primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
select { appearance:none; max-width:100%; padding:6px 30px 6px 10px; background-image:var(--chevron); background-repeat:no-repeat; background-position:right 10px center; }
input[type=number] { width:64px; padding:5px 6px; }
input[type=checkbox] { accent-color:var(--accent); width:16px; height:16px; }
a { color:var(--muted); text-underline-offset:4px; }
a:hover { color:var(--text); }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
h1,h2,h3,p,pre { margin:0; }
summary { cursor:pointer; }
summary::marker { color:var(--muted); }
pre { font:var(--reader-font)/1.65 var(--mono); white-space:pre-wrap; overflow-wrap:anywhere; tab-size:4; unicode-bidi:plaintext; }
mark { background:var(--mark-bg); color:var(--mark-text); border-radius:2px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip { position:absolute; top:-80px; left:16px; z-index:3; padding:10px 16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.skip:focus { top:8px; }
.site-header { max-width:1440px; margin:auto; padding:0 32px; min-height:68px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.brand-group,.header-tools,.help-links { display:flex; align-items:center; gap:20px; min-width:0; }
.brand { display:inline-flex; align-items:center; gap:0; text-decoration:none; color:var(--text); font-size:21px; font-weight:500; letter-spacing:-.7px; white-space:nowrap; }
.brand img { margin-right:9px; }
.brand>span { font-weight:750; }
.header-slogan { font-size:12px; color:var(--muted); }
.header-tools { gap:16px; font-size:12px; }
.header-tools select { min-height:30px; font-size:12px; background-color:transparent; }
.help-links a,.language-nav a { text-decoration:none; white-space:nowrap; }
main { max-width:1440px; margin:auto; padding:24px 32px 0; min-width:0; }
.intro { text-align:center; padding:38px 0 26px; }
.eyebrow { color:var(--accent); font-size:12px; font-weight:650; letter-spacing:.6px; }
h1 { font-size:clamp(32px,4.2vw,52px); line-height:1.18; font-weight:700; letter-spacing:-1.8px; margin:12px 0 6px; }
.tagline { font-size:24px; color:var(--muted); letter-spacing:-.6px; }
.import-panel { max-width:820px; margin:auto; border:1px dashed var(--border); border-radius:12px; background:var(--surface); padding:28px; text-align:center; }
.import-heading { display:flex; flex-direction:column; align-items:center; gap:12px; }
.file-symbol { display:grid; place-items:center; width:42px; height:42px; border:1px solid var(--border); border-radius:10px; color:var(--muted); font:26px/1 var(--mono); }
.import-heading h2 { font-size:18px; font-weight:600; letter-spacing:-.3px; }
.import-heading p { margin-top:4px; color:var(--muted); font-size:12px; }
.import-actions,.paste-actions,.source-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; }
.import-actions { margin-top:20px; }
.import-note { margin-top:16px; font-size:11px; color:var(--muted); }
.import-panel.dragging { border-color:var(--accent); outline:2px solid var(--accent); outline-offset:3px; background:var(--accent-soft); }
#paste-panel { margin-top:20px; text-align:left; border-top:1px solid var(--line); padding-top:16px; width:100%; }
#paste-panel label { display:block; margin-bottom:8px; font-weight:600; }
textarea { display:block; width:100%; min-height:120px; resize:vertical; background:var(--bg); border:1px solid var(--control-border); border-radius:var(--radius-sm); padding:12px; font:12px/1.6 var(--mono); }
.paste-actions { justify-content:flex-start; margin-top:10px; }
.status-bar { display:flex; justify-content:center; align-items:center; gap:12px; min-height:42px; padding:8px 0; color:var(--muted); font-size:12px; }
.status-bar button { min-height:28px; padding:4px 10px; }
.error { color:var(--error); }
progress { display:block; width:100%; height:4px; accent-color:var(--accent); margin:0 0 10px; border:0; border-radius:2px; }
progress::-webkit-progress-bar { background:var(--line); }
progress::-webkit-progress-value { background:var(--accent); }
progress::-moz-progress-bar { background:var(--accent); }
body[data-loaded=true] main { padding-top:8px; }
body[data-loaded=true] .intro { display:none; }
body[data-loaded=true] .import-panel { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:2px 20px; max-width:none; padding:12px 16px; text-align:left; border-style:solid; }
body[data-loaded=true] .import-heading { flex-direction:row; gap:12px; grid-row:1/3; }
body[data-loaded=true] .file-symbol { width:32px; height:32px; font-size:22px; border:0; }
body[data-loaded=true] .import-heading h2 { font-size:14px; }
body[data-loaded=true] .import-heading p { font-size:11px; }
body[data-loaded=true] .import-actions { margin:0; justify-content:flex-end; }
body[data-loaded=true] .import-note { margin:4px 0 0; text-align:right; }
body[data-loaded=true] #paste-panel { grid-column:1/-1; }
body[data-loaded=true] .status-bar { justify-content:flex-start; min-height:34px; }
.source-bar { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin:0 0 16px; }
.source-info { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px 12px; min-width:0; }
#source-name { font-size:14px; font-weight:650; overflow-wrap:anywhere; }
#summary,#source-details { color:var(--muted); font-size:11px; }
#source-details summary { white-space:nowrap; }
#source-technical { padding-top:4px; max-width:720px; overflow-wrap:anywhere; }
.source-actions { justify-content:flex-end; flex-shrink:0; }
.source-actions button { font-size:12px; min-height:30px; }
.toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.tabs { display:flex; padding:3px; gap:3px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.tabs button { background:transparent; border:0; color:var(--muted); min-height:32px; padding:6px 16px; }
.tabs button[aria-selected=true] { color:var(--text); background:var(--hover); box-shadow:inset 0 -2px var(--accent); }
.search-box { display:flex; align-items:center; gap:8px; min-width:180px; flex:1; border:1px solid var(--control-border); border-radius:var(--radius-sm); background:var(--surface); padding:0 10px; color:var(--muted); }
.search-box>span[aria-hidden] { font-size:22px; line-height:1; }
.search-box:focus-within { outline:2px solid var(--focus); outline-offset:2px; }
#search { border:0; min-height:38px; width:100%; min-width:0; background:transparent; padding:6px 0; outline:0; }
#search::placeholder { color:var(--muted); opacity:1; }
.level-label { max-width:100%; }
.level-label select { min-height:40px; }
.metrics-bar { margin:16px 0 10px; }
.metrics { display:flex; gap:24px; align-items:center; flex-wrap:wrap; }
.metric-scope { display:flex; flex-direction:column; gap:2px; font-size:11px; color:var(--muted); padding-right:16px; border-right:1px solid var(--border); }
.metric-scope>span:first-child { color:var(--text); font-weight:600; }
.metric { display:grid; grid-template-columns:auto auto; align-items:baseline; gap:0 6px; font-size:12px; color:var(--muted); }
.metric strong { font-size:20px; line-height:1.3; font-weight:650; color:var(--text); letter-spacing:-.5px; font-variant-numeric:tabular-nums; }
.metric small { grid-column:1/-1; font-size:10px; }
#filtered-summary:not(:empty) { margin-top:10px; padding:6px 10px; border-left:2px solid var(--info); background:var(--surface); color:var(--text); font-size:12px; }
.severity-summary { margin:8px 0 12px; }
#severity-caption { font-size:10px; color:var(--muted); margin-bottom:6px; }
.severity-counts { display:flex; flex-wrap:wrap; gap:6px; }
.severity-counts button { display:inline-flex; align-items:baseline; gap:8px; padding:4px 8px; min-height:28px; font-size:11px; color:var(--muted); background:transparent; }
.severity-counts button .count { color:var(--text); font-weight:650; font-variant-numeric:tabular-nums; }
.severity-counts button[aria-pressed=true] { border-color:var(--muted); background:var(--surface-raised); }
.pattern-controls { display:flex; align-items:center; flex-wrap:wrap; gap:20px; margin:12px 0; font-size:12px; color:var(--muted); }
.pattern-controls label { display:flex; align-items:center; gap:8px; }
.pattern-controls select { min-height:30px; font-size:12px; }
.check-label { cursor:pointer; }
.pattern-notice { font-size:11px; color:var(--muted); padding:0 0 6px; }
.view-tools { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:6px 0; font-size:11px; color:var(--muted); }
.view-tools>div { display:flex; flex-shrink:0; gap:4px; }
button.text-button { min-height:28px; padding:4px 6px; color:var(--muted); background:transparent; border-color:transparent; font-size:11px; }
button.text-button:hover { color:var(--text); background:var(--hover); }
#log-panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); min-width:0; }
.column-head { display:none; }
body[data-mode=original] .column-head { display:grid; grid-template-columns:76px minmax(0,1fr); gap:12px; border-bottom:1px solid var(--border); padding:8px 12px; font-size:10px; color:var(--muted); }
.row { border-bottom:1px solid var(--line); min-width:0; }
.row:last-child { border-bottom:0; }
.row.original { display:grid; grid-template-columns:76px minmax(0,1fr); gap:12px; padding:5px 12px; }
.row.original .message { min-width:0; }
.row.original .message-text { margin:0; min-height:20px; }
.number { color:var(--muted); font:10px/1.8 var(--mono); font-variant-numeric:tabular-nums; }
.line-ending { display:block; font-size:9px; opacity:.8; }
.entry-details { min-width:0; }
.entry-summary { display:flex; align-items:baseline; gap:10px; list-style:none; padding:7px 12px; min-height:36px; min-width:0; font:var(--reader-font)/1.6 var(--mono); }
.entry-summary::-webkit-details-marker { display:none; }
.entry-summary:before { content:'›'; color:var(--muted); font:17px/1 var(--font); display:inline-block; width:8px; flex:0 0 8px; text-align:center; }
.entry-details[open]>.entry-summary:before { transform:rotate(90deg); }
.entry-summary:hover { background:var(--hover); }
.entry-summary>.number { min-width:32px; flex-shrink:0; }
.entry-time { flex:0 1 auto; min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; font-size:10px; color:var(--muted); }
.pattern-meta { display:inline-flex; align-items:baseline; gap:8px; flex-shrink:0; }
.pattern-meta strong { color:var(--text); min-width:24px; font-size:11px; }
.severity { font:600 10px/1.5 var(--mono); display:inline-block; min-width:42px; color:var(--unknown); }
.severity[data-level=error],.severity[data-level=fatal],.severity-counts [data-level=error]>span:first-child,.severity-counts [data-level=fatal]>span:first-child { color:var(--error); }
.severity[data-level=warn],.severity-counts [data-level=warn]>span:first-child { color:var(--warn); }
.severity[data-level=info],.severity-counts [data-level=info]>span:first-child { color:var(--info); }
.severity[data-level=debug],.severity-counts [data-level=debug]>span:first-child { color:var(--debug); }
.severity[data-level=trace],.severity-counts [data-level=trace]>span:first-child { color:var(--trace); }
.severity[data-level=notice],.severity-counts [data-level=notice]>span:first-child { color:var(--notice); }
.severity[data-level=critical],.severity[data-level=emergency],.severity-counts [data-level=critical]>span:first-child,.severity-counts [data-level=emergency]>span:first-child { color:var(--critical); }
.severity[data-level=alert],.severity-counts [data-level=alert]>span:first-child { color:var(--alert); }
.entry-component { flex:0 1 auto; min-width:0; max-width:20%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--muted); font-size:10px; }
.entry-summary .message-text { flex:1 1 180px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; unicode-bidi:plaintext; }
.entry-details[open]>.entry-summary .message-text { white-space:pre-wrap; overflow-wrap:anywhere; }
.pattern-kind { flex-shrink:0; color:var(--muted); font:10px/1.5 var(--font); border:1px solid var(--border); border-radius:var(--radius-sm); padding:1px 5px; }
.template-parameter { background:var(--parameter-bg); color:var(--parameter-text); border-radius:3px; }
.entry-info { display:flex; flex-direction:column; gap:8px; margin:0 12px 10px 30px; padding-top:10px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; }
.pattern-label { font-size:11px; color:var(--muted); }
.pattern-metadata,.occurrence-meta { display:flex; flex-wrap:wrap; gap:4px 16px; font-size:11px; color:var(--muted); min-width:0; }
.pattern-metadata>span,.occurrence-meta>span { max-width:100%; overflow-wrap:anywhere; }
.recognition-status { flex-basis:100%; }
.recognized-field { font:10px/1.6 var(--mono); }
.copy-actions { display:flex; align-items:center; flex-wrap:wrap; gap:4px; }
.copy-feedback { font-size:11px; color:var(--muted); overflow-wrap:anywhere; }
.entry-info>.copy-actions { margin-left:-6px; }
.raw-content { padding:0 12px 12px 30px; }
.raw { max-height:340px; overflow:auto; padding:10px 12px; border-radius:var(--radius-sm); background:var(--bg); border:1px solid var(--line); color:var(--text); }
.chunk-controls,.occurrence-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; color:var(--muted); font-size:11px; }
.chunk-controls button,.occurrence-controls button { font-size:11px; min-height:28px; }
.chunk-controls>span,.occurrence-controls>span { margin-right:auto; }
.source-expansion:not(.entry-details) { margin-top:8px; font-size:11px; }
.source-expansion:not(.entry-details)>.raw-content { padding:8px 0; }
.source-expansion:not(.entry-details)>summary { color:var(--muted); }
.occurrence-note { font-size:11px; color:var(--muted); margin-bottom:8px; }
.pattern-expansion>div:not(.entry-info) { padding:0 12px 12px 30px; }
.occurrence { padding:10px 0; border-top:1px solid var(--line); }
.occurrence>.raw { margin:6px 0 2px; }
.occurrence-meta .recognition-status { font-size:10px; }
.occurrence .copy-actions { margin-left:-6px; }
.search-hit { padding:8px 12px 8px 30px; border-top:1px solid var(--line); }
.match-snippet { margin-top:4px; max-height:100px; overflow:auto; }
.empty { padding:36px 16px; text-align:center; color:var(--muted); }
.empty strong { color:var(--text); }
.empty p { margin-top:4px; }
.pagination { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; font-size:11px; color:var(--muted); margin:12px 0 24px; }
.pagination>div { display:flex; align-items:center; gap:8px; }
.pagination button { min-height:30px; font-size:12px; }
.pagination input { min-height:30px; }
.help-section { display:grid; grid-template-columns:1fr 1fr; gap:12px; max-width:820px; margin:18px auto 26px; font-size:12px; }
.help-section>details { min-width:0; padding:12px 16px; border-top:1px solid var(--line); color:var(--muted); }
.help-section>details>summary { color:var(--text); font-weight:500; }
.help-section p { margin-top:8px; }
.help-section h2,.help-section h3 { color:var(--text); font-size:13px; font-weight:600; margin-top:16px; }
.guide-content article { margin-top:12px; }
.format-guide { margin-top:16px; }
.format-guide pre { margin-top:12px; background:var(--surface); border-radius:var(--radius-sm); padding:10px; }
body[data-loaded=true] .help-section { max-width:none; margin-top:18px; }
footer { max-width:1440px; margin:auto; display:flex; gap:16px; padding:18px 32px 24px; font-size:11px; color:var(--muted); }
footer>a { margin-left:auto; }
.footer-brand { color:var(--text); font-weight:600; }
/* Inert, empty, hidden hooks. No runtime enables these. Simulation is QA only. */
.ad-slot:not([hidden]) { display:grid; place-items:center; min-height:90px; max-width:970px; margin:12px auto; padding:12px; border:1px solid var(--border); border-radius:var(--radius); color:var(--muted); font-size:11px; }
body[data-loaded=true] .ad-slot { display:none!important; }
@media(max-width:1100px) {
  .header-slogan { display:none; }
  .metrics { gap:16px; }
  .entry-component { max-width:15%; }
}
@media(max-width:900px) {
  .ad-slot { display:none!important; }
  .site-header { padding:0 20px; gap:12px; }
  main { padding:16px 20px 0; }
  .header-tools { gap:12px; }
  .help-links { gap:12px; }
  .entry-summary { flex-wrap:wrap; gap:4px 8px; }
  .entry-summary .message-text { flex-basis:100%; padding-left:16px; }
  .entry-summary .entry-component { max-width:40%; }
  .view-tools { align-items:flex-start; }
}
@media(max-width:640px) {
  .site-header { min-height:60px; padding:12px 16px; flex-wrap:wrap; gap:10px; }
  .brand { font-size:20px; }
  .brand img { width:26px; height:26px; }
  .header-tools { margin-left:auto; gap:10px; }
  .help-links { display:none; }
  .header-tools select { max-width:125px; }
  main { padding:8px 12px 0; }
  .intro { padding:28px 0 22px; }
  h1 { letter-spacing:-1px; }
  .tagline { font-size:21px; }
  .import-panel { padding:24px 12px; }
  .import-actions { gap:6px; }
  .import-actions button { padding:7px 10px; font-size:12px; min-height:36px; }
  .import-note { font-size:10px; }
  body[data-loaded=true] .import-panel { padding:10px 12px; display:block; }
  body[data-loaded=true] .import-heading { display:none; }
  body[data-loaded=true] .import-actions { justify-content:flex-start; }
  body[data-loaded=true] .import-note { text-align:left; margin-top:6px; }
  .status-bar { font-size:11px; }
  .source-bar { flex-direction:column; gap:10px; margin-bottom:14px; }
  .source-actions { justify-content:flex-start; }
  .toolbar { gap:8px; }
  .tabs { width:100%; }
  .tabs button { flex:1; padding:6px 8px; font-size:12px; }
  .search-box { min-width:120px; }
  .level-label { max-width:48%; }
  .level-label select { width:100%; font-size:11px; }
  .metrics { gap:12px 18px; align-items:flex-start; }
  .metric-scope { flex-basis:100%; flex-direction:row; border:0; padding:0; gap:10px; }
  .metric { display:flex; flex-direction:column; gap:1px; font-size:10px; }
  .metric strong { font-size:19px; }
  .metric small { max-width:120px; font-size:9px; }
  .severity-counts { gap:5px; }
  .severity-counts button { min-height:30px; }
  .view-tools { flex-direction:column; gap:4px; }
  .view-tools>div { align-self:flex-end; }
  .entry-summary { padding:8px; }
  .entry-summary .entry-time { flex-basis:calc(100% - 62px); }
  .entry-summary .pattern-meta { padding-left:16px; }
  .row.pattern .pattern-meta { padding-left:0; }
  .row.pattern .entry-summary .message-text { order:2; }
  .row.pattern .pattern-kind { margin-left:auto; }
  .entry-info { margin-left:24px; margin-right:8px; }
  .raw-content,.pattern-expansion>div:not(.entry-info) { padding-left:24px; padding-right:8px; }
  .row.original { grid-template-columns:42px minmax(0,1fr); padding:5px 8px; gap:8px; }
  body[data-mode=original] .column-head { grid-template-columns:42px minmax(0,1fr); padding:8px; gap:8px; }
  .pagination { gap:8px; }
  .pagination>div { gap:6px; flex-wrap:wrap; }
  .pagination button { min-height:34px; }
  .help-section { grid-template-columns:1fr; gap:0; margin:14px auto 18px; }
  footer { padding:14px 16px 22px; gap:10px; flex-wrap:wrap; font-size:10px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation:none!important; transition:none!important; } }
@media(forced-colors:active) {
  .tabs button[aria-selected=true],.severity-counts button[aria-pressed=true] { outline:2px solid Highlight; }
  mark { outline:1px solid Highlight; }
}
