/* The admin panel: H opens it. Light paper, serif headings, eye toggles, a small inspector.
   Deliberately not the catalogue's dark dock. */
body.admin{--admin-w:510px}
#admin{position:fixed;top:0;right:0;bottom:0;width:var(--admin-w);background:#fbfbf9;border-left:1px solid var(--line);display:none;grid-template-rows:auto 1fr auto;font-size:13.5px;color:#2a2a28;z-index:20}
body.admin #admin{display:grid}
#admin header{display:flex;align-items:baseline;justify-content:space-between;padding:18px 20px 12px;border-bottom:1px solid var(--line)}
#admin header .t{font:400 17px 'Instrument Serif',Georgia,serif;letter-spacing:.04em}
#admin header .s{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--mute)}
#admin header .s.dirty{color:#b58a00}
#admin header .s.bad{color:#c0392b}
#admin .body{overflow:auto;min-height:0;display:flex;flex-direction:column}
#tree{padding:10px 8px 14px;border-bottom:1px solid var(--line)}
.tn{display:flex;align-items:center;gap:6px;padding:4px 8px;border-radius:4px;cursor:pointer;color:#2a2a28;user-select:none}
.tn:hover{background:#f1f1ec}
.tn.sel{background:#efe9cf}
.tn .car{width:12px;font-size:9px;color:var(--mute);text-align:center;flex:none}
.tn .car.leaf{visibility:hidden}
.tn .lb{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tn .lb.edited::after{content:"";display:inline-block;width:4px;height:4px;border-radius:50%;background:var(--gold);margin-left:6px;vertical-align:2px}
.tn .kind{font-size:9.5px;letter-spacing:.12em;text-transform:uppercase;color:#a6a6a2;flex:none}
.tn .eye{width:22px;height:18px;flex:none;display:grid;place-items:center;color:#2a2a28;opacity:.55}
.tn .eye:hover{opacity:1}
.tn.off .lb,.tn.off .kind{color:#b5b5b0}
.tn.off .eye{opacity:.25}
.kids{margin-left:14px;border-left:1px solid var(--line);padding-left:4px}
.kids.closed{display:none}
#insp{padding:14px 20px 24px;display:flex;flex-direction:column;gap:12px}
#insp .h{font:400 15px 'Instrument Serif',Georgia,serif;color:var(--ink)}
#insp .path{font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--mute);margin-top:-8px;word-break:break-all}
#insp label{display:flex;flex-direction:column;gap:5px;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mute)}
#insp label .lh{display:flex;justify-content:space-between;align-items:baseline}
#insp label .lh button{font:inherit;letter-spacing:inherit;text-transform:inherit;color:#b58a00;background:none;border:0;padding:0;cursor:pointer}
#insp input,#insp textarea,#insp select{font:400 13px/1.45 Inter,system-ui,sans-serif;color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:4px;padding:7px 9px;width:100%;outline:none;letter-spacing:0;text-transform:none}
#insp input:focus,#insp textarea:focus,#insp select:focus{border-color:#d9c25a}
#insp textarea{min-height:88px;resize:vertical}
#insp .row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:#2a2a28;letter-spacing:0;text-transform:none}
#insp .sw{width:30px;height:16px;border-radius:9px;background:#d8d8d3;position:relative;cursor:pointer;flex:none}
#insp .sw::after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:left .15s}
#insp .sw.on{background:var(--gold)}
#insp .sw.on::after{left:16px}
#insp .empty{color:var(--mute);font-weight:300}
#insp .thumb{width:100%;max-height:160px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:4px;mix-blend-mode:multiply}
#insp .goto{align-self:flex-start;font:inherit;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#2a2a28;background:none;border:1px solid var(--line);border-radius:4px;padding:4px 10px;cursor:pointer}
#admin footer{padding:10px 20px 12px;border-top:1px solid var(--line);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--mute);display:flex;flex-direction:column;gap:8px}
#admin footer .r{display:flex;justify-content:space-between;align-items:center;gap:8px}
#admin footer button{font:inherit;letter-spacing:inherit;text-transform:inherit;color:#2a2a28;background:none;border:1px solid var(--line);border-radius:4px;padding:4px 10px;cursor:pointer}
#admin footer button:disabled{color:#b5b5b0;cursor:default}
#admin footer .keys{font-size:10px;color:#a6a6a2}
#hist{display:none;flex-direction:column;gap:2px;max-height:160px;overflow:auto;border:1px solid var(--line);border-radius:4px;padding:4px;background:#fff;letter-spacing:0;text-transform:none;font-size:11.5px}
#hist.open{display:flex}
#hist button{border:0;text-align:left;padding:4px 8px;border-radius:3px;letter-spacing:0;text-transform:none;font-size:11.5px}
#hist button:hover{background:#f1f1ec}
#hist .none{color:var(--mute);padding:4px 8px}

/* hovering a row in the tree shows where it is on the page */
.mark{outline:1.5px dashed var(--gold);outline-offset:4px}

/* text mode: T (or the panel button; F2 where Windows passes it on) lights every word on the page; click one and type */
body.tx [data-tx]{outline:1px dashed rgba(181,138,0,.55);outline-offset:3px;cursor:text;min-width:1ch;min-height:1em}
body.tx [data-tx]:hover{outline-color:var(--gold);background:rgba(255,204,0,.08)}
body.tx [data-tx][contenteditable="true"]{outline:1.5px solid var(--gold);background:#fff;cursor:text}
body.tx .ways button,body.tx .pnav li button{cursor:text}
#txbar{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);display:none;align-items:center;gap:16px;padding:8px 14px;background:#161616;color:#f6f6f4;border-radius:4px;font-size:11px;letter-spacing:.12em;text-transform:uppercase;z-index:30;white-space:nowrap}
#txbar b{font-weight:400;color:var(--gold)}
#txbar .txb{font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
#txbar .txb:hover{color:#fff}
#txbar .txb:hover b{text-decoration:underline;text-underline-offset:3px}
/* a phone: the bar keeps to the screen, two lines at most, the click hint goes */
@media (max-width:600px){#txbar{gap:6px 14px;flex-wrap:wrap;justify-content:center;width:max-content;max-width:calc(100% - 32px);white-space:normal}#txbar>span:first-child{display:none}}
body.tx #txbar{display:flex}
body.admin #txbar{left:calc(50% - var(--admin-w) / 2)}
@media (max-width:900px){body.admin{--admin-w:0px}#admin{display:none!important}}
#admin header .acts{display:flex;align-items:baseline;gap:14px}
#admin header .txbtn{font:inherit;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#2a2a28;background:none;border:1px solid var(--line);border-radius:4px;padding:4px 10px;cursor:pointer}
body.tx #admin header .txbtn{background:var(--gold);border-color:var(--gold)}
.tn.settings .lb{font-weight:500}

/* the rooms picker (Rooms in the panel's header, or ?rooms=1): every room for every workspace */
#rooms{position:fixed;inset:0;right:var(--admin-w,0px);background:#f6f5f1;z-index:25;display:none;grid-template-rows:auto 1fr;color:#2a2a28;font-size:13px}
#rooms.open{display:grid}
#rooms header{display:flex;align-items:baseline;gap:18px;padding:16px 28px 12px;border-bottom:1px solid var(--line)}
#rooms header b{font:400 20px 'Instrument Serif',Georgia,serif;letter-spacing:.02em}
#rooms header span{flex:1;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mute)}
#rooms button{font:inherit;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#2a2a28;background:none;border:1px solid var(--line);border-radius:4px;padding:4px 10px;cursor:pointer}
#rooms .rbody{overflow:auto;min-height:0;padding:8px 28px 40px}
#rooms .rrow{padding:18px 0 22px;border-bottom:1px solid var(--line)}
#rooms .rhead{display:flex;align-items:baseline;gap:14px;margin-bottom:10px}
#rooms .rhead b{font:400 18px 'Instrument Serif',Georgia,serif}
#rooms .rhead span{flex:1;font-size:11px;color:var(--mute)}
#rooms .rpair{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:18px;align-items:start}
#rooms .rbig{width:100%;aspect-ratio:2180/1744;object-fit:cover;background:#fff;border:1px solid var(--line);border-radius:3px;display:block}
#rooms .rgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
#rooms figure{margin:0;cursor:pointer;border:2px solid transparent;border-radius:3px;padding:2px;background:#fff}
#rooms figure:hover{border-color:#e6d68c}
#rooms figure.now{border-color:var(--gold)}
#rooms figure img{width:100%;aspect-ratio:2180/1744;object-fit:cover;display:block}
#rooms figcaption{font-size:10.5px;line-height:1.3;color:#555;padding:4px 2px 2px}
#rooms figure.now figcaption{color:#2a2a28;font-weight:500}

/* the texts table (F3): every word of the site in rows, English beside Latvian, the section on screen first */
#texts{position:fixed;inset:0;right:var(--admin-w,0px);background:#f6f5f1;z-index:26;display:none;grid-template-rows:auto 1fr;color:#2a2a28;font-size:13px}
body:not(.admin) #texts{right:0}
#texts.open{display:grid}
#texts header{display:flex;align-items:baseline;gap:18px;padding:16px 28px 12px;border-bottom:1px solid var(--line)}
#texts header b{font:400 20px 'Instrument Serif',Georgia,serif;letter-spacing:.02em}
#texts header span{flex:1;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mute)}
#texts header .q{font:inherit;font-size:13px;width:220px;padding:5px 10px;border:1px solid var(--line);border-radius:4px;background:#fff;color:#2a2a28}
#texts button{font:inherit;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#2a2a28;background:none;border:1px solid var(--line);border-radius:4px;padding:4px 10px;cursor:pointer}
#texts .tbody{overflow:auto;min-height:0;padding:4px 28px 60px}
#texts .tgroup{padding:18px 0 10px;border-bottom:1px solid var(--line)}
#texts .tgroup h3{margin:0 0 8px;font:400 18px 'Instrument Serif',Georgia,serif}
#texts .tgroup.here h3{color:#8a6a00}
#texts .trow{display:grid;grid-template-columns:minmax(120px,190px) minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start;padding:5px 0;border-top:1px solid #ecebe6}
#texts .tname{font-size:10.5px;letter-spacing:.06em;color:var(--mute);padding-top:7px;word-break:break-word}
#texts .tcell{position:relative;display:block}
#texts .tlang{position:absolute;left:8px;top:7px;font-size:9.5px;letter-spacing:.12em;color:#b5b5b0;pointer-events:none}
#texts textarea{width:100%;box-sizing:border-box;resize:none;overflow:hidden;font:inherit;font-size:13px;line-height:1.45;padding:5px 10px 5px 32px;border:1px solid transparent;border-radius:4px;background:#fff;color:#2a2a28;min-height:30px}
#texts textarea:focus{outline:none;border-color:#e6d68c}
#texts .tcell.edited textarea{box-shadow:inset 3px 0 0 var(--gold)}
#texts .tback{position:absolute;right:6px;top:5px;display:none;font-size:9.5px;padding:1px 6px;background:#fff;color:#b58a00;border-color:#efe3b0}
#texts .tcell.edited:hover .tback{display:block}
@media (max-width:760px){#texts .trow{grid-template-columns:1fr}#texts header{flex-wrap:wrap}#texts header .q{width:100%}}
/* F4 Changes: every saved change, newest first (admin.js); dressed like the texts table */
#changes{position:fixed;inset:0;right:var(--admin-w,0px);background:#f6f5f1;z-index:26;display:none;grid-template-rows:auto 1fr;color:#2a2a28;font-size:13px}
body:not(.admin) #changes{right:0}
#changes.open{display:grid}
#changes header{display:flex;align-items:baseline;gap:18px;padding:16px 28px 12px;border-bottom:1px solid var(--line);flex-wrap:wrap}
#changes header b{font:400 20px 'Instrument Serif',Georgia,serif;letter-spacing:.02em}
#changes header span{flex:1;min-width:260px;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mute)}
#changes header input{font:inherit;font-size:13px;letter-spacing:0;text-transform:none;width:200px;padding:5px 10px;border:1px solid var(--line);border-radius:4px;background:#fff;color:#2a2a28}
/* one person's changes (2026-11-10): Everyone, the names with the most changes, Others */
#changes .cpeople{flex-basis:100%;display:flex;gap:6px;flex-wrap:wrap}
#changes .cpeople button{font:inherit;font-size:12px;padding:3px 11px;border:1px solid var(--line);border-radius:999px;background:#fff;color:#2a2a28;cursor:pointer;white-space:pre;text-transform:none;letter-spacing:0}
#changes .cpeople button.on{background:var(--ink);border-color:var(--ink);color:#fbfbf9}
#changes button{font:inherit;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#2a2a28;background:none;border:1px solid var(--line);border-radius:4px;padding:4px 10px;cursor:pointer}
#changes button:disabled{color:#c4c4bf;cursor:default}
#changes .tbody{overflow:auto;min-height:0;padding:4px 28px 60px}
#changes h3{margin:18px 0 6px;font:400 18px 'Instrument Serif',Georgia,serif}
#changes .crow{display:grid;grid-template-columns:130px minmax(140px,1.1fr) minmax(0,1fr) minmax(0,1fr) auto;gap:12px;align-items:start;padding:7px 0;border-top:1px solid #ecebe6}
#changes .cwhen{font-size:11px;color:var(--mute);white-space:pre}
#changes .cwhere{font-size:10.5px;letter-spacing:.06em;color:var(--mute);word-break:break-word}
#changes .cold,#changes .cnew{white-space:pre-wrap;word-break:break-word;line-height:1.45}
#changes .cold{color:#9a9a95;text-decoration:line-through;text-decoration-color:#d8d8d2}
#changes .none{color:var(--mute)}
@media (max-width:760px){#changes .crow{grid-template-columns:1fr}#changes header input{width:100%}}
/* what a save had to say: whose words it replaced, others' words that came in, a save that did not go up */
#saveNote{position:fixed;left:20px;bottom:20px;z-index:40;max-width:420px;padding:10px 14px;border-radius:6px;background:#2a2a28;color:#f6f5f1;font-size:12.5px;line-height:1.45;box-shadow:0 6px 24px rgba(0,0,0,.18);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .3s,transform .3s;cursor:pointer}
#saveNote.on{opacity:1;transform:none;pointer-events:auto}
/* History: only what changed, struck out and in gold; ↵ is a new line */
#changes .crow{grid-template-columns:150px minmax(140px,.8fr) minmax(0,2fr) auto}
.cdiff{line-height:1.5;word-break:break-word;color:#5d5d58}
.cdiff del{color:#b0453a;text-decoration:line-through;text-decoration-color:rgba(176,69,58,.5);background:rgba(176,69,58,.07)}
.cdiff ins{color:#2a2a28;text-decoration:none;background:rgba(255,204,0,.28);border-radius:2px}
.cdiff i{font-style:normal;color:#a6a6a2;font-size:11px}
.cacts{display:flex;flex-direction:column;gap:4px;align-items:stretch}
#changes .cacts .cfrom{color:#8a8a85;border-style:dashed}
/* where a change or a sign-in came from (device · browser · address), under its time; the time's tooltip has the rest */
#changes .cfromdev{display:block;margin-top:2px;font-size:10.5px;color:#a6a6a2;white-space:normal;word-break:break-word}
#changes .cwhen[title]{cursor:help}
#changes .cev .cwhere{color:#2a2a28;letter-spacing:.02em}
#changes .cev .cdiff.cfromdev{margin:0;font-size:11px}
#changes .cev.bad .cwhere{color:#b0453a}
#changes .cme{align-self:center;margin-left:auto;font-size:11px;color:var(--mute);text-transform:none;letter-spacing:0;flex:0 0 auto;min-width:0}
#changes .cmore{display:block;margin:22px auto 0}
/* the panel's own history, in its foot: the latest changes, a click opens the whole list */
#recent{display:flex;flex-direction:column;max-height:220px;overflow:auto;border:1px solid var(--line);border-radius:4px;background:#fff;letter-spacing:0;text-transform:none;font-size:11.5px}
#recent:empty{display:none}
#recent .crow{display:block;padding:6px 9px;border-top:1px solid #f0efea;cursor:pointer}
#recent .crow:first-child{border-top:0}
#recent .crow:hover{background:#faf9f4}
#recent .cwhen{display:inline;color:#8a8a85;font-size:10.5px;white-space:pre}
#recent .cwhere{display:inline;color:#a6a6a2;font-size:10.5px;margin-left:6px}
#recent .cdiff{margin-top:2px;font-size:11.5px;max-height:3em;overflow:hidden}
#recent .none{color:var(--mute);padding:6px 9px}
/* the editors' password: a real sign-in form, so the browser offers to keep it (admin.js keyForm) */
#lapaKey{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:rgba(22,22,22,.22)}
#lapaKey form{width:min(320px,calc(100vw - 40px));display:flex;flex-direction:column;gap:9px;padding:20px 20px 16px;background:#fbfbf9;border:1px solid var(--line);border-radius:6px;box-shadow:0 12px 40px rgba(0,0,0,.16);font:400 13px/1.45 Inter,system-ui,sans-serif;color:#2a2a28}
#lapaKey label{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--mute)}
#lapaKey input{font:inherit;color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:4px;padding:8px 10px;width:100%;box-sizing:border-box;outline:none}
#lapaKey input:focus{border-color:var(--gold)}
#lapaKey .m{margin:0;min-height:1.45em;font-size:12px;color:#b0453a}
#lapaKey .b{display:flex;justify-content:flex-end;gap:8px}
#lapaKey button{font:inherit;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#2a2a28;background:none;border:1px solid var(--line);border-radius:4px;padding:6px 14px;cursor:pointer}
#lapaKey button[type=submit]{background:#161616;border-color:#161616;color:#f6f6f4}
#lapaKey button:disabled{opacity:.5;cursor:default}
