/* The page around the Tree Canvas: nothing but the canvas and a status line. The canvas draws its own title bar and buttons. */
html, body { height: 100%; margin: 0; background: #efe6d2; color: #2b2118; font: 15px/1.4 system-ui, sans-serif; }
#cv[hidden] { display: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #efe6d2; }
#msg { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 10; margin: 0; max-width: calc(100vw - 32px);
  padding: 8px 16px; border-radius: 999px; background: #2b2118; color: #fff7e8; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
#msg[hidden] { display: none; }
#msg.err { background: #a8361f; }
.nojs { position: fixed; inset: auto 16px 16px 16px; margin: 0; padding: 12px 16px; background: #fff7e8; border-radius: 10px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]), :root:not([data-theme="light"]) body, :root:not([data-theme="light"]) #cv { background: #1d1a16; color: #f3e9d6; }
  :root:not([data-theme="light"]) .nojs { background: #2b2620; }
}
:root[data-theme="dark"], :root[data-theme="dark"] body, :root[data-theme="dark"] #cv { background: #1d1a16; color: #f3e9d6; }
:root[data-theme="dark"] .nojs { background: #2b2620; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* The page the canvas opens on, before any tree. One type scale (13 / 15 / 17 / 40), two radii (10 / 16), cream ground, orange accent, and the canvas's own
   motif: cards joined by connectors. Colours are tokens so the dark theme is one block. */
#start, #yf, #sg { --ink: #2b2118; --soft: #6a5a45; --card: #fff7e8; --line: #cdbf9f; --accent: #d9822b; --accent-ink: #fff; --focus: #2b6cb0; --err: #a5342a; --shadow: rgba(43, 33, 24, .14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #start, :root:not([data-theme="light"]) #yf, :root:not([data-theme="light"]) #sg { --ink: #f3e9d6; --soft: #c9bda5; --card: #2b2620; --line: #4a4034; --accent-ink: #1d1a16; --focus: #7db4f0; --err: #f08a80; --shadow: rgba(0, 0, 0, .4); }
}
:root[data-theme="dark"] #start, :root[data-theme="dark"] #yf, :root[data-theme="dark"] #sg { --ink: #f3e9d6; --soft: #c9bda5; --card: #2b2620; --line: #4a4034; --accent-ink: #1d1a16; --focus: #7db4f0; --err: #f08a80; --shadow: rgba(0, 0, 0, .4); }
#start[hidden] { display: none; }
#start { position: fixed; inset: 0; display: flex; overflow: auto; padding: 28px 16px 40px; color: var(--ink); }
.stwrap { width: min(560px, 100%); margin: auto; display: grid; gap: 16px; }
#start h1, #start h2, #start p { margin: 0; }
.sthead { display: grid; justify-items: center; gap: 8px; text-align: center; margin-bottom: 4px; }
#start h1 { font: 400 40px/1.05 "Lilita One", system-ui, sans-serif; letter-spacing: .01em; }
#start .stlead { max-width: 30em; font-size: 15px; line-height: 1.45; color: var(--soft); }

/* the little tree: three cards and their connectors; the connectors draw themselves once */
.sttree { display: block; }
.stnode { fill: var(--card); stroke: var(--line); stroke-width: 2; }
.stnode.c0 { stroke: var(--accent); }
.stcon { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .stcon { animation: stdraw .9s .15s ease-out backwards; }
  .stnode { animation: stpop .45s ease-out backwards; } .stnode.c1 { animation-delay: .5s; } .stnode.c2 { animation-delay: .65s; }
  @keyframes stdraw { from { stroke-dashoffset: 1; } }
  @keyframes stpop { from { opacity: 0; transform: translateY(4px); } }
}

/* the doors */
.stcard { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 10px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.stcard:hover, .stcard:focus-within { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .stcard:hover, .stcard:focus-within { transform: translateY(-2px); box-shadow: 0 6px 18px var(--shadow); } }
#start h2 { font: 700 17px/1.2 system-ui, sans-serif; }
#start .stsub { font-size: 13px; line-height: 1.45; color: var(--soft); }
#start a, .stlink { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.stlink { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.stlink:hover, #start a:hover { color: var(--accent); }

/* the drop zone: dashed, and it wakes up when a file is dragged anywhere over the page */
.stdrop { border-style: dashed; justify-items: start; }
.stdrop.over { border-color: var(--accent); border-style: solid; background: color-mix(in srgb, var(--accent) 14%, var(--card)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.stdrop.over h2::after { content: "\a0\2014\a0let go to open it"; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .stdrop.over { transform: scale(1.015); } }

/* buttons: one primary (orange), the rest quiet */
.stbtn { font: 700 15px/1 system-ui, sans-serif; padding: 12px 20px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: transform .12s ease, filter .12s ease, border-color .12s ease; }
.stbtn:hover { border-color: var(--accent); }
.stbtn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stbtn.primary:hover { filter: brightness(1.06); }
@media (prefers-reduced-motion: no-preference) { .stbtn:hover, .stchip:hover { transform: translateY(-1px); } }
.stbtn:disabled { opacity: .6; cursor: progress; }
.stbtn:focus-visible, .stchip:focus-visible, .stlink:focus-visible, #start a:focus-visible, #start summary:focus-visible, #start input:focus-visible, .recopen:focus-visible, .recx:focus-visible, #yf button:focus-visible, #yf a:focus-visible, #yf input:focus-visible, #yf summary:focus-visible, #yf h1:focus-visible, #sg button:focus-visible, #sg input:focus-visible, #sg select:focus-visible, #sg summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* the link door */
.stlinkrow { display: flex; flex-wrap: wrap; gap: 8px; }
.stlinkin { flex: 1 1 220px; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 15px/1.2 system-ui, sans-serif; }
.stvh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#start .stmsg { font-size: 13px; line-height: 1.4; color: var(--soft); }
#start .stmsg[hidden] { display: none; }
#start .stmsg.err { color: var(--err); font-weight: 600; }
#start .stex { font-size: 13px; color: var(--soft); }

/* the archives: small chips, each with its own colour */
.stplain { display: grid; gap: 10px; justify-items: center; text-align: center; }
.stplain[hidden], .stcard[hidden] { display: none; }
.stplain h2 { font-size: 15px; color: var(--soft); }
.starch { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; width: 100%; }
.stchip { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 700 13px/1.1 system-ui, sans-serif; cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.stchip::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.stchip:hover { border-color: var(--accent); }
.stchip[data-k="defranceski"]::before { background: #D2493A; } .stchip[data-k="booyzen"]::before { background: #4E9A3E; }
.stchip[data-k="luwinski"]::before { background: #3A74C9; } .stchip[data-k="lerena"]::before { background: #8A5CC2; }
.stchip[data-k="falco"]::before { background: #D39A12; } .stchip[data-k="blazevic"]::before { background: #1E9C97; }
.stchip[data-k="darcy"]::before { background: #C9508F; } .stchip[data-k="mazza"]::before { background: #8E7B5E; }

/* last used */
#stRecent { justify-items: stretch; text-align: left; }
#stRecent h2 { text-align: center; }
#stRecent .stsub { text-align: center; }

/* Keep your work: one round save button with a few words beside it, linking to Connection & Backup. Green, because it is the "safe" colour on the rest of the site
   (the live dot); light and dark are two sets of tokens. When the six words are on, the disc fills. */
#start, #yf, #sg { --keep: #3f8f4a; --keep-fill: #e3f2e0; --keep-ink: #2c6a36; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #start, :root:not([data-theme="light"]) #yf, :root:not([data-theme="light"]) #sg { --keep: #6fbf73; --keep-fill: #22331f; --keep-ink: #bfe8b9; } }
:root[data-theme="dark"] #start, :root[data-theme="dark"] #yf, :root[data-theme="dark"] #sg { --keep: #6fbf73; --keep-fill: #22331f; --keep-ink: #bfe8b9; }
.stkeep { justify-self: center; display: flex; align-items: center; gap: 14px; max-width: 100%; padding: 6px 14px 6px 6px; border-radius: 999px; text-decoration: none !important; color: var(--ink); transition: transform .12s ease, background .12s ease; }
.stkeep:hover { background: color-mix(in srgb, var(--keep) 10%, transparent); color: var(--ink) !important; }
.stdisc { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--keep); background: var(--keep-fill); color: var(--keep-ink); transition: transform .15s ease, background .15s ease, color .15s ease; }
.stkeep.on .stdisc { background: var(--keep); color: var(--accent-ink); }
@media (prefers-reduced-motion: no-preference) { .stkeep:hover .stdisc { transform: scale(1.06) rotate(-4deg); } }
.stkeep:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.stkcap { display: grid; gap: 2px; text-align: left; min-width: 0; }
.stkcap b { font: 700 15px/1.2 system-ui, sans-serif; }
.stkcap small { font: 400 13px/1.35 system-ui, sans-serif; color: var(--soft); }


/* the line at the bottom that says a saved canvas came back, or that another device saved a newer one */
.knote { position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 11; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; max-width: calc(100vw - 32px);
  padding: 9px 12px 9px 16px; border-radius: 16px; background: #2b2118; color: #fff7e8; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); font-size: 14px; line-height: 1.35; }
.knote[hidden] { display: none; }
.knote #knBtns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.knote button { font: 700 13px/1 system-ui, sans-serif; padding: 7px 12px; border-radius: 999px; border: 2px solid #fff7e8; background: transparent; color: #fff7e8; cursor: pointer; }
.knote button:hover { background: #fff7e8; color: #2b2118; }
.knote .knx { border-color: transparent; padding: 5px 9px; font-size: 16px; }
.knote button:focus-visible { outline: 3px solid #7db4f0; outline-offset: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .knote { background: #f3e9d6; color: #1d1a16; } :root:not([data-theme="light"]) .knote button { border-color: #1d1a16; color: #1d1a16; } :root:not([data-theme="light"]) .knote button:hover { background: #1d1a16; color: #f3e9d6; } }
:root[data-theme="dark"] .knote { background: #f3e9d6; color: #1d1a16; } :root[data-theme="dark"] .knote button { border-color: #1d1a16; color: #1d1a16; } :root[data-theme="dark"] .knote button:hover { background: #1d1a16; color: #f3e9d6; }

/* the small print, folded away */
.sthelp { font-size: 13px; line-height: 1.5; color: var(--soft); border-top: 2px dotted var(--line); padding-top: 12px; }
.sthelp summary { cursor: pointer; font-weight: 700; }
.sthelp p { margin-top: 8px; }

@media (max-width: 480px) { #start { padding-top: 20px; } #start h1 { font-size: 34px; } .stcard { padding: 16px; } .stlinkrow .stbtn { flex: 1 1 100%; } }


/* The file open on the start screen: the way back to the canvas, and to the page about the file */
.stcur { border-color: var(--keep); }
.stcurbtns { display: flex; flex-wrap: wrap; gap: 8px; }
#start .stcur h2 { font-size: 17px; }

/* "Your file": the numbers, the report, what is kept on this device, and the export. A page of its own over the canvas (the canvas stays loaded underneath and keeps its state);
   plain sections, one column, the same tokens as the opening screen. */
#yf[hidden] { display: none; }
#yf { position: fixed; inset: 0; z-index: 20; overflow: auto; background: #efe6d2; color: var(--ink); padding: 24px 16px 56px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #yf { background: #1d1a16; } }
:root[data-theme="dark"] #yf { background: #1d1a16; }
.yfwrap { width: min(780px, 100%); margin: 0 auto; display: grid; gap: 28px; }
.yfhead { display: grid; gap: 8px; justify-items: start; }
#yf h1 { margin: 0; font: 400 36px/1.05 "Lilita One", system-ui, sans-serif; letter-spacing: .01em; }
#yf h1:focus { outline: none; }
#yf h2 { margin: 0 0 10px; font: 700 20px/1.2 system-ui, sans-serif; }
#yf h3 { margin: 18px 0 6px; font: 700 15px/1.25 system-ui, sans-serif; color: var(--ink); }
#yf p { margin: 0; }
#yf .stsub { font-size: 13px; line-height: 1.45; color: var(--soft); }
#yf a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#yf a:hover { color: var(--accent); }
#yf a.stbtn { display: inline-block; text-decoration: none; }
.yfsec { display: grid; gap: 8px; align-content: start; padding-top: 18px; border-top: 2px dotted var(--line); }
.yfsec:first-of-type { border-top: 0; padding-top: 0; }

/* the strip: the same five counts as the tree views, each a plain tile */
.yfmet { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.yfm { display: grid; gap: 2px; align-content: start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.yfm b { font: 700 26px/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.yfm span { font: 700 13px/1.2 system-ui, sans-serif; }
.yfm small { font: 400 12px/1.35 system-ui, sans-serif; color: var(--soft); }

/* the import report: the reader's own sentences, as lists and one table */
.yfreport dl.kv { display: grid; grid-template-columns: minmax(8.5em, 12em) 1fr; gap: 4px 14px; margin: 0; font-size: 14px; line-height: 1.4; }
.yfreport dt { color: var(--soft); font-weight: 700; }
.yfreport dd { margin: 0; overflow-wrap: anywhere; }
.yfreport p { font-size: 14px; line-height: 1.45; }
.yfreport p.small { font-size: 13px; color: var(--soft); }
.yfreport table.t { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.yfreport th, .yfreport td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.yfreport th.n, .yfreport td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yfreport .small { font-size: 12px; color: var(--soft); }
.yfreport .bar-in { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); }
@media (max-width: 560px) { .yfreport dl.kv { grid-template-columns: 1fr; gap: 0; } .yfreport dd { margin-bottom: 8px; } .yfreport table.t { display: block; overflow-x: auto; } }

/* the lists reuse the opening screen's rows; here they sit left-aligned under their own small headings */

/* the export */
.yfmodes { display: grid; gap: 8px; margin: 4px 0; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; }
.yfmodes legend { padding: 0 6px; font: 700 13px/1 system-ui, sans-serif; }
.yfmodes label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; cursor: pointer; }
.yfmodes input { margin-top: 3px; flex: none; }
.yfdl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
#yf .stmsg { font-size: 13px; line-height: 1.4; color: var(--soft); }

/* Settings: a drawer from the right over whatever is open (the opening screen, the canvas or Your file). A page of its own on a phone. */
#sg[hidden] { display: none; }
#sg { position: fixed; inset: 0; z-index: 30; color: var(--ink); display: flex; justify-content: flex-end; }
.sgback { position: absolute; inset: 0; background: rgba(29, 26, 22, .45); }
.sgpanel { position: relative; width: min(440px, 100%); height: 100%; overflow: auto; background: #efe6d2; padding: 20px 20px 48px; display: grid; gap: 20px; align-content: start; box-shadow: -8px 0 24px var(--shadow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sgpanel { background: #1d1a16; } }
:root[data-theme="dark"] .sgpanel { background: #1d1a16; }
@media (prefers-reduced-motion: no-preference) { .sgpanel { animation: sgin .18s ease-out; } @keyframes sgin { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } } }
.sghead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#sg h2 { margin: 0; font: 400 30px/1.05 "Lilita One", system-ui, sans-serif; letter-spacing: .01em; }
#sg h2:focus { outline: none; }
#sg h3 { margin: 0 0 8px; font: 700 17px/1.2 system-ui, sans-serif; }
#sg p { margin: 0; }
#sg .stsub { font-size: 13px; line-height: 1.45; color: var(--soft); }
.sgsec { display: grid; gap: 8px; align-content: start; padding-top: 16px; border-top: 2px dotted var(--line); }
.sgsec:first-of-type { border-top: 0; padding-top: 0; }
.sglks { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; }
.sglk { display: grid; justify-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--line); font: 700 13px/1.1 system-ui, sans-serif; cursor: pointer; }
.sglk svg { width: 100%; max-width: 64px; height: auto; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.sglk:hover { border-color: var(--accent); }
.sglk:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sglk[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); box-shadow: 0 3px 0 var(--accent); }
.sglk:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.sgsw { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.sgsw input { margin: 3px 0 0; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.sgsw b { display: block; font: 700 15px/1.3 system-ui, sans-serif; }
.sgsw small { display: block; margin-top: 3px; font: 400 13px/1.4 system-ui, sans-serif; color: var(--soft); }
.sglab { font: 700 13px/1 system-ui, sans-serif; margin-top: 4px; }
.sginput { width: 100%; box-sizing: border-box; font: 400 15px/1.3 system-ui, sans-serif; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.sginput:disabled { opacity: .6; }
.sgwhat { font-size: 13px; line-height: 1.45; color: var(--soft); }
.sgwhat summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.sgwhat p { margin-top: 6px; }
.stsettings { text-align: center; font-size: 13px; line-height: 1.45; }
.stsettings .stlink { font-weight: 700; font-size: 15px; }
@media (max-width: 560px) { .sgpanel { width: 100%; box-shadow: none; } }

/* ---- the full Fix list: a page over the canvas, like "Your file". The rows are fixrows.css's. ---- */
/* The Fix list wears the canvas's own looks (Sticker, Paper, Ground), the same tokens, fonts and thick-outline, ledge-shadow style, not a generic light or dark.
   html[data-look] says which one the visitor chose; with no data-look (Automatic) the device picks Sticker or Ground. */
@font-face { font-family: "Lilita One"; font-weight: 400; font-display: swap; src: url(/tree-canvas/fonts/lilita-one-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lilita One"; font-weight: 400; font-display: swap; src: url(/tree-canvas/fonts/lilita-one-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 200 1000; font-display: swap; src: url(/tree-canvas/fonts/nunito-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 200 1000; font-display: swap; src: url(/tree-canvas/fonts/nunito-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
#fx { --bg: #F1E8D2; --ink: #2b2118; --soft: #6b5a44; --card: #FFFCF3; --line: #E3D6B8; --accent: #D9822B; --accent-ink: #fff; --focus: #2b6cb0; --keep: #3f8a3a; --keep-fill: #E3EFD8; --keep-ink: #2c6a36;
  --fx-ink: var(--ink); --fx-soft: var(--soft); --fx-line: var(--line); --fx-card: var(--card); --fx-accent: var(--accent); --fx-ok: var(--keep); --fx-okfill: var(--keep-fill); --fx-focus: var(--focus); --fx-warn: #c2452d;
  --fx-body: Nunito, system-ui, sans-serif; --fx-display: "Lilita One", Impact, system-ui, sans-serif; }
:root[data-look="paper"] #fx { --bg: #F4E3CA; --ink: #3D2F21; --soft: #554636; --card: #D8C8B1; --line: #BEAD98; --accent: #DD7D17; --keep-fill: color-mix(in srgb, #3f8a3a 22%, #D8C8B1); --keep-ink: #1d5017; --fx-warn: #9a3220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #fx { --bg: #291A0A; --ink: #D8C8B1; --soft: #A3937E; --card: #3D2F21; --line: #554636; --accent: #DD7D17; --accent-ink: #291A0A; --focus: #7db4f0; --keep: #8cc77f; --keep-fill: #27401d; --keep-ink: #b5dc96; --fx-warn: #e8836b; } }
:root[data-theme="dark"] #fx { --bg: #291A0A; --ink: #D8C8B1; --soft: #A3937E; --card: #3D2F21; --line: #554636; --accent: #DD7D17; --accent-ink: #291A0A; --focus: #7db4f0; --keep: #8cc77f; --keep-fill: #27401d; --keep-ink: #b5dc96; --fx-warn: #e8836b; }
#fx[hidden] { display: none; }
#fx { position: fixed; inset: 0; z-index: 20; overflow: auto; background: var(--bg); color: var(--ink); padding: 24px 16px 64px; font: 600 15px/1.4 var(--fx-body); }
/* the sticker look itself: every word in the canvas's fonts, 2px outlines, a hard ledge underneath, pills for buttons that lift on hover and press down */
#fx *:not(.fx-pid) { font-family: var(--fx-body); }
#fx h1#fxTitle { font-family: var(--fx-display); }
/* a neighbour-based suggestion (likely.js): a chip on the candidate, highlighted, and one quiet line of counts. Copy only. */
#fx .fx-cand.likely { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
#fx .fx-likelychip { font: 800 10.5px/1 system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; padding: 3px 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); flex: none; }
#fx .fx-likelynote { font-size: 12.5px; margin: 4px 0 2px; max-width: 70ch; }
#fx .fx-likelynote.quiet { font-style: italic; opacity: .85; }
#fx .stbtn, #fx .fx-openall, #fx .fx-cand, #fx .fx-add { border: 2px solid var(--line); border-radius: 99px; box-shadow: 0 2px 0 var(--line); font-weight: 800; transition: transform .12s ease, box-shadow .12s ease, border-color .15s ease, color .15s ease; }
#fx .stbtn { font-size: 13px; padding: 8px 16px; } #fx .stbtn:first-child { font-size: 14px; }
#fx .stbtn:hover, #fx .fx-openall:hover:not(:disabled), #fx .fx-cand:hover, #fx .fx-add:hover { transform: translateY(-1px); border-color: var(--accent); }
#fx .stbtn:active, #fx .fx-openall:active, #fx .fx-cand:active, #fx .fx-add:active { transform: translateY(2px); box-shadow: none; }
#fx .stbtn.primary { color: var(--accent-ink); }
#fx .fxtools, #fx .fxkeep { border-radius: 16px; box-shadow: 0 3px 0 var(--line); }
#fx .fxkeep { border-style: solid; }
#fx .fxf input, #fx .fxf select { border-radius: 10px; font-weight: 700; }
#fx .fxbar { border-width: 2px; height: 14px; box-shadow: 0 2px 0 var(--line); }
#fx .fx-row { border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 3px 0 var(--line); padding: 12px 14px; font-weight: 600; }
#fx .fx-row.done { border-style: dashed; box-shadow: none; } #fx .fx-row.asis { border-style: dotted; box-shadow: none; }
#fx .fx-row.compact { padding: 8px 9px; }
#fx .fx-ib { border-width: 2px; box-shadow: 0 2px 0 var(--c-line); transition: transform .12s ease, box-shadow .12s ease, color .15s ease, border-color .15s ease; }
#fx .fx-ib:hover { transform: translateY(-1px); } #fx .fx-ib:active { transform: translateY(2px); box-shadow: none; }
#fx .fx-ghead { border-bottom-width: 2px; } #fx .fx-sec { border-bottom-width: 2px; }
#fx .fx-pr { border-width: 2px; }
@media (prefers-reduced-motion: reduce) { #fx .stbtn:hover, #fx .fx-openall:hover, #fx .fx-cand:hover, #fx .fx-add:hover, #fx .fx-ib:hover, #fx .stbtn:active, #fx .fx-openall:active, #fx .fx-cand:active, #fx .fx-add:active, #fx .fx-ib:active { transform: none; } }
.fxwrap { width: min(980px, 100%); margin: 0 auto; display: grid; gap: 18px; }
.fxhead { display: grid; gap: 10px; justify-items: start; }
#fx h1 { margin: 0; font: 400 36px/1.05 "Lilita One", system-ui, sans-serif; letter-spacing: .01em; }
#fx h1:focus { outline: none; }
#fx p { margin: 0; }
#fx .stsub { font-size: 13px; line-height: 1.45; color: var(--soft); }
#fx .stbtn { padding: 8px 14px; font-size: 13.5px; }
#fx .stbtn:first-child { font-size: 15px; }
#fx button:focus-visible, #fx a:focus-visible, #fx input:focus-visible, #fx select:focus-visible, #fx summary:focus-visible, #fx h1:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fxprog { display: flex; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; }
.fxbar { flex: 1 1 260px; height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, var(--line)); border: 1.5px solid var(--line); overflow: hidden; }
.fxbar i { display: block; height: 100%; width: 0; background: var(--keep); border-radius: 999px; transition: width .25s ease; }
@media (prefers-reduced-motion: reduce) { .fxbar i { transition: none; } }
#fx-prog, #fxp-prog, #fxo-prog { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.fxtools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.fxf { display: grid; gap: 3px; font-size: 12px; font-weight: 700; color: var(--soft); }
.fxf input, .fxf select { font: 400 14px/1.2 system-ui, sans-serif; padding: 8px 10px; border: 2px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); min-width: 150px; }
.fxf.fxq { flex: 1 1 240px; } .fxf.fxq input { width: 100%; }
.fxbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.fxck { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.fxck input { width: 18px; height: 18px; accent-color: var(--keep); }
.fxnames { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fxnames[hidden] { display: none; }
.fxchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 2px solid var(--line); border-radius: 99px; background: var(--card); font-size: 13.5px; }
.fxchip button { all: unset; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--soft); font-size: 12px; font-weight: 800; }
.fxchip button:hover { color: var(--accent); }
.fxchip button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.fxwho { flex-basis: 100%; font-size: 13.5px; font-weight: 700; }
.fxkeep { display: grid; gap: 8px; padding: 12px 14px; border: 2px dotted var(--line); border-radius: 12px; }
.fxsaved.saved { color: var(--keep-ink); font-weight: 700; }
#fx-body, #fxp-body, #fxo-body { display: grid; gap: 4px; }
/* the two lists, People and Places, are tabs of one page: one pane shows at a time, each with its own progress, filters and rows */
.fxpane { display: grid; gap: 18px; } .fxpane[hidden] { display: none; }
.fxtabs { display: flex; flex-wrap: wrap; gap: 8px; }
#fx .fxtab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border: 2px solid var(--line); border-radius: 99px; background: transparent; color: var(--soft); box-shadow: 0 2px 0 var(--line); font: 800 14px/1.2 var(--fx-body); cursor: pointer; transition: transform .12s ease, border-color .15s ease, color .15s ease; }
#fx .fxtab:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
#fx .fxtab[aria-selected="true"] { background: var(--card); color: var(--ink); border-color: var(--accent); }
.fxtn { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 800 12px/1.5 system-ui, sans-serif; font-variant-numeric: tabular-nums; text-align: center; }
@media (prefers-reduced-motion: reduce) { #fx .fxtab:hover { transform: none; } }
/* the Orphans tab: one quiet line of counts with its (i), the plain-words explanation, and a row's regime chip and period. The chip takes the Atlas's own colour for the regime. */
#fx .fxsum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; } #fx .fxsum .fxcounts { margin: 0; font-weight: 700; } #fx .fxsum .fxcounts[hidden] { display: none; }
#fx .fxwhat { flex-basis: 100%; max-width: 70ch; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-size: 13.5px; font-weight: 600; } #fx .fxwhat[hidden] { display: none; }
#fx .fxwhat p { margin: 0 0 6px; } #fx .fxwhat p:last-child { margin: 6px 0 0; } #fx .fxwhat-l { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
#fx .fx-era { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
#fx .fx-rg { --rgl: #7A8790; --rgd: #A9B4BB; font: 800 11px/1 system-ui, sans-serif; letter-spacing: .03em; padding: 4px 9px; border-radius: 99px; color: #fff; background: var(--rgl); text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #fx .fx-rg { background: var(--rgd); color: #1d1a16; text-shadow: none; } }
:root[data-theme="dark"] #fx .fx-rg { background: var(--rgd); color: #1d1a16; text-shadow: none; }
#fx .fx-plc { font-size: 15px; } #fx .fx-plc a { color: inherit; text-underline-offset: 2px; }
#fx .fx-cols { margin: 0; }
/* a Places row: each candidate is one copy button with its size and place beside it */
#fx .fx-cands .fx-cand small { font-size: 11.5px; font-weight: 600; }

/* a group is a quiet heading line (title, count, "n of N done") with its "Open next 10 people" control at the right of the SAME line */
.fx-ghead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin: 26px 0 0; padding-bottom: 5px; border-bottom: 1.5px solid var(--line); }
.fx-group { margin: 0; font: 800 13px/1.3 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.fx-group.group-done { opacity: .7; }
.fx-gn { font-variant-numeric: tabular-nums; color: var(--ink); }
.fx-gc { font-weight: 600; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.fx-gh { color: var(--soft); font-size: 12.5px; margin: 4px 0 2px; }
.fx-tick { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--keep); color: #fff; font-size: 11px; font-weight: 900; vertical-align: 1px; }
/* a section is one compact line, the same columns for every section: title | count | progress | (i) | priority */
.fx-sec { border-bottom: 1px solid var(--line); margin: 0; padding: 0; }
.fx-sec > summary { cursor: pointer; min-height: 40px; display: grid; grid-template-columns: minmax(0, 1fr) 4.2em 9.6em 28px 5.2em; align-items: center; column-gap: 10px; padding: 0 2px 0 22px; position: relative; list-style: none; font-size: 14.5px; }
.fx-sec > summary::-webkit-details-marker { display: none; }
.fx-sec > summary::before { content: ""; position: absolute; left: 4px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid var(--soft); border-bottom: 2px solid var(--soft); transform: rotate(-45deg); transition: transform .12s ease; }
.fx-sec[open] > summary::before { transform: rotate(45deg); margin-top: -7px; }
@media (prefers-reduced-motion: reduce) { .fx-sec > summary::before { transition: none; } }
.fx-sec > summary:hover { background: color-mix(in srgb, var(--card) 70%, transparent); }
.fx-st { display: flex; align-items: center; min-width: 0; } .fx-st b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.fx-n { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.fx-pg { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-mini { flex: none; width: 38px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--card) 60%, var(--line)); overflow: hidden; }
.fx-mini i { display: block; height: 100%; width: 0; background: var(--keep); }
.fx-sc { margin: 0; font-weight: 600; }
.fx-sec .fx-ib { --c-line: var(--line); --c-soft: var(--soft); --c-accent: var(--accent); --c-ok: var(--keep); width: 24px; height: 24px; justify-self: center; }
.fx-pr { justify-self: end; font: 800 10.5px/1 system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--soft); }
.fx-pr-high { border-color: var(--accent); color: var(--accent); }
.fx-pr-low { opacity: .75; }
.fx-sec.fx-empty > summary { color: var(--soft); cursor: default; } .fx-sec.fx-empty .fx-n, .fx-sec.fx-empty .fx-pr { opacity: .5; }
.fx-sec.sec-done > summary { color: var(--soft); }
.fx-sec.sec-done .fx-st b { color: var(--soft); }
.fx-sec.sec-done .fx-n { color: var(--soft); font-weight: 600; }
.fx-sec.sec-done .fx-pr { opacity: .5; }
.fx-sec .fx-how { margin: 2px 0 10px 22px; max-width: 70ch; display: grid; gap: 4px; }
.fx-prwhy { color: var(--ink); }
.fx-sbody { padding: 2px 0 10px 22px; }
#fx [hidden] { display: none !important; }
.fx-gact { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 10px; margin: 0; }
.fx-openall { padding: 5px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); }
.fx-openall:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.fx-openall:disabled { opacity: .55; cursor: default; }
@media (max-width: 640px) {
  .fx-sec > summary { grid-template-columns: minmax(0, 1fr) 28px 5.2em; grid-template-areas: "t i p" "n g g"; row-gap: 0; padding: 6px 2px 6px 22px; }
  .fx-st { grid-area: t; } .fx-ib { grid-area: i; } .fx-pr { grid-area: p; }
  .fx-st b { white-space: normal; } .fx-sec > summary::before, .fx-sec[open] > summary::before { top: 20px; margin-top: -4px; }
  .fx-sec[open] > summary::before { margin-top: -6px; }
  .fx-n { grid-area: n; text-align: left; font-size: 12.5px; } .fx-pg { grid-area: g; justify-self: end; }
  .fx-ghead { align-items: flex-start; } .fx-gact { justify-content: flex-start; }
}
#fx-print { display: none; }
@media print {
  body.fx-printing > *:not(#fx-print) { display: none !important; }
  body.fx-printing #fx-print { display: block; color: #000; background: #fff; padding: 0; font: 12px/1.4 system-ui, sans-serif; }
  #fx-print h1 { font: 700 22px system-ui; } #fx-print h2 { font: 700 16px system-ui; margin: 14px 0 2px; } #fx-print h3 { font: 700 13px system-ui; margin: 10px 0 4px; }
  .fx-pitem { display: flex; gap: 8px; margin: 4px 0; break-inside: avoid; } .fx-pbox { flex: none; font-size: 15px; } .fx-pwhy, .fx-ppeople, .fx-pnext, .fx-pinfo { color: #333; }
}
@media (max-width: 560px) { #fx { padding: 16px 12px 56px; } #fx h1 { font-size: 30px; } .fxf { flex: 1 1 130px; } .fxf input, .fxf select { min-width: 0; width: 100%; } }


/* The list of trees: a card per tree (a kept file, an archive, a link) with what was saved of it nested underneath */
#stRecent h2, #stRecent .trintro { text-align: center; }
#stList, #yfList { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
#yfRecent { display: grid; gap: 8px; }
.trcard, .trview, #stRecent, #stRecent > * { min-width: 0; }
.trcard { display: grid; gap: 10px; padding: 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); }
.trhead, .trview { display: flex; align-items: stretch; gap: 6px; }
.tropen { flex: 1 1 auto; min-width: 0; text-align: left; padding: 8px 10px; border-radius: 10px; border: 2px solid transparent; background: transparent; color: var(--ink); cursor: pointer; font: 400 14px/1.25 system-ui, sans-serif; transition: border-color .12s ease, background .12s ease; }
.tropen:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tropen b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15px/1.2 system-ui, sans-serif; }
.tropen small { display: block; margin-top: 3px; font: 400 13px/1.3 system-ui, sans-serif; color: var(--soft); }
.trnote { display: block; margin-top: 4px; font: italic 400 13px/1.25 system-ui, sans-serif; color: var(--ink); white-space: normal; }
.trside { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.trbtn { height: 34px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font: 700 13px/1 system-ui, sans-serif; white-space: nowrap; }
.trbtn:hover { border-color: var(--accent); }
.trico { width: 34px; padding: 0; color: var(--soft); font-size: 15px; }
.trico.trsure { width: auto; padding: 0 10px; border-color: var(--accent); color: var(--ink); }
.trin { flex: 1 1 auto; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--focus); background: var(--card); color: var(--ink); font: 15px/1.2 system-ui, sans-serif; }
.trviews { list-style: none; margin: 0 0 0 10px; padding: 0 0 0 12px; border-left: 3px solid var(--keep, var(--line)); display: grid; gap: 6px; }
.trview { align-items: center; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--card) 70%, transparent); }
.trview .tropen:hover { border-color: var(--keep, var(--accent)); }
.trview .tropen b { font-size: 14px; }
.trlast { border-style: dashed; }
.trform { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; }
.trform .trin { flex: 1 1 200px; }
.tropen:focus-visible, .trbtn:focus-visible, .trin:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 480px) { .trhead { flex-wrap: wrap; } .trhead .tropen { flex: 1 1 100%; } .trview { flex-wrap: wrap; } .trview .tropen { flex: 1 1 100%; } .trviews { margin-left: 4px; padding-left: 8px; } .trside { margin-left: auto; } }

/* a line every row of a section would repeat, said once above the rows (hoistRepeats in fixlist-rows.js) */
.fx-hoist { margin: 0 0 8px; padding: 0 0 6px; border-bottom: 1px dashed var(--line); }
.fx-hoist > * { margin: 0 0 2px; font-size: 13px; font-weight: 500; }


/* THE OPENING SCREEN, SHORT. It used to be eight blocks of explanation that ran well past one screen. Now: a title, one drop zone, one line for a link,
   a row of chips, one line for keeping the work, and the trees you have opened. The explanations moved into the "About these files" fold and into tooltips. */
.stwrap { width: min(620px, 100%); gap: 12px; }
.sthead { grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 12px; row-gap: 2px; margin-bottom: 0; }
.sthead .sttree { width: 66px; height: 35px; grid-row: 1; }
#start h1 { grid-row: 1; font-size: 34px; }
#start .stlead { grid-column: 1 / -1; font-size: 14px; }
.stdrop { justify-items: center; text-align: center; gap: 6px; padding: 16px 20px 18px; }
.stdrop .stup { color: var(--accent); }
.stdrop h2 { font-size: 18px; }
.stdrop.over h2::after { content: ""; }
.stdrop .stbtn { margin-top: 6px; }
.stlinksec { gap: 4px; }
.stlinksec .stlinkrow { flex-wrap: nowrap; width: 100%; }
.stlinksec .stlinkin { flex: 1 1 auto; min-width: 0; }
.stlinksec .stbtn { flex: none; }
#start .stex { font-size: 12.5px; }
#stArch { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
#stArch h2 { flex: 1 1 100%; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
#stArch .starch { display: contents; }
#stArch .stchip { padding: 7px 12px; border-radius: 999px; font-size: 13px; }
#stArch .stdemo::before { background: transparent; border: 2px dashed var(--soft); box-sizing: border-box; }
#stArch .stdemo { border-style: dashed; color: var(--soft); }
.stkeep { padding: 4px 14px 4px 4px; gap: 10px; }
.stkeep .stdisc { width: 38px; height: 38px; border-width: 2.5px; }
.stkeep .stdisc svg { width: 18px; height: 18px; }
.stkeep .stkcap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.stkeep .stkcap small { font-size: 12.5px; }
#stFixSaved { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 10px; }
#stFixSaved h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#stFixSaved #stFixTxt { font-size: 14px; }
#stRecent { gap: 8px; }
#stRecent h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
#stRecent #stList { width: 100%; gap: 8px; text-align: left; }
#stRecent .trcard { padding: 8px 10px; gap: 6px; border-width: 1.5px; }
#stRecent .tropen { padding: 4px 8px; }
#stRecent .tropen small { margin-top: 1px; font-size: 12.5px; }
#stRecent .trbtn { height: 30px; }
#stRecent .trico { width: 30px; }
#stRecent .trviews { gap: 4px; }
#stRecent .stkept { font-size: 12.5px; }
.stsettings { display: flex; justify-content: center; gap: 6px 16px; flex-wrap: wrap; }
.stsettings .stlink { font-size: 14px; }
.sthelp { padding-top: 8px; }
@media (max-width: 480px) { .stlinksec .stlinkrow { flex-wrap: wrap; } .stlinksec .stlinkin { flex: 1 1 100%; } .stlinksec .stbtn { flex: 1 1 100%; } }
