:root {
    --ink: #16131f;
    --paper: #fff7df;
    --panel: #fffdf5;
    --muted: #6d657a;
    --line: #16131f;
    --pink: #ff4fab;
    --cyan: #10c7ff;
    --yellow: #ffd84d;
    --green: #35d07f;
    --violet: #7c5cff;
    --red: #ff4e42;
    --shadow-hard: 8px 8px 0 var(--ink);
    --shadow-soft: 0 22px 70px rgba(22, 19, 31, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 12%, rgba(255, 79, 171, 0.32), transparent 30%),
        radial-gradient(circle at 90% 18%, rgba(16, 199, 255, 0.26), transparent 32%),
        linear-gradient(135deg, #fff0b8 0%, #ffe4ec 46%, #dff7ff 100%);
    color: var(--ink);
    font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0;
}

button,
input,
select {
    font: inherit;
}

.screen-pattern {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(22, 19, 31, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 19, 31, 0.055) 1px, transparent 1px),
        radial-gradient(circle, rgba(22, 19, 31, 0.08) 1px, transparent 1.5px);
    background-size: 34px 34px, 34px 34px, 10px 10px;
    mix-blend-mode: multiply;
}

.atlas-app {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    gap: 16px;
    height: 100vh;
    padding: 14px;
    max-width: 100%;
}

.control-deck,
.map-deck,
.machine-detail {
    border: 3px solid var(--line);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: var(--shadow-hard);
}

.control-deck {
    display: flex;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
}

.brand-panel {
    position: sticky;
    top: 0;
    z-index: 12;
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 12px;
    overflow: hidden;
    border-bottom: 3px solid var(--line);
    background: var(--paper);
}

.brand-panel::after {
    display: none;
}

.brand-topline {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 4px;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.language-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 2px 2px 0 var(--line);
}

.language-option {
    min-width: 38px;
    min-height: 24px;
    padding: 2px 7px;
    border: 0;
    border-right: 2px solid var(--line);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.language-option:last-child {
    border-right: 0;
}

.language-option.active {
    background: var(--cyan);
}

.language-option:hover,
.language-option:focus-visible {
    background: var(--yellow);
    outline: none;
}

.map-header .language-toggle {
    box-shadow: 2px 2px 0 var(--line);
}

.map-header .language-option {
    min-width: 34px;
    min-height: 24px;
    padding: 2px 6px;
    font-size: 0.6rem;
}

.brand-panel h1 {
    position: relative;
    z-index: 1;
    max-width: none;
    margin: 0;
    font-size: clamp(1.55rem, 2.5vw, 2.45rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
    text-transform: uppercase;
    text-shadow: 4px 4px 0 var(--cyan);
    overflow-wrap: break-word;
}

.brand-lockup {
    position: relative;
    z-index: 1;
    width: min(100%, 690px);
    min-width: 0;
}

.brand-lockup-title {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-lockup-title h1 {
    flex: 1 1 auto;
    min-width: 0;
}

.brand-lockup img {
    flex: 0 0 auto;
    width: 46px;
    aspect-ratio: 160 / 190;
    border: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.brand-panel p {
    display: none;
}

.compact-stats {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.compact-stats > span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 3px 7px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 2px 2px 0 var(--line);
    color: var(--ink);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.compact-stats > span span {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.search-panel {
    padding: 8px 10px;
    border-bottom: 3px solid var(--line);
    background: var(--paper);
}

.sticky-controls {
    flex: 0 0 auto;
    z-index: 4;
    background: var(--paper);
}

.search-panel label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-panel input,
.submit-grid input,
.submit-grid select {
    width: 100%;
    min-height: 34px;
    padding: 0 12px;
    border: 2px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    outline: none;
    font-weight: 700;
}

.search-panel input:focus,
.submit-grid input:focus,
.submit-grid select:focus {
    box-shadow: 0 0 0 4px var(--yellow);
}

.utility-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 7px;
}

.utility-row button {
    min-height: 28px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 2px 2px 0 var(--line);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.utility-row button:first-child {
    background: var(--cyan);
}

.utility-row button:nth-child(2) {
    background: var(--yellow);
}

.filter-strip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px 10px 9px;
    border-bottom: 3px solid var(--line);
    background: #fff;
}

.control-deck.subpage-mode .sticky-controls,
.control-deck.subpage-mode .filter-strip {
    display: none;
}

.control-deck.list-focus-mode .sticky-controls,
.control-deck.list-focus-mode .filter-strip,
.control-deck.list-focus-mode .panel-tabs {
    display: none;
}

.filter-row {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.filter-row-category {
    border-top: 2px dashed rgba(22, 19, 31, 0.16);
    padding-top: 6px;
}

.filter-more-toggle {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 2px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    white-space: nowrap;
}

.filter-more-toggle:hover,
.filter-more-toggle:focus-visible {
    background: var(--paper);
    outline: none;
}

.filter-more-toggle.expanded {
    background: var(--paper);
}

.map-attribution {
    margin: 0;
    padding: 8px 12px;
    border-top: 2px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.link-button {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
    color: var(--pink);
    outline: none;
}

.vending-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 2px 2px 0 var(--line);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.vending-filter span {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    font-size: 0.68rem;
    line-height: 1;
}

.vending-filter.active {
    background: var(--yellow);
    box-shadow: none;
}

.machine-list {
    min-height: 0;
    padding: 9px;
    background:
        linear-gradient(90deg, rgba(255, 79, 171, 0.06), rgba(16, 199, 255, 0.06)),
        #fff;
}

.deck-scroll {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.panel-tabs {
    flex: 0 0 auto;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    padding: 8px 10px;
    border-bottom: 3px solid var(--line);
    background: var(--paper);
}

.panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #fff;
}

.panel-tab {
    min-height: 34px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.panel-tab.active {
    background: var(--yellow);
    transform: translate(2px, 2px);
    box-shadow: none;
}

.panel-view {
    display: none;
}

.panel-view.active {
    display: block;
}

.snack-board,
.my-finds-board {
    display: grid;
    gap: 12px;
    padding: 12px;
    background:
        linear-gradient(90deg, rgba(255, 216, 77, 0.14), rgba(255, 79, 171, 0.08)),
        #fff;
}

.snack-board-head,
.my-finds-head,
.snack-form {
    padding: 12px;
    border: 2px solid var(--line);
    background: var(--paper);
    box-shadow: 4px 4px 0 var(--line);
}

.snack-board h2,
.my-finds-board h2,
.snack-form h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
}

.snack-board-head p,
.my-finds-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.4;
}

.my-finds-list {
    display: grid;
    gap: 10px;
}

.passport-auth {
    margin: 10px 0;
}

.passport-auth-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 3px solid var(--line);
    background: #fff;
    box-shadow: 4px 4px 0 var(--line);
}

.passport-auth-card.saved {
    background: linear-gradient(135deg, #fff7df 0%, #f4fcff 100%);
}

.passport-auth-card.muted {
    opacity: 0.75;
}

.passport-auth-card h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.passport-auth-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.35;
}

.passport-auth-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.passport-auth-fields input {
    min-width: 0;
    height: 42px;
    padding: 0 10px;
    border: 2px solid var(--line);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
}

.passport-auth-card button {
    min-height: 42px;
    padding: 0 12px;
    border: 2px solid var(--line);
    background: var(--blue);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.passport-auth-card.saved button {
    background: #fff;
}

.passport-auth-card button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.passport-auth-message {
    color: var(--ink) !important;
}

.passport-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.passport-stamp {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 74px;
    padding: 9px;
    border: 2px dashed var(--line);
    background: #fff;
    color: var(--muted);
    opacity: 0.72;
}

.passport-stamp.earned {
    border-style: solid;
    background: linear-gradient(135deg, #fff7df 0%, #f4fcff 100%);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    opacity: 1;
}

.stamp-mark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    font-size: 1rem;
}

.passport-stamp h3 {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.passport-stamp p {
    margin: 2px 0 0;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.25;
}

.my-find-card,
.empty-state {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--line);
    background: var(--paper);
    box-shadow: 4px 4px 0 var(--line);
}

.my-find-card-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.my-find-card h3,
.empty-state h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 900;
}

.my-find-card-top span {
    flex: 0 0 auto;
    padding: 4px 7px;
    border: 2px solid var(--line);
    background: var(--yellow);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.my-find-card p,
.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.35;
}

.my-find-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.my-find-actions button,
.empty-state button {
    min-height: 34px;
    border: 2px solid var(--line);
    background: var(--blue);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.my-find-actions button.danger {
    background: #fff;
    color: #d82055;
    border-style: dashed;
}

.my-find-sync {
    display: grid;
    min-height: 34px;
    place-items: center;
    border: 2px solid var(--line);
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    font-size: 0.68rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.snack-list {
    display: grid;
    gap: 10px;
}

.snack-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 64px;
    gap: 12px;
    align-items: start;
    padding: 10px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 4px 4px 0 var(--line);
}

.snack-rank {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--yellow);
    font-weight: 900;
}

.snack-copy h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.15;
}

.snack-copy p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.4;
}

.snack-vote {
    display: grid;
    gap: 2px;
    min-height: 50px;
    place-items: center;
    border: 2px solid var(--line);
    background: var(--pink);
    box-shadow: 2px 2px 0 var(--line);
    color: #fff;
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.snack-vote span {
    font-size: 1rem;
    line-height: 1;
}

.snack-vote.voted {
    background: var(--ink);
    color: var(--yellow);
}

.snack-form {
    display: grid;
    gap: 8px;
}

.snack-form input,
.snack-form textarea {
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    border: 2px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
}

.snack-form textarea {
    min-height: 76px;
    resize: vertical;
}

.snack-form button {
    min-height: 40px;
    border: 2px solid var(--line);
    background: var(--green);
    box-shadow: 3px 3px 0 var(--line);
    cursor: pointer;
    font-weight: 900;
    text-transform: uppercase;
}

.brand-about-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 3px 7px;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--line);
}

.brand-about-button span {
    font-size: 0.95rem;
    line-height: 1;
}

.brand-about-button:hover,
.brand-about-button:focus-visible {
    background: var(--yellow);
    outline: none;
}

.about-dialog {
    width: min(540px, calc(100vw - 24px));
    max-height: calc(100vh - 48px);
    margin: auto;
    padding: 0;
    border: 3px solid var(--line);
    background: var(--paper);
    box-shadow: 8px 8px 0 var(--line);
}

.about-dialog::backdrop {
    background: rgba(22, 19, 31, 0.55);
}

.about-dialog-form {
    position: relative;
    margin: 0;
    padding: 22px 24px 24px;
}

.about-dialog h2 {
    margin: 0 32px 12px 0;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.16;
    letter-spacing: -0.01em;
}

.about-dialog p {
    margin: 0 0 10px;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.55;
    color: var(--ink);
}

.about-dialog p:last-child {
    margin: 0;
}

.about-dialog strong {
    background: var(--yellow);
    padding: 0 4px;
}

.about-dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 2px solid var(--line);
    background: var(--pink);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.about-dialog-close:hover,
.about-dialog-close:focus-visible {
    background: var(--ink);
    outline: none;
}

.theme-board {
    padding: 12px;
}

.theme-board-head {
    margin-bottom: 12px;
}

.theme-board-head h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.theme-board-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.4;
}

.theme-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.theme-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 2px solid var(--line);
    background: var(--paper);
    box-shadow: 4px 4px 0 var(--line);
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.theme-card:hover,
.theme-card:focus-visible,
.theme-card.active {
    background: #fff;
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 var(--line);
    outline: none;
}

.theme-card-emoji {
    font-size: 1.6rem;
    line-height: 1;
}

.theme-card h3 {
    margin: 4px 0 0;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.18;
}

.theme-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
}

.theme-card-count {
    margin-top: 4px;
    align-self: start;
    padding: 4px 7px;
    border: 2px solid var(--line);
    background: var(--yellow);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.theme-banner[hidden] {
    display: none !important;
}

.theme-banner {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 2px solid var(--line);
    background: var(--pink);
    color: #fff;
    box-shadow: 4px 4px 0 var(--line);
}

.control-deck.list-focus-mode .theme-banner {
    margin: 0;
    padding: 9px 11px;
    border-width: 0 0 3px;
    box-shadow: 0 4px 0 var(--line);
}

.theme-banner-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.theme-banner-emoji {
    font-size: 1.6rem;
    line-height: 1;
}

.control-deck.list-focus-mode .theme-banner-emoji {
    font-size: 1.15rem;
}

.theme-banner-copy strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
}

.control-deck.list-focus-mode .theme-banner-copy strong {
    font-size: 0.82rem;
}

.theme-banner-copy span {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.35;
    opacity: 0.92;
}

.control-deck.list-focus-mode .theme-banner-copy span {
    font-size: 0.66rem;
    line-height: 1.25;
}

.source-link {
    display: inline-block;
    padding: 4px 8px;
    border: 2px solid var(--ink);
    background: var(--cyan);
    color: var(--ink);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.74rem;
    text-decoration: none;
    box-shadow: 2px 2px 0 var(--ink);
}

.source-link:hover,
.source-link:focus-visible {
    background: var(--yellow);
    outline: none;
}

.theme-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.control-deck.list-focus-mode .theme-banner-actions {
    gap: 5px;
}

.theme-banner-share,
.theme-banner-back,
.theme-banner-clear {
    padding: 6px 9px;
    border: 2px solid var(--ink);
    background: #fff;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}

.control-deck.list-focus-mode .theme-banner-share,
.control-deck.list-focus-mode .theme-banner-back,
.control-deck.list-focus-mode .theme-banner-clear {
    padding: 5px 7px;
    font-size: 0.62rem;
}

.theme-banner-share {
    background: var(--yellow);
}

.theme-banner-back {
    background: var(--cyan);
}

.theme-banner-share:hover,
.theme-banner-share:focus-visible,
.theme-banner-back:hover,
.theme-banner-back:focus-visible,
.theme-banner-clear:hover,
.theme-banner-clear:focus-visible {
    background: var(--ink);
    color: #fff;
    outline: none;
}

.machine-card {
    width: 100%;
    margin: 0 0 8px;
    padding: 9px;
    border: 2px solid var(--line);
    background: var(--paper);
    box-shadow: 4px 4px 0 var(--line);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.machine-card.has-thumb {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 9px;
    align-items: stretch;
}

.machine-card-thumb {
    position: relative;
    overflow: hidden;
    border: 2px solid var(--line);
    background: #16131f;
}

.machine-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.machine-card-thumb.is-reference::after {
    content: 'GMaps';
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 1px 4px;
    background: var(--ink);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.machine-card:hover,
.machine-card.active {
    background: #fff;
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 var(--line);
}

.map-coverage-note {
    cursor: default;
}

.map-coverage-note:hover {
    background: var(--paper);
    transform: none;
    box-shadow: 4px 4px 0 var(--line);
}

.machine-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.machine-card h2 {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.16;
}

.machine-card p {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.34;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rarity {
    flex: 0 0 auto;
    padding: 3px 6px;
    border: 2px solid var(--line);
    background: var(--pink);
    color: #fff;
    font-size: 0.64rem;
    font-weight: 900;
    text-transform: uppercase;
}

.machine-meta,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.machine-pill {
    padding: 3px 6px;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.machine-pill.hot {
    background: var(--cyan);
}

.machine-pill.area {
    background: var(--yellow);
}

.machine-pill.best {
    background: var(--pink);
    color: #fff;
    border-color: var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
}

.machine-card.editorial-pick {
    border-color: var(--pink);
    box-shadow: 4px 4px 0 var(--pink);
}

.machine-pill.status {
    background: #fff;
}

.machine-pill.status-needs-photo {
    background: var(--yellow);
}

.machine-pill.status-recently-checked {
    background: var(--green);
}

.machine-pill.status-recently-added {
    background: var(--cyan);
}

.machine-pill.status-needs-update {
    background: var(--red);
    color: #fff;
}

.submit-panel {
    padding: 12px;
    border-top: 0;
    background: var(--paper);
}

.local-data-panel {
    display: grid;
    gap: 10px;
    margin: 12px;
    padding: 12px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 4px 4px 0 var(--line);
}

.submit-panel h2 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
}

.submit-panel p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 650;
    line-height: 1.4;
}

.local-data-panel h2 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
}

.local-data-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.4;
}

.local-data-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.local-data-actions button,
.import-local-data {
    display: grid;
    min-height: 38px;
    place-items: center;
    border: 2px solid var(--line);
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.import-local-data {
    background: #fff;
    overflow: hidden;
}

.import-local-data input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.local-data-actions button:hover,
.local-data-actions button:focus-visible,
.import-local-data:hover,
.import-local-data:focus-within {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--line);
    outline: none;
}

.local-data-status {
    padding: 8px;
    border: 2px dashed var(--line);
    background: var(--paper);
}

.submit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.submit-grid .wide {
    grid-column: 1 / -1;
}

.submit-grid button {
    min-height: 38px;
    border: 2px solid var(--line);
    background: var(--green);
    box-shadow: 3px 3px 0 var(--line);
    cursor: pointer;
    font-weight: 900;
    text-transform: uppercase;
}

.submit-grid input[type="file"] {
    width: 100%;
    min-height: auto;
    padding: 8px;
    border: 0;
    background: transparent;
    font-size: 0.78rem;
}

.submit-grid .locate-button {
    background: var(--cyan);
}

.advanced-fields {
    border: 2px solid var(--line);
    background: #fff;
}

.advanced-fields summary {
    min-height: 36px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.coordinate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 0 8px 8px;
}

.photo-upload {
    display: block;
    min-height: 66px;
    padding: 10px;
    border: 2px solid var(--line);
    background: #fff;
    cursor: pointer;
}

.photo-upload span {
    display: block;
    margin-bottom: 5px;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.photo-upload small {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.35;
}

.photo-upload.compact {
    min-height: 52px;
    padding: 8px;
}

.map-deck {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #dcebf1;
}

.map-header {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 2px solid var(--line);
    background: rgba(255, 253, 245, 0.94);
    box-shadow: 4px 4px 0 var(--line);
}

.map-legend {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 7px 10px;
    padding: 9px 10px;
    border: 2px solid var(--line);
    background: rgba(255, 253, 245, 0.94);
    box-shadow: 3px 3px 0 var(--line);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.map-legend i {
    width: 10px;
    height: 10px;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--legend-color);
}

.map-header span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-header span[hidden] {
    display: none;
}

.map-header strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.map-header-controls {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.signal-light {
    width: 18px;
    height: 18px;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.28);
}

#vending-map {
    width: 100%;
    height: 100%;
}

.machine-detail {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 3;
    width: min(410px, calc(100% - 36px));
    max-height: min(560px, calc(100% - 104px));
    overflow: auto;
    padding: 0 18px 18px;
    background: var(--panel);
}

.machine-detail[hidden] {
    display: none;
}

.detail-close {
    position: sticky;
    top: 10px;
    float: right;
    right: 10px;
    z-index: 6;
    width: 32px;
    height: 32px;
    border: 2px solid var(--line);
    background: var(--pink);
    box-shadow: 2px 2px 0 var(--line);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

.detail-sticky-header {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 -18px;
    padding: 14px 18px 12px;
    border-bottom: 2px solid var(--line);
    background: var(--panel);
    box-shadow: 0 4px 8px -4px rgba(22, 19, 31, 0.18);
}

.detail-tags {
    margin: 12px 0 0;
}

.detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0 4px;
}

.detail-actions a,
.detail-actions button {
    display: grid;
    min-height: 34px;
    place-items: center;
    padding: 0 10px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 2px 2px 0 var(--line);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.detail-actions a {
    background: var(--cyan);
}

.detail-actions button {
    background: var(--yellow);
}

.detail-delete {
    display: block;
    margin: 8px 0 0;
    padding: 6px 10px;
    border: 2px dashed var(--red, #ff4e42);
    background: transparent;
    color: var(--red, #ff4e42);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    width: 100%;
}

.detail-delete:hover,
.detail-delete:focus-visible {
    border-style: solid;
    background: var(--red, #ff4e42);
    color: #fff;
    outline: none;
}

.detail-label {
    display: inline-block;
    padding: 5px 8px;
    border: 2px solid var(--line);
    background: var(--yellow);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.machine-detail h2 {
    margin: 8px 38px 4px 0;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.05;
    text-shadow: 2px 2px 0 var(--cyan);
    text-transform: uppercase;
}

.detail-source {
    display: inline-block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.detail-source:hover,
.detail-source:focus-visible {
    color: var(--ink);
    outline: none;
}

.alt-summary {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--line);
    color: var(--muted);
    font-style: italic;
}

.detail-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 2px solid var(--line);
    scroll-margin-top: 90px;
}

.detail-section h3 {
    scroll-margin-top: 90px;
}

.detail-sticky-header + .detail-tags,
.detail-tags + .detail-actions,
.detail-actions + .detail-section {
    border-top: 0;
}

#detail-content > .detail-section:first-of-type {
    margin-top: 0;
    border-top: 0;
}

.detail-section h3 {
    margin: 0 0 7px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-section p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.5;
}

.photo-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.photo-strip img {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--line);
    object-fit: cover;
    background: #fff;
}

.reference-photo {
    margin: 10px 0 0;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 4px 4px 0 var(--line);
    overflow: hidden;
}

.reference-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #16131f;
}

.reference-photo figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-top: 2px solid var(--line);
    background: var(--yellow);
}

.reference-photo-source {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ink);
}

.reference-photo-cta {
    border: 2px solid var(--ink);
    background: var(--pink);
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 6px 8px;
    cursor: pointer;
}

.reference-photo-cta:hover,
.reference-photo-cta:focus-visible {
    background: var(--ink);
    outline: none;
}

.photo-empty-state {
    display: grid;
    gap: 5px;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 2px dashed var(--line);
    background: #fff;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.photo-empty-state strong {
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.photo-empty-state span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.35;
}

.photo-empty-state:hover,
.photo-empty-state:focus-visible,
.photo-upload.attention {
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--line);
    outline: none;
}

.nearby-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.nearby-card {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px;
    border: 2px solid var(--line);
    background: #fff;
    box-shadow: 2px 2px 0 var(--line);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.nearby-card:hover,
.nearby-card:focus-visible {
    background: var(--cyan);
    outline: none;
}

.nearby-card strong {
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.15;
}

.nearby-card span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
}

.report-card {
    margin-top: 10px;
    padding: 10px;
    border: 2px solid var(--line);
    background: var(--paper);
}

.report-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.report-card p {
    font-size: 0.82rem;
}

.report-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.report-form input,
.report-form select,
.report-form textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 2px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
}

.report-form textarea {
    min-height: 82px;
    resize: vertical;
}

.report-form button {
    min-height: 42px;
    border: 2px solid var(--line);
    background: var(--pink);
    box-shadow: 3px 3px 0 var(--line);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    text-transform: uppercase;
}

.vending-marker {
    display: grid;
    width: var(--size, 34px);
    height: var(--size, 34px);
    place-items: center;
    border: 3px solid var(--line);
    border-radius: 50%;
    background: var(--marker-color);
    box-shadow: 4px 4px 0 var(--line);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.gm-style .gm-style-iw-c {
    border: 2px solid var(--line);
    border-radius: 0;
    box-shadow: 4px 4px 0 var(--line);
}

@media (max-width: 980px) {
    body {
        overflow: auto;
    }

    .atlas-app {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        padding: 10px;
        overflow-x: clip;
    }

    .control-deck {
        display: block;
        max-height: none;
        overflow: visible;
    }

    .sticky-controls {
        position: static;
        border-bottom: 0;
        box-shadow: none;
    }

    .filter-strip {
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 4px 0 rgba(22, 19, 31, 0.14);
    }

    .deck-scroll {
        display: block;
        overflow: visible;
    }

    .panel-scroll {
        overflow: visible;
    }

    .panel-tabs {
        top: 53px;
        z-index: 9;
        box-shadow: 0 4px 0 rgba(22, 19, 31, 0.12);
    }

    .map-deck {
        height: 72vh;
        min-height: 560px;
        order: -1;
    }

    .brand-panel h1 {
        max-width: none;
        font-size: clamp(2rem, 9vw, 3.2rem);
    }

    .brand-lockup {
        width: 100%;
    }

    .brand-lockup img {
        width: 82px;
    }
}

@media (max-width: 560px) {
    .atlas-app {
        gap: 10px;
    }

    .control-deck,
    .map-deck,
    .machine-detail {
        box-shadow: 5px 5px 0 var(--ink);
    }

    .quick-stats,
    .submit-grid {
        grid-template-columns: 1fr;
    }

    .local-data-actions {
        grid-template-columns: 1fr;
    }

    .mission-bar {
        grid-template-columns: 1fr;
    }

    .panel-tabs {
        gap: 6px;
        padding: 8px;
    }

    .filter-row {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .vending-filter,
    .filter-more-toggle {
        flex: 1 1 calc(50% - 7px);
        justify-content: center;
    }

    .panel-tab {
        min-height: 34px;
        padding: 0 4px;
        font-size: 0.66rem;
    }

    .snack-card {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .snack-vote {
        grid-column: 1 / -1;
        grid-template-columns: auto auto;
        min-height: 38px;
        justify-content: center;
        padding: 0 12px;
    }

    .passport-auth-fields {
        grid-template-columns: 1fr;
    }

    .map-deck {
        height: 68vh;
        min-height: 500px;
    }

    .machine-detail {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-height: 48vh;
    }

    .brand-lockup {
        gap: 6px;
    }

    .brand-lockup img {
        width: 48px;
    }

    .brand-panel h1 {
        font-size: clamp(1.9rem, 10vw, 2.7rem);
    }
}
