
.tj { --tile: 76px; --lab: 88px; position: relative; -webkit-tap-highlight-color: transparent; }
.tj-dlg { -webkit-tap-highlight-color: transparent; }
.tj [hidden], .tj-strip[hidden] { display: none !important; }
.tj-board[data-size=S] { --tile: 58px; } .tj-board[data-size=L] { --tile: 100px; }
@media (max-width: 600px) {
  .tj { --lab: 52px; }
  .tj-board { --tile: 62px; } .tj-board[data-size=S] { --tile: 50px; } .tj-board[data-size=L] { --tile: 82px; }
}


.tj-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tj-title { flex: 1 1 260px; font: 800 clamp(20px, 2.6vw, 26px)/1.15 var(--display) !important; background: transparent !important; border: 2px dashed transparent !important;
  padding: 4px 8px !important; margin-left: -10px; min-height: 48px; border-radius: 10px; color: var(--ink); }
.tj-title:hover { border-color: var(--soft) !important; }
.tj-title:focus { border-color: var(--line) !important; background: var(--paper) !important; }
.tj-status { flex: none; min-height: 18px; white-space: nowrap; font-size: 13px; color: var(--mute); } 
.tj-title { min-width: 0; }
.tj-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px; background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.tj-barl, .tj-barr, .tj-kt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tj-bar .b { padding: 8px 13px; }
.tj-bar .b.ico { width: 44px; padding: 0; }
.tj-bar .b:disabled { opacity: .4; cursor: default; transform: none; box-shadow: var(--shadow-sm); }
.ic.fat { stroke-width: 3.2; }
.tj-bar .b.primary { box-shadow: 3px 3px 0 var(--line); }

.tj-bs, .tj-phoneonly { display: none !important; }
@media (max-width: 520px) {
  .tj-bar { flex-wrap: nowrap; gap: 4px; padding: 0; background: none; border: 0; box-shadow: none; }
  .tj-barl, .tj-barr { flex-wrap: nowrap; gap: 4px; }
  .tj-barr { margin-left: auto; }
  .tj-bar .b { padding: 8px; font-size: 14px; }
  .tj-bar .b.pc { width: 44px; padding: 0; }
  .tj-bar .b.pc .tj-bt, .tj-bar .pchide, .tj-kt { display: none !important; }
  .tj-bar .b:has(.tj-bs) .tj-bt { display: none; }
  .tj-bar .tj-bs { display: inline !important; }
  .tj-phoneonly { display: grid !important; }
  .tj-tile.txt { max-width: 170px; }
  .tj-status { font-size: 12px; }
  .tj-title { font-size: 17px !important; min-height: 40px; }
}
.tj-seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow-sm); }
.tj-segb { min-height: 40px; min-width: 44px; padding: 6px 11px; border: 0; border-left: 2px solid var(--line); background: transparent; color: var(--ink); font: 700 14px/1 var(--sans); cursor: pointer; }
.tj-segb:first-child { border-left: 0; }
.tj-segb[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.tj-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; cursor: pointer; }
.tj-check input { width: 20px; height: 20px; accent-color: var(--jam); }


.tj-notes:empty { display: none; }
.tj-notice { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 52px 12px 14px; margin: 0 0 12px; background: var(--jam-soft);
  border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.tj-notice p { margin: 0; flex: 1 1 260px; font-weight: 600; }
.tj-notice.tj-start { background: var(--c); color: #1b1622; }
.tj-notice.tj-start .b:not(.primary) { background: #fff; color: #1b1622; }
@media (max-width: 520px) { 
  .tj-notice.tj-start { flex-wrap: nowrap; padding: 8px; gap: 6px; }
  .tj-notice.tj-start > p, .tj-notice.tj-start > .tj-x { display: none; }
  .tj-notice.tj-start .tj-noteacts { flex-wrap: wrap; gap: 6px; width: 100%; }
  .tj-notice.tj-start .b { flex: 1 1 auto; padding: 6px 8px; font-size: 13.5px; }
  .tj-notice .b:has(.tj-bs) .tj-bt { display: none; }
  .tj-notice .tj-bs { display: inline !important; }
}
.tj-notice.tj-store, .tj-notice.tj-warnnote { background: var(--paper); }
.tj-noteacts { display: flex; flex-wrap: wrap; gap: 8px; }
.tj-x { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font: 800 26px/1 var(--display); cursor: pointer; border-radius: 10px; }
.tj-x:hover { background: rgba(127, 127, 127, .15); }
.tj-add { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); margin-bottom: 14px; padding: 6px 14px 14px; }
.tj-tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 48px; margin-bottom: 8px; }
.tj-tabs .tj-tab { flex: none; }
.tj-tab[aria-pressed=true] { color: var(--ink); border-color: var(--jam); }
.tj-tab { min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink2); font: 700 15px/1 var(--sans); cursor: pointer; }
.tj-tab[aria-selected=true] { color: var(--ink); border-color: var(--jam); }
.tj-lbl { display: block; font-weight: 700; font-size: 15px; margin: 4px 0 6px; }
.tj-paste { min-height: 110px; font-size: 16px; }
.tj-row2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.tj-row2 input { flex: 1 1 200px; width: auto; }
.tj-hint { font-size: 14px; color: var(--mute); }
.tj-err, .tj-warn { color: var(--warn); font-weight: 600; font-size: 15px; margin: 8px 0 0; }
.tj-err:empty { display: none; }
.tj-note { font-size: 14px; color: var(--ink2); background: var(--paper); border-left: 4px solid var(--jam); padding: 8px 10px; border-radius: 6px; }
.tj-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px; border: 2px dashed var(--line); border-radius: var(--r-sm); background: var(--paper); }
.tj-drop p { margin: 0; flex: 1 1 220px; color: var(--ink2); }
.tj-dropping .tj-board { outline: 3px dashed var(--jam); outline-offset: 6px; border-radius: var(--r); }
.tj-credits { font-size: 13px; color: var(--mute); margin: 10px 0 0; }
.tj-toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(520px, calc(100% - 24px)); pointer-events: none; }
.tj-toast { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 16px; background: var(--ink); color: var(--bg); border-radius: 12px;
  border: 2px solid var(--line); box-shadow: var(--shadow); font-weight: 600; font-size: 15px; pointer-events: auto; }
.tj-toast .b { background: var(--bg); color: var(--ink); border-color: var(--bg); box-shadow: none; }
body.tj-placing .tj-toasts { bottom: 190px; }


.tj-tile { position: relative; width: var(--tile); height: var(--tile); flex: none; padding: 4px; margin: 0; display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 9px; font: 700 13px/1.12 var(--sans); text-align: center;
  overflow: hidden; overflow-wrap: break-word; hyphens: auto; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: transform .08s, box-shadow .08s; }
.tj-tile:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--line); }

.tj-tile.txt { --chip: calc(var(--tile) * .64); width: auto; height: auto; min-width: 64px; max-width: 220px; min-height: max(44px, var(--chip)); padding: 5px 12px;
  font-size: 14px; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.tj-tile.txt .tj-tt { -webkit-line-clamp: 2; }
.tj-tile.txt.mid { font-size: 12.5px; } .tj-tile.txt.long { font-size: 11px; }
.tj-board[data-size=L] .tj-tile.txt { font-size: 16px; max-width: 260px; }
.tj-board[data-size=S] .tj-tile.txt { font-size: 12.5px; padding: 4px 10px; }
.tj-tile.img { padding: 0; background: var(--paper); }
.tj-tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; display: block; }
.tj-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 3px; background: rgba(27, 22, 34, .8); color: #fff; font: 700 10px/1.15 var(--sans);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.noname .tj-cap { display: none; }
.tj-tt { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tj-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; z-index: 2; }
.tj-tile.sel { outline: 3px solid var(--jam); outline-offset: 2px; transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--line); z-index: 2; }
.tj-tile.grabbed { outline: 3px dashed var(--jam); outline-offset: 2px; transform: scale(1.06); z-index: 3; }
.tj-tile.tj-ph { opacity: .3; }
.tj-ghost { position: fixed !important; left: 0 !important; top: 0 !important; z-index: 130; pointer-events: none; box-shadow: 5px 5px 0 var(--line); opacity: .95; margin: 0; will-change: transform; }
body.tj-dragging, body.tj-dragging .tj-tile { cursor: grabbing; }
.tj-tile.tj-hotitem { padding-right: 24px; }
.tj-hotitem::after { content: "!"; position: absolute; top: 50%; margin-top: -9px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--jam); color: #fff; font: 800 13px/18px var(--display); text-align: center; }


.tj-tiers { border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: var(--line); display: grid; gap: 2px; }
.tj-row { display: flex; min-height: 64px; background: var(--paper); }
.tj-lab { flex: 0 0 var(--lab); width: var(--lab); display: flex; align-items: center; justify-content: center; padding: 6px 4px; border: 0; border-right: 2px solid var(--line);
  background: #d9d4cc; color: #1b1622; font: 800 32px/1.05 var(--display); text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.tj-lab.mid { font-size: 19px; } .tj-lab.long { font-size: 14px; }
.tj-lab:hover { filter: brightness(1.04) saturate(1.1); }
.tj-lab:focus-visible { outline: 3px solid var(--focus); outline-offset: -5px; }
.tj-items { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; padding: 5px; min-height: 64px; }
@media (max-width: 600px) { .tj-row, .tj-row .tj-items { min-height: 56px; } .tj-lab { font-size: 26px; } }
.tj-items.tj-over { background: var(--jam-soft); }
body.tj-placing .tj-row .tj-items, body.tj-placing .tj-cell, body.tj-placing .tj-spot, body.tj-placing .tj-level, body.tj-placing .tj-plane { cursor: copy; }
body.tj-placing .tj-row .tj-items:hover { background: var(--jam-soft); }
.tj-board[data-kind=blank] .tj-row { min-height: calc(var(--tile) * 1.15); }
.tj-board[data-kind=blank] .tj-row .tj-items { min-height: 0; }


.tj-pool { margin-top: 16px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 10px 10px 6px; }
.tj-poolhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 0 4px 6px; }
.tj-pooltitle { font: 800 20px/1 var(--display); margin: 0; }
.tj-count { font-size: 14px; color: var(--mute); font-weight: 600; }
.tj-pool .tj-items { padding: 4px; min-height: 56px; border-radius: 10px; }
.tj-empty { margin: 8px; color: var(--mute); font-size: 15px; }
.tj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tj-poolhead .tj-chips { flex: 1 1 100%; }
.tj-chip { min-height: 38px; padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: 700 14px/1 var(--sans); cursor: pointer; }
.tj-chip[aria-pressed=true] { background: var(--b); color: #1b1622; }


.tj-strip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 110; background: var(--paper); border-top: 2px solid var(--line); box-shadow: 0 -4px 0 rgba(0, 0, 0, .08);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.tj-striphead { margin: 0; font-size: 14px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 1180px; width: 100%; justify-self: center; }
.tj-stripzones, .tj-stripacts { display: flex; flex-wrap: wrap; gap: 6px; max-width: 1180px; width: 100%; justify-self: center; }
.tj-zbtn { min-width: 52px; min-height: 52px; padding: 4px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: 800 20px/1 var(--display); cursor: pointer; box-shadow: var(--shadow-sm); }
.tj-board[data-kind=align] .tj-zbtn, .tj-board[data-kind=bell] .tj-zbtn, .tj-board[data-kind=iceberg] .tj-zbtn, .tj-board[data-kind=topn] .tj-zbtn { font: 700 14px/1.1 var(--sans); max-width: 160px; }
.tj-zbtn:active { transform: translate(2px, 2px); box-shadow: none; }
.tj-striphint { align-self: center; font-weight: 700; }
body.tj-placing { padding-bottom: 170px; }


.tj-dlg { width: min(580px, calc(100% - 20px)); max-height: calc(100% - 24px); padding: 0; border: 2px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink);
  box-shadow: 6px 6px 0 var(--line); overflow: auto; }
.tj-dlg::backdrop { background: rgba(20, 16, 26, .55); }
.tj-dlghead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 56px 10px 18px; background: var(--paper); border-bottom: 2px solid var(--soft); }
.tj-dlghead h2 { margin: 0; font-size: 23px; }
.tj-dlghead .tj-x { top: 8px; }
.tj-dlgbody { padding: 14px 18px 18px; }
.tj-dlgbody > * + * { margin-top: 12px; }
.tj-dlgbody h2 { margin: 0 0 8px; font-size: 22px; }
.tj-dlgbody h3 { margin: 18px 0 4px; }
.tj-dlgfoot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.tj-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tj-rowlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tj-rowed { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.tj-rowsdlg .tj-rowed:has(.tj-swatch) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.tj-rown { width: 22px; text-align: center; font: 800 15px/1 var(--display); color: var(--mute); }
.tj-swatch { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; padding: 0; }
.tj-rowacts { display: flex; gap: 4px; }
.tj-mini { width: 40px; height: 44px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: 800 17px/1 var(--sans); cursor: pointer; }
.tj-mini:disabled { opacity: .35; cursor: default; }
.tj-pal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--card); border: 2px solid var(--soft); border-radius: 12px; }
.tj-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.tj-custom input { width: 52px; height: 44px; border: 2px solid var(--line); border-radius: 10px; padding: 2px; background: var(--card); }
.tj-itemprev:empty { display: none; }
.tj-itemprev img { width: 120px; height: 120px; object-fit: cover; border: 2px solid var(--line); border-radius: 12px; }
.tj-lists { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tj-li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
.tj-liinfo { flex: 1 1 200px; display: grid; gap: 2px; min-width: 0; }
.tj-liinfo b { font: 800 17px/1.2 var(--display); overflow-wrap: anywhere; }
.tj-liacts { display: flex; flex-wrap: wrap; gap: 6px; }
.tj-checks { display: flex; flex-wrap: wrap; gap: 0 18px; }
.tj-prev { display: grid; place-items: center; min-height: 180px; max-height: 46vh; overflow: hidden; background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
.tj-prev.clear { background-image: linear-gradient(45deg, var(--soft) 25%, transparent 25%, transparent 75%, var(--soft) 75%), linear-gradient(45deg, var(--soft) 25%, transparent 25%, transparent 75%, var(--soft) 75%);
  background-size: 18px 18px; background-position: 0 0, 9px 9px; } 
.tj-prev img { max-width: 100%; max-height: 46vh; object-fit: contain; display: block; }
.tj-prev.busy { opacity: .6; }
.tj-video { border-top: 2px solid var(--soft); padding-top: 4px; }
.tj-video > * + * { margin-top: 10px; }
.tj-video progress { width: 100%; height: 14px; accent-color: var(--jam); }
.tj-vprev { display: block; max-width: 220px; max-height: 390px; border: 2px solid var(--line); border-radius: 12px; background: #000; margin-bottom: 8px; }


.tj-deck { width: min(620px, calc(100% - 16px)); }
.tj-deckprog { margin: 0 0 0 auto; font-weight: 700; color: var(--mute); }
.tj-deckcard { display: grid; place-items: center; padding: 18px 16px 6px; }
.tj-bigcard { position: relative; width: min(240px, 56vw); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 14px; background: var(--card);
  border: 3px solid var(--line); border-radius: 20px; box-shadow: 6px 6px 0 var(--line); font: 800 clamp(20px, 5vw, 30px)/1.12 var(--display); text-align: center; overflow: hidden; overflow-wrap: anywhere; }
.tj-bigcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tj-bigcard .tj-cap { font-size: 15px; padding: 6px; }
.tj-deckdone { font: 800 24px/1.2 var(--display); text-align: center; margin: 30px 0; }
.tj-deckzones { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; padding: 14px 16px 6px; }
.tj-dzone { min-height: 64px; padding: 6px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: 800 28px/1 var(--display); cursor: pointer; box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.tj-deckzones[data-n="9"] .tj-dzone, .tj-deckzones[data-n="25"] .tj-dzone, .tj-deckzones[data-n="4"] .tj-dzone { font: 700 14px/1.1 var(--sans); }
.tj-dzone:active { transform: translate(2px, 2px); box-shadow: none; }
.tj-deckacts { display: flex; gap: 8px; padding: 8px 16px 6px; justify-content: space-between; }
.tj-deckacts .b { flex: 1; }
.tj-deck .tj-hint { padding: 0 16px 14px; margin: 0; }
@media (pointer: coarse) { .tj-deck .tj-hint { display: none; } }


.tj-field { font: 800 15px/1.2 var(--display) !important; text-align: center; background: transparent !important; border: 2px dashed transparent !important; padding: 4px 6px !important;
  min-height: 40px !important; border-radius: 8px; color: inherit !important; width: 100%; }
.tj-field:hover { border-color: currentColor !important; }
.tj-field:focus { background: var(--paper) !important; color: var(--ink) !important; border-color: var(--line) !important; }


.tj-align { display: grid; grid-template-columns: minmax(56px, 92px) repeat(var(--n, 3), minmax(0, 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.tj-align[data-n="2"] { --n: 2; } .tj-align[data-n="5"] { --n: 5; }
.tj-align > * { background: var(--paper); min-width: 0; }
.tj-corner, .tj-axc, .tj-axr { background: var(--card) !important; }
.tj-axc { border-radius: 0 !important; }
.tj-axr { border-radius: 0 !important; height: 100%; writing-mode: horizontal-tb; }
.tj-cell { display: flex; flex-direction: column; min-height: calc(var(--tile) + 44px); }
.tj-cell:nth-child(odd) { background: color-mix(in srgb, var(--paper) 85%, var(--b)); }
.tj-cellname { font: 700 12px/1.2 var(--sans); color: var(--ink2); padding: 5px 6px 0; text-transform: uppercase; letter-spacing: .03em; }
.tj-cell .tj-items { justify-content: center; min-height: calc(var(--tile) + 10px); }
.tj-align[data-n="5"] .tj-tile { --tile: 52px; font-size: 9.5px; }
.tj-align .tj-tile.txt, .tj-spot .tj-tile.txt { max-width: 100%; }
.tj-align[data-n="5"] .tj-tile.txt, .tj-spots[data-n="5"] .tj-tile.txt { min-width: 0; padding: 3px 6px; font-size: 10.5px; }
@media (max-width: 600px) {
  .tj-align { grid-template-columns: 48px repeat(var(--n, 3), minmax(0, 1fr)); }
  .tj-align .tj-field { font-size: 12px !important; padding: 2px !important; }
  .tj-align[data-n="5"] .tj-tile { --tile: 36px; padding: 2px; font-size: 8px; border-radius: 6px; }
  .tj-align[data-n="5"] .tj-cellname { font-size: 8px; padding: 2px; }
  .tj-align[data-n="5"] .tj-items { padding: 2px; gap: 2px; }
}


.tj-ice { border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); display: grid; }
.tj-level { position: relative; padding: 6px 8px 8px; color: #1b1622; min-height: calc(var(--tile) + 54px); }
.tj-level::before { content: ""; position: absolute; inset: 0; background: var(--ice); clip-path: polygon(var(--a) 0, var(--b) 0, var(--c) 100%, var(--e) 100%); pointer-events: none; }
.tj-level > * { position: relative; }
.tj-level + .tj-level { border-top: 2px solid rgba(27, 22, 34, .35); }
.tj-level:nth-child(2) { border-top: 3px solid var(--line); }
.tj-level.deep { color: #fff; }
.tj-levelhead { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 200px); gap: 6px; align-items: center; }
.tj-levelhead .tj-field { text-align: left; font-size: 18px !important; }
.tj-leveln { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font: 800 14px/1 var(--display); }
.tj-addline { font: 600 14px/1.2 var(--sans) !important; text-align: left; background: rgba(255, 255, 255, .22) !important; color: inherit !important; border: 2px dashed currentColor !important; opacity: .85; }
.tj-addline::placeholder { color: inherit !important; opacity: .8; }
.tj-addline:focus { opacity: 1; background: var(--paper) !important; color: var(--ink) !important; }
.tj-addline::placeholder { color: #4a4453; }
.tj-level .tj-items { justify-content: center; }
@media (max-width: 600px) { .tj-levelhead { grid-template-columns: auto minmax(0, 1fr); } .tj-addline { grid-column: 1 / -1; } }


.tj-bell { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 8px 8px; }
.tj-curve { display: block; width: 100%; height: 90px; }
.tj-curvefill { fill: var(--jam-soft); }
.tj-curveline { fill: none; stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; }
.tj-spots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: -4px; }
.tj-spots[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tj-spot { display: flex; flex-direction: column; align-items: center; min-width: 0; border-top: 2px dashed var(--soft); padding-top: 6px; }
.tj-fig { width: 56px; height: 74px; color: var(--ink); }
.tj-spot .tj-items { justify-content: center; width: 100%; min-height: calc(var(--tile) + 10px); border-radius: 10px; }
.tj-spots[data-n="5"] .tj-tile { --tile: 54px; }
@media (max-width: 600px) { .tj-spots[data-n="5"] .tj-tile { --tile: 40px; font-size: 8.5px; padding: 2px; } .tj-spots[data-n="5"] .tj-field { font-size: 11px !important; } .tj-fig { width: 40px; height: 54px; } }


.tj-compass { display: grid; grid-template-columns: minmax(64px, 130px) minmax(0, 620px) minmax(64px, 130px); grid-template-areas: ". top ." "left plane right" ". bot ."; justify-content: center;
  align-items: center; gap: 6px; }
.tj-ctop { grid-area: top; } .tj-cbot { grid-area: bot; } .tj-cleft { grid-area: left; } .tj-cright { grid-area: right; }
.tj-plane { grid-area: plane; position: relative; aspect-ratio: 1; width: 100%; display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); background: var(--card); overflow: hidden; touch-action: manipulation; }
.tj-plane.tj-over { outline: 3px dashed var(--jam); outline-offset: 3px; }
.tj-quad { position: relative; opacity: .85; }
.tj-qcolor { position: absolute; width: 24px !important; height: 24px !important; min-height: 0 !important; padding: 0 !important; border: 2px solid rgba(27, 22, 34, .5) !important;
  border-radius: 50% !important; opacity: .35; cursor: pointer; background: transparent !important; transition: opacity .15s; }
.tj-qcolor::-webkit-color-swatch-wrapper { padding: 0; } .tj-qcolor::-webkit-color-swatch { border: 0; border-radius: 50%; }
.tj-plane:hover .tj-qcolor, .tj-qcolor:focus { opacity: 1; }
.q0 .tj-qcolor { left: 6px; top: 6px; } .q1 .tj-qcolor { right: 6px; top: 6px; } .q2 .tj-qcolor { left: 6px; bottom: 6px; } .q3 .tj-qcolor { right: 6px; bottom: 6px; }
.tj-axisx, .tj-axisy { position: absolute; background: var(--line); pointer-events: none; }
.tj-axisx { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; } .tj-axisy { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
.tj-plane .tj-tile, .tj-plane .tj-tile.txt { position: absolute; width: calc(var(--tile) * .82); height: calc(var(--tile) * .82); min-width: 0; min-height: 0; max-width: none; padding: 3px;
  transform: translate(-50%, -50%); z-index: 1; font-size: 10px; overflow-wrap: anywhere; }
.tj-plane .tj-tile.txt.mid, .tj-plane .tj-tile.txt.long { font-size: 9px; }
.tj-plane .tj-tile:hover { transform: translate(calc(-50% - 1px), calc(-50% - 1px)); }
.tj-plane .tj-tile.sel, .tj-plane .tj-tile.grabbed { transform: translate(-50%, -50%) scale(1.08); }
@media (max-width: 600px) {
  .tj-compass { grid-template-columns: 1fr 1fr; grid-template-areas: "top top" "plane plane" "left right" "bot bot"; }
  .tj-plane .tj-tile, .tj-plane .tj-tile.txt { width: 44px; height: 44px; font-size: 8px; padding: 2px; }
}


.tj-bracket { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.tj-bracket > * + * { margin-top: 12px; }
.tj-lead { font-weight: 700; font-size: 17px; margin: 0; }
.tj-rounds { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.tj-round { flex: 0 0 220px; display: flex; flex-direction: column; gap: 6px; }
.tj-rmatches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.tj-round h3 { margin: 0 0 2px; font-size: 16px; }
.tj-match { display: grid; gap: 4px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); }
.tj-match.bye { opacity: .75; }
.tj-ent { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 8px 4px 4px; border: 2px solid var(--soft); border-radius: 9px; background: var(--card); color: var(--ink);
  font: 700 14px/1.15 var(--sans); text-align: left; cursor: pointer; min-width: 0; }
.tj-ent img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; border: 1.5px solid var(--line); flex: none; }
.tj-ent:hover:not(:disabled) { border-color: var(--line); }
.tj-ent.win { background: var(--jam-soft); border-color: var(--line); }
.tj-ent.win .tj-entn { font-weight: 800; }
.tj-ent.lose { opacity: .5; text-decoration: line-through; }
.tj-ent:disabled { cursor: default; }
.tj-seed { flex: none; min-width: 24px; height: 24px; padding: 0 4px; display: grid; place-items: center; border-radius: 6px; background: var(--soft); font: 800 12px/1 var(--display); color: var(--ink); }
.tj-entn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tj-byetag { font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; padding-left: 6px; }
.tj-champ { padding: 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--c); color: #1b1622; }
.tj-kicker { margin: 0; font: 800 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; }
.tj-champname { margin: 4px 0 8px; font: 800 30px/1.1 var(--display); }
.tj-champ h3 { margin: 10px 0 4px; }
.tj-ranking { margin: 0; padding-left: 0; list-style: none; columns: 2 200px; }
.tj-ranking li { margin: 0 0 4px; }
@media (max-width: 700px) { .tj-rounds { flex-direction: column; overflow: visible; } .tj-round { flex: none; } }

.tj-bpart + .tj-bpart { border-top: 2px dashed var(--soft); padding-top: 12px; }
.tj-bpart > .tj-kicker { margin-bottom: 8px; }
.tj-match.none { visibility: hidden; min-height: 96px; }
@media (max-width: 700px) { .tj-match.none { display: none; } }


.tj-topn { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; }
.tj-ranklist { flex-direction: column; flex-wrap: nowrap; gap: 6px; counter-reset: rk; }
.tj-ranklist .tj-tile, .tj-pyr .tj-tile { counter-increment: rk; }
.tj-ranklist .tj-tile, .tj-ranklist .tj-tile.txt { width: 100%; max-width: none; height: auto; min-height: 52px; justify-content: flex-start; gap: 10px; padding: 4px 10px 4px 50px; text-align: left; font-size: 15px; }
.tj-ranklist .tj-tile::before, .tj-pyr .tj-tile::before { content: counter(rk); position: absolute; display: grid; place-items: center; background: var(--jam); color: #fff; font: 800 15px/1 var(--display); border-radius: 8px; }
.tj-ranklist .tj-tile::before { left: 6px; top: 50%; width: 34px; height: 34px; margin-top: -17px; }
.tj-ranklist .tj-tile:nth-child(1)::before { background: #c99400; } .tj-ranklist .tj-tile:nth-child(2)::before { background: #7a7a86; } .tj-ranklist .tj-tile:nth-child(3)::before { background: #a5602b; }
.tj-ranklist .tj-tile.img img { width: 44px; height: 44px; border-radius: 6px; flex: none; }
.tj-ranklist .tj-tile.img .tj-cap { position: static; background: none; color: inherit; font-size: 15px; padding: 0; }
.tj-ranklist .tj-tile.mid, .tj-ranklist .tj-tile.long { font-size: 14px; }
.tj-pyr .tj-tile.txt { padding-left: 26px; }
.tj-phoneonly { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tj-phoneonly .tj-seg, .tj-phoneonly .tj-check { grid-column: 1 / -1; justify-self: start; }
.tj-notice .tj-phoneonly { display: none !important; }
@media (max-width: 520px) { .tj-notice .tj-phoneonly { display: inline-flex !important; } }
.tj-ranklist .tj-tile.sel, .tj-ranklist .tj-tile.grabbed, .tj-ranklist .tj-tile:hover { transform: none; }
.tj-pyr { justify-content: center; }
.tj-pyr .tj-tile::before { left: 2px; top: 2px; width: 22px; height: 22px; font-size: 12px; z-index: 1; border-radius: 6px; }
.tj-br { flex-basis: 100%; height: 0; }


.tj-cmp { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 14px; margin-bottom: 14px; }
.tj-people { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tj-person { display: grid; gap: 2px; padding: 8px; border: 2px solid var(--soft); border-radius: 10px; background: var(--paper); }
.tj-person.bad { border-color: var(--warn); }
.tj-person.bad .tj-hint { color: var(--warn); }
.tj-result { margin-top: 18px; display: grid; gap: 6px; }
.tj-result h2 { margin: 18px 0 8px; }
.tj-compare .tj-board { margin-top: 14px; }
.tj-hotlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tj-hotlist li { padding: 10px 12px; background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
.tj-votes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tj-vote { font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--soft); }
.tj-twin, .tj-opp { font-weight: 700; margin: 0 0 6px; }
.tj-twin::before { content: "♥ "; color: var(--jam); } .tj-opp::before { content: "⇄ "; color: var(--mute); }
.tj-tblwrap { overflow-x: auto; }
.tj-matrix td, .tj-matrix th { text-align: center; white-space: nowrap; }
.tj-matrix td.twin { background: var(--jam-soft); font-weight: 800; }

@media (prefers-reduced-motion: reduce) { .tj-tile, .tj-zbtn { transition: none; } }


@media print {
  .tj { --paper: #fff; --card: #fff; --ink: #1b1622; --line: #1b1622; --soft: #ccc; --shadow: none; --shadow-sm: none; }
  .tj-bar, .tj-notes, .tj-add, .tj-pool, .tj-strip, .tj-credits, .tj-toasts, .tj-status, .tj-dlg, .head, .tj-cmp, .tj-qcolor, .tj-addline { display: none !important; }
  .tj * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; }
  .tj-title { border: 0 !important; padding: 0 !important; }
  .tj-row { break-inside: avoid; }
  .tj-board[data-kind=blank] .tj-row { min-height: max(8mm, calc((100vh - 50mm) / var(--rows, 6))); } 
  .tj-board[data-kind=blank] .tj-row .tj-items, .tj-board[data-kind=blank] .tj-lab { min-height: 0; }
  .tj-tiers { break-inside: avoid; }
  .tj-top { padding-left: 10px; }
  @page { margin: 12mm; }
}


.tj-fold { display: none; margin-left: auto; min-height: 36px; padding: 4px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: 700 13px/1 var(--sans); cursor: pointer; }
.tj-pool .tj-items.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); }
.tj-pool .tj-items.pics .tj-tile { width: auto; height: auto; aspect-ratio: 1; }
.tj-items.pics .tj-cap, .tj-board[data-kind=tier] .tj-tile.img .tj-cap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-overflow: clip; }
@media (max-width: 600px) {
  .tj-pool.tj-hasitems { position: sticky; bottom: 0; z-index: 20; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 0 var(--line); padding: 6px 8px 8px; }
  .tj-pool.tj-hasitems .tj-items { max-height: 124px; overflow-y: auto; overscroll-behavior: contain; }
  .tj-pool.tj-hasitems .tj-fold { display: inline-flex; align-items: center; }
  .tj-pool.tj-folded .tj-items, .tj-pool.tj-folded .tj-chips { display: none !important; }
  .tj-poolhead { flex-wrap: wrap; padding-bottom: 4px; }
  .tj-poolhead .tj-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tj-poolhead .tj-chips::-webkit-scrollbar { display: none; }
  .tj-poolhead .tj-chip { flex: none; }
  .tj-pooltitle { font-size: 17px; }
}


.tj-mgroup + .tj-mgroup { margin-top: 14px; }
.tj-mgroup h3 { margin: 0 0 6px; font: 800 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--mute); }
.tj-mrow { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tj-mrow .tj-lbl { margin: 0; }
.tj-mtools { grid-column: 1 / -1; gap: 8px; }
.b.danger { color: var(--warn); border-color: var(--warn); box-shadow: 2px 2px 0 var(--warn); }
@media (max-width: 520px) {
  .tj-mgroup .b.tj-phoneonly, .tj-next .tj-phoneonly { display: inline-flex !important; }
  .tj-mtools.tj-phoneonly { display: flex !important; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .tj-sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 85vh; border-radius: 20px 20px 0 0; border-bottom: 0; }
}


.tj-deckend { display: grid; gap: 10px; justify-items: center; text-align: center; width: 100%; }
.tj-deckend .tj-deckdone { margin: 8px 0 0; }
.tj-next { display: grid; gap: 10px; width: 100%; }
.tj-next .tj-row2 { justify-content: center; margin: 0; }
.tj-champ .tj-next .tj-row2 { justify-content: flex-start; }
.tj-next .tj-use .b { min-height: 38px; padding: 6px 11px; font-size: 14px; }
.tj-next .tj-use .tj-lbl { margin: 0; width: 100%; text-align: inherit; }
.tj-deckfilters:empty { display: none; }
.tj-deckfilters { padding: 10px 16px 0; }
.tj-deckfilters .tj-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tj-deckfilters .tj-chip { flex: none; }
.tj-video .b.primary { margin-top: 2px; }


:root[data-theme=dark] :is(.tj, .tj-dlg, .tj-strip, .tj-toasts) { --line: #6d6280; }
:root[data-theme=dark] .tj-row { background: #221d2b; }
:root[data-theme=dark] .tj-notice.tj-start { background: var(--paper); color: var(--ink); border-color: #d9c94a; box-shadow: 4px 4px 0 #d9c94a; }
:root[data-theme=dark] .tj-notice.tj-start .b:not(.primary) { background: var(--card); color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) :is(.tj, .tj-dlg, .tj-strip, .tj-toasts) { --line: #6d6280; }
  :root:not([data-theme=light]) .tj-row { background: #221d2b; }
  :root:not([data-theme=light]) .tj-notice.tj-start { background: var(--paper); color: var(--ink); border-color: #d9c94a; box-shadow: 4px 4px 0 #d9c94a; }
  :root:not([data-theme=light]) .tj-notice.tj-start .b:not(.primary) { background: var(--card); color: var(--ink); }
}
@media (max-width: 520px) { 
  .tj-notice.tj-example, .tj-notice.tj-vs { flex-wrap: nowrap; padding: 6px 44px 6px 12px; gap: 8px; }
  .tj-notice.tj-example p, .tj-notice.tj-vs p { flex: 1 1 auto; font-size: 14px; line-height: 1.3; }
  .tj-notice.tj-example .tj-x, .tj-notice.tj-vs .tj-x { top: 50%; margin-top: -22px; }
}


@media (max-width: 600px) { .tj-vprev { max-height: 46vh; width: auto; max-width: 100%; display: block; margin: 0 auto; } }
.tj-items.pics .tj-cap, .tj-board[data-kind=tier] .tj-tile.img .tj-cap { overflow-wrap: normal; word-break: normal; hyphens: manual; }
@media (max-width: 600px) { .tj-items.pics .tj-cap { font-size: 9px; letter-spacing: -.01em; } }


[hidden] { display: none !important; }


.tj-dlg [hidden], .tj-deck [hidden] { display: none !important; }
@media (min-width: 601px) { 
  .tj-pool.tj-hasitems { position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -4px 0 var(--line), var(--shadow-sm); }
  .tj-pool.tj-hasitems .tj-items { max-height: 30vh; overflow-y: auto; overscroll-behavior: contain; }
}
.tj-allplaced { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 4px; width: 100%; }
.tj-alltext { margin: 0; font: 800 18px/1.2 var(--display); }
.tj-allplaced .tj-row2 { margin: 0; }
.tj-tile .tj-cap.long { font-size: 8.5px; letter-spacing: -.02em; }
.tj-keyhint { }
@media (pointer: coarse) { .tj-keyhint { display: none; } }
.tj-add .tj-lbl { font-weight: 500; color: var(--ink2); }
.tj-wide { width: 100%; }
.b.tj-ok { background: var(--go) !important; color: #fff !important; }
.tj-vout { display: grid; gap: 8px; justify-items: start; }
.tj-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 2px; font-weight: 600; }
.tj-verdict { font: 800 19px/1.35 var(--display); margin: 0 0 4px; }
.tj-cmpsum { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tj-cmpsum .tj-lbl { margin: 0; }
.tj-stripzones .tj-zbtn { flex: 1 1 0; min-width: 44px; }
.tj-deckzones[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tj-poolhead .tj-chips, .tj-deckfilters .tj-chips { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
@media (min-width: 601px) { .tj-poolhead .tj-chips { -webkit-mask-image: none; mask-image: none; padding-right: 0; } }

.tj-plane .tj-tile.txt { width: auto; min-width: calc(var(--tile) * .82); max-width: 140px; height: auto; min-height: calc(var(--tile) * .62); padding: 4px 8px; font-size: 12px; overflow-wrap: normal; hyphens: auto; }
.tj-plane .tj-tile.txt.mid, .tj-plane .tj-tile.txt.long { font-size: 11px; }
.tj-quad.q0:not([style]), .tj-quad.q3:not([style]) { background: color-mix(in srgb, var(--b) 26%, var(--card)); }
.tj-quad.q1:not([style]), .tj-quad.q2:not([style]) { background: color-mix(in srgb, var(--f) 22%, var(--card)); }
@media (max-width: 600px) { .tj-plane .tj-tile.txt { min-width: 44px; max-width: 96px; min-height: 36px; font-size: 10px; padding: 3px 5px; } }

.tj-spot .tj-tile.txt { font-size: 12.5px; }
.tj-spot .tj-tile.txt .tj-tt { -webkit-line-clamp: 3; }

.tj-rounds { justify-content: center; }
.tj-round + .tj-round .tj-match { position: relative; }
@media (min-width: 701px) {
  .tj-match { position: relative; }
  .tj-round:not(:last-child) .tj-match::after { content: ""; position: absolute; left: 100%; top: 50%; width: 14px; height: 2px; background: var(--line); }
}
.tj-ranking { max-width: 560px; }
@media (max-width: 600px) { .tj-align[data-n="5"] .tj-cellname { font-size: 9.5px; hyphens: auto; } }

@media (max-width: 520px) {
  .tj-expdlg .tj-seg { display: flex; width: 100%; }
  .tj-expdlg .tj-segb { flex: 1 1 0; min-width: 0; padding: 6px 2px; font-size: 12.5px; line-height: 1.15; }
  .tj-expdlg .tj-dlgfoot { flex-direction: column-reverse; align-items: stretch; }
  .tj-notice.tj-foreign { padding: 8px 44px 8px 10px; gap: 6px; }
  .tj-notice.tj-foreign p { font-size: 14px; line-height: 1.35; }
  body.tj-typing .tj-pool.tj-hasitems .tj-items, body.tj-typing .tj-pool.tj-hasitems .tj-chips { display: none !important; }
  .tj-notice.tj-example .b { white-space: nowrap; }
}

@media (prefers-reduced-motion: no-preference) {
  .tj-tile.just { animation: tj-pop .2s ease-out; }
  @keyframes tj-pop { from { transform: scale(1.12); } }
  .tj-allplaced .tj-alltext { animation: tj-nod .4s ease-out; }
  @keyframes tj-nod { 40% { transform: translateY(-3px); } }
  .tj-champ { animation: tj-flash .5s ease-out; }
  @keyframes tj-flash { from { box-shadow: 0 0 0 6px var(--c); } }
}

.tj-tpl .tj-title { font: 700 16px/1.3 var(--sans) !important; color: var(--ink2); min-height: 40px; }
.tj-tt { text-wrap: balance; }
