/* Braille's own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the score,
   the list down the left, the settings and their "i", the windows, the result, the phone layout, and the wide middle
   column every trainer has). Only this tool's subject goes here: braille drawn as dots (a cell is a grid of six
   places, sized by one number, --dot), a thing's card (its braille, its dots in words, how to remember it), a word
   taken apart sign by sign, Explore's three views (the lessons' chips, every cell, your own words), the six cells to
   pick from, the pad a cell is written on, the sheet to emboss (print only), and the buttons under the board (the same
   sizes as Bird Sounds' and the field guides' answers). Colours and fonts are the shell's variables. */

.board {
  container-type: inline-size;
  flex: 1; min-height: 0; overflow: auto; box-sizing: border-box; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 12px;
  background: #0b1219; border: 1px solid var(--line-strong); border-radius: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.board .note { color: var(--muted); text-align: center; max-width: 62ch; line-height: 1.55; margin: 0; font-size: 13px; text-wrap: pretty; }
.board .note.warn { color: var(--scan); }

/* ---------- braille: cells of six places, the raised dots filled ---------- */
.br { --dot: 12px; display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(var(--dot) * 1.5) calc(var(--dot) * 2.6); vertical-align: middle; max-width: 100%; }
.br .bw { display: inline-flex; gap: calc(var(--dot) * 1.25); }
.br .bc { display: grid; grid-template-columns: repeat(2, var(--dot)); grid-auto-rows: var(--dot); gap: calc(var(--dot) * .5); flex: none; }
.br .bc i { box-sizing: border-box; border-radius: 50%; border: 1px solid var(--line-strong); font: 600 calc(var(--dot) * .56)/1 var(--f-mono); font-style: normal; color: #1b1610; display: grid; place-items: center; }
.br .bc i.on { background: var(--bone); border-color: var(--bone); }
/* (Preferences: Show the empty dots, off) */
body.no-ghost .br .bc i:not(.on) { border-color: transparent; }
.br-xl { --dot: 34px; }
.br-l { --dot: 17px; }
.br-m { --dot: 10px; }
.br-s { --dot: 6px; }
.br-s .bc i, .br-m .bc i { border-width: 1px; }
.br-s .bc i:not(.on) { border-color: rgba(255, 255, 255, .13); }
/* the braille a question shows, in the middle of the board */
.plate { flex: 1 0 auto; display: grid; place-items: center; width: 100%; padding: 18px 6px; box-sizing: border-box; }
/* (a sentence is asked a size up from how it is drawn elsewhere, until its answer's card needs the room) */
.plate .br-m { --dot: 13px; }
.plate .br-s { --dot: 9px; }
.board.has-fb .plate { flex: 0 0 auto; padding: 8px 6px; }
.board.has-fb .br.ask.br-xl { --dot: 20px; }
.board.has-fb .br.ask.br-m { --dot: 10px; }
.board.has-fb .br.ask.br-s { --dot: 6px; }

/* ---------- a thing's card: its braille, its dots, how to remember it, where it is used ---------- */
.feedback { display: grid; gap: 10px; width: 100%; }
@container (min-width: 600px) { .feedback.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cue { background: var(--bg-lift); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; display: grid; gap: 9px; width: 100%; box-sizing: border-box; align-content: start; text-align: start; min-width: 0; }
.cue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cue-head b { font-size: 16px; color: var(--bone); white-space: pre-wrap; }
.cue-head .kind { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cue-cells { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.cue-cells .dots { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.cue p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--fg); text-wrap: pretty; text-align: start; }
.cue p.rule, .cue p.also { color: var(--muted); font-size: 13.5px; }
.cue p em { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--scan); }
.cue.main { padding: 18px 20px; gap: 12px; }
.cue.main .cue-cells { gap: 14px 26px; padding: 6px 0; }
.cue.main .cue-cells .dots { font-size: 14px; }

/* a word taken apart: each sign over the print it stands for; a contraction in the accent colour */
.parts { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-end; }
.parts .pw { display: inline-flex; gap: 4px; align-items: flex-end; }
.part { display: inline-grid; justify-items: center; gap: 5px; padding: 5px 4px 3px; border-radius: 7px; min-width: 14px; }
.part b { font: 600 13px/1.1 var(--f-mono); color: var(--fg); white-space: pre; min-height: 14px; }
.part.is-sign { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); }
.part.is-sign b { color: var(--scan); }
.part.is-ind b { color: var(--muted); font-size: 9px; }
.part .br.none { color: var(--muted); font: 600 14px var(--f-mono); }

/* ---------- Explore: its three views ---------- */
.tabs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); flex: none; max-width: 100%; }
.tab { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 8px; padding: 7px 13px; cursor: pointer; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { background: var(--bg-lift); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-strong); }
/* every lesson's chips, and the misses after a test */
.chart { display: grid; gap: 14px; min-width: 0; width: 100%; padding-top: 2px; }
.lgroup { display: grid; gap: 7px; }
.lgroup.is-later { opacity: .55; }
.ghead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--scan); }
.ghead em { font-style: normal; color: var(--muted); letter-spacing: 0; }
.ghead em.done { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; color: var(--fg); cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 9px; text-align: start; }
.chip b { font-size: 13px; font-weight: 600; white-space: pre-wrap; }
.chip:hover { border-color: var(--scan); }
.chip.is-on { border-color: var(--bone); box-shadow: 0 0 0 1px var(--bone); background: var(--bg-lift); }
.chip.is-known b::after { content: " ✓"; color: var(--ok); }
.summary { display: grid; gap: 10px; justify-items: center; width: min(100%, 640px); }
.summary .chips { justify-content: center; }
/* every cell: seven lines of tiles, each cell over what it can mean */
.lines { display: grid; gap: 8px; width: 100%; }
.cline { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.ctile { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 3px 7px; display: grid; gap: 7px; justify-items: center; align-content: start; cursor: pointer; min-width: 0; }
.ctile:hover { border-color: var(--scan); }
.ctile .means { display: grid; gap: 2px; justify-items: center; min-width: 0; max-width: 100%; }
.ctile .mean { font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; white-space: pre-wrap; }
.ctile .mean + .mean { color: var(--muted); font-weight: 500; }
.ctile .mean.more { color: var(--muted); font-weight: 500; font-size: 10.5px; }
/* your own words */
.own { display: grid; gap: 14px; justify-items: center; width: min(100%, 720px); }
.own-out { display: grid; gap: 10px; justify-items: center; min-height: 64px; width: 100%; }
.own-out .parts { justify-content: center; }
.typebox { width: min(100%, 520px); display: flex; gap: 6px; }
.type {
  flex: 1; min-width: 0; box-sizing: border-box; font-family: var(--f-mono); font-size: 19px; font-weight: 600; text-align: center;
  color: var(--fg); background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 12px; outline: none;
}
.type::placeholder { font-size: 14px; color: var(--muted); font-weight: 500; }
.type:focus { border-color: var(--scan); }
.type.is-ok { border-color: var(--ok); color: var(--ok); }
.type.is-bad { border-color: var(--bad); color: var(--bad); }
.typebox .act { flex: none; }

/* ---------- a lesson's cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; width: 100%; }
.cue.icard { padding: 11px 13px; }
.cue.icard p { font-size: 13.5px; }

/* ---------- six cells to pick from ---------- */
.six { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; flex: 1 0 auto; align-content: center; }
.six .pickbtn { flex-direction: column; justify-content: center; gap: 10px; min-height: clamp(104px, calc(19vh / var(--room, 1)), 190px); padding: 14px 8px 10px; text-align: center; }
.six .pickbtn kbd { position: absolute; inset-inline-start: 8px; top: 8px; }
.six .pickbtn .txt { flex: none; font-size: 13.5px; color: var(--muted); min-height: 1.2em; white-space: pre-wrap; }
.six .pickbtn:disabled { opacity: 1; }
.six .pickbtn:disabled:not(.is-right):not(.is-wrong) .br { opacity: .45; }
.board.has-fb .six { flex: 0 0 auto; }
.board.has-fb .six .pickbtn { min-height: 84px; }

/* ---------- writing: what is written so far, and the cell being written ---------- */
.writer { display: grid; gap: 16px; justify-items: center; width: 100%; flex: 1 0 auto; align-content: center; }
.board.has-fb .writer { flex: 0 0 auto; }
.board.has-fb .pad { display: none; }
.entry { min-height: 58px; width: min(100%, 640px); box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 12px; background: #070b12; padding: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; }
.entry.is-ok { border-color: var(--ok); }
.entry.is-bad { border-color: var(--bad); }
.entry .caret { min-width: 26px; min-height: 40px; border-bottom: 2px solid var(--scan); display: inline-grid; place-items: center; padding-bottom: 4px; }
.pad { display: grid; grid-template-columns: repeat(2, 76px); gap: 12px 26px; }
.pdot { position: relative; width: 76px; height: 76px; border-radius: 50%; cursor: pointer; font: inherit; color: var(--muted); background: var(--panel); border: 1px solid var(--line-strong); display: grid; place-items: center; align-content: center; gap: 2px; touch-action: manipulation; }
.pdot b { font: 700 20px/1 var(--f-mono); }
.pdot kbd { font: 500 10.5px var(--f-mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
.pdot:hover:not(:disabled) { border-color: var(--scan); }
.pdot[aria-pressed="true"] { background: var(--bone); border-color: var(--bone); color: #1b1610; }
.pdot[aria-pressed="true"] kbd { color: #5d5345; border-color: #a99c84; }
.pdot:disabled { cursor: default; opacity: .5; }

/* ---------- the buttons under the board: the answers (two by two) or a row of actions ---------- */
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
.actions.one { grid-template-columns: minmax(0, 1fr); }
.actions:empty { display: none; }
.actions.row { display: flex; flex-wrap: wrap; justify-content: center; }
.act {
  font: inherit; font-weight: 700; font-stretch: 102%; font-size: 15px; color: var(--fg); cursor: pointer; text-align: start;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; min-height: 46px;
  display: flex; align-items: center; gap: 10px; position: relative; line-height: 1.2;
}
.act kbd { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; flex: none; }
.act .txt { flex: 1; min-width: 0; white-space: pre-wrap; }
.actions.row > .act { justify-content: center; text-align: center; flex: 0 1 auto; min-width: 120px; }
.actions.row > .act .txt { flex: 0 1 auto; }
.act:hover:not(:disabled) { border-color: var(--scan); }
.act:disabled { opacity: .32; cursor: default; }
.act.primary { background: var(--bone); color: #1b1610; border-color: var(--bone); }
.act.primary kbd { color: #5d5345; border-color: #a99c84; }
.act.is-right { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); opacity: 1; }
.act.is-wrong { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); opacity: 1; }
.actions:not(.row) > .act.primary { grid-column: 1 / -1; justify-self: center; justify-content: center; width: min(100%, 360px); }
.actions.row > .typebox { flex: 1 1 100%; margin: 0 auto; }
.own .act { justify-content: center; text-align: center; }
.own .act .txt { flex: 0 1 auto; }

@media (max-width: 900px) {
  .board { border-radius: 14px; gap: 10px; padding: 8px; }
  .br-xl { --dot: 28px; }
  .br-l { --dot: 14px; }
  .br-m { --dot: 8px; }
  .br-s { --dot: 5px; }
  .plate .br-m { --dot: 9px; }
  .plate .br-s { --dot: 6px; }
  .board.has-fb .br.ask.br-m { --dot: 8px; }
  .board.has-fb .br.ask.br-s { --dot: 5px; }
  /* once a sentence is answered, only the right answer and the pick stay under it: its card needs the room */
  .actions.one > .choice:disabled:not(.is-right):not(.is-wrong) { display: none; }
  .act { padding: 9px 10px; font-size: 13.5px; min-height: 42px; }
  .act kbd { display: none; }
  .actions.row > .act { min-width: 0; flex: 1 1 0; }
  .cue { padding: 11px 13px; }
  .cue.main { padding: 14px; }
  .cue p { font-size: 13.5px; }
  .tab { padding: 7px 9px; font-size: 12.5px; }
  .cline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .six .pickbtn { min-height: clamp(78px, 12vh, 120px); padding: 10px 6px 8px; }
  .board.has-fb .six .pickbtn { min-height: 64px; }
  .pad { grid-template-columns: repeat(2, 68px); gap: 10px 30px; }
  .pdot { width: 68px; height: 68px; }
  .pdot kbd { display: none; }
  .type { font-size: 17px; }
  .typebox { width: 100%; }
  .parts { gap: 10px 16px; }
}
/* clean view: the subject takes the room the chips leave */
body.clean .chart, body.clean .tabs { display: none; }

/* ---------- the sheet to emboss: only ever printed ---------- */
#sheet { display: none; }
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  body > *:not(#sheet) { display: none !important; }
  #sheet { display: block; color: #000; font: 10pt/1.4 Arial, Helvetica, sans-serif; }
  #sheet p { margin: 0 0 3mm; }
  #sheet .sheet-art { margin: 4mm 0; line-height: 0; }
  #sheet .sheet-scale { display: flex; align-items: center; gap: 3mm; }
  #sheet .sheet-scale i { display: block; width: 50mm; height: 0; border-top: 0.3mm solid #000; flex: none; }
  #sheet .sheet-foot { color: #555; font-size: 8pt; }
}
