:root {
    --bg: #f4f7f3;
    --ink: #1c1c1c;
    --muted: #5e675f;
    --sage: #8fb59a;
    --sage-dark: #6d9a7b;
    --card: #ffffff;
    --line: #e4eee6;
    --open: #7eae8c;
    --progress: #8d8478;
    --closed: #3a3a3a;
    --urgent: #d4534a;
    --shadow: 0 10px 30px rgba(40, 60, 45, 0.06);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

button, input, textarea, select { font: inherit; color: inherit; }

a { color: var(--sage-dark); }

.app {
    width: min(100%, 1080px);
    margin: 0 auto;
    min-height: 100vh;
    padding: 1.25rem 1.15rem 6.5rem;
}

.eyebrow {
    margin: 0.4rem 0 1.4rem;
    text-align: center;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: #8b938c;
}

.logo-wrap { display: flex; justify-content: center; margin: 0.5rem 0 1.6rem; }

.logo-wrap img { width: 220px; height: auto; }

.screen-title {
    margin: 0.2rem 0 0.6rem;
    font-size: 2.4rem;
    letter-spacing: -0.04em;
    font-weight: 650;
    line-height: 1.05;
}

.lede { margin: 0 0 1.4rem; font-size: 1.15rem; line-height: 1.45; }

.topbar {
    display: grid;
    grid-template-columns: 2.5rem 1fr 2.5rem;
    align-items: center;
    margin: -0.2rem 0 1rem;
}

.topbar h1 { margin: 0; text-align: center; font-size: 1.05rem; font-weight: 650; }

.icon-button {
    width: 2.4rem;
    height: 2.4rem;
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
}

.field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: white;
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow);
}

.field input {
    border: 0;
    outline: none;
    width: 100%;
    font-size: 1.15rem;
    background: transparent;
}

.prefix { color: #222; font-size: 1.15rem; }

.btn {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: var(--sage);
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 0.95rem 1.2rem;
    font-size: 1.15rem;
    font-weight: 650;
    cursor: pointer;
}

.btn:disabled { opacity: 0.6; }

.btn.secondary {
    background: white;
    color: var(--sage-dark);
    border: 1.5px solid #b7d2c0;
}

.btn.ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: none;
}

.stack { display: grid; gap: 0.9rem; }

.quiet { color: var(--muted); text-align: center; font-size: 0.95rem; }

.error { color: var(--urgent); margin: 0.4rem 0 0; font-size: 0.92rem; }

.place h2 { margin: 0.2rem 0 0; font-size: 2rem; letter-spacing: -0.03em; }

.place p { margin: 0.25rem 0 1rem; color: var(--muted); font-size: 1.15rem; }

.card {
    background: var(--card);
    border-radius: 1.15rem;
    box-shadow: var(--shadow);
    padding: 0.3rem 1rem;
}

.check-row, .sop-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.95rem 0.15rem;
    cursor: pointer;
}

.check-row {
    position: relative;
    min-height: 3.25rem;
    margin: 0.2rem 0;
    padding: 0.85rem 0.7rem;
    border: 2px solid transparent;
    border-radius: 0.85rem;
    border-bottom: 2px solid transparent;
}

.check-row:last-child, .sop-row:last-child { border-bottom: 0; }

.check-row:last-child { border-bottom: 2px solid transparent; }

.issue-check {
    position: absolute;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    opacity: 0;
}

.issue-box {
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 0.4rem;
    border: 2px solid #8aa394;
    background: #fff;
    display: grid;
    place-items: center;
    flex: none;
}

.issue-box::after {
    content: "";
    width: 0.32rem;
    height: 0.58rem;
    border: solid transparent;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.issue-check:checked + .issue-box {
    background: #1f6b4a;
    border-color: #1f6b4a;
}

.issue-check:checked + .issue-box::after {
    border-color: #fff;
}

.check-row:has(.issue-check:checked) {
    background: #e4f3e8;
    border-color: #1f6b4a;
    box-shadow: inset 4px 0 0 #1f6b4a;
}

.issue-check:focus-visible + .issue-box,
.check-row:has(.issue-check:focus-visible) {
    outline: 3px solid #1a4d32;
    outline-offset: 3px;
}

.issue-name { font-size: 1.05rem; line-height: 1.3; }

.photo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.photo-row figure {
    position: relative;
    width: 5.6rem;
    height: 5.6rem;
    margin: 0;
}

.photo-row img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.8rem;
    border: 2px solid #c5dccb;
    background: white;
}

.photo-row button {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    width: 1.4rem;
    height: 1.4rem;
    border: 0;
    border-radius: 50%;
    background: #1c1c1c;
    color: white;
    cursor: pointer;
    line-height: 1;
}

.box {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.35rem;
    border: 1.5px solid #b7c9bb;
    display: grid;
    place-items: center;
    color: var(--sage-dark);
    flex: none;
}

.box.on { background: #eef6f0; border-color: var(--sage); }

.thanks-note, .shield {
    display: flex;
    gap: 0.7rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 1rem 0;
}

.panes { display: grid; gap: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.8rem; }

.pill {
    border-radius: 999px;
    background: #e7f2ea;
    color: #2f5a3e;
    padding: 0.35rem 0.7rem;
    font-size: 0.92rem;
}

.drop {
    border: 1.5px dashed #c5d8cb;
    background: #f7fbf8;
    border-radius: 1rem;
    min-height: 180px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--ink);
    padding: 1rem;
    cursor: pointer;
}

.drop input { display: none; }

label.line { display: block; margin: 0.9rem 0 0.35rem; font-weight: 600; }

.input, textarea.input {
    width: 100%;
    border: 0;
    background: white;
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    font-size: 1.2rem;
    font-weight: 650;
}

.switch { position: relative; width: 3.1rem; height: 1.8rem; }

.switch input { opacity: 0; width: 0; height: 0; }

.switch span {
    position: absolute;
    inset: 0;
    background: #d5ddd6;
    border-radius: 999px;
    cursor: pointer;
}

.switch span:before {
    content: "";
    position: absolute;
    width: 1.4rem;
    height: 1.4rem;
    left: 0.2rem;
    top: 0.2rem;
    background: white;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.switch input:checked + span { background: var(--sage); }

.switch input:checked + span:before { transform: translateX(1.25rem); }

.center { text-align: center; }

.mark {
    width: 7.5rem;
    height: 7.5rem;
    margin: 1.5rem auto 1rem;
    border-radius: 50%;
    background: var(--sage);
    color: white;
    display: grid;
    place-items: center;
    font-size: 3.4rem;
}

.ref { font-size: 2.1rem; letter-spacing: -0.04em; margin: 0.2rem 0 1rem; }

.card-link { color: inherit; text-decoration: none; display: block; }

.place-name { margin: 0.2rem 0; font-size: 1.8rem; letter-spacing: -0.03em; }

.shot-grid { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 0.4rem 0 1rem; }

.shot { margin: 0; width: 6.4rem; }

.shot-open {
    display: block;
    width: 6.4rem;
    height: 6.4rem;
    padding: 0;
    border: 2px solid #c5dccb;
    border-radius: 0.8rem;
    background: white;
    cursor: pointer;
    overflow: hidden;
}

.shot-open img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot a { display: inline-block; margin-top: 0.25rem; font-size: 0.85rem; }

.timeline { list-style: none; margin: 0 0 1rem; padding: 0; }

.timeline li {
    margin: 0 0 0.2rem 0.35rem;
    padding: 0 0 0.85rem 0.85rem;
    border-left: 3px solid var(--sage);
}

#shot-viewer {
    width: min(100vw, 100%);
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: #1c1c1c;
}

#shot-viewer::backdrop { background: rgba(20, 24, 20, 0.92); }

.shot-bar { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.8rem; }

.shot-bar button {
    background: transparent;
    color: white;
    border: 0;
    font-size: 1rem;
    cursor: pointer;
}

#shot-image { width: 100%; height: calc(100vh - 3.4rem); object-fit: contain; background: #1c1c1c; }

.report-card, .run-card {
    background: white;
    border-radius: 1.15rem;
    box-shadow: var(--shadow);
    padding: 1rem 1.05rem 1.05rem;
    margin-bottom: 0.8rem;
}

.report-card header, .run-card header {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: flex-start;
}

.ref-small { margin: 0; color: #8b938c; font-size: 0.92rem; }

.report-card h3, .run-card h3 { margin: 0.15rem 0; font-size: 1.35rem; }

.report-card p, .run-card p { margin: 0; color: #444; }

.chip-row { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

.chip {
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.chip-open { background: var(--open); }

.chip-progress { background: var(--progress); }

.chip-closed { background: transparent; color: var(--closed); border: 1.5px solid var(--closed); }

.chip-urgent { background: var(--urgent); }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.8rem 0 1rem; }

.filters button, .select {
    border-radius: 999px;
    border: 1.5px solid #d5e0d7;
    background: white;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}

.filters button.on { background: var(--sage); color: white; border-color: var(--sage); }

.note {
    width: 100%;
    margin-top: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    padding: 0.6rem 0.7rem;
}

.actions { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.7rem; }

.actions button {
    border: 0;
    background: var(--sage);
    color: white;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
}

.code-row { display: flex; gap: 0.45rem; justify-content: space-between; margin: 1.2rem 0; }

.code-row input {
    width: 100%;
    aspect-ratio: 0.8;
    text-align: center;
    font-size: 1.4rem;
    border-radius: 0.8rem;
    border: 1.5px solid #d7e3da;
    background: white;
}

.split-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.remember { display: flex; gap: 0.6rem; align-items: center; margin: 1.2rem 0 2rem; }

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0.45rem 0.4rem 0.7rem;
}

.tabbar a {
    text-align: center;
    text-decoration: none;
    color: #667069;
    font-size: 0.75rem;
}

.tabbar a strong { display: block; font-size: 1.15rem; font-weight: 500; }

.tabbar a.on { color: var(--sage-dark); }

.scan-launch { margin: 0 0 1.2rem; }

#qr-reader {
    overflow: hidden;
    border-radius: 1.15rem;
    background: white;
    min-height: 240px;
    box-shadow: var(--shadow);
}

.scan-message {
    margin: 1rem 0;
    line-height: 1.45;
}

.preview {
    background: #eef6f0;
    border-radius: 0.8rem;
    padding: 0.7rem 0.8rem;
    color: #245c38;
    font-size: 0.92rem;
}

@media (min-width: 640px) {
    .app { padding-top: 2rem; }

    .panes { grid-template-columns: 1fr 1fr; align-items: start; gap: 1.4rem; }

    .desk { grid-template-columns: 220px 1fr; }

    .mobile-only { display: none; }
}

@media (max-width: 639px) {
    .pane-issues.is-hidden, .pane-details.is-hidden { display: none; }
}
