/* ✒️ Jaan · Pabsa on the server (V1-1b, MUST-DO §5 N60): name chip, 🕘 history panel, dialogs, conflict notice, my boards. Portal tokens → light + dark. */
/* a colour per person: 10 mid-tones that keep 3:1 on white and on the dark page (dark mode lightens them); the name is always written next to the dot */
.jp-c0 { --jc: #e11d48; } .jp-c1 { --jc: #ea580c; } .jp-c2 { --jc: #ca8a04; } .jp-c3 { --jc: #16a34a; } .jp-c4 { --jc: #0d9488; }
.jp-c5 { --jc: #0284c7; } .jp-c6 { --jc: #4f46e5; } .jp-c7 { --jc: #9333ea; } .jp-c8 { --jc: #c026d3; } .jp-c9 { --jc: #65a30d; }
.jp-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--jc, #888); margin-right: 5px; vertical-align: baseline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .jp-dot { background: color-mix(in srgb, var(--jc, #888) 62%, #fff); } }
:root[data-theme="dark"] .jp-dot { background: color-mix(in srgb, var(--jc, #888) 62%, #fff); }

/* status bar items */
.jp-chip, .jp-histbtn { display: inline-flex; align-items: center; white-space: nowrap; }
.jp-chip { font: inherit; font-size: 12.5px; color: var(--lt-text, var(--text, #1a1a1a)); }
.jp-chip b { font-weight: 600; margin: 0 2px; }
button.jp-chip { cursor: pointer; border: 1px solid transparent; border-radius: 6px; padding: 3px 8px; background: none; }
button.jp-chip:hover { background: color-mix(in srgb, var(--lt-text, #1a1a1a) 8%, transparent); }
.jp-state { font-size: 12.5px; color: var(--lt-muted, var(--muted, #6b7280)); }
.jp-state.bad { color: var(--lt-red, var(--red, #B11F24)); font-weight: 600; }

/* dialogs */
.jp-modal { position: fixed; inset: 0; z-index: 2200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.jp-modal[hidden] { display: none; }
.jp-dlg { position: relative; box-sizing: border-box; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg, #fff); color: var(--text, #1a1a1a); border: 1px solid var(--line, #e5e5e5);
  border-radius: 14px; padding: 18px 20px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3); }
.jp-dlg--w { width: min(520px, 100%); }
.jp-dlg h2 { margin: 0 28px 8px 0; font-size: 18px; line-height: 1.4; }
.jp-dlg__p { margin: 0 0 12px; font-size: 14.5px; color: var(--muted, #6b7280); line-height: 1.6; }
.jp-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted, #6b7280); font-size: 16px; cursor: pointer; }
.jp-x:hover { background: var(--red-soft, rgba(177, 31, 36, .08)); color: var(--text, #1a1a1a); }
.jp-inp { font: inherit; box-sizing: border-box; width: 100%; border: 1px solid var(--line, #e5e5e5); border-radius: 10px; padding: 9px 12px; background: var(--bg, #fff); color: var(--text, #1a1a1a); }
.jp-inp:focus { outline: 2px solid var(--red, #B11F24); outline-offset: 1px; }
.jp-inp--pin { width: 11em; letter-spacing: .2em; }
.jp-form { display: flex; flex-direction: column; gap: 8px; }
.jp-modes { border: 0; padding: 0; margin: 2px 0; display: flex; flex-direction: column; gap: 6px; }
.jp-modes legend { font-weight: 600; font-size: 14.5px; padding: 0; margin-bottom: 4px; }
.jp-modes label { font-size: 14.5px; cursor: pointer; }
.jp-modes small, .jp-lbl small { color: var(--muted, #6b7280); font-weight: 400; }
.jp-lbl { font-weight: 600; font-size: 14.5px; }
.jp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.jp-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.jp-btn { font: inherit; font-size: 14.5px; border: 1px solid var(--line, #e5e5e5); background: var(--bg, #fff); color: var(--text, #1a1a1a); border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.jp-btn:hover { border-color: var(--red, #B11F24); }
.jp-btn--main { background: var(--red, #B11F24); border-color: var(--red, #B11F24); color: #fff; font-weight: 700; }
.jp-btn--q { padding: 3px 12px; font-size: 13px; color: var(--muted, #6b7280); }
.jp-btn:disabled { opacity: .6; cursor: default; }
.jp-btn:focus-visible, .jp-x:focus-visible, .jp-hi:focus-visible { outline: 2px solid var(--red, #B11F24); outline-offset: 2px; }
.jp-msg { min-height: 1.2em; margin: 4px 0 0; font-size: 13.5px; color: var(--muted, #6b7280); }
.jp-msg.bad { color: var(--red, #B11F24); }

/* 🕘 history */
.jp-hist { box-sizing: border-box; margin: 10px 0; border: 1px solid var(--line, #e5e5e5); border-radius: 12px; background: var(--bg, #fff); color: var(--text, #1a1a1a); overflow: hidden; }
.jp-hist[hidden] { display: none; }
.jp-hist__h { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line, #e5e5e5); background: var(--surface, #f7f7f7); font-size: 14.5px; }
.jp-hist__g { display: grid; grid-template-columns: minmax(200px, 38%) 1fr; max-height: 380px; }
.jp-hist__l { list-style: none; margin: 0; padding: 4px; overflow: auto; border-right: 1px solid var(--line, #e5e5e5); }
.jp-hist__l li { margin: 0; }
.jp-hist__l li.on > .jp-hi { background: var(--red-soft, rgba(177, 31, 36, .08)); }
.jp-hist__e { padding: 10px; color: var(--muted, #6b7280); font-size: 14px; }
.jp-hi { display: block; width: 100%; text-align: left; font: inherit; border: 0; background: none; color: inherit; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.jp-hi:hover { background: color-mix(in srgb, var(--text, #1a1a1a) 6%, transparent); }
.jp-hi__t { display: block; font-size: 13.5px; font-weight: 600; }
.jp-who { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 6px; font-size: 13px; }
.jp-who em { font-style: normal; font-size: 11.5px; border: 1px solid var(--line, #e5e5e5); border-radius: 999px; padding: 0 7px; color: var(--muted, #6b7280); }
.jp-hi__p { display: block; font-size: 12.5px; color: var(--muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-badge { font-style: normal; font-size: 11px; font-weight: 400; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--red-soft, rgba(177, 31, 36, .1)); color: var(--red, #B11F24); }
.jp-badge--s { background: color-mix(in srgb, var(--muted, #6b7280) 16%, transparent); color: var(--muted, #6b7280); }
.jp-hist__v { padding: 10px 14px; overflow: auto; min-width: 0; }
.jp-pv__h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; font-size: 13px; color: var(--muted, #6b7280); }
.jp-prev { border: 1px solid var(--line, #e5e5e5); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; max-height: 190px; overflow: auto; font-family: var(--lt-font); font-size: var(--lt-size); line-height: var(--lt-lh); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface, var(--bg, #fff)); }
.jp-prev .lt-ln, .jp-prev .lt-multi { font-family: 'Tilok', sans-serif; color: var(--lt-ln-color); font-size: calc(var(--lt-ln-scale) * 1em); line-height: 1; padding: 0 1px; }
.jp-prev .lt-raw { color: var(--lt-raw-c); }
.jp-prev .lt-u { border-bottom: 1px dashed var(--muted, #6b7280); }
@media (max-width: 600px) {
  .jp-hist__g { grid-template-columns: 1fr; max-height: none; }
  .jp-hist__l { max-height: 200px; border-right: 0; border-bottom: 1px solid var(--line, #e5e5e5); }
  .jp-hist__v { max-height: 340px; }
  .jp-dlg { padding: 16px; }
}

/* conflict notice */
.jp-conflict { box-sizing: border-box; margin: 10px 0; border: 1px solid var(--red, #B11F24); border-left-width: 5px; border-radius: 10px; padding: 10px 14px; background: var(--red-soft, rgba(177, 31, 36, .08)); color: var(--text, #1a1a1a); font-size: 14.5px; line-height: 1.6; }
.jp-conflict[hidden] { display: none; }
.jp-conflict p { margin: 2px 0 8px; color: var(--muted, #6b7280); font-size: 13.5px; }
.jp-conflict .jp-row { margin-top: 4px; }

/* กระดานของฉัน (เครื่องนี้) on /board/ */
.bd__mine { margin: 26px 0 0; border-top: 1px solid var(--line, #e5e5e5); padding-top: 16px; }
.bd__mine h2 { font-size: 17px; margin: 0 0 8px; } .bd__mine h2 small { font-weight: 400; color: var(--muted, #6b7280); }
.bd__mine ul { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bd__mine li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 7px 10px; border-radius: 10px; }
.bd__mine li:hover { background: color-mix(in srgb, var(--text, #1a1a1a) 5%, transparent); }
.bd__mine a { color: var(--red, #B11F24); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; } .bd__mine a:hover { text-decoration: underline; }
.bd__mine time { font-size: 13px; color: var(--muted, #6b7280); }
