/* nemo.town signed-in mode — components the anonymous mode never shows.
   /styles.css (shared) is loaded first; this only adds. Tokens from
   /theme.css. No inline styles anywhere in the app: the CSP is style-src 'self'. */

.landing {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: var(--bg);
}
.landing[hidden] { display: none; }
.landing-card {
    width: min(420px, 100%);
    background: var(--bg-secondary);
    border: 1px solid var(--chrome-border);
    border-radius: var(--radius-card);
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}
.landing-icon { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 14px; }
.landing-title { font-size: var(--fs-title3); font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.landing-body { font-size: var(--fs-subheadline); line-height: 1.45; color: var(--text-secondary); margin-bottom: 20px; }
.landing-foot { font-size: var(--fs-footnote); color: var(--text-secondary); margin-top: 14px; }
.landing-foot a { color: var(--accent); text-decoration: none; }

.account-btn { margin-left: 0; }

.banner-slot { position: fixed; top: 0; left: 0; right: 0; z-index: 2500; pointer-events: none; }
.banner {
    pointer-events: auto;
    margin: 8px auto 0; width: min(560px, calc(100% - 24px));
    padding: 10px 14px; border-radius: var(--radius-bar);
    background: var(--bg-secondary); border: 1px solid var(--orange);
    box-shadow: var(--shadow-chrome);
    color: var(--text-primary); font-size: var(--fs-subheadline); display: flex; gap: 12px; align-items: center;
}
.banner.offline { border-color: var(--separator); }
.banner button { margin-left: auto; }
.banner-btn { width: auto; height: 32px; padding: 0 12px; font-size: var(--fs-footnote); border-radius: 8px; }

/* account sheet */
.account-sheet { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.account-email { font-size: var(--fs-subheadline); font-weight: 600; color: var(--text-primary); word-break: break-all; }
.account-synced { font-size: var(--fs-footnote); color: var(--text-secondary); margin-bottom: 6px; }
.account-row {
    text-align: left; padding: 12px 14px; border: 0; border-radius: var(--radius-row);
    background: var(--fill-1); color: var(--text-primary); font-size: var(--fs-body); cursor: pointer;
}
.account-row:active { background: var(--fill-2); }
.account-row.danger { color: var(--red); }
.account-label { margin: 6px 0 -2px; }
.account-field { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.account-field-hint { font-size: var(--fs-footnote); color: var(--text-secondary); }
.account-field-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-field-sub { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-footnote); color: var(--text-secondary); }

/* toast */
.toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
    max-width: min(520px, calc(100% - 32px)); padding: 10px 16px; border-radius: var(--radius-bar);
    background: var(--material-thick); border: 1px solid var(--chrome-border); box-shadow: var(--shadow-chrome);
    color: var(--text-primary); font-size: var(--fs-subheadline); z-index: 4000;
    opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* first-sync strip + empty state */
.sync-strip {
    position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 1500;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; border-radius: var(--radius-pill);
    background: var(--material-thick); border: 1px solid var(--chrome-border);
    color: var(--text-secondary); font-size: var(--fs-footnote);
    box-shadow: var(--shadow-chrome);
}
.sync-strip[hidden] { display: none; }
.sync-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--fill-3); border-top-color: var(--accent);
    animation: sync-spin 0.9s linear infinite;
}
@keyframes sync-spin { to { transform: rotate(360deg); } }
.bottom-hint[hidden] { display: none; }

/* shared maps sheet */
.shares-sheet { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.shares-heading { font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); margin: 8px 2px 2px; }
.shares-empty, .shares-note { color: var(--text-secondary); font-size: var(--fs-subheadline); line-height: 1.45; text-align: center; padding: 20px 16px; }
.shares-note { padding-top: 12px; font-size: var(--fs-footnote); }
.share-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-row); background: var(--fill-1);
}
.share-row-main { flex: 1; min-width: 0; }
.share-row-name { font-size: var(--fs-body); color: var(--text-primary); overflow-wrap: anywhere; }
.share-row-name-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.share-row-rename { flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--text-secondary); }
.share-row-rename:hover, .share-row-rename:focus-visible { background: var(--fill-3); color: var(--accent); }
.share-row-name-input { flex: 1; min-width: 0; font: inherit; font-size: var(--fs-body); color: var(--text-primary); background: var(--fill-3); border: 1px solid var(--accent); border-radius: 8px; padding: 2px 8px; }
.share-row-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: var(--fs-caption); color: var(--text-secondary); }
.share-row-address { margin-top: 2px; font-size: var(--fs-caption); color: var(--accent); word-break: break-all; }
.share-collection { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 12px; background: var(--fill-1); border-radius: var(--radius-row); }
.share-collection .shares-heading { margin: 0; }
.share-collection-address { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-footnote); color: var(--text-primary); word-break: break-all; }
.share-collection .share-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.share-collection .share-action.share-open { margin-left: 0; background: var(--fill-3); }
.share-collection-empty { padding: 2px 14px 6px; white-space: normal; }
.share-badge { padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-caption2); font-weight: 600; }
.share-badge.live { background: var(--green-tint); color: var(--green); }
.share-badge.paused { background: var(--orange-tint); color: var(--orange); }
.share-badge.hidden { background: var(--gray-tint); color: var(--text-secondary); }
.share-badge.kept { background: var(--accent-fill); color: var(--accent); }
.share-row-tappable { cursor: pointer; border-radius: var(--radius-row); }
@media (hover: hover) { .share-row-tappable:hover .share-row-name { color: var(--accent); } }
.share-link { color: var(--accent); text-decoration: none; font-size: var(--fs-subheadline); font-weight: 600; padding: 6px 4px; }

/* shared maps actions */
.share-row { flex-wrap: wrap; }
.share-row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }
.share-action {
    padding: 7px 12px; border: 0; border-radius: var(--radius-pill); cursor: pointer;
    background: var(--fill-3); color: var(--accent); font-size: var(--fs-footnote); font-weight: 600; text-decoration: none;
}
.share-action:active { background: var(--fill-2); }
.share-action.danger { color: var(--red); }
.share-action.share-open { margin-left: auto; background: transparent; }
.share-row-hint { font-size: var(--fs-caption); color: var(--text-secondary); }

/* standalone pages (delete-account) */
.page { background: var(--bg); min-height: 100vh; margin: 0; padding: 24px; display: flex; align-items: flex-start; justify-content: center; font-family: var(--font); color: var(--text-primary); }
.page-card { width: min(520px, 100%); background: var(--bg-secondary); border: 1px solid var(--chrome-border); border-radius: var(--radius-card); padding: 28px 24px 22px; color: var(--text-primary); box-shadow: var(--shadow-card); }
.page-card .landing-icon { display: block; margin: 0 0 14px; }
.page-title { font-size: var(--fs-title3); font-weight: 700; margin: 0 0 12px; }
.page-body { font-size: var(--fs-subheadline); line-height: 1.5; color: var(--text-secondary); margin: 0 0 14px; }
.page-body a, .page-foot a { color: var(--accent); text-decoration: none; }
.page-list { color: var(--text-secondary); font-size: var(--fs-subheadline); line-height: 1.5; margin: 0 0 14px 20px; padding: 0; }
.page-label { display: block; font-size: var(--fs-footnote); color: var(--text-secondary); margin: 18px 0 6px; }
.page-input { width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: var(--radius-row); border: 0; background: var(--fill-1); color: var(--text-primary); font-size: var(--fs-body); margin-bottom: 12px; }
.page-input:focus { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }
.page-foot { font-size: var(--fs-footnote); color: var(--text-secondary); margin: 14px 0 0; }
.btn-danger { background: var(--red); }
.btn-primary:disabled { opacity: 0.45; cursor: default; }

/* sign-in / merge sheets */
.signin-body { font-size: var(--fs-subheadline); line-height: 1.45; color: var(--text-primary); }
.signin-note { font-size: var(--fs-footnote); line-height: 1.4; color: var(--text-secondary); }
.signin-note a { color: var(--accent); text-decoration: none; }
.account-foot { font-size: var(--fs-caption); line-height: 1.4; color: var(--text-secondary); margin: -2px 2px 4px; }
.merge-sheet .account-row { text-align: center; }

/* sharing pill — the phone's capsule, stacked above the locate button bottom-right
   (the pill IS the Leaflet control element; the 8px rule beats map.css's 16px). */
.leaflet-bottom.leaflet-right .nemo-pill { margin-bottom: 8px; }
.nemo-pill {
    display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 0;
    height: var(--ctl); min-width: var(--ctl); padding: 0 12px; box-sizing: border-box;
    background: var(--material-regular); color: var(--text-primary);
    border: 1px solid var(--chrome-border); border-radius: var(--radius-pill);
    box-shadow: var(--shadow-chrome);
    cursor: pointer; position: relative; font: inherit;
    transition: max-width var(--dur-pill) var(--ease-in-out), opacity .18s ease;
    max-width: var(--ctl); overflow: hidden; white-space: nowrap;
}
.nemo-pill.hidden { display: none; }
.nemo-pill.announcing { max-width: 260px; padding-left: 14px; }
.nemo-pill svg { flex: 0 0 auto; width: 24px; height: 24px; color: var(--text-secondary); }
.nemo-pill-dot {
    position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--text-secondary);
}
.nemo-pill.announcing .nemo-pill-dot { display: none; }
.nemo-pill.live .nemo-pill-dot { background: var(--green); }
.nemo-pill.live svg { color: var(--green); animation: nemo-pill-pulse 1.2s ease-in-out infinite alternate; }
.nemo-pill.paused svg { color: var(--text-secondary); }
.nemo-pill-text { font-size: var(--fs-footnote); font-weight: 500; margin-right: 8px; }
.nemo-pill:not(.announcing) .nemo-pill-text { display: none; }
@keyframes nemo-pill-pulse { from { opacity: 1; } to { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) {
    .nemo-pill { transition: none; }
    .nemo-pill.live svg { animation: none; }
}

/* options: "Share and keep updated" subordinate row */
.options-action-live { align-items: center; background: var(--accent-tint); }
.options-action-live .options-action-icon { color: var(--accent); }
.options-action-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.options-action-live .options-action-label { color: var(--accent); font-weight: 600; }
.options-action-caption { font-size: var(--fs-caption); color: var(--text-secondary); }
.options-action-chevron { color: var(--text-tertiary); font-size: 20px; margin-left: 8px; }

/* create-share sheet */
.create-share { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; }
.create-share .page-label { margin-top: 4px; }
.create-share-list { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; }
.create-share-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-row); background: var(--fill-1); cursor: pointer; }
.create-share-check { width: 20px; height: 20px; accent-color: var(--accent); }
.create-share-emoji { font-size: 18px; }
.create-share-title { font-size: var(--fs-subheadline); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.create-share .account-row { text-align: center; }
.signin-intro { margin-bottom: 4px; }
.shares-sheet .share-action.share-showall { align-self: center; margin-top: 6px; }
