#needs-open {
 --needs-ink: #e2d9ae;
 display: inline-flex;
 flex: 0 0 auto;
 align-items: center;
 justify-content: center;
 align-self: flex-start;
 gap: 8px;
 min-width: 60px;
 min-height: 44px;
 margin: -8px 0 0;
 padding: 4px 6px;
 border: 0;
 border-radius: 4px;
 color: var(--needs-ink);
 background: #192722c2;
 pointer-events: auto;
 touch-action: manipulation;
}
#needs-open:hover, #needs-open:focus-visible {background: #2d3e34}
#needs-open:focus-visible {outline: 2px solid #eed09b; outline-offset: 1px}
#needs-open .needs-mark {display: grid; width: 19px; justify-items: center; gap: 2px; color: var(--needs-ink)}
#needs-open svg {display: block; width: 20px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round}
#needs-open .needs-mark i {display: block; width: 18px; height: 3px; border-radius: 1px; background: #667166; overflow: hidden}
#needs-open .needs-mark i::before {content: ''; display: block; height: 100%; width: var(--filled, 70%); background: currentColor}
#needs-open .needs-mark[data-low="true"] {color: #f2b780}
#needs-panel {
 width: min(26rem, calc(100vw - 24px));
 max-height: calc(100dvh - 24px);
 box-sizing: border-box;
 padding: 0 20px 12px;
 color: var(--rail-ink);
 background: var(--rail-paper);
 border: 1px solid var(--rail-rule);
 border-block-start: 4px solid var(--rail-enamel);
 border-radius: 3px;
 overscroll-behavior: contain;
}
#needs-panel::backdrop {background: #111b17a3}
#needs-panel header {display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 10px 6px; border-block-end: 1px solid var(--rail-rule)}
#needs-panel h2 {margin: 0; color: var(--rail-ink); font: 700 1.5rem/1.25 var(--book-type, sans-serif)}
#needs-panel section {padding: 14px 0; border-block-end: 1px dashed var(--rail-rule)}
#needs-panel h3 {display: flex; align-items: baseline; gap: 12px; margin: 0; font: inherit; color: var(--rail-muted)}
#needs-panel h3 strong {font: 700 1.1rem/1.5 var(--book-type, sans-serif); color: var(--rail-ink)}
#needs-panel p {margin: 4px 0 8px; font-size: .91rem; line-height: 1.55; color: var(--rail-muted)}
#needs-panel .needs-actions {display: flex; flex-wrap: wrap; gap: 8px}
#needs-panel button {padding: 5px 11px; min-height: 44px; border: 1px solid var(--rail-outline); border-radius: 4px; font: inherit; font-size: .9rem; color: var(--rail-ink); background: var(--rail-paper-raised); touch-action: manipulation}
#needs-panel .needs-actions button:first-child:not(:disabled) {background: var(--rail-enamel); color: var(--rail-cream); border-color: var(--rail-enamel)}
#needs-panel button:disabled {background:var(--rail-paper-shade);color:var(--rail-muted);border-color:var(--rail-rule);opacity:1}
#needs-panel button { -webkit-tap-highlight-color: transparent }
#needs-panel button:enabled:hover {background:var(--rail-paper-shade)}
#needs-panel button:enabled:active {background:var(--rail-selected)}
#needs-panel .needs-actions button:first-child:enabled:is(:hover,:active) {background:var(--rail-enamel-deep)}
#needs-panel #needs-close {min-width: 44px; padding: 4px 8px; border: 0; background: transparent}
#needs-panel #needs-result {margin: 8px 0 0; color: var(--rail-ink)}
#needs-panel #needs-result:empty {display: none}
@media (pointer: coarse) {
 #game #needs-open {margin: 0; align-self: center; min-width: 52px; padding-inline: 2px}
}
@media (pointer: coarse) and (orientation: portrait) and (max-width: 700px) {
 #game #needs-open {margin-inline-start: auto; align-self: flex-start; padding-block: 1px 10px; background: transparent}
 #game .scenehud {column-gap: 6px}
 #game #loc {text-overflow: ellipsis}
 #game .ride-status {max-width: calc(100% - 160px)}
}

/* The sheet teaches its own marks: why they fall, what that costs, and every way to mend them. */
#needs-panel .needs-why {margin: 6px 0 4px; color: var(--rail-ink)}
#needs-panel .needs-ways {margin: 10px 0 0; padding: 8px 0 0; list-style: none; border-block-start: 1px dotted var(--rail-rule)}
#needs-panel .needs-ways li {display: grid; gap: 1px; padding: 4px 0; font-size: .9rem; line-height: 1.45}
#needs-panel .needs-ways strong {font-weight: 700; color: var(--rail-ink)}
#needs-panel .needs-ways span {color: var(--rail-muted)}
#needs-panel #needs-free {margin: 12px 0 6px; color: var(--rail-ink)}
#needs-panel .needs-remind {display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: .9rem; color: var(--rail-ink); cursor: pointer}
#needs-panel .needs-remind input {width: 20px; height: 20px; accent-color: var(--rail-enamel)}
#needs-panel [hidden] {display: none}
