/* Application styles — consume theme tokens only (see wwwroot/css/theme.css). */

html, body {
    font-family: var(--np-font-sans);
    background: var(--np-bg);
    color: var(--np-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Bootstrap body defaults → theme tokens (fixes dark-on-dark labels/copy). */
body,
.page,
.content,
main,
article {
    color: var(--np-text);
    background-color: transparent;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--np-text-strong);
}

p, li, dt, dd, th, td,
.form-label,
.col-form-label,
.form-check-label,
label {
    color: var(--np-text);
}

a, .btn-link {
    color: var(--np-link);
}

a:hover, .btn-link:hover {
    color: var(--np-accent-soft);
}

html[data-theme="light"] a:hover,
html[data-theme="light"] .btn-link:hover {
    color: var(--np-accent-strong);
}

.btn-primary {
    color: var(--np-text-on-accent);
    background-color: var(--np-accent-strong);
    border-color: var(--np-accent);
}

.btn-primary:hover {
    background-color: var(--np-accent);
    border-color: var(--np-accent-soft);
}

.btn-outline-light {
    color: var(--np-text);
    border-color: var(--np-border);
}

.btn-outline-light:hover {
    color: var(--np-text-strong);
    background: var(--np-fill-hover);
    border-color: var(--np-border-hover);
}

.btn-outline-secondary {
    color: var(--np-text);
    border-color: var(--np-border);
}

.btn-outline-secondary:hover {
    color: var(--np-text-strong);
    background: var(--np-fill-hover);
    border-color: var(--np-border-hover);
}

/* Tables: themed in both modes (avoid Bootstrap "dark table" only). */
.table,
.table-dark {
    --bs-table-bg: var(--np-surface);
    --bs-table-striped-bg: var(--np-surface-muted);
    --bs-table-hover-bg: var(--np-fill-hover);
    --bs-table-color: var(--np-text);
    --bs-table-striped-color: var(--np-text);
    --bs-table-hover-color: var(--np-text-strong);
    --bs-table-border-color: var(--np-border);
    color: var(--np-text);
}

.form-control,
.form-select,
.form-control-plaintext {
    background-color: var(--np-surface-input);
    border-color: var(--np-border);
    color: var(--np-text);
}

.form-control::placeholder,
.form-select::placeholder {
    color: var(--np-text-placeholder);
    opacity: 1;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--np-surface-input);
    color: var(--np-text);
    border-color: var(--np-border-focus);
    box-shadow: 0 0 0 0.15rem var(--np-focus-glow);
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--np-surface-muted);
    color: var(--np-text-muted);
    opacity: 1;
}

.form-select option {
    background-color: var(--np-surface-input);
    color: var(--np-text);
}

.form-text {
    color: var(--np-text-muted) !important;
}

.form-check-input {
    background-color: var(--np-surface-input);
    border-color: var(--np-border-control);
}

.form-check-input:checked {
    background-color: var(--np-accent-strong);
    border-color: var(--np-accent);
}

.form-check-input:focus {
    border-color: var(--np-border-focus);
    box-shadow: 0 0 0 0.15rem var(--np-focus-glow);
}

.form-section {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--np-text);
}

.form-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--np-text-strong);
}

.report-step h2,
.report-optional h2 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.report-step-index {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: var(--np-radius-pill);
    background: var(--np-accent-strong);
    color: var(--np-text-on-accent);
    font-size: 1rem;
    font-weight: 700;
}

.report-step-photo {
    border-color: var(--np-accent);
}

.report-step-lead {
    margin: -0.35rem 0 1rem;
    color: var(--np-text);
    font-size: 1.05rem;
}

.report-upload-wrap {
    position: relative;
}

.report-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 9.5rem;
    margin: 0;
    padding: 1.5rem 1rem;
    border: 2px dashed var(--np-border-control);
    border-radius: var(--np-radius-xl);
    background: var(--np-fill-subtle);
    color: var(--np-text-strong);
    text-align: center;
    cursor: pointer;
}

.report-upload:hover {
    border-color: var(--np-accent);
    background: var(--np-fill-hover);
    color: var(--np-text-strong);
}

.report-upload-wrap:focus-within .report-upload {
    border-color: var(--np-accent);
    box-shadow: 0 0 0 0.15rem var(--np-focus-glow);
}

.report-upload-title {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
}

.report-upload-hint {
    color: var(--np-text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

.report-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.report-previews {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.report-preview {
    margin: 0;
}

.report-preview-open {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.report-preview-media {
    display: block;
    width: 100%;
    max-height: 24rem;
    object-fit: contain;
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    background: var(--np-surface-media);
}

.report-preview-fallback {
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px dashed var(--np-border);
    border-radius: var(--np-radius-lg);
    color: var(--np-text-muted);
    background: var(--np-fill-subtle);
}

.report-plate {
    margin-top: 1rem;
}

.report-preview-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    padding-bottom: calc(var(--np-bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 1rem);
    background: var(--np-overlay-lightbox);
    color: var(--np-lightbox-text);
}

.report-preview-lightbox .form-label,
.report-preview-lightbox .report-preview-close {
    color: var(--np-lightbox-text);
}

.report-preview-lightbox .form-text {
    color: var(--np-lightbox-muted);
}

.report-preview-lightbox .report-preview-close {
    border-color: var(--np-lightbox-border);
    background: transparent;
}

.report-preview-lightbox .report-preview-close:hover {
    color: var(--np-lightbox-text);
    border-color: var(--np-lightbox-text);
    background: var(--np-lightbox-fill);
}

.report-preview-lightbox-bar {
    display: flex;
    justify-content: flex-end;
}

.report-preview-lightbox img {
    display: block;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    object-fit: contain;
    border-radius: var(--np-radius-lg);
    background: var(--np-surface-media);
}

.report-preview-lightbox .report-plate {
    margin-top: 0;
    flex: 0 0 auto;
}

.report-optional-tag {
    color: var(--np-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.report-confirm {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-height: 0;
    margin: 0;
    padding-left: 0;
}

.report-confirm .form-check-input {
    float: none;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    margin: 0.1rem 0 0;
}

.report-confirm .form-check-label {
    font-size: 1.05rem;
    padding-top: 0.35rem;
}

.np-token-box {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-md);
    background: var(--np-surface-muted);
}

.np-token-box code {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    color: var(--np-text);
}

.np-connect-steps {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    color: var(--np-text);
}

.np-connect-steps li + li {
    margin-top: 0.4rem;
}

/* Alerts with readable contrast on both themes */
.alert {
    color: var(--np-text);
    border: 1px solid var(--np-border);
    background: var(--np-surface-muted);
}

.alert-danger {
    background: var(--np-danger-soft-bg);
    border-color: var(--np-accent-strong);
    color: var(--np-accent-soft);
}

html[data-theme="light"] .alert-danger {
    color: var(--np-accent-strong);
}

.alert-info {
    background: var(--np-info-soft-bg);
    border-color: var(--np-info);
    color: var(--np-link);
}

.alert-warning {
    background: var(--np-warning-soft-bg);
    border-color: var(--np-accent-2);
    color: var(--np-accent-2);
}

html[data-theme="light"] .alert-warning {
    color: var(--np-accent-2-hover);
}

.alert-success {
    background: var(--np-ok-soft-bg);
    border: 1px solid var(--np-ok-strong);
    color: var(--np-ok);
}

html[data-theme="light"] .alert-success {
    color: var(--np-ok-strong);
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: auto;
    padding: 0.28rem 0.65rem;
    border-radius: var(--np-radius-pill);
    border: 1px solid var(--np-border);
    background: var(--np-fill-subtle);
    color: var(--np-text);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background var(--np-transition), border-color var(--np-transition), color var(--np-transition);
}

.theme-toggle:hover {
    background: var(--np-fill-hover);
    border-color: var(--np-border-hover);
    color: var(--np-text-strong);
}

.theme-toggle-icon {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: var(--np-text);
    opacity: 0.85;
    box-shadow: inset -0.28rem -0.1rem 0 0 var(--np-page-bg);
}

html[data-theme="light"] .theme-toggle-icon {
    box-shadow: none;
    background: radial-gradient(circle at 35% 35%, var(--np-accent-2) 0 42%, transparent 43%),
                var(--np-accent-2);
    opacity: 1;
}

.location-picker-map {
    height: 320px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--np-border);
    z-index: 0;
    background: var(--np-surface-map);
}

.location-actions .form-text {
    flex: 1 1 12rem;
}

.hero {
    background:
        radial-gradient(circle at top right, var(--np-fill-hover), transparent 42%),
        linear-gradient(160deg, var(--np-surface-elevated) 0%, var(--np-bg) 72%);
    border: 1px solid var(--np-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    max-width: 18ch;
    line-height: 1.15;
}

.hero .lead {
    max-width: 60ch;
    color: var(--np-text-muted);
    font-size: 1.1rem;
}

.hero-badge {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--np-accent-2);
    margin-bottom: 0.75rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 1.25rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.stat-label {
    color: var(--np-text-muted);
    font-size: 0.9rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.sighting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.sighting-card {
    display: block;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color var(--np-transition), transform var(--np-transition);
}

.sighting-card:hover {
    border-color: var(--np-border-strong);
    transform: translateY(-2px);
    color: inherit;
}

.sighting-card-media {
    position: relative;
    /* Slightly wide frame suits plate-focused thumbs without aggressive cover-crop. */
    aspect-ratio: 16 / 10;
    background: var(--np-surface-media);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sighting-card-media img {
    width: 100%;
    height: 100%;
    /* Show the full plate thumb — never non-uniform stretch or random cover zoom. */
    object-fit: contain;
    object-position: center;
}

.media-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--np-text-muted);
}

.sighting-card-body {
    padding: 0.85rem 1rem 1rem;
}

.sighting-card-plate {
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.sighting-card-body .meta {
    color: var(--np-text-muted);
    font-size: 0.85rem;
}

.sighting-card-body .date {
    font-size: 0.85rem;
    color: var(--np-text-muted);
}

.score-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    min-width: 2.2rem;
    text-align: center;
    border-radius: var(--np-radius-pill);
    padding: 0.2rem 0.45rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--np-text-on-accent);
}

.score-low { background: var(--np-accent); }
.score-mid { background: var(--np-accent-2); color: var(--np-text-score-mid); }
.score-high { background: var(--np-ok); color: var(--np-text-score-high); }

.page-header {
    margin-bottom: 1.5rem;
}

.gallery-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.gallery-add {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.2;
    padding: 0.9rem 1.75rem;
}

.gallery-filters {
    align-items: flex-end;
}

.gallery-score-filter {
    min-width: 16rem;
    flex: 1 1 16rem;
}

.gallery-score-filter .form-range {
    accent-color: var(--np-accent);
}

.empty-state {
    background: var(--np-surface);
    border: 1px dashed var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 2rem;
    text-align: center;
    color: var(--np-text-muted);
}

.map-placeholder {
    min-height: 280px;
    display: grid;
    place-items: center;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.map-filters > div {
    min-width: 11rem;
}

.map-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    color: var(--np-text);
    font-size: 0.95rem;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(16rem, 0.9fr);
    gap: 1rem;
    min-height: 28rem;
}

@media (max-width: 900px) {
    .map-layout {
        grid-template-columns: 1fr;
    }
}

.map-canvas {
    min-height: 28rem;
    height: 65vh;
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    overflow: hidden;
    background: var(--np-surface-map-canvas);
    z-index: 1;
}

.map-side {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 1rem;
    max-height: 65vh;
    overflow: auto;
}

.map-side h2 {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.map-side-empty {
    padding: 1rem;
    text-align: left;
}

.map-side-empty .btn {
    margin: 0.25rem 0.35rem 0 0;
}

.map-point-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.map-point-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    align-items: start;
    padding: 0.55rem 0;
    border-top: 1px solid var(--np-border);
}

.map-point-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.map-point-item {
    background: transparent;
    border: 0;
    color: inherit;
    text-align: left;
    padding: 0;
    cursor: pointer;
}

.map-point-item:hover .map-point-title {
    color: var(--np-text-strong);
}

.map-point-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.map-point-meta {
    color: var(--np-text-muted);
    font-size: 0.85rem;
}

.map-point-link {
    font-size: 0.85rem;
    white-space: nowrap;
    margin-top: 0.15rem;
}

.map-approx-pill {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: var(--np-radius-pill);
    background: var(--np-status-neutral);
    color: var(--np-text-muted);
    font-size: 0.75rem;
}

/* Leaflet popups on dark theme */
.np-map-popup {
    color: var(--np-popup-text);
    display: grid;
    gap: 0.45rem;
    min-width: 12rem;
}

.np-map-thumb {
    width: 100%;
    max-height: 120px;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    background: var(--np-surface-map-canvas);
}

.np-map-meta {
    font-size: 0.85rem;
    color: var(--np-popup-meta);
}

.np-map-approx {
    font-size: 0.8rem;
    color: var(--np-popup-approx);
}

.np-map-score {
    margin-left: 0.35rem;
    font-weight: 600;
}

.leaflet-container {
    font: inherit;
    background: var(--np-surface-map-canvas);
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

.edit-media-preview {
    max-width: 36rem;
}

/* Never force both axes — width:100% + max-height alone can non-uniformly stretch <img>. */
.edit-media-preview .detail-image,
.edit-media-preview .detail-video {
    max-height: 18rem;
}

.detail-media {
    display: grid;
    gap: 0.75rem;
}

.detail-image,
.detail-video {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(70vh, 36rem);
    object-fit: contain;
    object-position: center;
    border-radius: var(--np-radius-xl);
    border: 1px solid var(--np-border);
    background: var(--np-sidebar-bg);
}

.media-tile {
    display: grid;
    gap: 0.5rem;
    justify-items: start;
}

.media-tile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Fixed frame + contain so thumbs never stretch or collapse into a strip. */
.media-thumb-preview {
    display: block;
    flex: 0 0 auto;
    width: 7.5rem;
    height: 5rem;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: var(--np-radius-md);
    border: 1px solid var(--np-border);
    background: var(--np-sidebar-bg);
}

/* Image crop modal */
.np-crop-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: var(--np-overlay-scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.np-crop-modal {
    width: min(960px, 100%);
    max-height: min(92vh, 900px);
    overflow: auto;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 1rem 1.25rem 1.25rem;
    box-shadow: 0 12px 40px var(--np-raw-black-a40);
}

.np-crop-modal h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.np-crop-stage {
    position: relative;
    width: 100%;
    min-height: 220px;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--np-sidebar-bg);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-md);
    overflow: hidden;
    margin: 0.75rem 0 1rem;
    user-select: none;
    touch-action: none;
}

.np-crop-image {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    pointer-events: none;
}

.np-crop-box {
    position: absolute;
    border: 2px solid var(--np-accent);
    box-shadow: 0 0 0 9999px var(--np-raw-black-a40);
    cursor: move;
    box-sizing: border-box;
}

.np-crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--np-accent);
    border: 1px solid var(--np-text);
    border-radius: 2px;
}

.np-crop-handle[data-handle="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.np-crop-handle[data-handle="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.np-crop-handle[data-handle="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.np-crop-handle[data-handle="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }

.np-crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Manual blur brush */
.np-blur-modal {
    max-width: min(980px, 100%);
}

.np-blur-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.np-blur-toolbar .form-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9rem;
}

.np-blur-toolbar input[type="range"] {
    width: 8rem;
    accent-color: var(--np-accent);
}

.np-blur-stage {
    position: relative;
    width: 100%;
    min-height: 220px;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--np-sidebar-bg);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-md);
    overflow: auto;
    margin: 0.5rem 0 1rem;
    user-select: none;
    touch-action: none;
}

.np-blur-canvas {
    display: block;
    max-width: 100%;
    cursor: crosshair;
    border-radius: var(--np-radius-sm);
}

.detail-dl {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.5rem 1rem;
}

.detail-dl dt {
    color: var(--np-text-muted);
    margin: 0;
}

.detail-dl dd {
    margin: 0;
}

.score-panel {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 1rem;
    margin: 1rem 0;
}

.score-panel-value {
    font-size: 2rem;
    font-weight: 800;
    min-width: 3.5rem;
    text-align: center;
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    color: var(--np-text-on-accent);
}

.disclaimer {
    color: var(--np-text-muted);
    font-size: 0.9rem;
    margin-top: 1.25rem;
}

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--np-radius-pill);
    font-size: 0.8rem;
    background: var(--np-status-neutral);
}

.status-pendingreview { background: var(--np-status-pending); color: var(--np-text-on-accent); }
.status-approved { background: var(--np-status-approved); color: var(--np-text-on-accent); }
.status-rejected { background: var(--np-status-rejected); color: var(--np-text-on-accent); }
.status-needsinfo { background: var(--np-status-needsinfo); color: var(--np-text-on-accent); }
.status-draft { background: var(--np-status-draft); color: var(--np-text-on-accent); }
.status-softdeleted { background: var(--np-status-softdeleted); color: var(--np-text-on-accent); }

.prose {
    max-width: 48rem;
}

.prose h1, .prose h2 {
    margin-top: 1.5rem;
}

.prose .small {
    font-size: 0.9rem;
}

.callout {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--np-border);
    background: var(--np-fill-subtle);
    color: var(--np-text-muted);
    font-size: 0.95rem;
    max-width: 60rem;
}

.callout strong {
    color: var(--np-text);
}

.admin-ai-detail {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 16rem;
    overflow: auto;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--np-border);
    background: var(--np-surface);
    color: var(--np-text-muted);
}

.why-matters {
    margin-bottom: 1.5rem;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.85rem;
}

.why-card {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 1rem 1.1rem;
}

.why-card h3 {
    font-size: 1rem;
    margin: 0 0 0.4rem;
    color: var(--np-text);
}

.why-card p {
    margin: 0;
    color: var(--np-text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.mod-thumb-cell {
    width: 4.5rem;
}

.mod-thumb {
    width: 3.5rem;
    height: 2.6rem;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--np-border);
    background: var(--np-surface-map-canvas);
}

.mod-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--np-text-muted);
    font-size: 0.8rem;
}

.mod-form {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--np-border);
}

.mod-form h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.mod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-success {
    background-color: var(--np-ok-strong);
    border-color: var(--np-ok);
    color: var(--np-text-on-accent);
}

.btn-success:hover {
    background-color: var(--np-ok-hover);
    border-color: var(--np-ok-border);
    color: var(--np-text-on-accent);
}

.btn-warning {
    background-color: var(--np-accent-2);
    border-color: var(--np-accent-2);
    color: var(--np-text-on-accent-2);
}

.btn-warning:hover {
    background-color: var(--np-accent-2-hover);
    border-color: var(--np-accent-2-hover);
    color: var(--np-text-on-accent);
}

.file-list {
    margin-top: 0.75rem;
    color: var(--np-text-muted);
}

.text-muted {
    color: var(--np-text-muted) !important;
}

.text-danger {
    color: var(--np-accent-soft) !important;
}

html[data-theme="light"] .text-danger {
    color: var(--np-accent-strong) !important;
}

.text-success {
    color: var(--np-ok) !important;
}

html[data-theme="light"] .text-success {
    color: var(--np-ok-strong) !important;
}

.text-warning {
    color: var(--np-accent-2) !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--np-text-strong), 0 0 0 0.25rem var(--np-focus-ring);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--np-valid);
}

.invalid {
    outline: 1px solid var(--np-invalid);
}

.validation-message {
    color: var(--np-invalid);
}

.blazor-error-boundary {
    background: var(--np-error-boundary-bg);
    padding: 1rem 1rem 1rem 1.25rem;
    color: var(--np-error-boundary-text);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: var(--np-border-control);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--np-text-placeholder);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.form-floating > label {
    color: var(--np-text-muted);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--np-text-muted);
}

code, .code, pre {
    color: var(--np-accent-soft);
    background: var(--np-fill-subtle);
}

html[data-theme="light"] code,
html[data-theme="light"] .code,
html[data-theme="light"] pre {
    color: var(--np-accent-strong);
}

/* Card / callout content always inherits readable body text */
.callout,
.stat-card,
.empty-state,
.score-panel,
.detail-info,
.page-header {
    color: var(--np-text);
}

.page-header h1,
.hero h1 {
    color: var(--np-text-strong);
}

hr {
    border-color: var(--np-border);
    opacity: 1;
}

/* InputNumber / number spinners stay on theme */
input[type="number"] {
    color: var(--np-text);
    background-color: var(--np-surface-input);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile-friendly base + Drive mode
   ═══════════════════════════════════════════════════════════════════════════ */

html {
    /* Prevent iOS text-size adjust jank */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Comfortable touch targets on coarse pointers */
@media (pointer: coarse) {
    .btn,
    .form-control,
    .form-select,
    .form-check-input,
    .nav-link,
    .navbar-toggler {
        min-height: 2.75rem;
    }

    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0.2rem;
    }

    .btn-sm {
        min-height: 2.35rem;
    }
}

@media (max-width: 640.98px) {
    .content.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .hero {
        padding: 1.35rem 1.1rem;
        border-radius: var(--np-radius-xl);
    }

    .hero h1 {
        max-width: none;
        font-size: clamp(1.45rem, 6.5vw, 1.9rem);
    }

    .hero .lead {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .location-picker-map {
        height: 260px;
    }

    .map-canvas {
        min-height: 18rem;
        height: 50vh;
    }

    .map-side {
        max-height: none;
    }

    .sighting-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .sighting-card-body {
        padding: 0.65rem 0.7rem 0.75rem;
        font-size: 0.9rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .gallery-header {
        align-items: stretch;
    }

    .gallery-add {
        flex: 1 1 100%;
        text-align: center;
    }

    .gallery-score-filter {
        flex: 1 1 100%;
        min-width: 0;
    }

    /* Stack primary form actions full-width */
    .btn-lg {
        width: 100%;
    }

    .why-grid {
        grid-template-columns: 1fr;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .sighting-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Drive mode ─────────────────────────────────────────────────────────── */
.drive-mode {
    max-width: 28rem;
    margin: 0 auto;
    padding-bottom: 1.5rem;
}

.drive-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.drive-header h1 {
    font-size: clamp(1.5rem, 5vw, 1.85rem);
    margin: 0;
    line-height: 1.15;
}

.drive-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--np-accent-2);
}

.drive-link-quiet {
    font-size: 0.85rem;
    white-space: nowrap;
    margin-top: 0.35rem;
}

.drive-lead {
    color: var(--np-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.drive-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.drive-capture {
    display: grid;
    gap: 1rem;
    justify-items: center;
    padding: 1.25rem 0 0.5rem;
}

.drive-shutter {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--np-text-strong);
    width: min(100%, 16rem);
    aspect-ratio: 1;
    max-height: 16rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.drive-shutter-ring {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    border: 3px solid var(--np-border-strong);
    background:
        radial-gradient(circle at 50% 50%, var(--np-accent-strong) 0 38%, transparent 39%),
        var(--np-surface-elevated);
    box-shadow:
        0 0 0 1px var(--np-border-subtle),
        0 12px 40px var(--np-shadow-soft);
    transition: transform var(--np-transition-fast), border-color var(--np-transition-fast);
}

.drive-shutter:hover .drive-shutter-ring,
.drive-shutter:focus-visible .drive-shutter-ring {
    border-color: var(--np-accent);
    transform: scale(1.02);
}

.drive-shutter:active .drive-shutter-ring {
    transform: scale(0.97);
}

.drive-shutter:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.drive-shutter-label {
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--np-text-strong);
    text-shadow: 0 1px 2px var(--np-shadow-soft);
    margin-top: 42%;
}

.drive-btn-block {
    width: 100%;
    min-height: 3rem;
    font-weight: 600;
}

.drive-hint {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--np-text-muted);
    max-width: 28ch;
}

.drive-review {
    display: grid;
    gap: 0.9rem;
}

.drive-photo-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.55rem;
    overflow-x: auto;
    padding: 0.15rem 0.1rem 0.35rem;
    -webkit-overflow-scrolling: touch;
}

.drive-photo-thumb {
    appearance: none;
    flex: 0 0 auto;
    width: 4.25rem;
    height: 4.25rem;
    padding: 0;
    border-radius: var(--np-radius-md);
    border: 2px solid var(--np-border);
    background: var(--np-surface);
    overflow: hidden;
    cursor: pointer;
}

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

.drive-photo-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--np-text-muted);
    font-weight: 600;
}

.drive-photo-thumb.is-selected {
    border-color: var(--np-accent);
    box-shadow: 0 0 0 2px var(--np-accent-soft);
}

.drive-photo-thumb:focus-visible {
    outline: 2px solid var(--np-accent);
    outline-offset: 2px;
}

.drive-photo-add {
    appearance: none;
    flex: 0 0 auto;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: var(--np-radius-md);
    border: 2px dashed var(--np-border-strong);
    background: var(--np-surface);
    color: var(--np-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.drive-photo-add:hover,
.drive-photo-add:focus-visible {
    background: var(--np-fill-hover);
    outline: none;
}

.drive-photo-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.drive-photo-add-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--np-text-muted);
}

.drive-preview {
    border-radius: var(--np-radius-xl);
    border: 1px solid var(--np-border);
    background: var(--np-surface-media);
    overflow: hidden;
    min-height: 12rem;
    display: grid;
    place-items: center;
}

.drive-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(50vh, 22rem);
    object-fit: contain;
    object-position: center;
}

.drive-preview-fallback {
    display: grid;
    gap: 0.25rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--np-text);
}

.drive-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.drive-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: var(--np-radius-pill);
    background: var(--np-fill-soft);
    border: 1px solid var(--np-border-subtle);
    color: var(--np-text-muted);
    font-size: 0.8rem;
    font-weight: 550;
}

.drive-pill-ok {
    color: var(--np-ok);
    border-color: var(--np-ok-border);
    background: var(--np-ok-soft-bg);
}

.drive-pill-warn {
    color: var(--np-accent-2);
    border-color: var(--np-accent-2);
    background: var(--np-warning-soft-bg);
}

.drive-compact-section {
    margin-bottom: 0;
    padding: 0.9rem 1rem;
}

.drive-compact-section .form-label {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.drive-terms {
    padding: 0.35rem 0.15rem;
}

.drive-terms .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
}

.drive-terms .form-check-label {
    font-size: 0.92rem;
    padding-left: 0.25rem;
}

.drive-actions {
    display: grid;
    gap: 0.65rem;
    position: sticky;
    bottom: calc(var(--np-bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 0.5rem);
    z-index: 5;
    padding-top: 0.25rem;
}

@media (min-width: 641px) {
    .drive-actions {
        bottom: 0.75rem;
    }
}

.drive-submit {
    font-size: 1.1rem;
    min-height: 3.35rem;
    box-shadow: 0 8px 24px var(--np-shadow-soft);
}

.drive-success {
    display: grid;
    gap: 0.85rem;
}

.drive-success-actions {
    display: grid;
    gap: 0.55rem;
}

/* Live camera overlay (created by drive.js) */
.np-drive-cam-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--np-bg);
    color: var(--np-text);
}

.np-drive-cam-frame {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 56rem;
    margin: 0 auto;
    background: var(--np-bg);
}

.np-drive-cam-video {
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: cover;
    background: var(--np-bg);
}

.np-drive-cam-guide {
    pointer-events: none;
    position: absolute;
    left: 10%;
    right: 10%;
    top: 28%;
    bottom: 32%;
    border: 2px solid var(--np-border-strong);
    border-radius: var(--np-radius-md);
    box-shadow: 0 0 0 9999px var(--np-overlay-scrim);
}

.np-drive-cam-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--np-surface);
    border-top: 1px solid var(--np-border);
}

.np-drive-cam-btn {
    appearance: none;
    border: 1px solid var(--np-border);
    background: var(--np-surface-input);
    color: var(--np-text);
    border-radius: var(--np-radius-pill);
    padding: 0.65rem 1rem;
    font-size: 1rem;
    min-height: 2.75rem;
    cursor: pointer;
}

.np-drive-cam-btn:hover,
.np-drive-cam-btn:focus-visible {
    background: var(--np-fill-hover);
    outline: none;
}

.np-drive-cam-cancel {
    justify-self: start;
}

.np-drive-cam-flip {
    justify-self: end;
}

.np-drive-cam-shutter {
    appearance: none;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    border: 4px solid var(--np-text-strong);
    background: var(--np-accent);
    box-shadow: 0 0 0 3px var(--np-surface);
    cursor: pointer;
    justify-self: center;
}

.np-drive-cam-shutter:hover,
.np-drive-cam-shutter:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

.np-drive-cam-shutter:active {
    transform: scale(0.96);
}

.np-drive-cam-hint {
    margin: 0;
    padding: 0.5rem 1rem 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--np-text-muted);
    background: var(--np-surface);
}

.drive-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--np-border-subtle);
}

/* Highlight Drive mode in sidebar */
.nav-item .np-nav-drive {
    color: var(--np-text-strong);
}



/* ─── Login ──────────────────────────────────────────────────────────────── */
.login-page h1 {
    margin-bottom: 0.35rem;
}

.login-lead {
    max-width: 42rem;
    margin-bottom: 1.25rem;
}

.login-card {
    max-width: 28rem;
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 1.25rem 1.15rem 1.35rem;
}

.login-section-title {
    font-size: 1.05rem;
    margin: 0 0 0.85rem;
}

.login-provider-form + .login-provider-form {
    margin-top: 0.65rem;
}

.login-provider-btn {
    min-height: 3.25rem;
    font-weight: 650;
}

.login-setup {
    padding: 0.75rem 0.85rem;
    border-radius: var(--np-radius-md);
    background: var(--np-surface-muted);
    border: 1px solid var(--np-border);
    color: var(--np-text);
    font-size: 0.85rem;
    overflow-x: auto;
}

/* ─── Plate grouping ─────────────────────────────────────────────────────── */
.plate-repeat-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.12rem 0.5rem;
    border-radius: var(--np-radius-pill);
    background: var(--np-warning-soft-bg);
    border: 1px solid var(--np-accent-2);
    color: var(--np-accent-2);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.plate-group-panel {
    margin-top: 1rem;
}

.plate-group-title {
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
}

.plate-group-plate code {
    font-size: 1rem;
    letter-spacing: 0.06em;
}

.plate-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.plate-group-item {
    margin: 0;
}

.plate-group-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem;
    border-radius: var(--np-radius-md);
    border: 1px solid var(--np-border-subtle);
    background: var(--np-fill-subtle);
    text-decoration: none;
    color: inherit;
    transition: background-color var(--np-transition-fast), border-color var(--np-transition-fast);
}

.plate-group-link:hover {
    background: var(--np-fill-hover);
    border-color: var(--np-border-hover);
    color: inherit;
    text-decoration: none;
}

.plate-group-thumb {
    width: 3.25rem;
    height: 2.25rem;
    object-fit: contain;
    object-position: center;
    border-radius: var(--np-radius-sm);
    background: var(--np-surface-media);
    border: 1px solid var(--np-border-subtle);
    flex-shrink: 0;
}

.plate-group-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--np-text-muted);
    font-size: 0.8rem;
}

.plate-group-meta {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
    font-size: 0.9rem;
}

.plate-group-meta-main {
    font-weight: 600;
    color: var(--np-text-strong);
}

.mod-row-repeat {
    box-shadow: inset 3px 0 0 var(--np-accent-2);
}

.np-token-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-md);
    background: var(--np-surface-muted);
}

.np-token-box code {
    flex: 1 1 12rem;
    min-width: 0;
    word-break: break-all;
    color: var(--np-text);
}

.np-connect-steps {
    margin: 0 0 0.85rem;
    padding-left: 1.2rem;
}

.np-connect-steps li {
    margin: 0.35rem 0;
}

.oauth-consent .login-card {
    margin-top: 0.5rem;
}

/* ─── Rapid add, queue count, stacked mobile records ─────────────────────── */
.queue-remaining {
    margin: 0.35rem 0 0;
    color: var(--np-text-muted);
    font-weight: 650;
}

.rapid-page {
    max-width: 36rem;
}

.rapid-confirmation a {
    margin-left: 0.35rem;
}

.rapid-actions {
    display: grid;
    gap: 0.75rem;
}

.rapid-submit,
.mod-plate-save,
.mod-actions .btn {
    min-height: 3rem;
}

.rapid-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.rapid-preview-slot {
    margin-top: 1rem;
}

.rapid-preview-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 9.5rem;
    padding: 1rem;
    border: 1px dashed var(--np-border);
    border-radius: var(--np-radius-xl);
    background: var(--np-fill-subtle);
    color: var(--np-text);
    font-weight: 650;
    text-align: center;
}

.rapid-preview-error {
    margin-bottom: 0;
}

.rapid-spinner {
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 auto;
    border: 3px solid var(--np-border);
    border-top-color: var(--np-accent);
    border-radius: 50%;
    animation: rapid-spin 0.7s linear infinite;
}

.rapid-submit .rapid-spinner {
    width: 1.15rem;
    height: 1.15rem;
    border-width: 2px;
    border-color: var(--np-text-on-accent);
    border-top-color: var(--np-accent-2);
}

@keyframes rapid-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rapid-spinner {
        animation: none;
    }
}

.mod-plate-edit {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-lg);
    background: var(--np-surface);
}

.mod-plate-edit .form-control {
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    min-height: 3rem;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.np-stack-cards {
    display: none;
}

.np-stack-card {
    background: var(--np-surface);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-xl);
    padding: 0.9rem;
    display: grid;
    gap: 0.65rem;
    min-width: 0;
}

.np-stack-card dl {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    gap: 0.35rem 0.65rem;
    margin: 0;
}

.np-stack-card dt {
    margin: 0;
    color: var(--np-text-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.np-stack-card dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.np-stack-thumb {
    width: 100%;
    max-height: 9rem;
    object-fit: contain;
    object-position: center;
    border-radius: var(--np-radius-md);
    background: var(--np-surface-media);
    border: 1px solid var(--np-border);
}

.np-stack-actions {
    display: grid;
    gap: 0.5rem;
}

.np-stack-actions .btn {
    width: 100%;
    min-height: 3rem;
}

@media (max-width: 640.98px) {
    .np-stack-table {
        display: none !important;
    }

    .np-stack-cards {
        display: grid;
        gap: 0.75rem;
    }

    .page-header .page-actions {
        width: 100%;
    }

    .page-header .page-actions .btn {
        flex: 1 1 8rem;
        min-height: 3rem;
    }

    .mod-actions {
        flex-direction: column;
    }

    .mod-actions .btn,
    .mod-plate-save,
    .rapid-submit {
        width: 100%;
        min-height: 3rem;
    }

    .media-tile-actions .btn {
        min-height: 2.75rem;
    }
}
