:root { --bg:#fbfaf7; --ink:#1d1d1b; --muted:#6b6b66; --line:#dcd9d0; --acc:#2456a6;
  --wk:#fde7a8; --dt:#cfe6ff; --ck:#d9f2d0; --sel:#ffe2e2; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--ink);
  font: 15px/1.45 -apple-system, "Segoe UI", system-ui, sans-serif; }
[hidden] { display:none !important; }
button { font:inherit; padding:3px 10px; border:1px solid var(--line); background:#fff; border-radius:4px; cursor:pointer; }
button:hover { border-color:var(--acc); }
button.primary { background:var(--acc); color:#fff; border-color:var(--acc); }
input, select, textarea { font:inherit; width:100%; padding:3px 5px; border:1px solid var(--line); border-radius:3px; background:#fff; }
.muted { color:var(--muted); }
.err { color:#b3261e; white-space:pre-line; margin:4px 0; }
.tag { font-size:12px; padding:1px 6px; border-radius:8px; background:#eee; }
.tag.practice { background:#fde7a8; }

#login, #finished { max-width:380px; margin:12vh auto; }
#login form { display:grid; gap:10px; }

#main { display:flex; flex-direction:column; height:100vh; }
header { display:flex; gap:20px; align-items:center; padding:6px 14px; border-bottom:1px solid var(--line); background:#fff; }
header .clock { margin-left:auto; }
header nav { display:flex; gap:8px; align-items:center; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; background:#bbb; margin-right:4px; }
.dot.on { background:#2e9d4a; }

.panes { flex:1; display:grid; grid-template-columns: 1fr 460px; min-height:0; }
#text { overflow:auto; padding:18px 26px; font: 16.5px/1.6 Georgia, "Times New Roman", serif; white-space:pre-wrap; border-right:1px solid var(--line); }
#text ::selection { background:#b9d2ff; }
/* the coder's own highlights: name, what they were doing, the day */
#text .m { cursor:pointer; border-radius:2px; }
#text .m-doing { background:var(--wk); }
#text .m-day { background:var(--dt); }
#text .m-witness { box-shadow: inset 0 -3px 0 #7a5c2e; }
#text .m-doing.m-day { background:linear-gradient(var(--wk) 50%, var(--dt) 50%); }
#text .m.on { outline:2px solid var(--acc); outline-offset:1px; }

#selbar { position:fixed; z-index:30; display:flex; gap:4px; padding:5px; background:#1d1d1b; border-radius:7px; box-shadow:0 6px 24px #0005; }
#selbar button { border:0; padding:5px 10px; font-size:14px; }
#selbar button.next { font-weight:700; box-shadow:0 0 0 2px #fff, 0 0 0 4px var(--acc); }
#selbar kbd { font:11px/1 ui-monospace, monospace; padding:1px 4px; border:1px solid #0003; border-radius:3px; margin-right:3px; background:#fff8; }
.k-witness { background:#ead9bd; } .k-doing { background:var(--wk); } .k-day { background:var(--dt); }
.key { font-size:12px; padding:1px 6px; border-radius:3px; white-space:nowrap; }

#coding { overflow:auto; padding:10px 12px; background:#f4f2ec; }
.how { margin:0 0 8px; font-size:13px; }
.witnesses { display:flex; flex-wrap:wrap; gap:5px; align-items:center; margin-bottom:8px; }
.witnesses .w { background:#7a5c2e; color:#fff; border:0; }
.mark { background:#fff; border:1px solid var(--line); border-radius:5px; padding:6px 8px 4px; margin-bottom:8px; cursor:pointer; }
.mark.active { border-color:var(--acc); box-shadow:0 0 0 2px #2456a633; }
.mhead { display:flex; gap:6px; align-items:center; margin-bottom:4px; }
.mhead .spacer, .spacer { flex:1; }
.mhead button { font-size:12px; padding:1px 7px; }
.slot { display:flex; gap:7px; align-items:baseline; padding:3px 6px; border-radius:4px; margin:3px 0; background:#f6f4ee; }
.slot.k-witness:not(.todo) { background:#ead9bd; } .slot.k-doing:not(.todo) { background:var(--wk); } .slot.k-day:not(.todo) { background:var(--dt); }
.slot.todo { background:#fff; border:1px dashed var(--line); }
.slot .lab { font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); min-width:52px; }
.slot q { flex:1; font: 14px/1.4 Georgia, serif; quotes:"“" "”"; }
.slot i { flex:1; }
button.x { border:0; background:none; color:var(--muted); padding:0 4px; font-size:12px; }
button.x:hover { color:#b3261e; }
.what, .wd { display:flex; flex-wrap:wrap; gap:5px; align-items:center; margin:5px 0; }
.what button { flex:1; padding:6px 4px; white-space:nowrap; }
.wd button { padding:2px 7px; font-size:13px; }
.wd span { font-size:12px; }
button.sel { background:var(--acc); color:#fff; border-color:var(--acc); font-weight:600; }
.read { font-size:12.5px; color:var(--muted); margin-top:2px; }
.read.warn { color:#b3261e; }
label.chk { display:flex; align-items:center; gap:6px; font-size:13px; margin:3px 0; }
label.chk input { width:auto; }
label.chk.unsure { color:var(--muted); }
.trialbox { border-top:1px solid var(--line); padding-top:8px; }
.trialbox .none { display:flex; gap:6px; align-items:center; margin-bottom:6px; }
.trialbox .none input { width:auto; }
.actions { display:flex; gap:8px; justify-content:flex-end; align-items:center; margin-top:6px; }
.actions #saved { margin-right:auto; font-size:12.5px; }

dialog { max-height:80vh; overflow:auto; min-width:420px; }
#listBody table { border-collapse:collapse; width:100%; }
#listBody td { padding:2px 8px; border-bottom:1px solid #eee; }
#listBody a { cursor:pointer; color:var(--acc); }

/* definitions on hover */
.tip { display:inline-block; color:var(--acc); cursor:help; font-size:12px; margin-left:2px; }
#tipbox { position:fixed; z-index:50; max-width:420px; background:#1d1d1b; color:#fff; font-size:13px; line-height:1.45;
  padding:8px 11px; border-radius:6px; box-shadow:0 6px 24px #0004; pointer-events:none; }
#tipbox b { color:#ffe08a; } #tipbox p { margin:0 0 5px; } #tipbox p:last-child { margin:0; }

/* tutorial */
#tour { position:fixed; inset:0; z-index:40; background:#0006; }
#tourCard { position:fixed; z-index:45; width:min(560px, 92vw); max-height:86vh; overflow:auto; background:#fff;
  border-radius:8px; padding:16px 18px 12px; box-shadow:0 10px 40px #0005; font-size:14.5px; }
#tourCard h2 { font-size:18px; margin:0 0 8px; }
#tourCard p, #tourCard li { margin:0 0 7px; }
#tourCard table { border-collapse:collapse; font-size:12.5px; width:100%; margin:6px 0; }
#tourCard .ex .m-witness { box-shadow: inset 0 -3px 0 #7a5c2e; } #tourCard .ex .m-doing { background:var(--wk); } #tourCard .ex .m-day { background:var(--dt); }
#tourCard td, #tourCard th { border:1px solid var(--line); padding:3px 5px; text-align:left; vertical-align:top; }
#tourCard .ex { font: 14px/1.5 Georgia, serif; background:#fbfaf7; border-left:3px solid #7a5c2e; padding:6px 10px; margin:6px 0; }
.tourNav { display:flex; gap:6px; align-items:center; margin-top:10px; }
.tourNav .spacer { flex:1; }
.tour-focus { position:relative; z-index:41 !important; outline:3px solid #ffd54a; outline-offset:2px; border-radius:4px; background:#fff; }
#text:focus { outline:none; }
.slot button { white-space:nowrap; }
.usedays { margin:2px 0 4px 6px; display:flex; flex-wrap:wrap; gap:5px; align-items:baseline; }
