/* ============ the board tag (BoardTag.dc.html) ============
   The board name at the top is a button: an inked arrow sits inside its highlighter. The tag
   hangs off that arrow on a string (boardtag.js places it). The tag is paper, so it pins the
   light roles like .canvas-dialog; its band wears the board's palette. */

.ttl-btn { display: inline-flex; max-width: 100%; margin: 0; padding: 0; border: none; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: .6em .2em; }
/* a button can't ellipsize from its h1, so a long name trims itself and the arrow stays put */
.ttl-btn .hi { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; padding-right: .3em; transition: box-shadow .12s; }
.ttl-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-block: .1em; }
.ttl-car { display: inline-block; flex-shrink: 0; width: .46em; height: .46em; margin-left: .3em; transition: translate .12s, rotate .15s; }
.ttl-car .icon { display: block; width: 100%; height: 100%; stroke-width: 3.4; }
.ttl-btn:hover .hi { box-shadow: inset 0 -.14em 0 color-mix(in srgb, var(--gray-900) 16%, transparent); }
.ttl-btn:hover .ttl-car { translate: 0 3px; }
.ttl-btn.on .ttl-car { rotate: 180deg; translate: 0 0; }
.ttl-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.bt-scrim { position: fixed; inset: 0; z-index: 205; background: color-mix(in srgb, var(--bone) 45%, transparent); }
.bt-tag {
    color-scheme: light;
    --paper: var(--cream); --ink: var(--gray-900); --ink-soft: var(--gray-600); --line: var(--gray-900);
    --bt-gap: 46px; --bt-eye: 50%;
    position: fixed; left: 0; top: 0; z-index: 206;
    width: min(340px, calc(100vw - 24px)); box-sizing: border-box;
    background: var(--paper); color: var(--ink);
    border: 2.5px solid var(--line); border-radius: 30px 30px 14px 18px / 26px 26px 16px 14px;
    box-shadow: 4px 5px 0 var(--line), 0 12px 30px color-mix(in srgb, var(--gray-900) 16%, transparent);
    rotate: 1.2deg; transform-origin: var(--bt-eye) 0;
    visibility: hidden;
}
.bt-tag[data-placed] { visibility: visible; animation: bt-swing .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bt-swing { from { rotate: -6deg; } to { rotate: 1.2deg; } }

/* the string runs up from the eyelet to the arrow; the band's corners clip, the string doesn't */
.bt-string { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.bt-string path { fill: none; stroke: var(--brown-500); stroke-width: 2.5; stroke-linecap: round; }
.bt-eye {
    position: absolute; left: var(--bt-eye); top: 10px; translate: -50% 0; z-index: 2;
    width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%;
    background: var(--bone); border: 4px solid var(--yellow-300);
    box-shadow: 0 0 0 2px var(--line), inset 0 0 0 2px var(--line);
}

.bt-band {
    padding: 36px 18px 14px; border-radius: 27px 27px 0 0 / 23px 23px 0 0;
    background: var(--p-note, var(--green-200)); color: var(--p-note-ink, var(--green-900));
    border-bottom: 2.5px solid var(--line);
}
.bt-name { margin: 0; font-family: var(--font-marker); font-weight: 700; font-size: 34px; line-height: 1.05; rotate: -1.5deg; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-kind { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .94rem; }
.bt-tape { display: inline-block; padding: 1px 10px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-900); background: repeating-linear-gradient(-45deg, var(--yellow-300) 0 10px, var(--gray-900) 10px 20px); border: 2px solid var(--gray-900); rotate: -1.5deg; }
.bt-tape span { background: var(--yellow-300); padding: 0 4px; }
.bt-who { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .94rem; }
.bt-who .av-stack { margin-top: 0; }

.bt-body { padding: 14px 16px 12px; }
.bt-tiles { display: grid; grid-template-columns: repeat(var(--bt-cols, 3), 1fr); gap: 10px; }
.bt-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 78px; padding: 8px 4px; box-sizing: border-box;
    border: 2px solid var(--line); border-radius: 12px 16px 10px 14px; box-shadow: 2px 3px 0 var(--line);
    color: var(--gray-900); font: inherit; font-size: .94rem; line-height: 1.1; text-align: center; cursor: pointer;
    transition: rotate .12s, translate .12s;
}
.bt-tile:hover { translate: 0 -2px; rotate: 0deg; box-shadow: 3px 5px 0 var(--line); }
.bt-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.bt-c0 { background: var(--yellow-200); rotate: -1.6deg; }
.bt-c1 { background: var(--blue-100); rotate: 1.2deg; }
.bt-c2 { background: var(--pink-150); rotate: -.8deg; }
.bt-c3 { background: var(--green-100); rotate: 1.8deg; }

.bt-sec { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px; font-family: var(--font-marker); font-weight: 700; font-size: 22px; color: var(--ink-soft); }
.bt-sec::after { content: ""; flex: 1; border-top: 2.5px dashed color-mix(in srgb, var(--gray-900) 20%, transparent); }
.bt-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.bt-row .nm { flex: 1; min-width: 0; }
.bt-row .nm small { display: block; font-size: .8rem; color: var(--ink-soft); }
.bt-inp { width: 150px; min-height: 38px; padding: 4px 10px; box-sizing: border-box; border: 2px solid var(--line); border-radius: 185px 25px 145px 20px / 20px 155px 25px 175px; background: var(--white); font: inherit; color: var(--ink); }
.bt-inp::placeholder { color: var(--ink-soft); }
.bt-err { margin: 6px 0 0; color: var(--danger-text); font-size: .9rem; }

.bt-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; padding-top: 10px; border-top: 2.5px dashed color-mix(in srgb, var(--gray-900) 20%, transparent); font-size: .94rem; color: var(--ink-soft); }
.bt-foot a { color: var(--accent-strong); }
.bt-lnk { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px; border: none; background: none; font: inherit; font-size: .94rem; color: var(--ink); cursor: pointer; text-decoration: underline wavy color-mix(in srgb, var(--gray-900) 30%, transparent); text-underline-offset: 4px; }
.bt-lnk.out { color: var(--danger-text); }
.bt-lnk:disabled { cursor: default; text-decoration: none; color: var(--ink-soft); }
.bt-sure { width: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; box-sizing: border-box; background: var(--red-100); border: 2px solid var(--red-800); border-radius: 12px 14px 10px 12px; color: var(--red-900); }
.bt-sure span { flex: 1; min-width: 150px; }

@media (max-width: 759px) {
    .bt-tag { width: min(362px, calc(100vw - 24px)); --bt-gap: 40px; }
    .bt-tile { min-height: 80px; }
}
