:root {
    color-scheme: light;
    --bg: #f1f5f9;
    --panel: #fff;
    --text: #0f172a;
    --muted: #475569;
    --line: #94a3b8;
    --primary: #155e75;
    --primary2: #164e63;
    --ok: #166534;
    --bluebg: #eff6ff;
    --errbg: #fef2f2;
    --errline: #fecaca;
    --errtext: #991b1b;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
    color: var(--text);
}

button,
a {
    cursor: pointer;
}

.env-banner {
    border-bottom: 1px solid #93c5fd;
    background: var(--bluebg);
    padding: 8px 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #172554;
}

header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid #cbd5e1;
    background: #fff;
    box-shadow: 0 1px 5px #0001;
}

.head {
    max-width: 1120px;
    margin: auto;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.head-brand {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.head-brand:hover {
    color: inherit;
    text-decoration-color: var(--primary);
}

.head-brand:focus-visible {
    color: inherit;
    text-decoration: none;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.eyebrow {
    font-size: 10px;
    font-weight: 700;
    color: #164e63;
    letter-spacing: 0.02em;
}

.title {
    font-size: 18px;
    font-weight: 850;
}

.hamb {
    width: 48px;
    height: 48px;
    border: 1px solid #64748b;
    border-radius: 12px;
    background: #fff;
    display: grid;
    place-items: center;
}

.hamb i,
.hamb i::before,
.hamb i::after {
    display: block;
    width: 24px;
    height: 2px;
    background: #0f172a;
    content: "";
    position: relative;
}

.hamb i::before {
    position: absolute;
    top: -7px;
}

.hamb i::after {
    position: absolute;
    top: 7px;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: #0f172a55;
    border: 0;
    padding: 0;
}

.overlay.open {
    display: block;
}

.menu {
    display: none;
    position: fixed;
    right: 12px;
    top: var(--menu-top, 88px);
    z-index: 50;
    width: min(90vw, 320px);
    max-height: calc(100vh - var(--menu-top, 88px) - 12px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - var(--menu-top, 88px) - 12px - env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #fff;
    padding: 0;
    box-shadow: 0 15px 35px #0003;
}

.menu.open {
    display: flex;
    flex-direction: column;
}

.menu-head {
    flex-shrink: 0;
    padding: 12px 12px 8px;
    border-bottom: 1px solid #e2e8f0;
}

.menu-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 4px 12px 8px;
}

.menu-foot {
    flex-shrink: 0;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.menu-foot.menu-logout {
    margin-top: 0;
    padding-top: 8px;
}

.menu-foot.menu-logout button {
    min-height: 48px;
}

.menu-user,
.menu-project {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
}

.menu-project {
    font-weight: 700;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.menu-current {
    padding: 6px 12px 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
}

.menu-item {
    display: block;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    padding: 0 14px;
    text-align: left;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    line-height: 48px;
}

.menu-item:hover {
    background: #f8fafc;
}

.menu-item.active {
    background: var(--primary);
    color: #fff;
}

.menu-item.active:hover {
    background: var(--primary2);
}

.menu-section-label {
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.04em;
}

.menu-item-accent {
    border: 1px solid #99f6e4;
    background: #f0fdfa;
}

.menu-item-accent.active {
    border-color: var(--primary);
}

.admin-shortcuts {
    margin-top: 14px;
}

.actions-inline {
    gap: 10px;
    margin-top: 12px;
}

.actions-inline .primary,
.actions-inline .secondary {
    text-decoration: none;
}

.menu-logout {
    margin-top: 8px;
    border-top: 0;
    padding-top: 0;
}

.menu-logout form {
    margin: 0;
}

.menu-logout button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    padding: 0 14px;
    text-align: left;
    font-weight: 800;
    color: var(--text);
}

.menu-logout button:hover {
    background: #f8fafc;
}

.main {
    max-width: 1120px;
    margin: auto;
    padding: 18px 12px 36px;
}

.panel {
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 2px 7px #0000000c;
}

.stack > * + * {
    margin-top: 14px;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.between {
    justify-content: space-between;
}

.wrap {
    flex-wrap: wrap;
}

h2 {
    margin: 0;
    font-size: 25px;
}

h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.primary,
.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 12px;
    padding: 0 18px;
    font-weight: 850;
    text-decoration: none;
}

.primary {
    border: 0;
    background: var(--primary);
    color: #fff;
}

.primary:hover {
    background: var(--primary2);
    color: #fff;
}

.primary:disabled {
    background: #cbd5e1;
    color: #475569;
}

.secondary {
    border: 1px solid #64748b;
    background: #fff;
    color: var(--text);
}

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

.stat-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--muted);
}

.stat-num {
    margin-top: 6px;
    font-size: 24px;
    font-weight: 800;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr;
    gap: 8px 16px;
    margin: 0;
}

.detail-grid dt {
    margin: 0;
    font-weight: 700;
    color: var(--muted);
}

.detail-grid dd {
    margin: 0;
}

.records {
    display: grid;
    gap: 10px;
}

.record {
    width: 100%;
    min-height: 88px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 14px;
    text-align: left;
}

.record strong {
    display: block;
}

.record h3 a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 4px 0;
    text-decoration: none;
}

.record h3 a:hover {
    text-decoration: underline;
}

.record small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 700;
}

.target-record {
    display: grid;
    gap: 12px;
}

.record-actions {
    gap: 8px;
}

.record-actions .primary,
.record-actions .secondary {
    flex: 0 1 auto;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 850;
}

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

.grid2 {
    display: grid;
    gap: 14px;
}

@media (min-width: 720px) {
    .grid2 {
        grid-template-columns: 1fr 1fr;
    }
}

.input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #64748b;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
}

.field {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.hint {
    border-radius: 11px;
    background: #f1f5f9;
    padding: 11px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.location-source-note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 14px;
    font-weight: 700;
}

.location-source-note strong {
    color: var(--primary);
}

.coords-picker.stack {
    gap: 10px;
}

.coords-status-error {
    background: var(--errbg);
    color: var(--errtext);
    border: 1px solid var(--errline);
}

.flash-region {
    position: sticky;
    top: 0;
    z-index: 25;
    margin: 0 0 12px;
}

.flash {
    border-radius: 11px;
    padding: 11px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    transition: opacity 0.45s ease;
}

.flash:last-child {
    margin-bottom: 0;
}

.flash.is-dismissing {
    opacity: 0;
}

.page-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 0 0 14px;
}

.page-nav-back {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.breadcrumbs-item:not(:last-child)::after {
    content: "/";
    margin-left: 6px;
    color: #94a3b8;
    font-weight: 600;
}

.breadcrumbs-item a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumbs-item a:hover {
    text-decoration: underline;
}

.breadcrumbs-item.is-current span {
    color: var(--text);
    font-weight: 800;
}

.flash-error {
    border: 1px solid var(--errline);
    background: var(--errbg);
    color: var(--errtext);
}

.flash-success {
    border: 1px solid #22c55e;
    background: #f0fdf4;
    color: #14532d;
}

.saved {
    border: 1px solid #22c55e;
    border-radius: 11px;
    background: #f0fdf4;
    padding: 11px;
    color: #14532d;
    font-weight: 850;
}

.auth-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 12px 48px;
}

.auth-wrap .panel h1 {
    margin: 0 0 20px;
    font-size: 22px;
}

.auth-wrap label {
    display: grid;
    gap: 6px;
    font-weight: 800;
    margin-bottom: 14px;
}

.auth-wrap .primary {
    width: 100%;
    margin-top: 8px;
}

.auth-secondary-action {
    margin-top: 16px;
    text-align: center;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    min-width: 48px;
    border: none;
    background: none;
    padding: 8px 16px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: underline;
}

.issued-credentials code {
    font-weight: 800;
    font-size: 15px;
}

.admin-flow {
    margin: 0 0 12px;
    padding-left: 1.25rem;
    font-weight: 700;
}

.admin-flow a {
    color: var(--primary);
}

.panel-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    background: #f8fafc;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table td a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 8px 10px;
    font-weight: 800;
    text-decoration: none;
}

@media (min-width: 720px) {
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .main {
        padding-top: 24px;
    }
}

.wizard-step-task {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    background: #f8fafc;
    font-size: 14px;
    line-height: 1.55;
}

.wizard-step-task strong {
    font-weight: 850;
}

.weather-manual-section {
    margin-top: 4px;
}

.weather-manual-section.is-highlighted {
    margin-top: 12px;
    padding: 12px;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    background: #fffbeb;
    animation: weather-manual-pulse 1.4s ease 2;
}

@keyframes weather-manual-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgb(245 158 11 / 35%);
    }

    50% {
        box-shadow: 0 0 0 10px rgb(245 158 11 / 0%);
    }
}

.wizard-progress {
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid #99f6e4;
    border-radius: 12px;
    background: #f0fdfa;
    font-size: 14px;
    font-weight: 700;
    color: #0f766e;
}

.wizard-progress-num {
    font-size: 16px;
    font-weight: 850;
    color: var(--primary);
}

.wizard-callout {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.wizard-callout-warn {
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

.wizard-steps {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: none;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.wizard-steps li {
    flex: 0 0 auto;
    min-width: 88px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 8px 10px;
    font-size: 12px;
    color: var(--muted);
}

.wizard-steps li.active {
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.wizard-steps li.done {
    color: var(--ok);
}

.wizard-step-num {
    display: inline-block;
    min-width: 1.4em;
    font-weight: 800;
}

.wizard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.wizard-panel {
    position: relative;
}

@media (max-width: 719px) {
    .wizard-panel {
        padding-bottom: 4px;
    }

    .wizard-panel .wizard-actions-nav {
        position: sticky;
        bottom: 0;
        z-index: 12;
        margin: 16px -16px 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #cbd5e1;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -4px 16px #00000012;
        backdrop-filter: blur(6px);
    }

    .wizard-panel .wizard-actions-nav .primary,
    .wizard-panel .wizard-actions-nav .secondary {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }
}

.getting-started {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
}

.getting-started ol {
    margin: 8px 0 0;
    padding-left: 1.25rem;
    font-weight: 700;
    line-height: 1.6;
}

.empty-state {
    border: 2px solid var(--primary);
    background: linear-gradient(180deg, #ecfeff 0%, #fff 45%);
    text-align: center;
    padding: 28px 20px;
    gap: 14px;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    min-width: min(100%, 280px);
    padding: 0 24px;
    font-size: 16px;
    font-weight: 850;
    text-decoration: none;
}

.wizard-completion-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.wizard-completion-actions .wizard-completion-btn {
    flex: 1 1 200px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}

.record-meta-primary {
    display: block;
}

.record-meta-secondary {
    display: none;
}

.record-meta-mobile-hint {
    display: inline;
    color: var(--muted);
}

.record-meta-detail {
    margin-top: 8px;
    width: 100%;
}

@media (min-width: 720px) {
    .wizard-steps {
        display: flex;
    }

    .record-meta-primary {
        display: inline;
    }

    .record-meta-secondary {
        display: inline;
    }

    .record-meta-mobile-hint {
        display: none;
    }

    .record-meta-detail {
        margin-top: 0;
        width: auto;
        text-align: right;
    }
}

.upload-result-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.upload-result-list .file {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 700;
    word-break: break-all;
}

.upload-result-list .file-failed {
    color: var(--errtext);
}

.upload-result-list .file-warn {
    color: #b45309;
}

.upload-result-list .file-ok {
    color: var(--ok);
}

.upload-queue {
    margin-top: 12px;
}

.file-drop .upload-queue.is-active {
    margin-bottom: 0;
}

.file-drop .upload-queue.is-active + .file-drop-pending-list {
    margin-top: 12px;
}

.upload-queue.is-active {
    margin-bottom: 8px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.upload-queue-heading {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 800;
}

.upload-queue[hidden] {
    display: none;
}

.wizard-panel form.has-upload-queue-active {
    scroll-margin-bottom: 120px;
}

@media (max-width: 719px) {
    .wizard-panel form.has-upload-queue-active .upload-queue.is-active {
        margin-bottom: 0;
    }
}

.upload-queue-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upload-queue-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 700;
    word-break: break-all;
}

.upload-queue-item-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}

.upload-queue-item-status {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
}

.upload-queue-item.is-waiting .upload-queue-item-status {
    color: var(--muted);
}

.upload-queue-item.is-uploading .upload-queue-item-status {
    color: var(--accent);
}

.upload-queue-item.is-done .upload-queue-item-status {
    color: var(--ok);
}

.upload-queue-item.is-warn .upload-queue-item-status {
    color: #b45309;
}

.upload-queue-item.is-failed .upload-queue-item-status,
.upload-queue-item.is-network_error .upload-queue-item-status {
    color: var(--errtext);
}

.upload-queue-progress {
    margin-top: 8px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.upload-queue-progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.15s ease;
}

.upload-queue-progress-bar.is-indeterminate {
    width: 35%;
    animation: upload-queue-indeterminate 1.1s ease-in-out infinite alternate;
}

@keyframes upload-queue-indeterminate {
    from {
        margin-left: 0;
        width: 20%;
    }

    to {
        margin-left: 65%;
        width: 35%;
    }
}

.upload-queue-item-message {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--errtext);
}

.upload-queue-actions {
    margin-top: 12px;
}

.upload-queue-retry {
    min-height: 48px;
    width: 100%;
}

.upload-queue-summary {
    margin: 0 0 8px;
    font-weight: 700;
}

.network-status-banner {
    margin: 0 0 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--errtext);
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.network-status-banner[hidden] {
    display: none;
}

.network-form-alert {
    margin: 0 0 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--errtext);
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.network-form-alert[hidden] {
    display: none;
}

.coords-status-error {
    color: var(--errtext);
    border-color: var(--errline);
    background: var(--errbg);
}

button.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.wizard-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin: 12px 0;
}

.filepick {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
}

.file-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.file-list .file {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.file-drop-label {
    font-weight: 800;
}

.file-drop-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.file-drop-action-btn {
    flex: 1 1 calc(50% - 6px);
    min-height: 48px;
    min-width: 0;
}

.file-drop-zone {
    position: relative;
    display: block;
    min-height: 112px;
    margin-top: 6px;
    padding: 18px 14px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop-zone:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.file-drop-zone.is-dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.file-drop-lead {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.file-drop-hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: #64748b;
}

.file-drop-selected {
    margin: 10px 0 0;
    font-size: 13px;
    word-break: break-all;
}

.file-drop-pending-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    gap: 8px;
}

.file-drop-pending-list[hidden] {
    display: none;
}

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

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

.weather {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.weather > div,
.coord {
    border-radius: 11px;
    background: var(--bg);
    padding: 12px;
}

.weather small,
.coord small {
    font-weight: 800;
    color: var(--muted);
}

.weather strong,
.coord strong {
    display: block;
    margin-top: 2px;
}

.photos {
    display: grid;
    gap: 12px;
}

.photo {
    min-width: 0;
}

@media (min-width: 720px) {
    .photos {
        grid-template-columns: 1fr 1fr;
    }
}

.photo-img {
    width: 100%;
    height: 132px;
    border-radius: 9px;
    background: var(--bg);
    display: block;
    object-fit: cover;
    object-position: center;
}

.photo-img:not(img) {
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--muted);
}

.photo-meta {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin-top: 12px;
}

.photo-filename,
.csv-filename {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.photo-meta-row {
    display: grid;
    grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
    gap: 8px;
    line-height: 1.5;
}

.photo-meta-label {
    font-weight: 800;
    color: var(--muted);
}

.photo-coordinate {
    overflow-wrap: anywhere;
}

.photo-actions {
    margin: 12px 0 0;
}

.photo-download-link,
.csv-file-action {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    padding: 8px 12px;
    font-weight: 800;
    text-decoration: none;
}

.csv-file-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.csv-file-item {
    display: grid;
    gap: 10px;
    min-width: 0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
}

.csv-file-actions {
    display: grid;
    gap: 8px;
}

.csv-file-action {
    width: 100%;
}

@media (min-width: 720px) {
    .csv-file-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .csv-file-action {
        width: auto;
    }
}

.csv-card small {
    display: block;
    margin-top: 4px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-weight: 800;
    padding: 8px 12px;
    text-decoration: none;
}

.chart-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}

.chart-svg {
    min-width: 620px;
    width: 100%;
}

.saved {
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: var(--ok);
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-page {
    max-width: 560px;
    margin: 24px auto 0;
    text-align: center;
}

.error-page-code {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.error-page-title {
    margin: 8px 0 0;
    font-size: 1.35rem;
}

.error-page-message {
    margin: 12px 0 0;
}

.error-page-actions {
    justify-content: center;
    margin-top: 18px;
}

.issued-credentials-grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.issued-credentials-row {
    display: grid;
    grid-template-columns: minmax(88px, auto) 1fr auto;
    gap: 8px;
    align-items: center;
}

.issued-credentials-label {
    font-weight: 700;
    font-size: 13px;
}

.issued-copy-btn {
    min-height: 48px;
    padding: 0 14px;
    font-size: 13px;
}

.photo-thumb {
    width: 72px;
    height: 72px;
    border-radius: 9px;
    object-fit: cover;
    object-position: center;
    background: var(--bg);
    flex-shrink: 0;
}

.photo-thumb-placeholder {
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--muted);
    font-size: 12px;
}

.rep-photo-option,
.photo-link-option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 4px;
    cursor: pointer;
}

.rep-photo-option input,
.photo-link-option input {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
}

.rep-photo-meta,
.photo-link-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.rep-photo-meta strong,
.photo-link-meta strong {
    word-break: break-all;
}

.photo-link-options {
    border: 0;
    padding: 0;
    margin: 8px 0 0;
}

.photo-link-option {
    border-top: 1px solid #e2e8f0;
}

.photo-link-option:first-of-type {
    border-top: 0;
}

.photo-link-none {
    font-weight: 700;
}

@media (max-width: 719px) {
    .main .panel > p.hint > a,
    .admin-flow a {
        display: inline-flex;
        align-items: center;
        min-height: 48px;
        padding: 8px 0;
    }
}

.map-preview-section {
    gap: 8px;
}

.map-preview-heading {
    font-size: 14px;
}

.map-preview-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    min-height: 220px;
}

.map-preview-placeholder {
    margin: 0;
    padding: 24px 16px;
    text-align: center;
}

.photo-upload-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.photo-upload-item {
    padding: 8px 0;
    border-top: 1px solid #e2e8f0;
}

.photo-upload-item:first-child {
    border-top: 0;
}

.map-preview-frame {
    display: block;
    width: 100%;
    min-height: 220px;
    border: 0;
}

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

.password-requirements {
    margin: 0 0 14px;
    background: var(--bluebg);
    border: 1px solid #93c5fd;
}

.password-requirements-list {
    margin: 8px 0 0;
    padding-left: 1.2em;
}

.password-requirements-list li {
    margin-bottom: 4px;
}

.password-requirements-list li:last-child {
    margin-bottom: 0;
}

/* UI-07: field mobile readability — body text ≥14px, stronger borders/contrast outdoors */
@media (max-width: 719px) {
    :root {
        --muted: #334155;
        --line: #64748b;
    }

    .env-banner {
        font-size: 14px;
    }

    .menu-user,
    .menu-project,
    .menu-current {
        font-size: 14px;
        color: #334155;
    }

    .menu-current {
        color: var(--primary);
    }

    .menu-section-label {
        font-size: 14px;
        color: #334155;
    }

    .breadcrumbs {
        font-size: 14px;
    }

    .data-table th {
        font-size: 14px;
    }

    .wizard-steps li {
        font-size: 14px;
    }

    .file-drop-hint,
    .file-drop-selected {
        font-size: 14px;
        color: #334155;
    }

    .upload-queue-item-status,
    .upload-queue-item-message,
    .upload-queue-summary {
        font-size: 14px;
    }

    .upload-queue-item-status {
        padding: 2px 8px;
        border: 1px solid currentColor;
        border-radius: 6px;
    }

    .photo-thumb-placeholder,
    .record-meta-mobile-hint {
        font-size: 14px;
        color: #334155;
    }

    .photo-meta-label {
        color: #334155;
    }

    .panel {
        border-color: #64748b;
    }

    .file-drop-zone {
        border-color: #64748b;
        background: #fff;
    }

    .upload-queue.is-active {
        border-color: #64748b;
        background: #fff;
    }

    .menu {
        left: 8px;
        right: 8px;
        width: auto;
        max-height: none;
        height: calc(100dvh - var(--menu-top, 88px) - 8px);
    }

    .menu-head {
        padding: 10px 12px 8px;
    }

    .menu-scroll {
        padding: 2px 12px 6px;
    }

    .menu-item {
        min-height: 44px;
        line-height: 44px;
    }

    .menu-section-label {
        padding-top: 8px;
        padding-bottom: 2px;
    }

    .upload-result-list .file {
        border-bottom-color: #94a3b8;
    }
}

body.has-menu-open {
    overflow: hidden;
    overscroll-behavior: none;
}
