/* The training hall uses the surfaces of a real workshop. */
body:has(.train-world){background:#f3e5ce!important}
.train-world {
  --tr-ink:#132139; --tr-blue:#093b95; --tr-paper:#fbedd6; --tr-wood:#ac653a;
  --tr-line:#967b554b; --tr-deep:#0b2040;
  box-sizing:border-box; width:min(100%,930px); min-height:100svh; margin:auto;
  color:var(--tr-ink); background:linear-gradient(155deg,#fff3e2,#ebd6b8);
  padding:0 clamp(14px,4vw,42px) 84px; font:1rem/1.45 'Onest',system-ui,sans-serif; overflow-wrap:anywhere;
}
.train-world *, .train-world *::before,.train-world *::after{box-sizing:border-box}
.train-world h1,.train-world h2,.train-world h3{line-height:1.03;letter-spacing:-.035em}
.train-world h1{margin:0;font-size:clamp(1.85rem,6.9vw,3.6rem);font-weight:900}
.train-world h2{margin:.2em 0;font-size:clamp(1.23rem,4.7vw,2rem)}
.train-world :is(a,button,input,summary):focus-visible{outline:3px solid #b3482e;outline-offset:3px}
.train-world :is(a,button,input,summary){scroll-margin-block:7px 79px}
html:has(.train-world){scroll-padding-block:8px 80px}
.train-world .tr-primary,.train-world .tr-secondary {
  min-height:46px; display:inline-flex; justify-content:center;align-items:center;padding:8px 13px;
  color:#fff4db;background:var(--tr-blue);border:1px solid var(--tr-blue);border-radius:7px;
  font:750 .92rem/1.25 'Onest',system-ui,sans-serif;text-decoration:none;text-align:center;cursor:pointer;
}
.train-world .tr-secondary{color:var(--tr-ink);background:#fff4e3;border-color:#957753}
.train-world .tr-primary:disabled{background:#ded0b8;border-color:#a28e72;color:#514739;cursor:default}
.tr-mark{display:inline-block;flex:none;width:34px;height:34px;background:url('./training-avatar-v1.svg') center/contain no-repeat}
.tr-header{display:flex;justify-content:space-between;align-items:center;min-height:54px;gap:9px;border-bottom:1px solid var(--tr-line)}
.tr-sign,.tr-exit{display:inline-flex;align-items:center;gap:7px;color:inherit;text-decoration:none;min-height:44px;font-weight:750;font-size:.86rem}
.tr-exit{font-weight:650;white-space:nowrap}
.train-world.tr-entry{position:relative;display:grid;grid-template-rows:auto 1fr;isolation:isolate;width:100%;color:#fff1d8;min-height:100svh;padding:0;overflow:hidden;background:#261c16}
.tr-entry-photo,.tr-entry::after{position:absolute;inset:0;width:100%;height:100%;z-index:-2}
.tr-entry-photo{object-fit:cover;object-position:50% 48%}
.tr-entry::after{content:'';z-index:-1;background:linear-gradient(180deg,#100c0a7d 0%,transparent 22%,transparent 43%,#18110be6 82%,#18110b 100%)}
.tr-entry-top{display:flex;justify-content:space-between;align-items:center;padding:max(10px,env(safe-area-inset-top)) clamp(16px,4vw,40px)}
.tr-entry-top .tr-exit{padding:0 10px;border-radius:5px;background:#140e0bd6;border:1px solid #fff1d84d}
.tr-entry-copy{align-self:end;width:min(100%,1000px);margin:0 auto;padding:100px clamp(21px,7vw,70px) max(20px,env(safe-area-inset-bottom))}
.tr-entry-copy h1{text-transform:uppercase;font-size:clamp(2.85rem,11.2vw,6.2rem);letter-spacing:-.06em;color:#fff0cf;line-height:.94}
.tr-entry-copy > p{margin:8px 0 15px;font-size:clamp(1rem,4.5vw,1.45rem)}
.tr-entry-copy .tr-primary{min-height:51px;min-width:min(100%,315px);font-size:1rem;background:#07388f;border-color:#1d53ad;box-shadow:0 3px 0 #061e4c}
.tr-entry-actions{display:flex;align-items:center;flex-wrap:wrap;gap:0 12px;color:#f5deb7;font-size:.83rem}
.tr-entry-actions a{display:inline-flex;align-items:center;min-height:44px;color:#fff1d8}
.tr-dock{position:sticky;bottom:0;display:grid;grid-template-columns:repeat(3,1fr);z-index:20;width:min(100%,625px);
  margin:22px auto -84px;padding:4px 5px max(5px,env(safe-area-inset-bottom));border:1px solid #172f5d;background:#0b2040fa;color:#fff0cf}
.tr-dock a{min-height:52px;display:grid;place-items:center;gap:0;color:#f2e1c0;text-decoration:none;font-size:.72rem;border-top:2px solid transparent}
.tr-dock a + a{border-left:1px solid #d9e3fa30}
.tr-dock a span{font-size:1.24rem;line-height:1}
.tr-dock a[aria-current]{background:#144596;border-top-color:#ffce70;color:#fff6df}
.tr-hall-title{display:flex;align-items:end;justify-content:space-between;gap:9px;margin:12px 0}
.tr-hall-title span{font-size:.82rem;color:#334360;font-weight:750}
.tr-floor{position:relative;isolation:isolate;overflow:hidden;min-height:310px;height:clamp(310px,89vw,520px);border:1px solid #453a2f;border-radius:4px;background:#b77943}
.tr-floor img,.tr-floor svg{position:absolute;width:100%;height:100%;inset:0}
.tr-floor img{object-fit:cover}
.tr-floor svg{pointer-events:none}
.tr-floor path{fill:none;stroke:#ffe3a1;stroke-width:3.5;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round;filter:drop-shadow(0 0 3px #662b11)}
.tr-floor ol{margin:0;padding:0;list-style:none}
.tr-floor li{position:absolute;transform:translate(-50%,-50%)}
.tr-floor button{height:44px;width:44px;border:2px solid #122139;border-radius:50%;background:#f3e4c6;color:#182339;font:850 1.05rem/1 'Onest',system-ui,sans-serif;cursor:pointer;box-shadow:0 2px 4px #120b09ab}
.tr-floor li[data-status=done] button{background:#c8e5d1}
.tr-floor li[data-current=true] button{background:#ffd275}
.tr-floor button[aria-pressed=true]{outline:3px solid #fff0c7;outline-offset:2px}
.tr-station-ticket{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:7px 12px;margin-top:11px;padding:10px 12px;background:#fff1d7;border:1px solid #ab8b62;border-left:4px solid var(--tr-blue)}
.tr-station-number{padding:5px 0;color:var(--tr-blue);font:850 1.7rem/1 'Onest',system-ui,sans-serif}
.tr-station-ticket p{margin:0;font-size:.83rem}
.tr-station-status,.tr-paper-meta{color:#4c5470;font:700 .71rem/1.4 Consolas,monospace}
.tr-station-ticket :is(.tr-primary,.tr-secondary){grid-column:2;justify-self:start}
.tr-lesson-title{display:flex;align-items:center;gap:10px;margin:13px 0 10px}
.tr-lesson-title span{background:var(--tr-blue);color:#fff1d7;font:750 .84rem/1 Consolas,monospace;padding:8px}
.tr-lesson-title h1{font-size:clamp(1.55rem,6vw,2.85rem)}
.tr-lead{margin:7px 0 13px}
.tr-finish{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:13px;padding-top:10px;border-top:1px solid var(--tr-line)}
.tr-journal,.tr-ticket{background:radial-gradient(ellipse at 25% 0%,#f5e7cb,#c8966f)}
.tr-clipboard{position:relative;max-width:650px;margin:24px auto 0;padding:clamp(17px,5vw,38px);
  background:repeating-linear-gradient(0deg,#ad8d5212 0 1px,transparent 1px 25px),var(--tr-paper);
  border:6px solid #173b75;border-radius:12px;box-shadow:4px 6px 0 #10264c}
.tr-clipboard::before{content:'';position:absolute;width:84px;height:16px;top:-13px;left:50%;transform:translateX(-50%);
  background:linear-gradient(#9e9687,#4b4a48,#9e9687);border-radius:4px;box-shadow:0 2px 4px #29231588;pointer-events:none}
.tr-clipboard h1{font-size:clamp(1.65rem,6.8vw,3rem);margin:.1em 0 .45em}
.tr-clipboard h2{margin:0 0 10px}
.tr-paper-meta{margin:0 0 6px}
.tr-training-card{display:grid;grid-template-columns:1fr;margin:0;border-top:1px solid var(--tr-line)}
.tr-training-card dt{margin:0;padding-top:9px;font:750 .75rem/1.3 'Onest',system-ui,sans-serif;color:#163c74;text-transform:uppercase}
.tr-training-card dd{margin:0;padding:2px 0 9px;border-bottom:1px solid var(--tr-line)}
.tr-transfer{width:fit-content;color:#174078;border:2px solid #174078;padding:6px 8px;font-weight:850;transform:rotate(-2deg)}
.tr-transfer-detail,.tr-plan-method{color:#334362;font-size:.86rem}
.tr-record{white-space:pre-line}
.tr-index{list-style:none;margin:0;padding:0}
.tr-index li{border-top:1px solid var(--tr-line)}
.tr-index a{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;min-height:46px;color:#103675;text-decoration:none;font-weight:720}
.tr-plan-form{margin-top:20px}
.tr-plan-form p{margin:5px 0 10px}
.tr-methods{border:1px solid var(--tr-line);margin:0 0 10px;padding:5px 9px}
.tr-methods legend{font-weight:750}
.tr-methods label{display:flex;min-height:44px;gap:7px;align-items:flex-start;padding:6px 0;cursor:pointer}
.tr-methods label + label{border-top:1px solid var(--tr-line)}
.tr-methods input{margin-top:5px;accent-color:var(--tr-blue)}
.tr-methods small{display:block;color:#495370}
.tr-field{display:grid;gap:4px;margin-top:9px;font-weight:720}
.tr-field input{min-width:0;min-height:45px;border:1px solid #92764e;border-radius:4px;padding:6px 8px;background:#fffbf1;color:var(--tr-ink);font:inherit}
.tr-pay{display:grid;gap:8px}
.tr-note{color:#4b4337}
@media(min-width:760px){.tr-entry-photo{object-position:center 59%}.tr-floor img{object-position:center 51%}}
@media(max-width:350px){.train-world{padding-inline:10px}.train-world.tr-entry{padding:0}.tr-floor{min-height:287px;height:287px}.tr-floor button{border-width:1px}}
@media(prefers-reduced-motion:reduce){.train-world *, .train-world *::before,.train-world *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
body.no-motion .train-world *{animation:none!important;transition:none!important;scroll-behavior:auto!important}

/* The journal is a leaf on the board; its actions stay together above the tabs. */
.train-world.tr-journal{padding-bottom:0}
.tr-journal .tr-dock{position:relative;bottom:auto;margin-bottom:0}
.tr-journal .tr-finish{justify-content:space-between}
.tr-journal .tr-finish :is(.tr-primary,.tr-secondary){flex:1 1 145px}

.train-world .train-tiles {
  color:#1b2b3d;
  background:#fbedd6;
  border:1px solid #d4b58e;
  border-radius:8px;
  overflow:hidden;
}
.train-world .train-tiles-head { padding:16px 16px 8px; }
.train-world .train-tiles-head h2 { margin:2px 0 6px; color:#123664; font-size:clamp(1.4rem,5vw,2rem); line-height:1.1; }
.train-world .train-tiles-head p { margin:0 0 5px; }
.train-world .train-tiles-step { color:#86522f; font-weight:750; font-size:.75rem; }
.train-world .train-workbench {
  padding:14px;
  background:repeating-linear-gradient(0deg,#bd865923 0 1px,transparent 1px 26px),#bb8051;
}
.train-world .train-trays { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(8px,3vw,18px); }
.train-world .train-tray-group { min-width:0; }
.train-world .train-tray-group h3 {
  margin:0 0 7px; padding:5px; background:#f4e4c7; color:#15345a; border-radius:4px;
  text-align:center; font-size:clamp(.8rem,3.1vw,1rem); line-height:1.2;
}
.train-world .train-tray {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px;
  padding:5px; background:#60442f; border:3px solid #d3a571; border-radius:8px;
  box-shadow:0 4px 0 #6a4225;
}
.train-world .train-tile {
  position:relative; display:grid; place-items:center; min-width:0; min-height:44px; aspect-ratio:1;
  padding:0; overflow:hidden; border:2px solid #f5e7cf; border-radius:3px; background:#f4e9d3;
}
.train-world .train-tile-button { cursor:pointer; }
.train-world .train-tile-button[aria-pressed='true'] { z-index:1; border-color:#ffd46d; outline:3px solid #093b95; outline-offset:1px; }
.train-world .train-tile-button:focus-visible, .train-world .train-tile-actions button:focus-visible,
.train-world .train-tile-next:focus-visible { outline:3px solid #51cafa; outline-offset:3px; }
.train-world .train-tile-face { display:block; width:100%; height:100%; transition:transform .18s ease; }
.train-world .train-shape-0 { background:#093b95; clip-path:polygon(10% 8%,90% 50%,10% 92%); }
.train-world .train-shape-1 { background:linear-gradient(45deg,#fbedd6 49%,#b65a37 50%); }
.train-world .train-shape-2 { background:radial-gradient(circle at bottom left,#093b95 0 68%,#fbedd6 69%); }
.train-world .train-shape-3 { background:linear-gradient(135deg,transparent 42%,#fbedd6 43% 57%,transparent 58%),
  linear-gradient(45deg,#093b95 42%,#fbedd6 43% 57%,#093b95 58%); }
.train-world .train-tile-selected { min-height:2.6em; padding:8px 10px; margin:12px 0 8px; color:#102b4a; background:#fbedd6; border-radius:4px; font-size:.9rem; }
.train-world .train-tile-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.train-world .train-tile-actions button, .train-world .train-tile-next {
  min-height:48px; padding:8px; border:1px solid #093b95; border-radius:5px; font:700 .9rem/1.25 system-ui,sans-serif; cursor:pointer;
}
.train-world .train-tile-primary { color:#fffaf0; background:#093b95; }
.train-world .train-tile-secondary { color:#093b95; background:#fbedd6; }
.train-world .train-tile-actions button:disabled { color:#6c737b; border-color:#a3a2a0; background:#e5dfd6; cursor:default; }
.train-world .train-tile-feedback:not(:empty) {
  margin-top:9px; padding:10px; border-left:4px solid #093b95; color:#152c46; background:#fbedd6; line-height:1.4;
}
.train-world .train-tile-next { width:100%; margin-top:10px; }
@media (prefers-reduced-motion:reduce) { .train-world .train-tile-face { transition:none; } }

.train-world .tr-station {
  --station-paper:var(--tr-paper,#fbedd6);
  --station-ink:var(--tr-ink,#132139);
  --station-blue:var(--tr-blue,#093b95);
  color:var(--station-ink);
  display:grid;
  gap:14px;
  font-family:inherit;
  min-width:0;
}
.train-world .tr-station *, .train-world .tr-station *::before, .train-world .tr-station *::after { box-sizing:border-box; }
.train-world .tr-st-heading h2 { margin:0 0 5px; font-size:clamp(1.35rem,5vw,1.8rem); line-height:1.1; }
.train-world .tr-st-heading p { margin:0; line-height:1.45; }
.train-world .tr-station button {
  min-height:44px;
  padding:8px 11px;
  border:1px solid #0d3b83;
  border-radius:5px;
  background:#fff9ef;
  color:#102c56;
  font-family:inherit;
  font-size:.91rem;
  font-weight:650;
  line-height:1.25;
  cursor:pointer;
}
.train-world .tr-station button:hover:not(:disabled) { background:#e7f0ff; }
.train-world .tr-station button:disabled { opacity:.48; cursor:default; }
.train-world .tr-station button[aria-pressed='true'] { background:#093b95; color:#fff; }
.train-world .tr-station :is(button,input):focus-visible { outline:3px solid #1469e8; outline-offset:3px; }
.train-world .tr-st-choice { border:0; min-width:0; padding:0; margin:0; }
.train-world .tr-st-choice legend { font-weight:750; padding:0; margin-bottom:8px; line-height:1.35; }
.train-world .tr-st-options,.train-world .tr-st-inline { display:flex; flex-wrap:wrap; gap:7px; }
.train-world .tr-st-feedback { padding:10px 12px; margin:0; border-left:4px solid #235dad; background:#e5efff; color:#132c4b; line-height:1.4; }
.train-world .tr-st-magnets {
  list-style:none; margin:0; padding:15px; display:grid; gap:8px;
  background:linear-gradient(145deg,#d6e1e5,#aabcc3); border:6px solid #805333; box-shadow:0 4px 0 #5e3825;
}
.train-world .tr-st-magnets li { display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:8px; align-items:center; padding:7px; background:#fff8e9; box-shadow:0 2px 3px #21303833; }
.train-world .tr-st-magnet-number { font:750 .85rem ui-monospace,monospace; color:#31548b; }
.train-world .tr-st-move { display:flex; gap:4px; }
.train-world .tr-st-move button { min-width:44px; padding:4px; font-size:1.1rem; }
.train-world .tr-st-tray { display:grid; gap:10px; padding:14px; background:#b47746; border:6px solid #714527; border-radius:6px; }
.train-world .tr-st-reference { margin:0; padding:9px 9px 9px 34px; background:#fff5e4; }
.train-world .tr-st-reference li { padding:5px; }
.train-world .tr-st-shutter { display:grid; place-items:center; min-height:120px; color:#fff7df; font-weight:750; border:2px solid #efd7a5; background:repeating-linear-gradient(90deg,#154a91 0 20px,#1b559c 21px 23px); }
.train-world .tr-station .tr-st-action { background:#093b95; color:#fff; border-color:#093b95; justify-self:start; }
.train-world .tr-st-recall { display:grid; gap:9px; }
.train-world .tr-st-recall h3 { margin:0; }
.train-world .tr-st-sequence { min-height:40px; margin:0; padding:7px 7px 7px 32px; background:#fff7e9; border:1px dashed #a77a52; }
.train-world .tr-st-calendar { padding:12px; border:1px solid #b6a183; background:#fff9ed; }
.train-world .tr-st-calendar legend { font-weight:750; padding:0 4px; }
.train-world .tr-st-calendar > div { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,125px),1fr)); gap:6px; }
.train-world .tr-st-calendar-day { min-height:64px; display:grid; grid-template-columns:auto 1fr; gap:3px 7px; padding:7px; border:1px solid #b0a18b; cursor:pointer; }
.train-world .tr-st-calendar-day:has(input:checked) { border:2px solid #093b95; background:#eaf1ff; padding:6px; }
.train-world .tr-st-calendar-day input { width:18px; height:18px; accent-color:#093b95; }
.train-world .tr-st-calendar-day span { color:#42649a; text-align:right; font:.75rem ui-monospace,monospace; }
.train-world .tr-st-calendar-day strong { grid-column:1/-1; font-size:.85rem; }
.train-world .tr-st-deck { display:grid; gap:10px; }
.train-world .tr-st-practice-card { padding:14px; border:1px solid #aa8f6d; border-left:6px solid #093b95; background:#fff8eb; box-shadow:3px 3px 0 #c5ae8b; }
.train-world .tr-st-practice-card small { display:block; margin-bottom:8px; color:#345b90; font:750 .72rem ui-monospace,monospace; }
.train-world .tr-st-practice-card .tr-st-feedback { margin-top:10px; }
.train-world .tr-st-attempts { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr)); gap:8px; padding:12px; border:6px solid #805333; background:#ba8054; }
.train-world .tr-st-attempt { min-width:0; display:grid; align-content:start; gap:5px; padding:12px; background:#fff7e9; border-top:4px solid #093b95; }
.train-world .tr-st-attempt small { color:#31548b; font:750 .7rem ui-monospace,monospace; }
.train-world .tr-st-attempt p { margin:0; font-size:.9rem; }

/* Entry stays a portrait poster inside its warm-world surround. */
.train-world.tr-entry{width:min(100%,524px)}
.tr-entry-copy{padding:30px clamp(18px,6vw,32px) max(16px,env(safe-area-inset-bottom))}
.tr-entry-copy h1{font-size:clamp(2.5rem,10vw,4rem)}
@media(max-height:600px){.tr-entry-copy>p{margin:5px 0 8px}.tr-entry-copy .tr-primary{min-height:46px}}
