/* Field app layout, touch controls, offline states, and report/consent editors. */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7f2;
    color: #123d43;
    font: 16px system-ui,sans-serif;
}

header {
    background: #073d50;
    color: white;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    font-weight: 700;
}

header img {
    width: 65px;
    background: white;
    border-radius: 8px;
    padding: 5px;
}

small {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
}

main {
    max-width: 650px;
    margin: auto;
    padding: 20px 16px 100px;
}

h1 {
    font-size: 28px;
    margin: 8px 0;
}

h2 {
    font-size: 19px;
}

p {
    line-height: 1.5;
}

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

button {
    border: 0;
    border-radius: 8px;
    padding: 13px;
    background: #185d46;
    color: white;
    font-weight: 650;
    cursor: pointer;
    min-height: 44px;
}

button.secondary {
    background: #e7efe4;
    color: #185d46;
}

button:disabled {
    opacity: .5;
}

label {
    display: block;
    font-weight: 650;
    margin: 14px 0 5px;
}

input,select,textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #a7b9b4;
    border-radius: 7px;
    background: white;
    color: #123d43;
}

input[type=checkbox] {
    width: auto;
}

article,fieldset {
    background: white;
    border: 1px solid #d4e0d6;
    border-radius: 10px;
    padding: 15px;
    margin: 12px 0;
}

fieldset {
    min-width: 0;
}

legend {
    font-weight: 700;
}

/* Fixed touch navigation; respect the device safe area */
nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #073d50;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    justify-content: center;
}

nav button {
    background: transparent;
    flex: 1;
    max-width: 160px;
    font-size: 22px;
    padding: 6px;
}

nav span {
    display: block;
    font-size: 12px;
}

nav button.active {
    background: #47772e;
}

[hidden] {
    display: none!important;
}

#connection {
    padding: 10px;
    text-align: center;
    background: #e0efda;
    font-size: 14px;
    font-weight: 650;
}

#connection.offline {
    background: #ffe0a0;
    color: #573a00;
}

.wide {
    width: 100%;
    margin-top: 12px;
}

.gold {
    background: #ffba31;
    color: #173e3d;
}

.muted {
    color: #536660;
    font-size: 14px;
}

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

.photo img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.error {
    color: #a12626;
}

.brand {
    width: 180px;
    display: block;
    margin: 15px auto;
}

.tag {
    display: inline-block;
    background: #e7efe4;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 13px;
}

.project {
    text-align: left;
    width: 100%;
    background: white;
    color: #123d43;
    border: 1px solid #d4e0d6;
    margin: 6px 0;
}

.project small {
    color: #536660;
    letter-spacing: 0;
    margin-top: 5px;
}

button:focus-visible,input:focus-visible {
    outline: 3px solid #d58c00;
    outline-offset: 2px;
}

.settings-account {
    margin: 1.25rem 0 .75rem;
    border-block: 1px solid #cedbd0;
}

/* Account and device recovery settings */
.settings-account > div {
    padding: .85rem 0;
}

.settings-account > div + div {
    border-top: 1px solid #dbe5db;
}

.settings-account dt {
    color: #536660;
    font-size: .875rem;
    font-weight: 650;
    margin-bottom: .25rem;
}

.settings-account dd {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.settings-device {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #cedbd0;
}

.settings-device h2 {
    margin: 0 0 .25rem;
}

.settings-device [role=status]:empty {
    display: none;
}

.entry-choices {
    display: grid;
    gap: .75rem;
    margin-top: 1.25rem;
}

.entry-choice {
    margin: 0;
    padding: 1rem;
    font-size: 1.05rem;
}

.entry-choice:not(:disabled):hover {
    background: #e7efe4;
    border-color: #185d46;
}
/* Repeatable item and photo consent controls */

/* Repeatable item rows and per-photo consent controls */
.item-row + .item-row {
    border-top: 1px solid #d4e0d6;
    margin-top: 16px;
    padding-top: 16px;
}

.photo h3 {
    margin-top: 0;
}

.consent-person {
    background: #f5f7f2;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.45;
    padding: 8px 0;
}

.consent-check input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: #185d46;
}
/* Native modal keeps the unsaved report intact behind the offline policy. */

#privacy-policy {
    width: min(600px, calc(100% - 24px));
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid #d4e0d6;
    border-radius: 12px;
    padding: 20px;
    color: #123d43;
    background: #fff;
}

#privacy-policy::backdrop {
    background: rgba(7, 61, 80, 0.65);
}

#privacy-policy a {
    color: #185d46;
    overflow-wrap: anywhere;
}

.policy-draft {
    background: #fff3d8;
    border-radius: 7px;
    padding: 12px;
}
/* Report details and version history remain readable on narrow screens. */

/* Shared report detail and revision editor */
.report-detail, .report-correction {
    min-width: 0;
    overflow-wrap: anywhere;
}

.report-detail dl {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: .45rem .75rem;
    margin: .75rem 0;
}

.report-detail dt {
    font-weight: 600;
}

.report-detail dd {
    margin: 0;
    min-width: 0;
}

.report-detail img {
    max-width: 100%;
    height: auto;
    border-radius: .4rem;
}

.report-correction label {
    display: block;
    margin: .65rem 0;
}

.report-correction input:not([type=checkbox]), .report-correction select, .report-correction textarea {
    display: block;
    width: 100%;
    max-width: 100%;
}

.report-correction button, .report-detail button {
    margin: .3rem;
}

.report-correction fieldset {
    min-width: 0;
}
@media (max-width: 480px) {
    .report-detail dl {
        grid-template-columns: minmax(0, 1fr);
    }
}
