/* 📝 กระดาน (Board) — plan/board/plan.md, MUST-DO §5 N53. Uses the portal tokens (light + dark). */
.bd { max-width: 860px; margin: 0 auto 40px; }
.bd__head h1 { margin: 4px 0 6px; font-size: clamp(24px, 4.5vw, 32px); line-height: 1.35; overflow-wrap: anywhere; }
.bd__meta { margin: 0; font-size: 13.5px; color: var(--muted); }
.bd__meta a { color: var(--red); text-decoration: none; }
.bd__label { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
.bd__label a { color: var(--muted); }
.bd__body { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--surface, var(--bg)); font-family: var(--lt-font); font-size: var(--lt-size); line-height: var(--lt-lh);
  white-space: pre-wrap; overflow-wrap: anywhere; min-height: 120px; }
.bd__body .lt-ln, .bd__body .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; }   /* one colour on the published board (MUST-DO §5 N54) */
.bd__body .lt-u { border-bottom: 1px dashed var(--muted); }
.bd__tools, .bd__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.bd__btn { font: inherit; font-size: 14.5px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.bd__btn:hover { border-color: var(--red); }
.bd__btn--main { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.bd__btn--quiet { margin-left: auto; color: var(--muted); }
.bd__btn:disabled { opacity: .6; cursor: default; }
.bd__msg { font-size: 13.5px; color: var(--muted); }
.bd__msg.bad { color: var(--red); }
.bd__panel { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; background: var(--bg); }
.bd__panel h2 { font-size: 17px; margin: 0 0 10px; }
.bd__panel form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 0 0 14px; }
.bd__panel form:last-child { margin-bottom: 0; }
.bd__panel select, .bd__panel textarea { font: inherit; width: 100%; max-width: 480px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); color: var(--text); }
.bd__lbl { font-weight: 600; font-size: 14.5px; }
.bd__lbl small, .bd__modes small { font-weight: 400; color: var(--muted); }
.bd input[type="password"], .bd__url input { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); color: var(--text); }
.bd input[type="password"] { width: 11em; letter-spacing: .2em; }
.bd__url { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 14px; color: var(--muted); max-width: 100%; }
.bd__url input { min-width: 0; flex: 1 1 200px; }
.bd__modes { border: 0; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 6px; }
.bd__modes label { display: block; font-size: 15px; cursor: pointer; }
.bd__note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.bd__note a { color: var(--muted); }
.bd__title { font: inherit; font-size: 18px; font-weight: 600; width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 10px; background: var(--bg); color: var(--text); }
.bd__create { display: flex; flex-direction: column; gap: 8px; }
.bd__create .lt { margin-bottom: 6px; }
.bd__pin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bd__pin label { font-weight: 600; }
.bd__new { border: 1px solid var(--red); background: var(--red-soft, rgba(177, 31, 36, .08)); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: 14.5px; }
.bd__new small { color: var(--muted); }
.bd__foot { font-size: 14px; color: var(--muted); }
.bd__foot a { color: var(--red); }
.bd__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 600px) {
  .bd__body { padding: 14px; font-size: calc(var(--lt-size) - 1px); }
  .bd__btn--quiet { margin-left: 0; }
}

/* N68 · actions on the title row (top-right), ⋯ menu, edit state, pinned bar, pinned editor toolbar */
.bd__titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.bd__titlerow h1 { flex: 1 1 320px; min-width: 0; }
.bd__acts { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bd__acts .bd__tools, .bd__pinbar .bd__tools { margin: 0; flex-wrap: nowrap; }
.bd__editacts { display: none; align-items: center; gap: 8px; }
#bd.is-editing .bd__acts .bd__tools, #bd.is-editing .bd__pinbar .bd__tools { display: none; }
#bd.is-editing .bd__editacts { display: flex; }
.bd__editacts .bd__msg:empty { display: none; }
.bd__btn--icon { padding: 7px 12px; font-weight: 700; letter-spacing: 1px; }
.bd__more { position: relative; }
.bd__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 190px; display: flex; flex-direction: column; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); }
.bd__menu[hidden] { display: none; }
.bd__menu button { font: inherit; font-size: 14.5px; text-align: left; border: 0; background: none; color: var(--text); padding: 9px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.bd__menu button:hover, .bd__menu button:focus-visible { background: var(--surface, rgba(0, 0, 0, .05)); outline: none; }
.bd__pinbar { position: fixed; left: 0; right: 0; top: 0; z-index: 85; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
  transform: translateY(-110%); opacity: 0; visibility: hidden; transition: transform .18s ease, opacity .18s ease, visibility 0s .18s; }
.bd__pinbar.on { transform: none; opacity: 1; visibility: visible; transition: transform .18s ease, opacity .18s ease; }
.bd__pinin { max-width: 860px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.bd__pintitle { flex: 1; min-width: 0; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd__pinbar .bd__btn { padding: 5px 12px; font-size: 14px; }
#bd.is-editing .lt-bar { position: sticky; top: var(--bd-top, 0px); z-index: 60; }   /* the editor toolbar stays on screen on long boards */
@media (max-width: 600px) {
  .bd__titlerow { flex-direction: column; gap: 4px; }
  .bd__titlerow h1 { flex: none; }
  .bd__acts { align-self: flex-end; margin-top: 0; }
  .bd__tools .bd__btn:not(.bd__btn--main) .bd__l, .bd__pinbar .bd__l { display: none; }      /* phones: icons, keep the main label */
  .bd__pinin { padding: 6px 12px; gap: 8px; }
  .bd__editacts .bd__msg { display: none; }
}

/* N69 · PIN: a compact pop-up under the 🔑 button, and a compact card on the 🔒 private page */
.bd__pop { position: absolute; z-index: 95; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); padding: 12px 14px 10px; box-sizing: border-box; }
.bd__pop[hidden] { display: none; }
.bd__pophd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: 15px; }
.bd__x { font: inherit; font-size: 14px; border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.bd__x:hover { background: var(--surface, rgba(0, 0, 0, .06)); color: var(--text); }
.bd__pinrow { display: flex; gap: 8px; align-items: stretch; margin: 0; }
.bd input.bd__pinin { flex: 1; min-width: 0; width: auto; font-size: 20px; letter-spacing: .45em; text-align: center; padding: 8px 10px; border-radius: 10px; }
.bd input.bd__pinin::placeholder { letter-spacing: .3em; color: var(--muted); opacity: .7; }
.bd input.bd__pinin:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft, rgba(177, 31, 36, .12)); }
.bd input.bd__pinin:disabled { opacity: .55; }
.bd__pinrow .bd__btn { padding: 8px 16px; }
.bd__pinmsg { display: block; margin: 8px 2px 0; font-size: 12.5px; }
.bd input.bd__pinin.shake { animation: bdshake .35s; border-color: var(--red); }
@keyframes bdshake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.bd__lockcard { max-width: 380px; margin: 56px auto 40px; padding: 22px 22px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface, var(--bg)); text-align: center; }
.bd__lockcard h1 { font-size: 22px; margin: 0 0 6px; }
.bd__lockcard p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.bd__lockcard .bd__pinmsg { margin: 10px 0 0; }
@media (max-width: 600px) { .bd__lockcard { margin-top: 28px; } }
.bd__head { padding-top: 22px; }   /* breathing room under the section bar (2026-10-16) */
/* N80 (M2-1): "started from …" note above the create form, with the draft question when a draft exists */
.bd__start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; background: var(--surface, var(--bg)); font-size: 15px; }
.bd__start[hidden] { display: none; }
.bd__start > span:first-child { flex: 1; min-width: 12em; }
.bd__startacts { display: flex; flex-wrap: wrap; gap: 6px; }
.bd__startbtn { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.bd__startbtn:first-child { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.bd__startx { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 2px 6px; }
/* N81 (E1): keep boards in your account */
.bd__keep { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); line-height: 1.6; }
.bd__keep[hidden] { display: none; }
.bd__keep small { color: var(--muted); }
.bd__keepacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bd__keepacts a.bd__btn { text-decoration: none; }
.bd__keepline { margin: 10px 0 0; font-size: 14.5px; }
.bd__keepline a { color: var(--red); }
.bd__claimed { border-color: #16a34a; }
/* N82 (B3): public list */
.bd__listed { display: block; margin: 10px 0 4px; font-size: 15px; line-height: 1.6; }
.bd__listed input { margin: 0 6px 0 0; vertical-align: -2px; }
.bd__listed[hidden] { display: none; }
.bd__listed small { color: var(--muted); }
.bd__pub { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.bd__pub h2 { font-size: 20px; margin: 0 0 12px; }
.bd__pubtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.bd__pubtabs button { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14.5px; cursor: pointer; }
.bd__pubtabs button.on { border-color: var(--red); color: var(--red); background: var(--red-soft, rgba(177, 31, 36, .08)); font-weight: 600; }
.bd__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bd__card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, var(--bg)); color: var(--text); text-decoration: none; min-width: 0; }
.bd__card:hover { border-color: var(--red); }
.bd__card.is-feat { border-color: #e6a23c; }
.bd__ct { font-size: 16px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd__cs { font-size: 14.5px; line-height: 1.7; color: var(--text-2, var(--text)); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.bd__cs .lanna { font-family: Tilok, var(--font); font-size: 1.35em; line-height: 1.3; color: var(--red); }
.bd__cm, .bd__cw { font-size: 13px; color: var(--muted); }
.bd__cw { margin-top: auto; }
.bd__pubempty { color: var(--muted); text-align: center; padding: 16px 0; }
.bd__pubmore { text-align: center; margin: 14px 0 0; }
.bd__pubmore button[hidden] { display: none; }
/* N83 (E3): 📋 class template */
.bd__tpl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.bd__tpl .bd__lbl { margin: 0 6px 0 0; }
.bd__tpl button { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14.5px; cursor: pointer; }
.bd__tpl button.on { border-color: var(--red); color: var(--red); background: var(--red-soft, rgba(177, 31, 36, .08)); font-weight: 600; }
.bd__cls { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; background: var(--surface, var(--bg)); }
.bd__cls[hidden] { display: none; }
.bd__cls input, .bd__cls textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: var(--bg); color: var(--text); margin: 0 0 6px; }
.bd__cls textarea { resize: vertical; line-height: 1.6; }
.bd__classmsg { margin-top: 8px; }
.bd__cls legend { padding: 0 6px; margin-left: -6px; }
.bd__clsnote { margin: 0 0 8px; }
/* N83 (E4): ❤️ */
.bd__like.is-on { border-color: #e11d48; color: #e11d48; }
.bd__like .bd__likes { font-variant-numeric: tabular-nums; }
/* N84 (B4): 🖼 share image link in the ⋯ menu, same look as the menu buttons */
.bd__menu a.bd__menulink { display: block; font-size: 14.5px; color: var(--text); text-decoration: none; padding: 9px 12px; border-radius: 8px; white-space: nowrap; }
.bd__menu a.bd__menulink:hover, .bd__menu a.bd__menulink:focus-visible { background: var(--surface, rgba(0, 0, 0, .05)); outline: none; }
/* N85: 🖼 รูปทั้งกระดาน */
.bd__full { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bd__fullcard { background: var(--bg); color: var(--text); border-radius: 16px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 16px 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.bd__fullh { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bd__fullh b { font-size: 17px; }
.bd__fullgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.bd__fullimg { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--muted); font-size: 13px; text-align: center; }
.bd__fullimg img { width: 100%; aspect-ratio: 1080 / 1350; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.bd__fullimg:hover img { border-color: var(--red); }
.bd__fullacts { display: flex; flex-wrap: wrap; gap: 8px; }
/* N86: size buttons in the whole-board pictures panel */
.bd__fullopts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 4px; }
.bd__fullopts .bd__lbl { margin: 0 4px 0 0; }
.bd__fullopts button { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.bd__fullopts button.on { border-color: var(--red); color: var(--red); background: var(--red-soft, rgba(177, 31, 36, .08)); font-weight: 600; }
.bd__fullimg img { object-fit: contain; }
/* N87: picture options */
.bd__fullset { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 8px; }
.bd__fullset summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.bd__fullset .bd__fullopts { margin: 8px 0 2px; }
.bd__lbl2 { margin-left: 10px !important; }
.bd__fullbg button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--line); }
.bd__fullbg button.on { border-color: var(--red); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--red); }
.bd__fullbgn { font-size: 13px; color: var(--muted); margin-left: 4px; }
.bd__fullchk { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; margin-right: 10px; }
.bd__fullreset { border: 0; background: none; color: var(--red); font: inherit; font-size: 14px; cursor: pointer; margin-left: auto; }
.bd__fullimg.is-long img { max-height: 420px; object-fit: contain; object-position: top; }
.bd__fulldsp[hidden] { display: none; }
/* N90: nested Lanna spans (from the Enter bug) never scale twice */
.bd__body .lt-ln .lt-ln { font-size: 1em; padding: 0; }
/* N92: 🛟 unsaved text found on this device */
.bd__bak { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e6a23c; border-radius: 12px; background: rgba(230, 162, 60, .10); }
.bd__bak b { display: block; margin-bottom: 4px; }
.bd__bak p { margin: 0 0 8px; font-size: 14.5px; color: var(--muted); }
