/* Tall Tales for Modern Times: all styling. Colors follow the New Jersey cover. */
:root {
  --paper: #efe8d8;
  --paper2: #f6f1e5;
  --ink: #1d1b19;
  --grey: #4d4b47;
  --muted: #8a857a;
  --line: #d6ccb6;
  --pink: #e66b57;   /* "Tall Tales": the masthead words, and the Tall Tale kind (KIND_COLOR.hero in js) */
  --red: #d8402c;
  --gold: #e9b92f;
  --hover: #f3d27a;
  --pill: #fbf8f1;   /* the light beige of every pill and the search box */
  --display: 'League Gothic', 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --sans: 'Jost', 'Futura', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --slab: 'Zilla Slab', 'Rockwell', Georgia, serif;
  --hand: 'Patrick Hand SC', 'Marker Felt', 'Comic Sans MS', cursive;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red); }

/* ---- Header ---- */
.tt-head { position: sticky; top: 0; z-index: 25; background: var(--paper); display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 14px 28px 12px; border-bottom: 2px solid var(--ink); }
/* search, Regions and Tales sit in the masthead beside U.S.A., all the same height */
.tt-tools { display: flex; align-items: center; gap: 10px; margin-left: 10px; }
.tt-tools .tt-btn { height: 32px; display: inline-flex; align-items: center; }
.tt-logo { margin: 0; display: flex; align-items: center; gap: 12px; font: 400 64px/0.9 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.tt-logoA { color: var(--pink); }
.tt-logoB { color: var(--red); }
/* the pink dot between the words holds the Bear James logo, and links to bearjames.com */
.tt-badge { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: #4d6fa8; transition: transform .15s; }   /* the Folk Figure blue */
.tt-badge img { width: 50px; height: auto; display: block; }
.tt-badge:hover { transform: rotate(-6deg) scale(1.06); }
/* the counts, as a caption under the title art below the map */
/* the counts are set aside for now (BJ wants a better spot for them) */
.tt-stats { display: none !important; position: absolute; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; align-items: baseline; gap: 0 18px; margin-top: 4px; color: var(--muted); font: 500 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.tt-stats b { display: inline-block; font: 600 22px/1 'Kansas Casual', 'Patrick Hand SC', var(--hand); color: var(--grey); margin-right: 5px; letter-spacing: .02em; transform: skewX(11.23deg); }   /* numbers in Kansas Casual, dark gray ink; words like the panel's gray labels */
.tt-stats span { white-space: nowrap; }

/* ---- Toolbar ---- */
.tt-mapTitle { pointer-events: none; }
/* the search: a round magnifier button in the masthead (gold while a search is showing), opening a black
   dropdown with the search box in it */
.tt-tools .tt-findBtn { width: 32px; padding: 0; justify-content: center; }
.tt-findBtn svg { width: 15px; height: 15px; fill: none; stroke: var(--ink); stroke-width: 2.2; }
.tt-findBtn.tt-has { background: var(--gold); }
.tt-search { display: flex; align-items: center; gap: 8px; height: 40px; margin-top: 10px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.tt-search:focus-within { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px var(--gold); }
.tt-search svg { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 2; flex: none; }
.tt-search input { flex: 1; border: 0; background: none; outline: none; color: var(--paper); font: 500 16px var(--sans); min-width: 0; padding: 0; -webkit-appearance: none; appearance: none; }
.tt-search input::placeholder { color: var(--paper); opacity: .55; }
/* the box's own ✕ (clears the search), in the paper color so it shows on the black */
.tt-search input::-webkit-search-cancel-button { -webkit-appearance: none; width: 14px; height: 14px; margin-left: 8px; cursor: pointer;
  background: linear-gradient(45deg, transparent 44%, var(--paper) 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--paper) 44% 56%, transparent 56%); }
.tt-kindBar { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 2px; }
/* each pill's words in its kind's color; hover or pick it and the pill fills with that color */
.tt-kind { border: 0; background: none; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 500; color: var(--k); cursor: pointer; }
.tt-kind b { font-weight: 500; opacity: .7; margin-left: 2px; }
.tt-kind:hover, .tt-kind.tt-on { background: var(--k); color: #fff; }
.tt-kind:hover b, .tt-kind.tt-on b { opacity: .85; }
.tt-btn { border: 0; background: var(--pill); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-weight: 500; font-size: 14px; }
@media (hover: hover) { .tt-btn:hover { background: var(--hover); } }   /* mouse only: a phone's tap leaves "hover" stuck on */
.tt-btn.tt-primary { background: var(--red); border-color: var(--red); color: #fff; }
.tt-btn.tt-primary:hover { background: #b9321f; }
.tt-btn.tt-small { padding: 4px 12px; font-size: 13px; }

.tt-saveBar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 28px; background: var(--hover); font-size: 14px; border-bottom: 1px solid var(--ink); }
.tt-saveBar[hidden] { display: none; }
.tt-saveBar .tt-link { margin-left: auto; }
.tt-revBar { background: var(--gold); }
/* ---- Suggestions: a visitor's own notes in a state, the form's extras, and BJ's review cards ---- */
.tt-mine { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--hover); font-size: 14px; }
.tt-form .tt-formNote { margin: 0; }
.tt-form .tt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.tt-sug { margin: 14px 0; padding: 14px; border-radius: 12px; background: var(--pill); }
.tt-sug .tt-taleHead { margin-top: 4px; }
.tt-sug .tt-text, .tt-sug .tt-notes { margin: 6px 0; white-space: pre-wrap; }
.tt-sugNow { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--paper); font-size: 14px; }
.tt-sugNow summary { cursor: pointer; font-weight: 500; }
.tt-sugFrom { margin: 8px 0 10px; }

/* ---- Map ---- */
.tt-main { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 8px var(--panelW, 420px); gap: 0; align-items: start; transition: grid-template-columns .4s ease; }
.tt-dragging .tt-main { transition: none; }
/* the panel's left edge: drag it to resize */
.tt-split { align-self: stretch; cursor: col-resize; border-left: 0; background: var(--paper2); margin-left: 0; transition: background .15s; touch-action: none; }
.tt-split:hover, .tt-dragging .tt-split { background: var(--hover); }
.tt-dragging { cursor: col-resize; user-select: none; }
/* closed: the panel's column slides shut and the map grows into the room */
.tt-main.tt-closed { grid-template-columns: minmax(0, 1fr) 0px 0px; }
.tt-main.tt-closed .tt-panel { opacity: 0; height: 0; min-height: 0; padding: 0; overflow: hidden; }
.tt-main.tt-closed .tt-split { border-left-width: 0; margin-left: 0; pointer-events: none; }
.tt-main.tt-opening .tt-panel { animation: tt-fadeIn .45s ease; }
@keyframes tt-fadeIn { from { opacity: 0; } 40% { opacity: 0; } }
/* the ✕ (start over) at the panel's top right, and the arrow on the seam between map and panel, as matching circles */
.tt-close, .tt-openTab { position: absolute; top: 26px; right: 32px; width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; background: var(--pill); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.tt-close svg, .tt-openTab svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-close:hover, .tt-openTab:hover { background: var(--gold); }
.tt-close { z-index: 2; }
.tt-main.tt-opening .tt-close { animation: tt-turnIn .45s ease; }
@keyframes tt-turnIn { from { transform: rotate(-90deg) scale(.6); opacity: 0; } }
/* the arrow sits in the map's top right corner, always the same distance in: with the panel open it points
   right (fold it away); closed, the map widens and it rides along to the window's edge, turning to point left
   (bring it back). The panel's width + the 8px seam + 32px in from the map's edge. */
.tt-openTab { z-index: 6; right: calc(var(--panelW, 420px) + 8px + 32px); transition: right .4s ease, background .15s; }
.tt-openTab svg { transform: rotate(180deg); transition: transform .4s ease; }
.tt-main.tt-closed .tt-openTab { right: 32px; }
.tt-main.tt-closed .tt-openTab svg { transform: none; }
.tt-dragging .tt-openTab { transition: none; }
/* the map's area: pinned under the masthead and exactly the window's height below it, so the whole map,
   the title art and the counts always fit in view (the drawing scales down to fit) */
.tt-mapWrap { padding: 12px 8px 14px 10px; position: sticky; top: var(--headH, 90px); height: calc(100vh - var(--headH, 90px)); display: flex; flex-direction: column; }
.tt-split, .tt-panel { position: relative; z-index: 5; }
/* the map is a printed sheet: its own paper, BJ's gray watercolor printed into it (Multiply, like a Photoshop
   texture layer), and an old-map neatline around the edge. All of it lives inside the map's drawing, so the
   texture moves and scales with the map, and nothing touches the masthead or the panel. */
.tt-sheet { fill: var(--paper); }
.tt-wash { pointer-events: none; mix-blend-mode: multiply; opacity: var(--texture, .3); filter: brightness(1.18) contrast(1.35); }
.tt-neat { pointer-events: none; fill: none; stroke: var(--ink); }
.tt-neat .tt-rule { stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.tt-neat .tt-bars { stroke-linecap: butt; }
/* the sheet fills the whole map section; the counts and the search note sit on it */
.tt-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: hidden; }
.tt-legend { position: absolute; left: 50%; top: 48px; transform: translateX(-50%); z-index: 2; }
.tt-legend:empty { display: none; }
.tt-legend:not(:empty) { background: var(--paper2); padding: 6px 14px; border-radius: 999px; }
.tt-st path { stroke: none; cursor: pointer; transition: fill .15s; }
/* hover: the state goes gold, its name orange-red; selected: the state orange-red, its name gold */
.tt-st:hover path, .tt-st.tt-hot path, .tt-st:hover circle:not(.tt-bjDot), .tt-st.tt-hot circle:not(.tt-bjDot) { fill: var(--gold) !important; }
/* the Bear James story dot (orange-red; gold on a selected, orange-red state) */
.tt-bjDot { fill: var(--red); pointer-events: none; }
.tt-st.tt-sel .tt-bjDot { fill: var(--gold); }
.tt-st.tt-sel path, .tt-st.tt-sel circle { fill: var(--red) !important; }
.tt-st.tt-island path { stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.tt-hit { fill: transparent; cursor: pointer; }
.tt-ink { pointer-events: none; }
.tt-ink path { fill: var(--ink); }
/* BJ's lettering: his own font where it's installed, a hand font everywhere else */
/* the edge around the coast and every island: 10% black (for gold, use var(--gold) and opacity 1) */
.tt-edge { pointer-events: none; opacity: .1; }
.tt-edge path { fill: var(--ink); stroke: var(--ink); stroke-width: 11px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tt-reach { fill: none !important; stroke: transparent; stroke-width: 26; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.tt-toggle.tt-on, .tt-toggle.tt-on:hover { background: var(--gold); color: var(--ink); }
/* a toggle just switched off goes straight back to beige, not the hover gold, until the pointer leaves it (js) */
.tt-toggle.tt-justOff:not(.tt-on):not(.tt-has), .tt-toggle.tt-justOff:not(.tt-on):not(.tt-has):hover { background: var(--pill); }
.tt-regWrap { position: relative; display: inline-flex; }
.tt-regKey { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 25; background: var(--ink); color: var(--paper); border-radius: 8px; padding: 10px 12px; width: max-content; font-size: 13px; line-height: 1.7; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tt-regKey b { display: block; font: 400 20px/1.1 var(--display); color: var(--gold); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 4px; }
.tt-regKey span { display: block; }
.tt-regKey i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
@media (hover: hover) { .tt-regWrap:hover .tt-regKey { display: block; } }
.tt-regWrap:focus-visible .tt-regKey, .tt-regWrap:has(:focus-visible) .tt-regKey { display: block; }
/* the Search and Shared Tales hints: shown at once on hover, like the Regions key (a browser's own title tip waits a
   second). Hidden while their dropdown is open. */
#tt-findBtn, #tt-legBtn { position: relative; }
#tt-findBtn[data-tip]::after, #tt-legBtn[data-tip]::after { content: attr(data-tip); display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 25;
  background: var(--ink); color: var(--paper); border-radius: 8px; padding: 6px 10px; width: max-content; font: 500 13px/1.4 var(--sans); box-shadow: 0 6px 18px rgba(0,0,0,.25); pointer-events: none; }
/* only with a mouse (a phone's tap leaves a "hover" stuck on), and not once a search is typed in */
@media (hover: hover) {
  #tt-findBtn:hover:not([aria-expanded="true"])::after, #tt-legBtn:hover:not([aria-expanded="true"])::after { display: block; }
}
.tt-name { fill: var(--ink); }   /* BJ's lettering, outlined: no font needed */
.tt-hl { cursor: pointer; }
.tt-hl:hover .tt-name, .tt-hl.tt-hot .tt-name, .tt-dc:hover .tt-name, .tt-dc.tt-hot .tt-name { fill: var(--red); }
.tt-hl.tt-sel .tt-name { fill: var(--gold); }
/* a name outside its state sits on the paper, where gold is hard to read */
.tt-hl.tt-out.tt-sel .tt-name, .tt-dc.tt-sel .tt-name { fill: var(--red); }
.tt-dc line { stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tt-dc circle { stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: pointer; }
.tt-dc .tt-name { cursor: pointer; }
.tt-st.tt-big path:not(.tt-reach):not(.tt-inner) { stroke: var(--ink); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }   /* a moved Alaska draws its own coast */
.tt-st path.tt-inked { stroke: var(--ink); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }   /* the added Aleutians' coastline */
.tt-nameReach { fill: transparent; stroke: transparent; stroke-width: 5px; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: all; }
.tt-map [data-st]:focus { outline: none; }
.tt-map [data-st]:focus-visible path, .tt-map [data-st]:focus-visible .tt-hit { stroke: var(--red); stroke-width: 3; vector-effect: non-scaling-stroke; }

.tt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--grey); margin: 6px 0 0; min-height: 22px; }
.tt-legend i { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--ink); vertical-align: -3px; margin-right: 5px; border-radius: 3px; }

/* the Shared Legends drawer: floats over the map and panel, as wide as both, just under the toolbar */
.tt-dropWrap { position: relative; display: inline-flex; }
.tt-drawer { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; padding: 12px 28px 16px; background: var(--ink); color: var(--paper); box-shadow: 0 12px 24px rgba(0,0,0,.25); }   /* black, like the Regions key */
/* on a laptop or bigger it's a third as wide, hanging under the Shared Tales button (js: setDrawer sets --dropX) */
@media (min-width: 981px) and (orientation: landscape) {
  .tt-drawer { right: auto; left: var(--dropX, 28px); width: var(--dropW, 440px); padding: 14px 18px 16px; border-radius: 0 0 12px 12px; }
}
.tt-dropClose { position: absolute; top: 10px; right: 12px; border: 0; background: none; color: var(--paper); opacity: .7; font: 500 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; padding: 4px 6px; }
.tt-dropClose span { margin-left: 3px; }
.tt-dropClose:hover { opacity: 1; color: var(--gold); }
.tt-drawer .tt-sharedHead { padding-right: 70px; }
/* while a dropdown is open the page under it dims, and clicks there only close it */
.tt-main::after { content: ''; position: absolute; inset: 0; z-index: 20; background: rgba(29, 26, 23, .25); opacity: 0; pointer-events: none; transition: opacity .15s; }
.tt-dropOpen .tt-main::after { opacity: 1; pointer-events: auto; }
.tt-drawer .tt-sharedHead { font: 400 20px/1.1 var(--display); color: var(--gold); letter-spacing: .02em; }
.tt-drawer .tt-sharedHead small { font: 13px var(--sans); color: var(--paper); opacity: .7; }
.tt-drawer .tt-chip { background: rgba(255, 255, 255, .1); color: var(--paper); }
.tt-drawer .tt-chip b { color: var(--gold); }
/* its chips turn the map's pink (shared legends, search matches) on hover and when picked */
.tt-drawer .tt-chip:hover, .tt-drawer .tt-chip.tt-on { background: #f7bab0; color: var(--ink); }
.tt-drawer .tt-chip:hover b, .tt-drawer .tt-chip.tt-on b { color: var(--red); }
.tt-drawer[hidden] { display: none; }
.tt-sharedHead { font: 500 12px var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.tt-sharedHead small { font: 13px var(--sans); color: var(--muted); text-transform: none; margin-left: 6px; letter-spacing: 0; opacity: .8; }
.tt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tt-chip { border: 0; background: var(--pill); border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tt-chip b { font: 400 15px var(--display); margin-left: 4px; color: var(--red); }
@media (hover: hover) { .tt-chip:hover { background: var(--hover); } }   /* mouse only: a phone's tap leaves "hover" stuck on */
.tt-chip.tt-on { background: var(--gold); }

/* ---- Panel ---- */
.tt-panel { position: relative; min-width: 0; min-height: calc(100vh - var(--headH, 90px)); padding: 18px 24px 60px; background: var(--paper2); }
.tt-kicker { font: 500 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
/* every panel title (states, searches, Pick a State) and character names: Kansas Casual SemiBold,
   leaned back 11.23° so it stands upright like the map */
.tt-panel h2 { font: 600 40px/1.05 'Kansas Casual', 'Patrick Hand SC', var(--hand); text-transform: uppercase; color: var(--red); margin: 4px 0 8px; letter-spacing: .03em; display: table; transform: skewX(11.23deg); transform-origin: 0 100%; }
/* state names in BJ's map lettering (installed on his Mac; a hand font elsewhere) */
#tt-tip b { font-family: 'Kansas Casual', 'Patrick Hand SC', var(--hand); font-weight: 400; letter-spacing: .03em; }
#tt-tip b { transform: skewX(11.23deg); transform-origin: 0 100%; }
#tt-tip b { display: table; }
.tt-upright { display: inline-block; }
.tt-panel .tt-resState h3 { font-size: 20px; }
.tt-panel .tt-resState h3 .tt-upright { font: 600 22px 'Kansas Casual', 'Patrick Hand SC', var(--hand); letter-spacing: .03em; transform: skewX(11.23deg); transform-origin: 0 100%; }
#tt-tip b { font-size: 19px; margin-bottom: 2px; }
.tt-panel h3 { font: 500 12px var(--sans); text-transform: uppercase; color: var(--muted); margin: 26px 0 8px; letter-spacing: .14em; display: flex; align-items: baseline; gap: 8px; }
.tt-panel h3 small { font: 13px var(--sans); color: var(--muted); text-transform: none; letter-spacing: 0; opacity: .8; }
.tt-panelTools { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; align-items: center; }
.tt-sub { color: var(--grey); font-size: 14px; }

.tt-bj { border: 0; border-radius: 12px; background: var(--pill); padding: 12px 14px; margin: 14px 0 6px; display: flex; gap: 12px; align-items: flex-start; }
.tt-bj img { width: 74px; height: 74px; object-fit: cover; border: 1px solid var(--ink); border-radius: 4px; flex: none; }
.tt-bj .tt-kicker { color: var(--red); }
.tt-bj ul { margin: 4px 0 0; padding: 0; list-style: none; }
.tt-bj li { margin: 2px 0; }
.tt-bj li small { color: var(--grey); margin-left: 6px; }
.tt-slot { border: 2px dashed var(--muted); border-radius: 10px; padding: 12px 14px; margin: 10px 0 4px; color: var(--grey); font-size: 14px; }

.tt-tale { border-top: 1px solid var(--line); padding: 10px 0 12px; }
.tt-tale:first-of-type { border-top: 0; }
.tt-taleHead { display: flex; align-items: center; gap: 8px; }   /* the kind tag sits centered on the name beside it */
.tt-tale h4 { font: 600 19px/1.2 'Kansas Casual', 'Patrick Hand SC', var(--hand); letter-spacing: .02em; margin: 0; flex: 1; transform: skewX(11.23deg); transform-origin: 0 100%; }
.tt-tag { font-size: 11.5px; border-radius: 999px; padding: 1px 8px; color: #fff; white-space: nowrap; font-weight: 500; }
.tt-tag.tt-bjTag { background: var(--gold); color: var(--ink); }
.tt-text { margin: 4px 0 0; color: #2f2c28; }
/* long tales: cut at three lines (js: clampBodies), the last line fading into the paper, sliding open */
.tt-body { overflow: hidden; transition: max-height .35s ease; }
.tt-body.tt-clip { cursor: pointer; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.tt-more { display: flex; align-items: center; gap: 4px; width: max-content; margin: 2px 0 0 auto; border: 0; background: none; padding: 2px 0; color: var(--red); font: 500 13px var(--sans); cursor: pointer; }   /* on the right, under the words */
.tt-more[hidden] { display: none; }   /* only on tales long enough to need it */
.tt-more span { text-decoration: underline; text-underline-offset: 2px; }
.tt-more svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.tt-tale.tt-isOpen .tt-more svg { transform: rotate(180deg); }
/* a tale that opens lights up on hover, and its arrow nudges down */
.tt-tale.tt-long { position: relative; isolation: isolate; }
.tt-tale.tt-long::before { content: ''; position: absolute; inset: 4px -10px; z-index: -1; border-radius: 10px; background: var(--pill); opacity: 0; transition: opacity .15s; }
.tt-tale.tt-long:hover::before { opacity: 1; }
.tt-tale.tt-long:not(.tt-isOpen):hover .tt-more svg { transform: translateY(2px); }
.tt-notes { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--grey); }
.tt-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 13px; color: var(--grey); align-items: center; }
.tt-meta a { text-decoration: underline; text-underline-offset: 2px; }   /* the line runs under the words, not the icon */
/* the icon in front of a link: a magnifier (runs a search) or a page (opens a source) */
.tt-linkIcon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tt-docLink, .tt-legLink { white-space: nowrap; }
.tt-stLink { border: 0; background: var(--pill); border-radius: 4px; padding: 1px 6px; font-size: 12px; cursor: pointer; }
.tt-stLink:hover { background: var(--hover); }
.tt-listDot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: 4px; vertical-align: 1px; }   /* the map's Bear James dot */
.tt-legLink { border: 0; background: none; padding: 0; color: var(--red); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
mark { background: var(--hover); color: inherit; padding: 0 1px; border-radius: 2px; }
.tt-empty { color: var(--grey); font-style: italic; }

.tt-resState { margin-top: 18px; }
.tt-resState h3 { cursor: pointer; margin: 0 0 4px; color: var(--red); }
.tt-resState h3:hover { text-decoration: underline; }

.tt-list { margin: 6px 0 0; padding: 0; list-style: none; }
.tt-list li { padding: 5px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.tt-list li:first-child { border-top: 0; }
.tt-list .tt-stLink { flex: none; }
/* Pick a State: the By region / A–Z switch, and the A–Z list in columns */
.tt-listSwitch { gap: 16px !important; }
.tt-listSwitch button { border: 0; background: none; padding: 0 0 3px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tt-listSwitch button:hover { color: var(--ink); }
.tt-listSwitch button.tt-on { color: var(--ink); border-bottom-color: var(--red); }
.tt-az { columns: 3 108px; column-gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.tt-az li { break-inside: avoid; padding: 1px 0; white-space: nowrap; }
.tt-az button { border: 0; background: none; padding: 0; font: 500 13.5px/1.35 var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.tt-az button:hover { color: var(--red); }
.tt-az small { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 1px; }

.tt-lib h4 { font: 700 16px var(--slab); margin: 12px 0 2px; }
.tt-lib p { margin: 0 0 4px; font-size: 14px; color: #2f2c28; }

/* ---- Editing ---- */
.tt-form { border: 0; border-radius: 12px; padding: 14px; margin: 10px 0; background: var(--pill); display: grid; gap: 8px; }
.tt-form label { display: grid; gap: 2px; font-size: 12px; font-weight: 500; color: var(--grey); text-transform: uppercase; letter-spacing: .06em; }
.tt-form input, .tt-form select, .tt-form textarea { border: 0; border-radius: 6px; padding: 6px 8px; background: #fff; font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.tt-form textarea { resize: vertical; min-height: 60px; }
.tt-form input:focus, .tt-form select:focus, .tt-form textarea:focus { outline: 2px solid var(--gold); border-color: var(--ink); }
.tt-form .tt-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.tt-form label { min-width: 0; }
.tt-form input, .tt-form select, .tt-form textarea { min-width: 0; width: 100%; box-sizing: border-box; }
.tt-form .tt-hint { font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.tt-formBtns { display: flex; gap: 8px; align-items: center; }
.tt-formBtns .tt-del { margin-right: auto; color: var(--red); border-color: var(--red); }
.tt-editBtn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; line-height: 0; }
.tt-editBtn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }   /* just a pencil */
.tt-editBtn:hover { color: var(--red); }
.tt-link { border: 0; background: none; padding: 0; color: var(--red); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }

/* ---- Tooltip & toast ---- */
.tt-tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: 8px; padding: 9px 12px; max-width: 280px; font-size: 13px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tt-tip b { font: 400 22px/1 var(--display); text-transform: uppercase; display: block; color: var(--gold); letter-spacing: .02em; }
.tt-tip ul { margin: 5px 0 0; padding-left: 16px; }
.tt-tip small { color: #c9c1ae; }
.tt-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 30; font-size: 14px; max-width: calc(100vw - 32px); }
.tt-toast.tt-show { opacity: 1; transform: translate(-50%, 0); }

.tt-fail { max-width: 560px; margin: 80px auto; padding: 0 16px; font-size: 17px; }

/* ---- Narrow screens ---- */
/* stacked: any upright screen (phones, iPads held upright) or a narrow window. The map sits on top and
   the info under it, always there, so there's no drawer: no ✕, no tab. (Keep in step with STACKED in js/tales.js.) */
@media (max-width: 980px), (orientation: portrait) {
  .tt-main { grid-template-columns: 1fr; }
  .tt-openTab { display: none !important; }
  .tt-close { top: 18px; right: 16px; }   /* on a state or a search: start over */
  .tt-mapWrap { position: static; padding: 0; height: auto; display: block; }
  .tt-map { position: relative; inset: auto; width: 100%; height: auto; }
  .tt-stats { position: static; margin-top: 10px; }   /* small map: the counts go under the sheet */
  .tt-head { position: relative; }
  .tt-panel { border-top: 2px solid var(--ink); min-height: 0; padding: 16px; }
  .tt-split { display: none; }
  .tt-main.tt-closed { grid-template-columns: 1fr; }
  /* on a phone the map's box isn't pinned, and is only as tall as the map */
  .tt-mapWrap { position: relative; top: 0; min-height: 0; }   /* (not pinned here, so no masthead offset) */
  .tt-head, .tt-saveBar, .tt-drawer { padding-left: 16px; padding-right: 16px; }
  .tt-tools { margin-left: 0; }
  .tt-stats { flex-wrap: wrap; gap: 0 14px; }
  .tt-stats span { white-space: nowrap; }
}
@media (max-width: 560px) {
  /* on a phone the title stretches across the top, centered, with the buttons centered under it */
  .tt-logo { width: 100%; justify-content: center; font-size: calc((100vw - 32px) / 5.95); gap: .14em; }
  .tt-logoA, .tt-logoB { white-space: nowrap; }
  .tt-badge { width: .95em; height: .95em; }
  .tt-badge img { width: .78em; }
  .tt-tools { width: 100%; justify-content: center; }
    .tt-panel h2 { font-size: 34px; }
}

.tt-pointer { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }   /* Vermont's pointer */
.tt-dummyLink { font-size: 13px; color: var(--red); }   /* a dummy this state already has */
/* a Bear James book: a black feature card, like the dropdowns, so it stands apart from the tales below.
   Its cover is small beside the name; tap it and it opens to the card's full width (tap again for small). */
.tt-feature { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; margin: 16px 0 10px; padding: 14px; border-radius: 14px;
  background: var(--ink); color: var(--paper); box-shadow: 0 8px 22px rgba(0, 0, 0, .16); }
.tt-featureImg { flex: none; width: 120px; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; transition: width .25s ease; }
.tt-featureImg img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.tt-feature.tt-big .tt-featureImg { width: 100%; cursor: zoom-out; }
.tt-featureText { flex: 1 1 160px; min-width: 0; }
.tt-featureKicker { font: 500 11px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.tt-featureTitle { font: 400 26px/1.02 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 4px 0 8px; }
.tt-featureLinks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tt-featureLinks a { font: 500 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #f7bab0; text-decoration: none; }
.tt-featureLinks a span { display: inline-block; transition: transform .15s; }
.tt-featureLinks a:hover { color: var(--gold); }
.tt-featureLinks a:hover span { transform: translate(2px, -2px); }
/* outlined titles: each word a small drawing in the text's color; already leaned upright, so no skew */
.tt-outlined { transform: none !important; letter-spacing: 0 !important; word-spacing: -.02em; }
.tt-word { display: inline-block; overflow: visible; margin-right: .26em; }   /* the space between words, drawn the same in every browser */
.tt-word:last-of-type { margin-right: 0; }
.tt-word path { fill: currentColor; }
.tt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Signing in (to save the tales online) */
.tt-dialog { position: fixed; inset: 0; z-index: 40; background: rgba(30, 25, 20, .35); display: grid; place-items: center; padding: 16px; }
.tt-dialogCard { width: min(380px, 100%); margin: 0; background: var(--paper); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); padding: 20px; }
.tt-dialogCard h2 { margin: 0; font: 600 22px var(--sans); }
.tt-dialogCard .tt-sub { margin: 0 0 6px; font-size: 14px; line-height: 1.45; }
.tt-dialogCard input { background: #fff; }
.tt-dialogCard .tt-formBtns { justify-content: flex-end; }
.tt-dialogCard .tt-formBtns .tt-link { margin-right: auto; font-size: 13px; }
.tt-dots { -webkit-text-security: disc; }   /* a text box shown as dots (the book password) */
.tt-pwRow { display: flex; align-items: center; gap: 8px; }
.tt-pwRow input { flex: 1; min-width: 0; }
.tt-pwRow .tt-link { font-size: 12px; text-transform: none; letter-spacing: 0; }
.tt-dlgErr { min-height: 1em; margin: 0; color: var(--red); font-size: 13px; line-height: 1.4; }
.tt-account .tt-link { font-size: inherit; }
