/* Samuel's Jargon: search bar, week timeline, term cards that open into the article */
.jg [hidden] { display: none !important; }
.jg { --card: #fffdf8; --card-open: #fffdf8; --exbg: #ede3cb; max-width: 44rem; width: 100%; display: grid; gap: 1.6rem; justify-items: stretch; }
.jg button, .jg input, .jg textarea { font: inherit; color: inherit; }
.jg-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: .6rem 0; border-bottom: 1px solid var(--line); }
#jgQ { flex: 1; min-width: 10rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card-open); }
.jg-who { white-space: nowrap; color: var(--soft); font-size: 1rem; display: flex; gap: .5rem; align-items: center; }
.jg-btn { background: none; border: 1px solid var(--line); border-radius: 6px; padding: .25rem .75rem; cursor: pointer; color: var(--mark); font-size: 1rem; text-decoration: none; display: inline-block; }
.jg-btn:hover { border-color: var(--mark); }
.jg-btn.solid { background: var(--mark); border-color: var(--mark); color: var(--card-open); }
.jg-btn.danger { color: #8b2f1c; }
.jg-form { display: flex; gap: .5rem; flex-wrap: wrap; width: 100%; }
.jg-form input[type=text], .jg-form input[type=password], .jg-form input:not([type]) { flex: 1; min-width: 10rem; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card-open); }
.jg-err { width: 100%; color: #8b2f1c; font-size: .95rem; }
.jg-admin { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; font-size: 1rem; color: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; background: var(--band); }
.jg-admin input[type=date] { padding: .15rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card-open); }
.jg-week { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; }
.jg-date { font-family: "IM Fell English SC", var(--serif); color: var(--soft); font-size: 1rem; padding: .9rem 1rem 0 0; text-align: right; border-right: 1px solid var(--line); line-height: 1.3; }
.jg-date small { display: block; font-size: .85rem; }
.jg-cards { display: grid; gap: .7rem; min-width: 0; }
@media (max-width: 560px) { .jg-week { grid-template-columns: 1fr; gap: .4rem; } .jg-date { text-align: left; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 .3rem; } }
.jg-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-width: 0; scroll-margin-top: 4.5rem; }
.jg-card[open] { border-color: var(--soft); }
.jg-card > summary { list-style: none; cursor: pointer; padding: 0; display: flex; gap: 0; align-items: stretch; }
.jg-card > summary > * { align-self: center; }
.jg-card > summary > .jg-t { padding: .85rem 0 .85rem 1.1rem; }
.jg-card > summary > .jg-chev { padding: 0 .9rem; }
.jg-card > summary > .jg-thumb { margin-left: 1.1rem; }
.jg-card > summary::-webkit-details-marker { display: none; }
.jg-t { flex: 1; min-width: 0; }
.jg-card > summary > .jg-cex { flex: 0 0 45%; align-self: stretch; display: flex; align-items: center; overflow: hidden; border-radius: 0 7px 7px 0; }
.jg-cex svg { display: block; width: 100%; height: auto; }
.jg-ex svg > rect:first-of-type, .jg-cex svg > rect:first-of-type { fill: transparent !important; }
.jg-cex, .jg-ex.jg-done svg { background: var(--exbg); }
.jg-ex.jg-done svg { border-radius: 6px; width: 100%; }
.jg-offstage { position: absolute; left: -10000px; top: 0; width: 42rem; }
.jg-card h2 { margin: 0; font-size: 1.45rem; letter-spacing: .02em; line-height: 1.2; text-align: left; }
.jg-d { margin: .15rem 0 0; color: var(--soft); font-size: 1rem; }
.jg-thumb { width: 5.5rem; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); flex: none; max-width: 30%; }
.jg-chev { color: var(--soft); transition: transform .2s; }
.jg-card[open] .jg-chev { transform: rotate(90deg); }
.jg-tag { font-size: .78rem; border: 1px dashed var(--line); border-radius: 999px; padding: 0 .5rem; color: var(--soft); white-space: nowrap; }
.jg-art { padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--line); }
.jg-art h3 { font-family: "IM Fell English SC", var(--serif); color: var(--mark); font-size: 1.05rem; letter-spacing: .04em; margin: 1.1rem 0 .2rem; text-align: left; }
.jg-art p { margin: 0 0 .5rem; text-align: left; }
.jg-art .jg-img { display: block; max-width: 100%; border-radius: 4px; border: 1px solid var(--line); margin: .3rem 0; }
.jg-field { white-space: pre-wrap; min-height: 1.6em; outline: 1px dashed var(--mark); outline-offset: 3px; border-radius: 2px; padding: 0 .1rem; }
.jg-field:focus { outline-style: solid; }
.jg-field.jg-sug { color: #b5a993; }
.jg-in { width: 100%; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: 1rem; }
.jg-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; font-size: 1rem; color: var(--soft); }
.jg-chip { border: 1px solid var(--line); border-radius: 999px; padding: .05rem .6rem; background: var(--bg); cursor: pointer; font-size: .92rem; }
.jg-chip.on { background: var(--mark); color: var(--card-open); border-color: var(--mark); }
.jg-chip .x { border: 0; background: none; cursor: pointer; color: var(--soft); padding: 0 0 0 .2rem; }
.jg-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.jg-none { color: var(--soft); text-align: center; }
.jg-toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .5rem 1rem; border-radius: 6px; font-size: .95rem; max-width: calc(100% - 32px); z-index: 20; }
.jg-file { display: none; }
@media (prefers-reduced-motion: reduce) { .jg-chev { transition: none; } }

/* comments */
.jg-com { border-top: 1px solid var(--line); padding: .6rem 0 .2rem; }
.jg-com:first-child { border-top: 0; }
.jg-com-h { font-size: .95rem; color: var(--soft); display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.jg-com-h b { color: var(--text); font-weight: normal; font-family: "IM Fell English SC", var(--serif); }
.jg-com p { margin: .1rem 0 .3rem; }
.jg-reply { margin-left: 1.4rem; border-top: 0; border-left: 2px solid var(--line); padding: .2rem 0 .2rem .8rem; }
.jg-cform { display: grid; gap: .45rem; margin-top: .6rem; justify-items: start; }
.jg-cform input, .jg-cform textarea { width: 100%; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: 1rem; resize: vertical; }
.jg-replyform { margin: .2rem 0 .4rem 1.4rem; }
.jg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.jg-link { background: none; border: 0; padding: 0; color: var(--mark); cursor: pointer; font-size: .9rem; text-decoration: underline; }

/* sections fold from their title */
.jg-sec > summary { list-style: none; cursor: pointer; }
.jg-sec > summary::-webkit-details-marker { display: none; }
.jg-sec > summary h3::after { content: " ▾"; font-size: .8em; color: var(--soft); }
.jg-sec:not([open]) > summary h3::after { content: " ▸"; }
.jg-ex { position: relative; margin: .4rem 0; min-height: 3rem; }
.jg-ex .jg-cb { position: absolute; left: -10000px; top: 0; width: 100%; height: 900px; border: 0; }
.jg-ex svg { display: block; height: auto; max-width: 100%; }

/* requested terms */
.jg-req { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.jg-req-h { font-size: 1.5rem; margin: 0 0 .6rem; text-align: left; }
.jg-req-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .5rem; }
.jg-req-list li { background: var(--card); border-radius: 6px; padding: .5rem .9rem; }
.jg-req-list p { margin: .1rem 0 0; font-size: 1rem; }
.jg-soft { color: var(--soft); }
.jg-req .jg-row .jg-link { margin-right: 1rem; }

/* the board */
.jg-board { position: fixed; right: calc(1rem + env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 30; background: var(--card-open); border: 1px solid var(--soft); border-radius: 10px; box-shadow: 0 4px 18px rgba(59,49,37,.18); max-width: min(20rem, calc(100vw - 2rem)); }
.jg-board-tab { background: none; border: 0; cursor: pointer; padding: .5rem .9rem; font: inherit; color: var(--text); display: flex; gap: .5rem; align-items: center; }
.jg-board-tab span { background: var(--mark); color: var(--card-open); border-radius: 999px; min-width: 1.5em; padding: 0 .4em; font-size: .9rem; text-align: center; }
.jg-board-body { display: none; padding: 0 .9rem .8rem; max-height: 50vh; overflow: auto; }
.jg-board.open .jg-board-body { display: block; }
.jg-board-item { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding: .3rem 0; font-size: 1rem; }
.jg-board-item > span { display: flex; gap: .3rem; align-items: center; flex: none; }
.jg-mini { font-size: .85rem; padding: .05rem .5rem; }
.jg-board-item .x { border: 0; background: none; cursor: pointer; color: var(--soft); font-size: 1.1rem; }
.jg-board.flash { animation: jgflash .6s; }
@keyframes jgflash { 40% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .jg-board.flash { animation: none; } }
.jg-print { display: none; }

/* printing the board: only the sheets, two columns of clean cards on A4 */
@page { size: A4; margin: 12mm; }
@media print {
  body.jg-printing > *:not(main), body.jg-printing main > *:not(.jg), body.jg-printing .jg > *:not(.jg-print) { display: none !important; }
  body.jg-printing main { display: block; padding: 0; max-width: none; }
  body.jg-printing .jg { display: block; max-width: none; }
  body.jg-printing { background: #fff; font-size: 10.5pt; }
  body.jg-printing .jg-print { display: block; columns: 2; column-gap: 8mm; }
  .ps-card { break-inside: avoid; border: .4pt solid #b9ab92; border-radius: 3mm; padding: 4mm 5mm; margin: 0 0 6mm; background: #fff; }
  .ps-card h2 { font-size: 16pt; margin: 0 0 1mm; text-align: left; }
  .ps-card h3 { font-family: "IM Fell English SC", serif; font-weight: 400; color: #6b4a29; font-size: 9.5pt; letter-spacing: .04em; margin: 3mm 0 .5mm; text-align: left; }
  .ps-card p { margin: 0 0 1.5mm; text-align: left; line-height: 1.35; }
  .ps-syn { font-style: italic; color: #5c5040; }
  .ps-link { font-size: 8.5pt; word-break: break-all; color: #5c5040; }
  .ps-ex svg, .ps-img { display: block; width: 100%; height: auto; }
  .ps-ex svg > rect:first-of-type { fill: transparent !important; }
}
