/* The player tools (/items, /npcs, /crafting, /bard). Plain CSS on top of public/css/home.css, whose tokens it uses: wood
   frames for panels, inset wells for lists, the same type and buttons, and both themes from [data-theme]. */

.tools-page {
    --dw: 460px;          /* the detail panel's width */
    --head-h: 61px;       /* the sticky header's height; tools.js keeps it measured */
}

.t-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.frame :focus-visible,
.site-head :focus-visible {
    outline-color: var(--gold);
}

/* the scrollbar's room is kept from the first paint, so the header does not jump sideways when the list arrives */
html {
    scrollbar-gutter: stable;
}

/* the footer starts below the fold: the tool drawn into the empty main a moment later moves nothing on screen */
.t-main {
    min-height: calc(100vh - var(--head-h));
    padding-top: 20px;
    padding-bottom: 40px;
}

.t-main:focus {
    outline: none;
}

.t-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 60px 16px;
    color: var(--muted);
    text-align: center;
}

.t-status .spinner {
    margin: 0 0 10px;
}

.t-status.is-error {
    color: var(--text);
}

.t-status.is-error > i {
    color: var(--warn-ink);
    font-size: 28px;
}

/* ---------- the header's search (a combobox) ---------- */

.t-search {
    flex-basis: 300px;
}

.t-search input {
    padding-right: 40px;
}

.t-slist {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: min(380px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    overflow-y: auto;
    z-index: 45;
    padding: 4px;
    background: var(--well);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 2px var(--trim), 0 0 0 3px var(--ink), 6px 6px 0 rgba(0, 0, 0, .3);
    color: var(--text);
}

.t-sgroup + .t-sgroup {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--well-ring);
}

.t-shead {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px 2px;
    color: var(--muted);
    font: 700 12px var(--font);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.t-shead i {
    color: var(--accent);
}

.t-shead small {
    margin-left: auto;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.t-sopt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border: 1px solid transparent;
    cursor: pointer;
}

.t-sopt[aria-selected="true"] {
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

.t-spic {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--accent);
}

.t-spic img {
    max-width: 34px;
    max-height: 34px;
    width: auto;
    height: auto;
}

.t-sname {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.t-sname span {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.t-sname small,
.t-sr-empty {
    color: var(--muted);
    font-size: 13px;
}

.t-sr-empty {
    padding: 10px;
}

/* ---------- layout: filters on the left, results on the right ---------- */

.t-layout {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.t-view[hidden] {
    display: none;
}

.t-filters {
    position: sticky;
    top: calc(var(--head-h) + 14px);
    max-height: calc(100vh - var(--head-h) - 28px);
    overflow-y: auto;
    color: var(--wood-text);
    scrollbar-width: thin;
}

.t-filters > summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px 11px;
    border-bottom: 1px solid var(--ink);
    background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .22));
    font: 700 17px var(--font);
    text-shadow: 1px 1px 0 var(--ink);
    cursor: pointer;
    list-style: none;
}

.t-filters > summary::-webkit-details-marker {
    display: none;
}

.t-filters > summary > i:first-child {
    color: var(--gold);
}

.t-filtercount:not(:empty) {
    padding: 0 7px;
    background: var(--gold);
    border: 1px solid var(--ink);
    color: #1f180d;
    font: 600 12px/18px var(--mono);
    text-shadow: none;
}

.t-chev {
    margin-left: auto;
    font-size: 12px;
    transition: transform .2s var(--ease);
}

.t-filters[open] .t-chev {
    transform: rotate(180deg);
}

@media (min-width: 900px) {
    .t-filters > summary {
        cursor: default;
    }
    .t-chev {
        display: none;
    }
}

.t-form {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.t-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.t-field > label,
.t-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--wood-text);
    font: 600 14.5px var(--font);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
}

.t-field small {
    color: var(--wood-muted);
    font-size: 12.5px;
    line-height: 1.35;
}

.t-out {
    color: var(--gold);
    font: 500 13px var(--mono);
}

.t-form input[type="search"],
.t-form input[type="number"],
.t-form select,
.t-n,
.t-own,
.t-recipe-pick {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--slot);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
    color: var(--wood-text);
    font: 15px var(--font);
}

.t-form select,
.t-recipe-pick {
    padding-right: 6px;
}

.t-form select:disabled,
.t-form input:disabled {
    opacity: .55;
}

.t-form input::placeholder,
.t-own::placeholder {
    color: #a69676;
}

.t-form input:focus,
.t-form select:focus,
.t-n:focus,
.t-own:focus,
.t-recipe-pick:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--gold), inset 2px 2px 0 rgba(0, 0, 0, .5);
}

.t-form option,
.t-form optgroup,
.t-recipe-pick option {
    background: #30291e;
    color: #f4ead2;
}

.t-inline {
    display: flex;
    gap: 8px;
}

.t-inline > select {
    flex: 1;
}

.t-statmin input {
    flex: 0 0 76px;
}

.t-check {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--wood-text);
    font: 600 14.5px var(--font);
    cursor: pointer;
}

.t-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--gold);
}

.t-form input[type="range"] {
    width: 100%;
    margin: 4px 0;
    accent-color: var(--gold);
}

/* two range inputs as one min..max slider */
.t-range2 {
    position: relative;
    height: 26px;
    --lo: 0%;
    --hi: 100%;
}

.t-range2::before,
.t-range2::after {
    content: '';
    position: absolute;
    top: 11px;
    height: 4px;
    border: 1px solid var(--ink);
}

.t-range2::before {
    left: 0;
    right: 0;
    background: var(--slot);
}

.t-range2::after {
    left: var(--lo);
    right: calc(100% - var(--hi));
    background: var(--gold);
}

.t-range2 input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 26px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.t-range2 input::-webkit-slider-runnable-track {
    background: transparent;
    border: 0;
}

.t-range2 input::-moz-range-track {
    background: transparent;
    border: 0;
}

.t-range2 input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 1px solid var(--ink);
    background: linear-gradient(180deg, #f0d585, #b8964a);
    box-shadow: var(--bevel);
    pointer-events: auto;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.t-range2 input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: linear-gradient(180deg, #f0d585, #b8964a);
    pointer-events: auto;
    cursor: pointer;
}

.t-range2 input:focus-visible::-webkit-slider-thumb {
    outline: 2px dashed var(--gold);
    outline-offset: 2px;
}

.t-formfoot {
    display: flex;
    justify-content: flex-end;
}

.t-btn-quiet {
    background: linear-gradient(180deg, #8f7a48, #6e5c33);
    color: #f4ead2;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .4);
}

.t-btn-quiet:hover {
    color: #fff6dc;
    background: linear-gradient(180deg, #a08a52, #7a6639);
}

.t-btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 14px;
}

.t-dir {
    flex: none;
}

/* ---------- results ---------- */

.t-results {
    min-width: 0;
}

.t-resbar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px dashed var(--well-ring);
}

.t-title {
    margin: 0;
    font: 800 28px/1.2 var(--font);
    letter-spacing: 0;
    text-shadow: 2px 2px 0 var(--shade);
}

.t-title i {
    margin-right: 10px;
    color: var(--accent);
    font-size: 22px;
}

.t-resultcount {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.t-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-grid > li {
    min-width: 0;
}

.t-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 100%;
    padding: 12px 12px 10px;
    background: var(--well);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--well-ring), inset 2px 2px 0 var(--shade);
    color: var(--text);
    content-visibility: auto;
    contain-intrinsic-size: auto 196px;
    transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}

.t-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 var(--shade), 3px 3px 0 rgba(0, 0, 0, .25);
}

.t-card[aria-current] {
    box-shadow: 0 0 0 2px var(--accent), inset 2px 2px 0 var(--shade);
}

.t-card-pic {
    display: grid;
    place-items: center;
    height: 72px;
    margin-bottom: 4px;
    background: radial-gradient(closest-side, var(--accent-soft), transparent);
}

.t-card-pic img {
    max-width: 100%;
    max-height: 72px;
    width: auto;
    height: auto;
}

.t-card-sprite {
    height: 104px;
}

.t-card-sprite img {
    max-height: 100px;
}

.t-card-name {
    font: 700 16.5px/1.25 var(--font);
    overflow-wrap: anywhere;
}

.t-card-sub {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.3;
}

.t-card-blurb {
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.35;
}

.t-card-blurb:empty {
    display: none;
}

.t-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 6px;
}

.t-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.t-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    justify-content: center;
    border: 1px solid var(--well-ring);
    color: var(--accent);
    font: 600 12px var(--mono);
}

.t-price {
    color: var(--text-2);
    font: 500 12.5px var(--mono);
    white-space: nowrap;
}

.t-noimg {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--muted);
    opacity: .6;
}

.t-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 4px 10px;
    border: 1px dashed var(--accent-line);
    background: transparent;
    color: var(--accent);
    font: 600 14px var(--font);
    cursor: pointer;
}

.t-more:hover {
    background: var(--accent-soft);
}

.t-more-big {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 16px;
    padding: 10px;
}

.t-more[hidden] {
    display: none;
}

.t-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 50px 16px;
    color: var(--muted);
    text-align: center;
}

.t-empty > i {
    font-size: 30px;
    color: var(--accent);
}

.t-empty p {
    margin: 0;
}

.t-empty[hidden] {
    display: none;
}

/* ---------- the detail panel ---------- */

.t-backdrop {
    position: fixed;
    inset: 0;
    z-index: 34;
    background: rgba(10, 8, 5, .5);
    animation: fade .2s ease;
}

.t-detail {
    position: fixed;
    top: var(--head-h);
    right: 0;
    bottom: 0;
    z-index: 35;
    display: flex;
    flex-direction: column;
    width: min(var(--dw), 100vw);
    background: var(--well);
    border-left: 4px solid var(--trim);
    outline: 1px solid var(--ink);
    box-shadow: -8px 0 0 rgba(0, 0, 0, .2);
    color: var(--text);
    animation: t-slide .22s var(--ease);
}

.t-detail[hidden],
.t-backdrop[hidden] {
    display: none;
}

@keyframes t-slide {
    from { transform: translateX(30px); opacity: 0; }
}

.t-detail-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--wood-tex);
    border-bottom: 3px solid var(--trim-lo);
    box-shadow: inset 0 -1px 0 var(--ink);
}

.t-detail-head .btn[hidden] {
    display: none;
}

.t-trail-nav {
    flex: 1;
    min-width: 0;
}

.t-trail {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
    font: 600 14px var(--font);
}

.t-trail::-webkit-scrollbar {
    display: none;
}

.t-trail li {
    flex: none;
    display: flex;
    align-items: center;
    max-width: 180px;
    color: var(--wood-text);
    text-shadow: 1px 1px 0 var(--ink);
}

.t-trail li + li::before {
    content: '\203A';
    margin: 0 6px;
    color: var(--wood-muted);
}

.t-trail a,
.t-trail span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-trail a {
    color: var(--gold);
}

.t-trail [aria-current] {
    color: var(--wood-text);
}

.t-detail-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 18px 40px;
}

.t-dhead {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.t-dpic {
    flex: none;
    display: grid;
    place-items: center;
    min-width: 72px;
    min-height: 72px;
    padding: 6px;
    background: var(--slot);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
}

.t-dpic img {
    display: block;
}

.t-sprite img {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
}

.t-bigglyph {
    color: var(--gold);
    font-size: 30px;
}

.t-dtitle {
    min-width: 0;
}

.t-dtitle h2 {
    margin: 0;
    font: 700 25px/1.15 var(--font);
    overflow-wrap: anywhere;
}

.t-dtitle h2:focus {
    outline: none;
}

.t-dtitle h2:focus-visible {
    outline: 2px dashed var(--accent);
}

.t-dtitle p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14.5px;
}

.t-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.t-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px;
    border: 1px solid var(--well-ring);
    color: var(--text-2);
    font: 600 12.5px var(--font);
}

.t-chip i {
    color: var(--accent);
    font-size: 11px;
}

.t-chip.c-boss {
    border-color: var(--warn-ink);
    color: var(--warn-ink);
}

.t-chip.c-warn {
    margin-left: 6px;
    border-color: var(--warn-ink);
    color: var(--warn-ink);
}

.t-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 6px;
}

.t-actions .btn {
    height: 34px;
    font-size: 14.5px;
}

.t-sec {
    margin-top: 18px;
}

.t-sec h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--well-ring);
    font: 700 17px var(--font);
}

.t-sec h3 > i {
    color: var(--accent);
    font-size: 14px;
}

.t-count {
    padding: 0 6px;
    border: 1px solid var(--well-ring);
    color: var(--muted);
    font: 500 12px/18px var(--mono);
}

.t-note {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.t-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 18px;
}

.t-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-pills li {
    padding: 2px 9px;
    background: var(--well-2);
    border: 1px solid var(--well-ring);
    font-size: 14.5px;
}

.t-facts {
    display: grid;
    gap: 0;
    margin: 0;
}

.t-facts > div {
    display: grid;
    grid-template-columns: minmax(110px, 36%) minmax(0, 1fr);
    gap: 12px;
    padding: 5px 2px;
    border-bottom: 1px solid var(--hover);
}

.t-facts dt {
    color: var(--muted);
    font-size: 14px;
}

.t-facts dd {
    margin: 0;
    font-size: 14.5px;
    overflow-wrap: anywhere;
}

.t-list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 5px 4px;
    border-bottom: 1px solid var(--hover);
}

.t-row:last-child {
    border-bottom: 0;
}

.t-row.t-best {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}

.t-thumb {
    display: grid;
    place-items: center;
    width: 40px;
    min-height: 32px;
}

.t-thumb img {
    max-width: 40px;
    max-height: 40px;
    width: auto;
    height: auto;
}

.t-glyph {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: var(--well-2);
    border: 1px solid var(--well-ring);
    color: var(--accent);
    font-size: 14px;
}

.t-row-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.t-row-main > a,
.t-row-main > span:first-child {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.t-meta {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 400;
}

.t-row-end {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: end;
}

.t-spots {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    max-width: 190px;
}

.t-world {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border: 1px solid var(--well-ring);
    color: var(--accent);
    font: 500 12px/20px var(--mono);
    white-space: nowrap;
}

.t-world:hover {
    background: var(--accent-soft);
    text-decoration: none;
}

.t-recipe {
    padding: 8px 4px;
    border-bottom: 1px solid var(--hover);
}

.t-recipe-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin-bottom: 4px;
    font-weight: 600;
}

.t-ings {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-ings li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.t-ings .t-thumb {
    width: 32px;
    min-height: 28px;
}

.t-qty {
    color: var(--accent);
    font: 600 13.5px var(--mono);
}

.t-mapwell {
    position: relative;
    display: block;
    margin: 0 0 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--well-ring);
    aspect-ratio: 16 / 10;
}

.t-mapthumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t-mapgo {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 10px;
    background: rgba(18, 18, 18, .78);
    border: 1px solid var(--ink);
    color: #f4ead2;
    font: 600 14px var(--font);
}

.t-mapwell:hover .t-mapgo {
    background: rgba(18, 18, 18, .92);
    color: var(--gold);
}

.t-cmpwrap {
    overflow-x: auto;
    margin-top: 10px;
}

.t-cmp {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.t-cmp th,
.t-cmp td {
    padding: 6px;
    border-bottom: 1px solid var(--hover);
    text-align: left;
    vertical-align: top;
}

.t-cmp thead th {
    vertical-align: bottom;
}

.t-cmp thead th .t-thumb {
    margin-bottom: 4px;
}

.t-cmp tbody th {
    width: 7.5em;
    color: var(--muted);
    font-weight: 500;
}

.t-cmp .t-better {
    color: var(--get-ink);
    background: var(--get-bg);
    font-weight: 700;
}

.t-x {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-left: 6px;
    padding: 0;
    border: 1px solid var(--well-ring);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    vertical-align: middle;
}

.t-x:hover {
    color: var(--warn-ink);
    border-color: var(--warn-ink);
}

/* ---------- hover and focus previews ---------- */

.t-tip {
    position: fixed;
    z-index: 60;
    width: max-content;
    max-width: min(310px, calc(100vw - 16px));
    padding: 10px 12px;
    background: var(--well);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--trim), 0 0 0 2px var(--ink), 5px 5px 0 rgba(0, 0, 0, .3);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.4;
    pointer-events: none;
}

.t-tip[hidden] {
    display: none;
}

.t-tip-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.t-tip-head strong {
    display: block;
    font-size: 15.5px;
}

.t-tip-head small {
    color: var(--muted);
}

.t-tip-pic img {
    max-width: 64px;
    max-height: 64px;
    width: auto;
    height: auto;
}

.t-tip-pic .t-tip-map {
    max-width: 120px;
    max-height: 76px;
}

.t-tip ul {
    margin: 6px 0 0;
    padding: 6px 0 0;
    border-top: 1px dashed var(--well-ring);
    list-style: none;
}

/* ---------- the comparison tray ---------- */

.t-tray {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 32;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 6px 8px 6px 12px;
    transform: translateX(-50%);
    color: var(--wood-text);
}

.t-tray[hidden] {
    display: none;
}

.t-tray-label {
    color: var(--gold);
    font-weight: 700;
    white-space: nowrap;
}

.t-tray-list {
    display: flex;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
}

.t-tray-list a {
    display: block;
    max-width: 160px;
    padding: 2px 8px;
    overflow: hidden;
    background: var(--slot);
    border: 1px solid var(--ink);
    color: var(--wood-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-tray-go {
    flex: none;
    background: linear-gradient(180deg, #f0d585, #b8964a);
}

body.t-has-tray .t-main {
    padding-bottom: 90px;
}

/* ---------- the crafting planner ---------- */

.t-picklist {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 4px;
    max-height: 58vh;
    overflow-y: auto;
    list-style: none;
    background: var(--slot);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
}

.t-filters .t-resultcount {
    margin: -4px 0 0;
    color: var(--wood-muted);
    font-size: 13px;
}

.t-pick {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 6px;
    border: 1px solid transparent;
    color: var(--wood-text);
}

.t-pick:hover {
    text-decoration: none;
    background: rgba(255, 236, 190, .07);
    border-color: rgba(174, 164, 137, .3);
}

.t-pick[aria-current] {
    background: rgba(236, 206, 120, .16);
    border-color: var(--gold);
}

.t-pick .t-thumb {
    width: 34px;
    min-height: 30px;
}

.t-pick-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.t-pick-name span {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.t-pick-name small,
.t-pick small {
    color: var(--wood-muted);
    font-size: 12.5px;
}

.t-plan {
    min-width: 0;
    container: plan / inline-size;
}

.t-plan-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
    margin-bottom: 12px;
    padding: 14px 16px;
    color: var(--wood-text);
}

.t-plan-pic {
    display: grid;
    place-items: center;
    min-width: 64px;
    min-height: 64px;
    background: var(--slot);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
}

.t-plan-title {
    flex: 1;
    min-width: 180px;
}

.t-plan-title h2 {
    margin: 0;
    font: 700 24px/1.2 var(--font);
    text-shadow: 1px 1px 0 var(--ink);
}

.t-plan-title h2 a {
    color: var(--wood-text);
}

.t-plan-title p {
    margin: 2px 0 0;
    color: var(--wood-muted);
}

.t-nfield {
    width: 120px;
}

.t-plan-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 10px;
}

.t-tree-box,
.t-shop-box {
    padding: 0 0 12px;
    color: var(--wood-text);
}

.t-tree-box {
    container: tree / inline-size;
}

.t-shop-box {
    position: sticky;
    top: calc(var(--head-h) + 14px);
}

.t-box-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 10px;
    padding: 10px 14px 11px;
    border-bottom: 1px solid var(--ink);
    background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .22));
    font: 700 18px var(--font);
    text-shadow: 1px 1px 0 var(--ink);
}

.t-box-title i {
    color: var(--gold);
}

.t-tree-box > .t-note {
    margin: 0 14px 10px;
    color: var(--wood-muted);
}

.t-tree,
.t-node-kids {
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-tree {
    margin: 0 12px;
}

.t-node-kids {
    margin-left: 18px;
    padding-left: 14px;
    border-left: 2px dashed rgba(244, 234, 210, .25);
}

.t-node {
    margin-top: 8px;
}

.t-node-card {
    display: grid;
    grid-template-columns: auto 44px minmax(0, 1fr) auto;
    grid-template-areas: "tog pic main own" "tog pic note note";
    align-items: center;
    gap: 2px 10px;
    padding: 8px 10px;
    background: var(--well);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--well-ring), inset 2px 2px 0 var(--shade);
    color: var(--text);
}

.t-node-card.is-raw {
    background: var(--well-2);
}

.t-tog {
    grid-area: tog;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--well-ring);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.t-tog[aria-expanded="false"] i {
    transform: rotate(-90deg);
}

.t-node-card:not(:has(.t-tog))::before {
    content: '';
    grid-area: tog;
    width: 26px;
}

.t-node-pic {
    grid-area: pic;
    display: grid;
    place-items: center;
}

.t-node-pic img {
    max-width: 44px;
    max-height: 44px;
    width: auto;
    height: auto;
}

.t-node-main {
    grid-area: main;
    min-width: 0;
}

.t-node-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.t-node-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    color: var(--muted);
    font-size: 14px;
}

.t-node-counts b {
    color: var(--text);
    font-family: var(--mono);
}

.t-left b {
    color: var(--accent);
}

.t-left.is-done b {
    color: var(--get-ink);
    background: var(--get-bg);
    padding: 0 5px;
}

.t-node-own {
    grid-area: own;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

.t-own {
    width: 78px;
    height: 32px;
}

.t-node-extra {
    grid-area: note;
    min-width: 0;
}

.t-node-recipe,
.t-node-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13.5px;
}

.t-node-recipe i,
.t-node-note i {
    color: var(--accent);
}

.t-recipe-pick {
    flex: 1;
    min-width: 0;
    height: 32px;
    font-size: 14px;
}

.t-shoplist {
    padding: 0 12px;
}

.t-shopping {
    padding: 4px 8px;
    background: var(--well);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 1px var(--well-ring), inset 2px 2px 0 var(--shade);
    color: var(--text);
}

.t-shopping .t-row-main > span:first-child {
    font-weight: 400;
}

.t-done {
    margin: 0;
    padding: 10px;
    background: var(--well);
    border: 1px solid var(--ink);
    color: var(--text);
}

.t-done i {
    color: #8fd14f;
}

.t-cost {
    display: grid;
    gap: 4px;
    margin: 12px 12px 0;
}

.t-cost > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--wood-muted);
}

.t-cost b {
    color: var(--wood-text);
    font-family: var(--mono);
    font-weight: 600;
}

.t-cost .t-cost-total {
    padding-top: 6px;
    border-top: 1px dashed rgba(244, 234, 210, .3);
    color: var(--wood-text);
    font-weight: 700;
}

.t-cost .t-cost-total b {
    color: var(--gold);
    font-size: 17px;
}

.t-cost .t-note {
    margin: 4px 0 0;
    color: var(--wood-muted);
}

.t-intro {
    padding: 18px 20px 20px;
    color: var(--wood-text);
}

.t-intro h2 {
    margin: 0 0 8px;
    font: 700 22px var(--font);
    text-shadow: 1px 1px 0 var(--ink);
}

.t-intro h3 {
    margin: 18px 0 8px;
    font: 700 17px var(--font);
}

.t-intro .t-note {
    color: var(--gold);
}

.t-bullets {
    margin: 0;
    padding-left: 20px;
}

.t-bullets li + li {
    margin-top: 4px;
}

.t-hubs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-hubs .t-pick {
    background: var(--slot);
    border-color: var(--ink);
}

.t-hubs .t-pick small {
    margin-left: auto;
}

/* ---------- the bard (/bard) ---------- */

/* The roll and the track colours sit on the panels' wood and dark slots, which stay the same in both themes. */
.t-bard {
    --roll-bg: #221d15;
    --roll-band: #2b251b;
    --roll-grid: rgba(174, 164, 137, .2);
    --roll-text: #a69676;
    --trk-0: #ecce78;
    --trk-1: #8fd3f0;
    --trk-2: #f08a5d;
    --trk-3: #a8e07a;
    --trk-4: #c9a8ff;
    --trk-5: #ff9cc4;
    --trk-6: #7fe0c6;
    --trk-7: #f2f2f2;
}

.t-bard-status {
    margin: 0 0 12px;
    color: var(--text-2);
    font-size: 15px;
}

.t-bard-status:empty {
    display: none;
}

.t-bard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.t-bard-main,
.t-bard-side {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.t-bard-box {
    min-width: 0;
    padding: 0 0 12px;
    color: var(--wood-text);
}

.t-bard-box .t-note,
.t-bard-box .t-meta {
    color: var(--wood-muted);
}

.t-bard-box > .t-note,
.t-bard-box > .t-bard-note,
.t-bard-box > .t-actions,
.t-bard-box > .t-tracks,
.t-bard-box > .t-book,
.t-bard-box > details {
    margin-left: 14px;
    margin-right: 14px;
}

.t-bard-box a {
    color: var(--gold);
}

.t-box-sub {
    margin-top: 14px;
    border-top: 1px solid var(--ink);
}

.t-ext {
    margin-left: 4px;
    font-size: .75em;
}

/* the instruments */
.t-bard-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 14px 0;
}

.t-bard-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 2px 11px 2px 4px;
    border: 1px solid var(--ink);
    background: var(--slot);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
    color: var(--wood-text);
    font: 600 14.5px var(--font);
    cursor: pointer;
}

.t-bard-pick:hover {
    background: #3a3224;
}

.t-bard-pick[aria-checked="true"] {
    background: #4a3f27;
    box-shadow: 0 0 0 2px var(--gold), inset 2px 2px 0 rgba(0, 0, 0, .4);
    color: #fff6dc;
}

.t-bard-pick .t-thumb {
    width: 32px;
    min-height: 32px;
}

.t-bard-pick .t-thumb img {
    max-width: 32px;
    max-height: 32px;
}

.t-bard-head {
    padding: 12px 14px 6px;
}

.t-bard-ins {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

/* the musician window: three rows of twelve notes, or six pads */
.t-pad-wrap {
    padding: 6px 14px 10px;
}

.t-pad {
    display: grid;
    gap: 5px;
}

.t-pad-row {
    display: grid;
    grid-template-columns: 22px repeat(12, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
}

.t-pad.is-pads .t-pad-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.t-pad-label {
    align-self: center;
    color: var(--wood-muted);
    font: 500 12px var(--mono);
    text-align: center;
}

.t-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 1px solid var(--ink);
    background: linear-gradient(180deg, #3d3426, #2c251b);
    box-shadow: 0 0 0 1px rgba(174, 164, 137, .45), inset 1px 1px 0 rgba(255, 240, 205, .08);
    color: var(--wood-text);
    font: 700 14px var(--font);
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.t-cell.is-sharp {
    background: linear-gradient(180deg, #221d15, #17130e);
    color: var(--wood-muted);
}

.t-cell:hover {
    background: #4a3f2c;
}

.t-cell:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.t-pad.is-pads .t-cell {
    height: 72px;
    border-radius: 50% / 40%;
    font-size: 20px;
}

.t-cell-name {
    overflow: hidden;
    max-width: 100%;
    line-height: 1.1;
}

.t-cell-key {
    color: var(--wood-muted);
    font: 500 10.5px var(--mono);
    opacity: .8;
}

.t-cell.is-on {
    animation: t-hit .32s ease-out;
}

.t-cell.is-dropped {
    animation: t-miss .32s ease-out;
}

@keyframes t-hit {
    from { background: var(--gold); color: #1f180d; }
}

@keyframes t-miss {
    from { background: #a8321b; color: #ffe7c2; }
}

.t-bard-note {
    display: block;
    min-height: 1.5em;
    margin-bottom: 6px;
    color: var(--gold);
    font: 500 13px/1.5 var(--mono);
    overflow-wrap: anywhere;
}

.t-bard-about summary,
.t-bard-textio summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--wood-text);
    font-weight: 600;
    cursor: pointer;
}

.t-bard-about summary i,
.t-bard-textio summary i {
    color: var(--gold);
}

.t-bard-about .t-bullets {
    margin-bottom: 4px;
    color: var(--wood-muted);
    font-size: 14px;
    line-height: 1.45;
}

/* the song */
.t-bard-songhead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px;
}

.t-bard-songhead > i {
    color: var(--gold);
    font-size: 18px;
}

.t-bard-title {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--ink);
    background: var(--slot);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
    color: var(--wood-text);
    font: 700 19px var(--font);
}

.t-bard-title:focus,
.t-bard-speed:focus,
.t-bard-text:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--gold), inset 2px 2px 0 rgba(0, 0, 0, .5);
}

.t-bard-credit {
    margin: 0 14px 12px;
    padding: 8px 12px;
    border-left: 3px solid var(--gold);
    background: rgba(0, 0, 0, .18);
    font-size: 14.5px;
    line-height: 1.45;
}

.t-bard-credit[hidden] {
    display: none;
}

.t-bard-credit p {
    margin: 0;
}

.t-bard-credit i {
    color: var(--gold);
}

.t-bard-transport {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 0 14px;
}

.t-bard-rec[aria-pressed="true"] {
    background: linear-gradient(180deg, #c0462a, #8d2a15);
    color: #ffe7c2;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .4);
}

.t-bard-rec[aria-pressed="true"] i {
    animation: t-blink 1s steps(2, start) infinite;
}

@keyframes t-blink {
    to { visibility: hidden; }
}

.t-bard-transport [aria-pressed="true"].btn-icon {
    box-shadow: 0 0 0 2px var(--gold), var(--bevel);
}

.t-bard-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--wood-text);
    font: 600 14px var(--font);
}

.t-bard-speed {
    height: 34px;
    padding: 0 4px 0 8px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--slot);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
    color: var(--wood-text);
    font: 15px var(--font);
}

.t-bard-speed option {
    background: #30291e;
    color: #f4ead2;
}

.t-bard-time {
    color: var(--gold);
    font: 500 14px var(--mono);
}

.t-bard-prep {
    width: 110px;
    height: 10px;
    accent-color: var(--gold);
}

.t-bard-prep[hidden] {
    display: none;
}

.t-bard-stats {
    min-height: 0;
    margin: 6px 14px 0;
}

.t-bard-stats:empty {
    display: none;
}

.t-tracks {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}

.t-track {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) minmax(0, 170px) auto auto;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--ink);
    background: rgba(0, 0, 0, .16);
}

.t-track.is-selected {
    background: rgba(236, 206, 120, .12);
    border-color: var(--trim-hi);
}

.t-track.is-muted > :not(.t-track-tools):not(.t-track-edit) {
    opacity: .55;
}

.t-track-edit {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--ink);
    background: var(--c, var(--trk-0));
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .35), inset -1px -1px 0 rgba(0, 0, 0, .35);
    color: #1f180d;
    cursor: pointer;
}

.t-track-edit i {
    opacity: 0;
}

.t-track-edit[aria-pressed="true"] {
    box-shadow: 0 0 0 2px var(--wood-text), inset 1px 1px 0 rgba(255, 255, 255, .35);
}

.t-track-edit[aria-pressed="true"] i,
.t-track-edit:hover i,
.t-track-edit:focus-visible i {
    opacity: 1;
}

.t-track .t-track-name {
    width: 100%;
    height: 36px;
}

.t-track-count {
    white-space: nowrap;
}

.t-track-tools {
    display: flex;
    gap: 4px;
}

.t-track-tools .btn-icon {
    width: 30px;
}

.t-bard-trackbar {
    align-items: center;
    margin-top: 10px;
}

.t-bard-trackbar .t-bard-step {
    width: 90px;
    height: 32px;
}

.t-roll {
    position: relative;
    margin: 4px 14px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--ink);
    background: var(--roll-bg);
    box-shadow: 0 0 0 1px var(--trim-hi);
    scrollbar-color: var(--trim) var(--slot);
}

.t-roll:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.t-roll-canvas {
    display: block;
    cursor: crosshair;
    touch-action: pan-x;
}

.t-roll-head {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: var(--gold);
    box-shadow: 0 0 6px rgba(236, 206, 120, .8);
    pointer-events: none;
    will-change: transform;
}

.t-roll-head[hidden] {
    display: none;
}

.t-bard-textio {
    margin-top: 8px;
}

.t-bard-text {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--slot);
    box-shadow: 0 0 0 1px var(--trim-hi), inset 2px 2px 0 rgba(0, 0, 0, .5);
    color: var(--wood-text);
    font: 12.5px/1.45 var(--mono);
    resize: vertical;
}

.t-bard-hint {
    color: var(--wood-muted);
    font-size: 12.5px;
    line-height: 1.35;
}

/* the songbook and the saved songs */
.t-book {
    display: grid;
    gap: 4px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}

.t-book li {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* while the songbook loads: the room its songs take in the side column (nine songs, 552 px at the column's width),
   so the saved songs and the settings under it stay put when it comes; one column (narrower screens) needs none,
   the songbook is under the instrument there */
@media (min-width: 1101px) {
    .t-book[aria-busy="true"] {
        min-height: 552px;
    }
}

.t-book .t-pick {
    flex: 1;
    min-width: 0;
    background: var(--slot);
    border-color: var(--ink);
}

.t-book .t-pick[aria-current] {
    background: #4a3f27;
    border-color: var(--gold);
}

.t-book-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
    margin-left: auto;
    max-width: 82px;
}

.t-book-ins img {
    display: block;
    max-width: 22px;
    max-height: 22px;
    width: auto;
    height: auto;
}

.t-book .btn-icon {
    flex: none;
    width: 32px;
}

.t-book .is-armed {
    background: linear-gradient(180deg, #c0462a, #8d2a15);
    color: #ffe7c2;
}

@media (max-width: 1100px) {
    .t-bard-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- wide screens: the detail sits beside the list ---------- */

@media (min-width: 1280px) {
    body.t-detail-open .t-main {
        max-width: none;
        margin-right: calc(var(--dw) + 4px);
        padding-left: 24px;
        padding-right: 24px;
    }
    body.t-detail-open .t-backdrop {
        display: none;
    }
    /* beside the detail, clear of the filters on the left */
    body.t-detail-open .t-tray {
        left: auto;
        right: calc(var(--dw) + 28px);
        max-width: calc(100vw - var(--dw) - 360px);
        transform: none;
    }
}

@media (max-width: 1279px) {
    body.t-detail-open {
        overflow: hidden;
    }
}

/* ---------- narrower ---------- */

@media (max-width: 1100px) {
    .t-plan-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .t-shop-box {
        position: static;
    }
}

/* by the room the plan really has (the detail panel beside it takes 460 px): the shopping list goes under the tree
   before the tree's names have to break, and a narrow tree stacks each card's "have" box under its name */
@container plan (max-width: 760px) {
    .t-plan-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .t-shop-box {
        position: static;
    }
}

@container tree (max-width: 480px) {
    .t-node-card {
        grid-template-columns: auto 36px minmax(0, 1fr);
        grid-template-areas: "tog pic main" "tog own own" "tog note note";
    }
    .t-node-pic img {
        max-width: 36px;
        max-height: 36px;
    }
    .t-node-kids {
        margin-left: 6px;
        padding-left: 8px;
    }
}

@media (max-width: 899px) {
    .t-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
    .t-filters {
        position: static;
        max-height: none;
    }
    .t-picklist {
        max-height: 44vh;
    }
}

@media (max-width: 980px) {
    .t-search {
        flex: 1 1 200px;
    }
}

@media (max-width: 560px) {
    .tools-page .wrap {
        padding: 0 16px;
    }
    .t-detail {
        top: 0;
        width: 100vw;
        border-left: 0;
        z-index: 55;
    }
    .t-grid {
        grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
        gap: 10px;
    }
    .t-title {
        font-size: 24px;
    }
    .t-detail-body {
        padding: 14px 16px 40px;
    }
    .t-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }
    .t-row-end {
        grid-column: 2;
        justify-self: start;
    }
    .t-spots {
        justify-content: flex-start;
        max-width: none;
    }
    .t-node-card {
        grid-template-columns: auto 36px minmax(0, 1fr);
        grid-template-areas: "tog pic main" "tog own own" "tog note note";
    }
    .t-node-pic img {
        max-width: 36px;
        max-height: 36px;
    }
    .t-node-kids {
        margin-left: 6px;
        padding-left: 8px;
    }
    .t-tree {
        margin: 0 8px;
    }
    .t-tray-label {
        display: none;
    }
    .t-slist {
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .t-bard-grid,
    .t-bard-main,
    .t-bard-side {
        gap: 14px;
    }
    .t-pad-wrap {
        padding: 4px 8px 8px;
    }
    .t-bard-box > .t-note,
    .t-bard-box > .t-bard-note,
    .t-bard-box > .t-actions,
    .t-bard-box > .t-tracks,
    .t-bard-box > .t-book,
    .t-bard-box > details {
        margin-left: 10px;
        margin-right: 10px;
    }
    .t-pad-row {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 2px;
    }
    .t-pad-label,
    .t-cell-key {
        display: none;
    }
    .t-cell {
        height: 40px;
        font-size: 12px;
    }
    .t-pad.is-pads .t-cell {
        height: 60px;
    }
    .t-track {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-areas: "edit name tools" "edit sel count";
    }
    .t-track-edit {
        grid-area: edit;
        align-self: start;
    }
    .t-track-name {
        grid-area: name;
    }
    .t-track .t-recipe-pick {
        grid-area: sel;
    }
    .t-track-count {
        grid-area: count;
    }
    .t-track-tools {
        grid-area: tools;
    }
    .t-roll {
        margin-left: 10px;
        margin-right: 10px;
    }
    .t-bard-picks,
    .t-bard-songhead,
    .t-bard-transport,
    .t-bard-head {
        padding-left: 10px;
        padding-right: 10px;
    }
    .t-bard-credit {
        margin-left: 10px;
        margin-right: 10px;
    }
    /* fingers: the controls at least 44 px */
    .tools-page .btn,
    .t-form input[type="search"],
    .t-form input[type="number"],
    .t-form select,
    .t-n,
    .t-own,
    .t-recipe-pick,
    .t-bard-speed {
        height: 44px;
    }
    .tools-page .btn-icon {
        width: 44px;
    }
    .t-cell {
        height: 44px;
    }
}

/* ---------- a phone held sideways ----------
   The header scrolls away here (home.css), so what stuck under it sticks to the top of the screen instead. */
@media (orientation: landscape) and (max-height: 500px) {
    .t-filters {
        top: 14px;
        max-height: calc(100vh - 28px);
    }
    .t-shop-box {
        top: 14px;
    }
    .t-detail {
        top: 0;
    }
}

/* ---------- the changelog (/tools/changes): a news feed, one entry per release ---------- */

.t-changes .t-results {
    max-width: 920px;
    margin: 0 auto;
}

.t-cl-atom {
    margin-left: auto;
}

.t-cl-intro {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.45;
}

.t-cl-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0 0 18px;
    font-size: 14px;
}

.t-cl-bar-label {
    color: var(--muted);
}

.t-cl-bar-label i {
    margin-right: 5px;
}

.t-cl-bar select {
    max-width: 100%;
    padding: 3px 6px;
    font-size: 14px;
}

.t-cl-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.t-cl-status .spinner {
    margin: 0;
}

.t-cl-status.is-error {
    color: var(--warn-ink);
}

.t-cl-feed {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-cl-entry {
    padding: 14px 16px 12px;
    background: var(--well);
    border: 1px solid var(--ink);
    border-left: 4px solid var(--fam-item);
    box-shadow: 0 0 0 1px var(--well-ring), inset 2px 2px 0 var(--shade);
}

.t-cl-entry.is-server {
    border-left-color: var(--fam-map);
}

.t-cl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    color: var(--muted);
    font-size: 14px;
}

.t-cl-ver {
    padding: 1px 8px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font: 600 14px/1.4 var(--mono);
    text-decoration: none;
}

.t-cl-ver:hover {
    background: var(--hover);
}

.t-cl-src i {
    margin-right: 5px;
}

.t-cl-head {
    margin: 8px 0 4px;
    font: 700 22px/1.25 var(--font);
    letter-spacing: 0;
}

.t-cl-head a {
    color: var(--text);
    text-decoration: none;
}

.t-cl-head a:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
}

.t-cl-sum {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.45;
}

.t-cl-secs {
    display: grid;
    gap: 6px;
}

.t-cl-sec {
    border: 1px solid var(--well-ring);
}

.t-cl-sec > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.t-cl-sec > summary::-webkit-details-marker {
    display: none;
}

.t-cl-sec > summary:hover {
    background: var(--hover);
}

.t-cl-sec > summary > i:first-child {
    width: 18px;
    color: var(--accent);
    text-align: center;
}

.t-cl-sec.is-new > summary > i:first-child {
    color: var(--fam-map);
}

.t-cl-sec.is-removed > summary > i:first-child {
    color: var(--fam-npc);
}

.t-cl-n {
    min-width: 26px;
    padding: 0 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font: 600 13px/1.5 var(--mono);
    text-align: center;
}

.t-cl-chev {
    margin-left: auto;
    font-size: 12px;
    transition: transform .2s var(--ease);
}

.t-cl-sec[open] > summary .t-cl-chev,
.t-cl-notes[open] > summary .t-cl-chev {
    transform: rotate(180deg);
}

.t-cl-body {
    padding: 4px 10px 10px;
    border-top: 1px dashed var(--well-ring);
}

.t-cl-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    color: var(--muted);
}

.t-cl-loading .spinner {
    margin: 0;
    transform: scale(.7);
}

.t-cl-loading.is-error {
    color: var(--warn-ink);
}

.t-cl-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-cl-row {
    padding: 7px 0;
    border-bottom: 1px solid var(--well-ring);
}

.t-cl-row:last-child {
    border-bottom: 0;
}

.t-cl-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    font-weight: 600;
}

.t-cl-id {
    color: var(--muted);
    font: 400 12px var(--mono);
}

.t-cl-note,
.t-cl-tag {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.t-cl-tag {
    padding: 0 5px;
    border: 1px solid var(--well-ring);
}

.t-cl-diffs {
    display: grid;
    gap: 2px;
    margin: 4px 0 0;
    padding: 0 0 0 14px;
    list-style: none;
    font-size: 15px;
}

.t-cl-diffs li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 6px;
}

.t-cl-field {
    min-width: 9em;
    color: var(--muted);
}

.t-cl-was {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: var(--well-ring);
}

.t-cl-shop .t-cl-was,
.t-cl-diffs .is-del .t-cl-was {
    text-decoration: none;
}

.t-cl-arrow {
    color: var(--muted);
}

.t-cl-now {
    color: var(--text);
    font-weight: 600;
}

.t-cl-delta {
    font: 500 12px var(--mono);
}

.t-cl-delta.is-up {
    color: var(--fam-map);
}

.t-cl-delta.is-down {
    color: var(--fam-npc);
}

.t-cl-sign {
    width: 1em;
    font: 600 14px var(--mono);
    text-align: center;
}

.t-cl-diffs .is-add .t-cl-sign {
    color: var(--fam-map);
}

.t-cl-diffs .is-del .t-cl-sign {
    color: var(--fam-npc);
}

.t-cl-diffs .is-mod .t-cl-sign {
    color: var(--accent);
}

.t-cl-stats {
    margin: 3px 0 0 14px;
    color: var(--muted);
    font-size: 14px;
}

.t-cl-notes {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.t-cl-notes > summary {
    cursor: pointer;
}

.t-cl-notes > summary i {
    margin-right: 6px;
}

.t-cl-notes ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

@media (max-width: 600px) {
    .t-cl-entry {
        padding: 12px 12px 10px;
    }
    .t-cl-head {
        font-size: 19px;
    }
    .t-cl-field {
        min-width: 0;
    }
    .t-cl-atom span {
        display: none;
    }
}
