/* Files (lib/ui/files.js): folders, a folder's pages, a page. Scoped under .la; reads the Soft Focus
   tokens from app.css. The markdown styles (.md*) are at the bottom. */

.la .fl-head { display: flex; flex-direction: column; gap: .35rem; max-width: 60rem; }
.la .fl-h { margin: 0; font: var(--display-w) clamp(1.6rem, 1.2rem + 1.2vw, 2.3rem)/1.08 var(--f-display); letter-spacing: var(--display-track); color: var(--display-ink); overflow-wrap: anywhere; }
.la .fl-sub { margin: 0; font: var(--title-w) var(--title-size)/1.2 var(--f-title); }
.la .fl-empty { color: var(--ink-2); font-style: italic; margin: 0; }
.la .fl-right { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; }
.la .crumbs .fl-right .danger-q { margin-left: 0; }
.la .fl-trail { display: inline-flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.la .fl-crumb { border: 0; background: none; padding: .2rem .1rem; color: var(--ink-2); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.la .fl-crumb:hover { color: var(--ink); }
.la .fl-sep { color: var(--ink-2); opacity: .6; }

/* folder and page lists: plain rows, like a file browser */
.la .fl-list { display: flex; flex-direction: column; padding: .3rem; border-radius: calc(var(--radius) * .75); max-width: 60rem; }
.la .fl-row { display: flex; align-items: center; gap: .8rem; padding: .75rem .8rem; border-radius: 12px; cursor: pointer; min-width: 0; }
.la .fl-row + .fl-row { border-top: 1px solid var(--line); }
.la .fl-row:hover, .la .fl-row:focus-visible { background: var(--surface-2); }
.la .fl-ic { flex: none; font-size: 1.35rem; line-height: 1; }
.la .fl-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1 1 auto; }
.la .fl-t { font-weight: 650; font-size: 1.02rem; overflow-wrap: anywhere; }
.la .fl-folder .fl-t { font-size: 1.15rem; }
.la .fl-p { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la .fl-folder .fl-p { white-space: normal; }
.la .fl-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.la .fl-counts { display: flex; gap: .5rem; font-size: .8rem; }
.la .fl-count[data-st="found"] { color: var(--good); }
.la .fl-count[data-st="draft"] { color: var(--warn); }
.la .fl-count[data-st="questions"] { color: var(--bad); }
.la .fl-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
.la .fl-tag { font: 600 .72rem/1 var(--f-mono); padding: .2rem .35rem; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); }
.la .fl-badge { font: 700 .7rem/1 var(--f-util); letter-spacing: .06em; padding: .28rem .5rem; border-radius: 6px; color: var(--tone-ink); background: var(--warn); }
.la .fl-badge[data-st="found"] { background: var(--good); }
.la .fl-badge[data-st="questions"] { background: var(--bad); }

/* a page */
.la .fl-doc { max-width: 52rem; border-radius: var(--radius); display: flex; flex-direction: column; gap: .8rem; padding: clamp(1rem, 2.5vw, 2.2rem); }
.la .fl-dochead { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.la .fl-meta { overflow-wrap: anywhere; }
.la .fl-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.la .fl-out { text-decoration: none; display: inline-flex; align-items: center; }
.la .fl-toc { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .6rem 0; border-block: 1px solid var(--line); }
.la .fl-toc .lab { margin-right: .3rem; }
.la .fl-toc-i { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: .35rem .7rem; font: 600 .84rem/1.2 var(--f-util); color: var(--ink); cursor: pointer; text-align: left; }
.la .fl-toc-i:hover { border-color: var(--ink); }
.la .fl-sec { scroll-margin-top: calc(var(--top-h) + .8rem); }
.la .fl-sec-s { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .5rem 0 .3rem; }
.la .fl-sec-s::-webkit-details-marker { display: none; }
.la .fl-sec-s::after { content: "\25BE"; color: var(--ink-2); font-size: .85rem; transition: transform .12s ease; }
.la .fl-sec:not([open]) > .fl-sec-s::after { transform: rotate(-90deg); }
.la .fl-sec-h { margin: 0; font: var(--title-w) 1.25rem/1.25 var(--f-title); }
.la .fl-sec-b { padding-bottom: .6rem; }
.la .fl-notes { max-width: 52rem; border-radius: calc(var(--radius) * .75); }

/* markdown (lib/md.js) */
.la .md { display: flex; flex-direction: column; gap: .7rem; line-height: 1.6; overflow-wrap: anywhere; min-width: 0; font-size: 1.02rem; }
.la .md-h { margin: .5rem 0 0; font-family: var(--f-title); line-height: 1.25; }
.la h2.md-h { font-size: 1.25rem; }
.la h3.md-h { font-size: 1.1rem; }
.la h4.md-h, .la h5.md-h, .la h6.md-h { font-size: 1rem; }
.la .md-p { margin: 0; }
.la .md-list { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .3rem; }
.la .md-list .md-list { margin-top: .25rem; }
.la .md-task { list-style: none; margin-left: -1.2rem; }
.la .md-task[data-done] { color: var(--ink-2); }
.la .md-quote { margin: 0; padding: .45rem .9rem; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 10px 10px 0; display: flex; flex-direction: column; gap: .45rem; }
.la .md code { font: .88em/1.4 var(--f-mono); background: var(--surface-2); padding: .08em .3em; border-radius: 5px; overflow-wrap: anywhere; }
.la .md-pre { margin: 0; padding: .7rem .9rem; background: var(--surface-2); border-radius: 10px; overflow-x: auto; }
.la .md-pre code { background: none; padding: 0; white-space: pre; overflow-wrap: normal; }
.la .md-hr { border: 0; border-top: 1px solid var(--line); margin: .3rem 0; width: 100%; }
.la .md a { color: var(--accent); text-underline-offset: 2px; }
.la .md-tablewrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.la .md-table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.la .md-table th, .la .md-table td { text-align: left; vertical-align: top; padding: .45rem .6rem; border-bottom: 1px solid var(--line); min-width: 7rem; overflow-wrap: break-word; }
.la .md-table th { background: var(--surface-2); font-weight: 650; }
.la .md-table tr:last-child td { border-bottom: 0; }

@media (max-width: 720px) {
  .la .fl-row { align-items: flex-start; flex-wrap: wrap; }
  .la .fl-side { flex-direction: row; align-items: center; width: 100%; padding-left: 2.15rem; justify-content: flex-start; }
  .la .fl-tags { justify-content: flex-start; }
  .la .fl-doc { padding: 1rem .9rem; border-radius: calc(var(--radius) * .7); }
  .la .md-table th, .la .md-table td { min-width: 9rem; }
}
