/* The app in design F "Daylight", palette Forest (docs/design-system.md). Every colour, size,
   radius, shadow and motion comes from the shared tokens (tokens.css, copied from
   packages/design); this file writes no colour of its own. The fonts are bundled (fonts.css).

   One rule of the app stays above the design: a result card never uses green or a tick, because
   the app does not vouch for the harvest (REQ-APP-002). The forest green of the palette is used
   for the frame (logo, links, focus, selected tab), never on a result card or a calculated date.
   The status colour "ok" is not used anywhere in the app. */
* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}
/* The safe areas: the parts of a phone's screen under the status bar, the camera cut-out and the
   gesture bar (plan step 18). On Android, Capacitor's own SystemBars part writes them as
   --safe-area-inset-* on the page (0 when it keeps the page out of the bars itself); a browser
   gives them as env(). On a computer all four are 0. */
:root {
    --edge-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
    --edge-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
    --edge-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
    --edge-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
}
body {
    padding: var(--edge-top) var(--edge-right) var(--edge-bottom) var(--edge-left);
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: var(--leading-body);
}
#app {
    max-width: var(--space-frame);
    margin: 0 auto;
    padding: var(--space-md) 20px var(--space-2xl);
}
@media (min-width: 1024px) {
    #app {
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }
}
h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: var(--tracking-display);
    text-wrap: balance;
    overflow-wrap: break-word;
    color: var(--ink);
}
h1 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1;
}
h2 {
    margin: 0 0 var(--space-md);
    font-size: 2rem;
    line-height: var(--leading-heading);
}
h3 {
    margin: var(--space-lg) 0 12px;
    font-size: 1.5rem;
    line-height: 1.15;
}
h4 {
    margin: var(--space-md) 0 6px;
    font-size: 1.2rem;
    line-height: 1.2;
}
h5 {
    margin: 10px 0 4px;
    font-size: 1.05rem;
    line-height: 1.25;
}
p {
    margin: 6px 0;
}
a {
    color: var(--a1-deep);
    font-weight: 600;
    text-underline-offset: 4px;
}

/* ---------- The header: logo, product name, and the way into an account ---------- */
.app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px var(--space-md);
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--card) 75%, transparent);
    box-shadow: var(--shadow-header);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
/* The website's mark (src/ui/brand.ts; owner, 2026-11-24): a link to the website on the web, the picture only elsewhere. */
.logo-link {
    display: inline-flex;
    flex: none;
    border-radius: 50%;
}
.logo-mark {
    display: block;
    width: 36px;
    height: 36px;
}
/* The language switcher moves to the Account screen while signed in (src/main.ts, placeLanguage). */
.language-home[hidden],
.account-language[hidden] {
    display: none;
}
.account-language {
    display: grid;
    gap: var(--space-sm);
    margin-bottom: var(--space-md, 16px);
}
.account-language h2 {
    margin: 0;
    font-size: var(--text-small);
}
/* The lines about this build, at the foot of the page (owner, 2026-11-24, point 11): small print, no warning boxes. */
.about-build {
    display: grid;
    gap: 4px;
    margin: var(--space-lg, 24px) 0 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
}
.about-build p,
.about-build .banner,
.about-build .notice {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: var(--text-small);
    font-weight: 400;
}
.account-entry {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}
/* The language switcher sits beside the way into an account. */
.header-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}
.language-switch select {
    width: auto;
    min-width: 8.5rem;
}
.language-note {
    margin: 4px 0 0;
}
.account-entry .who {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-lines {
    margin: var(--space-lg) 0 var(--space-md);
    display: grid;
    gap: var(--space-sm);
}

/* ---------- Labels, notices, banners ---------- */
/* A small mono label in capitals. Always in "muted", never in "soft": it is text a person reads. */
.label,
.today {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
}
.today::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: var(--space-sm);
    border-radius: 50%;
    background: var(--a1);
    vertical-align: middle;
}
.banner,
.notice {
    margin: 0;
    padding: 12px 18px;
    border-radius: var(--radius-callout);
    font-size: var(--text-small);
}
.banner {
    border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
    background: var(--a3-soft);
    color: var(--warn-ink);
    font-weight: 600;
}
/* The line about a session that ended without "Sign out" (plan step 2c): a sentence, one button and a hint. */
#session-lost {
    display: grid;
    gap: var(--space-sm);
}
#session-lost[hidden] {
    display: none;
}
#session-lost p {
    margin: 0;
}
.notice {
    border: 1px solid color-mix(in srgb, var(--a1) 15%, transparent);
    background: var(--a1-soft);
    color: var(--a1-deep);
    font-weight: 500;
}
.hint {
    color: var(--muted);
    font-size: var(--text-small);
}
/* The internal-testing build's permanent line: the banner colours (warn-ink on a3-soft), in bold. */
.test-build {
    font-weight: 600;
}

/* ---------- The tabs ---------- */
nav[role="tablist"] {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: var(--space-md) 0 var(--space-lg);
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--card);
}
nav[role="tablist"] button {
    min-height: 40px;
    padding: 8px 18px;
    border: 0;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}
nav[role="tablist"] button:hover {
    background: var(--bg-2);
    color: var(--ink);
}
nav[role="tablist"] button[aria-selected="true"] {
    background: var(--ink);
    color: var(--on-dark);
}

/* ---------- Buttons ---------- */
button,
input,
select {
    font: inherit;
    color: inherit;
}
/* Every button is a pill. The secondary ("ghost") look is the default; the one main action of a form is the primary look. */
button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 44px;
    padding: 10px var(--space-lg);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--ink);
    font-size: var(--text-small);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color var(--motion-fast),
        border-color var(--motion-fast),
        box-shadow var(--motion-fast),
        color var(--motion-fast);
}
button:hover,
a.button:hover {
    border-color: color-mix(in srgb, var(--a1) 40%, transparent);
    background: var(--bg-2);
}
button[type="submit"],
button.primary,
a.button.primary,
button[aria-pressed="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--on-dark);
    box-shadow: var(--shadow-button);
}
button[type="submit"]:hover,
button.primary:hover,
a.button.primary:hover,
button[aria-pressed="true"]:hover {
    border-color: var(--a1-deep);
    background: var(--a1-deep);
}
button:disabled,
button:disabled:hover {
    border-color: var(--line-2);
    background: var(--bg-2);
    color: var(--muted);
    box-shadow: none;
    cursor: default;
}
/* Keyboard focus: the token outline (tokens.css) plus a soft ring on buttons, the same as hover would give. */
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 3px;
    box-shadow: var(--focus-ring-button);
}
button:focus-visible {
    border-color: color-mix(in srgb, var(--a1) 40%, transparent);
}

/* ---------- Forms ---------- */
input,
select {
    width: 100%;
    min-height: 48px;
    padding: 12px var(--space-md);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
    background: var(--card);
    color: var(--ink);
    font-size: var(--text-body);
    transition:
        border-color var(--motion-fast),
        box-shadow var(--motion-fast);
}
input::placeholder {
    color: var(--soft);
}
input:hover,
select:hover {
    border-color: color-mix(in srgb, var(--a1) 40%, transparent);
}
input:focus,
select:focus,
input:focus-visible,
select:focus-visible {
    outline: none;
    border-color: var(--a1);
    box-shadow: var(--focus-ring-field);
}
input[aria-invalid="true"] {
    border-color: var(--warn);
    box-shadow: var(--focus-ring-error);
}
label {
    display: block;
    margin: var(--space-md) 0 var(--space-sm);
    font-size: var(--text-small);
    font-weight: 600;
    color: var(--ink);
}
form,
#entries,
.result-group,
.product-card,
.explainers,
.day-panel,
#calendar-dates,
#lookup > .row,
.panel {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
}
@media (min-width: 640px) {
    form,
    #entries,
    .result-group,
    .product-card,
    .explainers,
    .day-panel,
    #calendar-dates,
    #lookup > .row,
    .panel {
        padding: var(--space-xl);
    }
}
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-md);
}
.row > div {
    flex: 1 1 180px;
}
.actions,
.picks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}
.reading p {
    margin: 6px 0;
}
.problems p {
    margin: 12px 0 0;
    padding: 10px var(--space-md);
    border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
    border-left: 4px solid var(--warn);
    border-radius: var(--radius-field);
    background: var(--a3-soft);
    color: var(--warn-ink);
    font-size: var(--text-small);
    font-weight: 600;
}
ul {
    margin: 4px 0;
    padding-left: 20px;
}
ul.entries {
    list-style: none;
    padding: 0;
}
li.entry {
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
/* The history of one spray: a box under the spray's line, one record per line, oldest first. */
.entry-history {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-left: 3px solid var(--line);
}
.entry-history h3 {
    margin: 0 0 var(--space-sm);
}
ol.history-lines {
    margin: 0;
    padding-left: 1.4em;
}
li.history-line {
    padding: 6px 0;
}
li.history-line p {
    margin: 0;
    padding: 0;
    overflow-wrap: anywhere;
}

/* ---------- Planned sprays and the list "Coming up". A plan is drawn hollow with a dotted edge, never like a spray in the diary. ---------- */
ul.planned-entries,
ul.coming-up-items {
    list-style: none;
    padding: 0;
}
li.planned-entry {
    margin: 10px 0;
    padding: 12px 14px;
    border: 2px dotted var(--line-2);
    border-radius: var(--radius-field);
    background: transparent;
    overflow-wrap: anywhere;
}
.planned-badge {
    display: inline-block;
    margin: 0 0 4px;
    padding: 1px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
}
.planned-passed,
.preview-problem {
    color: var(--warn-ink);
}
.plan-preview {
    margin: 8px 0;
}
.plan-preview summary {
    cursor: pointer;
    font-weight: 600;
}
ul.preview-rows {
    list-style: none;
    padding: 0;
}
.coming-up {
    margin: 0 0 var(--space-md);
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
    overflow-wrap: anywhere;
}
.coming-up h3 {
    margin-top: 0;
}
li.coming-up-item {
    padding: 6px 0;
    border-top: 1px solid var(--line);
}
li.coming-up-item[data-kind="planned-spray"],
li.coming-up-item[data-kind="planned-passed"] {
    font-style: italic;
}
.coming-up-source {
    color: var(--muted);
}
/* The five diary questions (docs/parts/diary-questions.md) use the same frame as the kind of entry. */
/* "Fill from a sentence" (docs/parts/sentence-reader.md): a folded box in the same frame. */
details.sentence {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
}
details.sentence textarea {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
}
/* "Read a product label" (docs/parts/label-photo.md): the same frame; the pictures never wider than the form. */
details.label-photo {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
}
details.label-photo canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 8px 0;
}
fieldset.label-edges {
    margin: 0 0 8px;
    padding: 4px 8px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
}
label.label-edge {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}
label.label-edge input[type="range"] {
    flex: 1;
    min-width: 0;
}
details.label-photo input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}
fieldset.questions,
fieldset.volume,
fieldset.kind {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
}
fieldset.questions legend,
fieldset.volume legend,
fieldset.kind legend {
    font-weight: 600;
    padding: 0 4px;
}
label.radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin: 0 16px 0 0;
    font-weight: 500;
}
input[type="checkbox"]#f-volume-unknown {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
    accent-color: var(--a1);
}
input[type="radio"] {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
    accent-color: var(--a1);
}
input[type="radio"]:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 3px;
    box-shadow: none;
}

/* ---------- Result cards. Neutral by design: ink for a date, amber for "take care", grey for no data. Never green. ---------- */
.cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}
.card {
    position: relative;
    flex: 1 1 260px;
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
    transition: box-shadow var(--motion-fast);
}
.card:hover {
    box-shadow: var(--shadow-lift);
}
/* The state as a dot beside the market's name; the words of the card always say it too, so colour never carries meaning alone. */
.card h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    font-size: 1.35rem;
}
.card h4::before {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--none);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--none) 18%, transparent);
}
.card[data-state="date"] h4::before {
    background: var(--ink);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 12%, transparent);
}
.card[data-state="no_limit_listed"] h4::before,
.card[data-state="not_checked"] h4::before,
.card[data-state="no_date"] h4::before {
    background: var(--warn);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 18%, transparent);
}
.headline {
    font-weight: 600;
}
.date {
    margin: var(--space-sm) 0 4px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: var(--tracking-display);
    line-height: 1.1;
}
/* Directly under every date: what the date is and is not. */
.card-notice {
    display: inline-block;
    margin: 4px 0 var(--space-sm);
    padding: 6px 12px;
    border: 1px solid color-mix(in srgb, var(--a3) 60%, transparent);
    border-radius: var(--radius-callout);
    background: var(--a3-soft);
    color: var(--sample-ink);
    font-size: var(--text-small);
    font-weight: 600;
}
.cautions {
    color: var(--warn-ink);
}
.explained {
    margin-top: var(--space-md);
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.explained h5 {
    margin: 0 0 4px;
}
.explained p {
    margin: 4px 0;
}
/* The substance facts on the lookup card: each line with its source in muted text below it. */
.substance-facts {
    margin-top: var(--space-md);
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.substance-facts h4 {
    margin: 0 0 4px;
    font-size: 1.1rem;
}
.substance-facts h4::before {
    content: none;
}
.substance-fact h5 {
    margin: 12px 0 4px;
    color: var(--ink);
}
.facts {
    margin: 0;
    padding-left: var(--space-md);
    color: var(--ink);
}
.facts li {
    margin: 4px 0;
    overflow-wrap: anywhere;
}
.facts .attribution {
    display: block;
}
.facts .attribution a {
    color: var(--a1-deep);
}
.small-print {
    color: var(--muted);
    font-size: var(--text-small);
}
details {
    margin-top: 12px;
}
summary {
    cursor: pointer;
    color: var(--a1-deep);
    font-weight: 600;
    border-radius: 8px;
}
summary:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}
.statements {
    font-size: var(--text-small);
    color: var(--muted);
    overflow-wrap: anywhere;
}
dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px var(--space-md);
    margin: var(--space-sm) 0;
}
dt {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    padding-top: 4px;
}
dd {
    margin: 0;
}
.legal,
.entry-legal {
    font-weight: 600;
}
.refused-entries {
    margin: 4px 0;
}
/* Who calculated a crop's dates (test build, signed in): a line of words, told apart by its text and never by a colour. */
.result-source {
    margin: 4px 0 12px;
    padding-left: 12px;
    border-left: 3px solid var(--muted);
}
.result-source p {
    margin: 2px 0;
    overflow-wrap: anywhere;
}
.result-source .source-label {
    font-weight: 600;
}
.result-source .source-line {
    color: var(--muted);
    font-size: var(--text-small);
}

/* ---------- The calendar. A day is one button. Sprays are solid chips; a calculated date is a marker with a
   dashed outline, so it differs by shape and not by colour alone. Never green. ---------- */
/* A typed product name can be one long word without a space: it breaks inside the word rather than push the page sideways. */
#calendar,
#account,
#sprays {
    overflow-wrap: anywhere;
}
.calendar-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm) 12px;
    margin-bottom: 12px;
}
.calendar-bar h2 {
    flex: 1 1 200px;
    margin: 0;
}
.calendar-steps,
.calendar-views {
    display: flex;
    gap: 6px;
}
.calendar-bar select {
    width: auto;
}
.weekdays,
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
.weekdays {
    margin-bottom: 4px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    text-align: center;
}
.week-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}
button.day {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 3px;
    min-width: 0;
    min-height: 96px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    background: var(--card);
    color: var(--ink);
    font-weight: 400;
    text-align: left;
    overflow: hidden;
    box-shadow: none;
}
button.day:hover {
    background: var(--card);
    border-color: color-mix(in srgb, var(--a1) 40%, transparent);
}
.week-list button.day {
    min-height: 52px;
    padding: 10px 14px;
}
button.day[data-other-month] {
    background: var(--bg-2);
    color: var(--muted);
}
button.day[data-today] {
    border: 2px solid var(--ink);
    padding: 5px;
}
.week-list button.day[data-today] {
    padding: 9px 13px;
}
button.day[aria-pressed="true"] {
    background: var(--a2-soft);
    color: var(--ink);
    border-color: var(--a1);
    box-shadow: none;
}
.day-num {
    font-family: var(--font-mono);
    font-weight: 500;
}
button.day[data-today] .day-num {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.spray-chip,
.more,
.marker,
.other-chip {
    display: block;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spray-chip {
    background: var(--bg-2);
    border-left: 4px solid var(--ink);
    color: var(--ink);
}
.week-list .spray-chip,
.week-list .marker,
.week-list .other-chip {
    white-space: normal;
    font-size: 0.9rem;
}
.more {
    color: var(--muted);
    padding-left: 10px;
}
.marker {
    border: 2px dashed var(--ink);
    background: var(--card);
    color: var(--ink);
    white-space: normal;
    overflow-wrap: anywhere;
}
/* A date that cold days made later (plan step 9c): the amber edge of a caution and a "!" after the market, at every width. */
.marker-cautioned {
    border-color: var(--warn);
}
.marker-caution {
    margin-left: 3px;
    font-weight: 700;
    color: var(--warn-ink);
}
.other-chip {
    border: 1px dotted var(--muted);
    color: var(--muted);
}
/* A pest alert period: its own kind, drawn apart from the calculated dates (solid amber edge, not the dashed ink of a date marker). */
.other-chip[data-kind="pest-alert"] {
    border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
    border-left: 4px solid var(--warn);
    background: var(--a3-soft);
    color: var(--warn-ink);
}
/* A planned spray: its own kind. Hollow (no fill), a dotted ink edge and the word "Planned": not the
   solid edge of a spray in the diary, not the dashed box of a calculated date, not the amber edge of an alert. */
.planned-chip {
    display: block;
    padding: 0 5px;
    border: 2px dotted var(--ink);
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.week-list .planned-chip {
    white-space: normal;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}
.marker-short,
.planned-short,
.spray-count {
    display: none;
}
.spray-count {
    align-self: flex-start;
    min-width: 1.5rem;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--on-dark);
    font-size: 0.78rem;
    text-align: center;
}
#calendar-notice,
#calendar-dates-notice,
#day-hint {
    margin: 12px 0 var(--space-md);
}
.day-panel h3,
#calendar-dates h3 {
    margin-top: 0;
}
.dated {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
}
.dated-crop {
    font-weight: 600;
}
ul.dates-rows {
    list-style: none;
    padding: 0;
}
ul.dates-rows li {
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.dates-line {
    color: var(--muted);
}
.dates-caution {
    color: var(--warn-ink);
}

/* ---------- The account screen ---------- */
#account-box {
    max-width: 560px;
}
#account form {
    max-width: 560px;
    padding: var(--space-lg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-panel);
}
@media (min-width: 640px) {
    #account form {
        padding: var(--space-xl) 40px;
        border-radius: var(--radius-panel);
    }
}
#account form button[type="submit"] {
    width: 100%;
    min-height: 52px;
    margin-top: var(--space-sm);
    font-size: 15px;
}
#account-box > p {
    margin: var(--space-sm) 0;
}
#account-box > .actions {
    margin-bottom: var(--space-md);
}
.label-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 12px;
}
.label-row label {
    margin-bottom: var(--space-sm);
}
/* "Show password": a checkbox with its label, under the password box(es) (src/ui/password-field.ts). */
label.show-password {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: 44px;
    margin: 4px 0 0;
    font-weight: 500;
    cursor: pointer;
}
.show-password input[type="checkbox"] {
    flex: none;
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
    accent-color: var(--a1);
}
.show-password input[type="checkbox"]:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 3px;
    box-shadow: none;
}
/* The other ways to sign in (src/ui/google-block.ts; plan step A16, 2026-11-24): after the line "or continue with",
   one row of equal logo buttons under the form, two by two on a narrow screen. The logos keep their own colours on the
   light card (Google's, Microsoft's and Facebook's rules: the logo is not altered). */
.google {
    margin: var(--space-md) 0 0;
}
.ways {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.ways[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
}
.ways[data-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (min-width: 460px) {
    .ways[data-count="4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.ways .way {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: var(--text-small);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
}
.ways .way:hover {
    border-color: color-mix(in srgb, var(--a1) 40%, transparent);
    background: var(--bg-2);
}
.ways .way:disabled,
.ways .way:disabled:hover {
    border-color: var(--line-2);
    background: var(--bg-2);
    cursor: default;
    opacity: 0.55;
}
.way-logo {
    flex: none;
}
/* The closed line under the form that makes an account; it opens the account notice (plan step A16). */
details.notice-more {
    margin: var(--space-md) 0 0;
    font-size: var(--text-small);
    text-align: center;
}
details.notice-more summary {
    cursor: pointer;
    color: var(--a1-deep);
    font-weight: 600;
}
details.notice-more summary:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 3px;
}
details.notice-more .notice {
    margin-top: 8px;
    text-align: left;
}
.or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: var(--space-md) 0 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
}
.or::before,
.or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-2);
}
.switch-line {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: var(--text-small);
}
.switch-line .muted {
    color: var(--muted);
}
button.link {
    min-height: 40px;
    padding: 4px 6px;
    border: 0;
    background: transparent;
    color: var(--a1-deep);
    box-shadow: none;
}
/* Always underlined (owner, 2026-11-24: "Login" under the form that makes an account). */
button.link.underlined {
    text-decoration: underline;
    text-underline-offset: 4px;
}
button.link:hover {
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- A narrow screen (a phone): seven columns still fit, so a day shows the number of sprays and the
   markets' letters only; the names are in the day's panel and in the week view. ---------- */
@media (max-width: 640px) {
    #app {
        padding: var(--space-sm) 12px var(--space-xl);
    }
    .app-header {
        border-radius: var(--radius-callout);
    }
    .header-tools,
    .account-entry {
        width: 100%;
    }
    .language-switch,
    .language-switch select {
        width: 100%;
    }
    .account-entry > * {
        flex: 1 1 auto;
    }
    h2 {
        font-size: 1.7rem;
    }
    nav[role="tablist"] {
        width: 100%;
        border-radius: var(--radius-callout);
    }
    nav[role="tablist"] button {
        flex: 1 1 40%;
    }
    .weekdays,
    .month-grid {
        gap: 2px;
    }
    .month-grid button.day {
        min-height: 56px;
        padding: 3px;
        align-items: center;
        gap: 2px;
        border-radius: 10px;
    }
    .month-grid button.day[data-today] {
        padding: 1px;
    }
    .month-grid .spray-chip,
    .month-grid .more,
    .month-grid .other-chip,
    .month-grid .marker-text,
    .month-grid .planned-text {
        display: none;
    }
    .month-grid .spray-count,
    .month-grid .marker-short,
    .month-grid .planned-short {
        display: block;
    }
    .month-grid .planned-chip {
        padding: 0 2px;
        font-size: 0.7rem;
    }
    .month-grid .spray-count {
        align-self: center;
    }
    .month-grid .marker {
        padding: 0 2px;
        font-size: 0.7rem;
        overflow-wrap: normal;
    }
    .calendar-bar h2 {
        flex-basis: 100%;
    }
}

/* ---------- The phone frame (plan step 18; the frame of report 29, section 1.3, in part) ----------
   On a phone-sized screen the five tab buttons are a bar fixed at the bottom, each at least 56 px
   high (Android asks for 48 dp), with their usual labels on up to three lines: no short labels
   were made, because new labels are the owner's to accept. The bar stays above the gesture bar
   (the bottom safe area), and the page keeps room under its last line for it: main.ts writes
   the bar's height into --tab-bar-height. Nothing else moves: the standing lines stay at the top
   of every screen, and "Read the page aloud" stays under them. Buttons and links that are buttons
   get Android's 48 px. Drafts: the owner looks at it on a phone (plan step 18). */
@media (max-width: 640px) {
    #app {
        padding-bottom: calc(var(--tab-bar-height, 96px) + var(--space-lg));
    }
    nav[role="tablist"] {
        position: fixed;
        z-index: 20;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 4px max(4px, var(--edge-right)) calc(4px + var(--edge-bottom)) max(4px, var(--edge-left));
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        background: var(--card);
        box-shadow: var(--shadow-header);
    }
    nav[role="tablist"] button {
        flex: none;
        min-width: 0;
        min-height: 56px;
        padding: 6px 2px;
        border-radius: var(--radius-field);
        font-size: 12px;
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: manual;
    }
    button,
    a.button,
    button.link {
        min-height: 48px;
    }
}
/* While the phone's keyboard is up (a text box has the focus on a touch screen), the bar is put
   away, so that it does not ride on the keyboard over the box being typed in. */
@media (max-width: 640px) and (pointer: coarse) {
    body:has(input:not([type="checkbox"], [type="radio"], [type="button"], [type="submit"]):focus, textarea:focus) nav[role="tablist"] {
        display: none;
    }
}

/* Under "reduce motion" nothing moves or fades: colour changes are instant. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Pest alerts ---------- */
.alerts-setting {
    margin-bottom: var(--space-lg);
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
}
.alerts-setting select {
    max-width: 100%;
}
.alerts-setting label {
    display: block;
    margin: var(--space-sm) 0 4px;
    font-weight: 600;
}
.chosen-crops,
.alert-cards {
    margin: 0;
    padding: 0;
    list-style: none;
}
.chosen-crops li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 0;
}
.alert-card {
    margin: 0 0 var(--space-md);
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--warn);
    border-radius: var(--radius-card);
    background: var(--card);
    overflow-wrap: anywhere;
}
.alert-card h4 {
    margin: 0 0 4px;
    font-size: 1.15rem;
}
.alert-kind {
    color: var(--muted);
    font-weight: 400;
}
.alert-card p,
.alert-says {
    margin: 4px 0;
}
.alert-card[data-expected="true"] {
    border-left-style: dashed;
}

/* ---------- The account's own data: the move question, "Download my data", "Delete my account" ---------- */
#account-data {
    max-width: 560px;
}
#account-data h3 {
    margin-top: var(--space-lg);
}
#account-data p,
#diary-owner {
    overflow-wrap: anywhere;
}
#account-data button,
#account-data label {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
#account-data input {
    max-width: 100%;
}
button.danger {
    border-color: var(--warn-ink);
    background: var(--warn-ink);
    color: var(--on-dark);
}
button.danger-link {
    border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
    background: transparent;
    color: var(--warn-ink);
    box-shadow: none;
}

/* ---------- The farm's plots on the Account screen (src/ui/plots.ts): a short list, one plot per block. A plot is a name, never a place. ---------- */
#plots-box {
    margin-top: var(--space-xl);
}
#plots-box h3 {
    margin: 0 0 var(--space-sm);
}
#plots-box p {
    overflow-wrap: anywhere;
}
ul.plots {
    list-style: none;
    padding: 0;
}
li.plot {
    padding: var(--space-md) 0;
    border-top: 1px solid var(--line);
}
li.plot .plot-crops {
    margin: var(--space-sm) 0;
}
/* The plot a spray names, in the spray's line: read as part of the line. */
.entry-plot {
    overflow-wrap: anywhere;
}

/* ---------- "Notices by e-mail" under the account (choices only; nothing is sent from the app) ---------- */
#notify {
    max-width: 560px;
}
#notify h3 {
    margin-top: var(--space-lg);
}
#notify p {
    overflow-wrap: anywhere;
}
#notify fieldset {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
    min-width: 0;
}
#notify legend {
    font-weight: 600;
    padding: 0 4px;
}
#notify .check {
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 8px;
    align-items: center;
    min-height: 44px;
}
#notify .check .hint {
    grid-column: 2;
    margin: 0 0 8px;
}
#notify .check[data-available="false"] label {
    color: var(--muted);
}
#notify input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
    accent-color: var(--a1);
}
#notify input[type="checkbox"]:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 3px;
    box-shadow: none;
}
#notify .quiet-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
#notify select {
    width: auto;
    min-width: 96px;
}
#notify label {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ---------- Read aloud (REQ-ACCESS-001, docs/parts/read-aloud.md). The secondary pill of every button;
   while a card is being read its button takes the dark ink look, never green (a result card carries no
   green). The focus ring is the design's, as on every button. */
.read-aloud-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 0 var(--space-sm);
}
.read-aloud-box.page-read {
    margin: calc(-1 * var(--space-sm)) 0 var(--space-lg);
}
button.read-aloud::before {
    /* A small speaker drawn with borders: decoration only; the words say what the button does. */
    content: "";
    flex: none;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid currentColor;
    margin-left: -2px;
}
.card button.read-aloud:hover,
.alert-card button.read-aloud:hover {
    border-color: var(--ink);
}
button.read-aloud[data-reading="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--on-dark);
    box-shadow: var(--shadow-button);
}
button.read-aloud[data-reading="true"]:hover {
    border-color: var(--ink);
    background: var(--ink);
}
.read-aloud-note {
    flex: 1 1 100%;
    margin: 0;
}

/* The platform's own line at the end of the page (src/platform/): hidden in a browser and in the Windows shell.
   The Android build shows its "Licences" link here; the notices are plain text that wraps inside the screen. */
#platform-footer {
    margin-top: var(--space-xl);
}
#licences-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
}

/* A link to an official source shows its whole address, which is longer than a phone's screen is wide:
   it breaks inside the screen instead of making the page scroll sideways (found at 360 px, 2026-11-18). */
a[data-external] {
    overflow-wrap: anywhere;
}

/* The "People" part of the Account screen and the Join part above it (plan step 10): plain lists, one person or invitation per line. */
#people-box,
#join-box {
    margin-top: 1.5rem;
}
#people-box ul,
#people-box ol,
#join-box ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}
#people-list,
#people-invites {
    list-style: none;
    padding-left: 0;
}
li.people-person,
li.people-invite {
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
}
li.people-person p,
li.people-invite p {
    margin: 0 0 0.25rem;
}
#people-invite label,
#join-form label {
    display: block;
    margin-top: 0.75rem;
}
/* The part "Where the farm is" under the account (plan step 6; test build only). */
#farm-place {
    max-width: 560px;
}
#farm-place h3 {
    margin-top: var(--space-lg);
}
#farm-place h4 {
    margin: 0 0 4px;
}
#farm-place p,
#farm-place li {
    overflow-wrap: anywhere;
}
#farm-place fieldset {
    margin: 12px 0;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
    min-width: 0;
}
#farm-place legend {
    font-weight: 600;
    padding: 0 4px;
}
#farm-place .check {
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 8px;
    align-items: center;
    min-height: 44px;
}
#farm-place select,
#farm-place input[type="text"] {
    max-width: 100%;
}
/* The soil card under "Where the farm is" (plan step 7; test build only). The table scrolls
   inside its own box on a narrow screen, so the page never scrolls sideways. */
#soil-card {
    margin: 16px 0;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
}
#soil-card .soil-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}
#soil-table {
    border-collapse: collapse;
    font-size: 0.95em;
}
#soil-table th,
#soil-table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--line-2);
}
#soil-table td {
    font-variant-numeric: tabular-nums;
}
#soil-card .soil-own-field {
    display: grid;
    gap: 2px;
    margin: 6px 0;
}
#place-stored {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-field);
}
#place-stored ul {
    margin: 0 0 4px;
    padding-left: 20px;
}

/* Two-step sign-in (src/ui/two-step.ts): the QR code never makes the page wider than the screen. */
#two-step-qr {
    max-width: 100%;
    height: auto;
}
#two-step-key {
    overflow-wrap: anywhere;
}

/* The statistics screen (plan step S5; src/ui/stats.ts): the tiles as a small table of figures. */
table.stats-tiles {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95em;
    margin: 8px 0;
}
table.stats-tiles th,
table.stats-tiles td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--line-2);
}
table.stats-tiles td {
    font-variant-numeric: tabular-nums;
}
#stats-pick {
    display: grid;
    gap: 2px;
    margin: 6px 0;
}

/* The app lock (plan step A14; src/ui/lock-devices.ts): the locked screen stands alone while the app is hidden. */
.lock-screen {
    max-width: 28rem;
    margin: 15vh auto 0;
    padding: 1.5rem 1rem;
}
.lock-screen input {
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    max-width: 10rem;
}
/* "Your devices" (plan step A14). */
ul.devices {
    list-style: none;
    padding: 0;
}
ul.devices > li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line, currentColor);
}
/* "Where the food is going" (2026-11-24): the 27 member states without bullets, in columns that wrap on a narrow screen. */
ul.destination-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0;
    columns: 2 11rem;
    column-gap: 1.5rem;
}
ul.destination-list > li {
    break-inside: avoid;
    padding: 0.15rem 0;
}
#destination-filter {
    display: block;
    max-width: 100%;
}
#destination-measures ul {
    padding-left: 1.25rem;
}
