/* RedPen look: crimson red accent, gas numbers in green (amber under 25, red at or below 0), big touch targets (48px+).
   The Web and PWAMobile copies of this file must stay identical (a test compares them): the screens' markup is shared,
   so their style is too. Loaded after the suite's shared theme.css files, so these rules win. */

:root {
    --rp-red: #DC143C;
    --rp-red-dark: #B5102F;
    --rp-red-tint: rgba(220, 20, 60, 0.10);
    --rp-brand: #DC143C;
    --rp-green: #15803D;
    --rp-amber: #B45309;
    --rp-red-text: #B91C1C;
    --rp-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --rp-muted: #565e66;   /* muted text on the page background: 5.5:1 (the shared muted grey is only 4.3:1 there) */

    /* Bootstrap's own "primary" becomes crimson, so links, focus rings and the loading spinner match. */
    --bs-primary: #DC143C;
    --bs-primary-rgb: 220, 20, 60;

    /* Login page palette (the shared theme.css variables): crimson on a deep red background. */
    --twr-login-bg-start: #3a0612;
    --twr-login-bg-end: #B5102F;
    --twr-login-icon-shadow-rgb: 220, 20, 60;
    --twr-login-title-color: #DC143C;
    --twr-login-accent-color: #DC143C;
    --twr-login-tagline-color: #6b5a5e;
    --twr-login-divider-color: #f1d5db;
}

[data-bs-theme="dark"] {
    --rp-brand: #F2506E;
    --rp-green: #4ADE80;
    --rp-amber: #FBBF24;
    --rp-red-text: #F87171;
    --rp-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --rp-muted: #adb5bd;
    --bs-primary: #DC143C;
    --bs-primary-rgb: 220, 20, 60;
}

/* ── Buttons and links ─────────────────────────────────────────────────── */
.btn-primary,
.btn-primary:focus,
[data-bs-theme="dark"] .btn-primary {
    background: var(--rp-red) !important;
    border: 1px solid var(--rp-red) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(220, 20, 60, 0.28);
}

.btn-primary:hover,
.btn-primary:active,
[data-bs-theme="dark"] .btn-primary:hover {
    background: var(--rp-red-dark) !important;
    border-color: var(--rp-red-dark) !important;
    color: #fff !important;
}

.btn-primary:disabled,
.btn-primary.disabled,
[data-bs-theme="dark"] .btn-primary:disabled {
    background: var(--rp-red) !important;
    opacity: 0.45;
}

.btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-primary {
    color: var(--rp-brand);
    border-color: var(--rp-brand);
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: var(--rp-red);
    border-color: var(--rp-red);
    color: #fff;
}

a { color: var(--rp-brand); }   /* --rp-brand is the lighter crimson on dark surfaces (4.5:1 or better) */
.form-control:focus, .form-check-input:focus,
[data-bs-theme="dark"] .form-control:focus { border-color: var(--rp-red); box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.25); }
.form-check-input:checked { background-color: var(--rp-red); border-color: var(--rp-red); }

.rp-big-btn { min-height: 48px; font-size: 1.05rem; padding: 0.6rem 1.1rem; }
.rp-input { min-height: 48px; font-size: 1.05rem; }
.rp-check .form-check-input { width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; }
.rp-check .form-check-label { font-size: 1.05rem; padding-left: 0.4rem; line-height: 1.8rem; }

/* ── Top bar, brand, bottom bar (phone) ────────────────────────────────── */
.rp-brand { color: var(--rp-brand) !important; font-weight: 800; font-size: 1.35rem; letter-spacing: 0.01em; }
.rp-topbar { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: var(--twr-surface); border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.rp-topbar-icon { display: inline-block; border-radius: 7px; }

.rp-bottom-nav { z-index: 1030; background-color: var(--twr-surface); padding-bottom: env(safe-area-inset-bottom); }
.rp-bottom-nav-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
    flex: 1; min-height: 56px; padding: 0.35rem 0.5rem; text-align: center; text-decoration: none;
    color: var(--twr-text-muted); font-size: 0.8rem;
}
.rp-bottom-nav-link i { font-size: 1.5rem; }
.rp-bottom-nav-link.active { color: var(--rp-brand); font-weight: 700; }
.rp-web-main .rp-day { padding-top: 0; }

/* ── Page frame and cards ──────────────────────────────────────────────── */
.rp-day { max-width: 640px; margin: 0 auto; padding: 0.75rem 1rem 1rem; }
.rp-day.rp-phone { padding-bottom: 6.5rem; }
.rp-page-title { color: var(--rp-brand); font-size: 1.5rem; font-weight: 800; margin: 0.5rem 0; }
.rp-card { background: var(--twr-surface); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; box-shadow: var(--rp-card-shadow); }
.rp-section-label { display: block; font-weight: 600; margin-bottom: 0.25rem; }

/* ── Which day ─────────────────────────────────────────────────────────── */
.rp-datebar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.rp-nav-btn {
    width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; border: 1px solid var(--bs-border-color, #ccc);
    background: var(--twr-surface); color: var(--twr-text); font-size: 1.25rem; display: flex; align-items: center; justify-content: center;
}
.rp-nav-btn:disabled { opacity: 0.4; }
.rp-datelabel { flex: 1; text-align: center; }
.rp-date-main { font-weight: 700; font-size: 1.1rem; }
.rp-today-btn { min-height: 48px; min-width: 96px; margin-top: 0.15rem; color: var(--rp-brand); border: 1px solid var(--rp-brand); background: transparent; font-weight: 600; font-size: 1.05rem; }

/* ── Gas numbers ───────────────────────────────────────────────────────── */
.gas-green { color: var(--rp-green); }
.gas-amber { color: var(--rp-amber); }
.gas-red { color: var(--rp-red-text); }
.gas-none { color: var(--twr-text-muted); }

.rp-tank { text-align: center; }
.rp-tank-label { font-size: 1.1rem; font-weight: 600; color: var(--twr-text-muted); }
.rp-tank-number { font-size: 4.5rem; line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; }
.rp-tank-sub { font-size: 0.95rem; color: var(--twr-text-muted); }
.rp-tank-proj { font-weight: 700; font-size: 1.05rem; }
.rp-outofgas { font-size: 1.15rem; font-weight: 700; text-align: center; background: #B91C1C; color: #fff; border: none; }

/* ── Start of day ──────────────────────────────────────────────────────── */
.rp-start-label { display: block; font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.rp-score-input { font-size: 2.25rem; text-align: center; font-weight: 700; min-height: 64px; }

/* ── Task list ─────────────────────────────────────────────────────────── */
.rp-list { list-style: none; padding: 0; margin: 0 0 1rem; background: var(--twr-surface); border-radius: 14px; box-shadow: var(--rp-card-shadow); overflow: hidden; }
.rp-row { padding: 0.25rem 0.5rem 0.5rem; border-bottom: 1px solid rgba(128, 128, 128, 0.2); }
.rp-row:last-child { border-bottom: none; }
.rp-row-top { display: grid; grid-template-columns: 48px 1fr auto 3.4rem; align-items: center; gap: 0.25rem; }
.rp-tick { width: 48px; height: 48px; border: none; background: transparent; color: var(--rp-brand); font-size: 2rem; display: flex; align-items: center; justify-content: center; padding: 0; }
.rp-tick:disabled { opacity: 0.5; }
.rp-title { text-align: left; background: transparent; border: none; min-height: 48px; padding: 0.25rem 0.25rem; font-size: 1.1rem; color: var(--twr-text); word-break: break-word; }
.rp-title-static { display: flex; align-items: center; font-style: italic; color: var(--twr-text-muted); }
.rp-cost { font-size: 1.15rem; font-weight: 600; color: var(--twr-text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.rp-cost-rest { color: var(--rp-green); font-weight: 800; }
.rp-after { font-size: 1.4rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.rp-rest { border-left: 5px solid var(--rp-green); background: rgba(21, 128, 61, 0.07); }
.rp-rest-tag { display: inline-block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; color: #fff; background: var(--rp-green); border-radius: 6px; padding: 0.05rem 0.4rem; margin-right: 0.4rem; vertical-align: middle; }
[data-bs-theme="dark"] .rp-rest-tag { color: #052e16; }
.rp-done .rp-title { text-decoration: line-through; opacity: 0.65; }
.rp-row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 0 0.25rem 48px; }
.rp-act {
    min-height: 48px; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0 0.9rem;
    border: 1px solid var(--bs-border-color, #ccc); border-radius: 10px; background: transparent; color: var(--twr-text); font-size: 0.95rem;
}
.rp-act i { font-size: 1.25rem; color: var(--rp-brand); }
.rp-act:disabled { opacity: 0.5; }
.rp-why { font-size: 0.95rem; text-align: center; color: var(--rp-muted) !important; }

/* ── Add button ────────────────────────────────────────────────────────── */
.rp-add-wrap { display: flex; justify-content: center; margin: 1rem 0; }
.rp-fab-wrap { position: fixed; left: 0; right: 0; bottom: calc(4.4rem + env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; z-index: 1020; }
.rp-fab { pointer-events: auto; border-radius: 999px; padding: 0.75rem 1.6rem; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }

/* ── Sheets (add, change, standard task) ───────────────────────────────── */
.rp-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 1040; }
.rp-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; z-index: 1050;
    background: var(--twr-surface); color: var(--twr-text); border-radius: 18px 18px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
.rp-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.rp-sheet-title { font-size: 1.25rem; font-weight: 800; margin: 0; color: var(--rp-brand); }
.rp-sheet-buttons { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.rp-sheet-buttons .btn { width: 100%; }
.rp-move-row { display: flex; gap: 0.5rem; margin-top: 1rem; }
.rp-move-row .btn { flex: 1; }
.rp-pick-list { max-height: 210px; overflow-y: auto; border: 1px solid var(--bs-border-color, #ccc); border-radius: 10px; margin-top: 0.5rem; }
.rp-pick { width: 100%; min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem; border: none; border-bottom: 1px solid rgba(128, 128, 128, 0.2); background: transparent; color: var(--twr-text); text-align: left; font-size: 1.05rem; }
.rp-pick:last-child { border-bottom: none; }
.rp-pick-cost { font-weight: 700; color: var(--twr-text-muted); }
.rp-picked { background: var(--rp-red-tint); font-weight: 700; }

@media (min-width: 768px) {
    .rp-sheet { left: 50%; right: auto; bottom: auto; top: 8vh; width: 520px; transform: translateX(-50%); border-radius: 18px; }
    .rp-sheet-buttons { flex-direction: row-reverse; }
    .rp-sheet-buttons .btn { width: auto; flex: 1; }
}

/* ── Standard tasks list ───────────────────────────────────────────────── */
.rp-std-row { width: 100%; min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.5rem 0.5rem; border: none; background: transparent; color: var(--twr-text); text-align: left; font-size: 1.1rem; }
.rp-std-row .rp-title-text { flex: 1 1 8rem; word-break: break-word; }
.rp-badge { flex-basis: 100%; font-size: 0.85rem; color: var(--rp-green); font-weight: 600; }

/* ── Notices ───────────────────────────────────────────────────────────── */
.rp-error, .rp-offline { font-size: 1.05rem; }

/* ── While another date loads, and the plain questions ─────────────────── */
.rp-dim > .rp-page > :not(.rp-datebar) { opacity: 0.45; pointer-events: none; }
.rp-move-question { font-size: 1.25rem; font-weight: 600; margin: 0.5rem 0 0; word-break: break-word; }
.rp-check-now { font-size: 1.1rem; }

/* ── New Day screen: the list typed one row per task ───────────────────── */
.rp-setup-list { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; }
.rp-setup-row { margin-bottom: 0.6rem; }
.rp-setup-line { display: grid; grid-template-columns: minmax(0, 1fr) 4.6rem 2.8rem 48px; align-items: center; gap: 0.35rem; }
.rp-setup-cost { text-align: center; padding-left: 0.25rem; padding-right: 0.25rem; }
.rp-setup-gas { font-size: 1.3rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.rp-setup-remove { width: 48px; height: 48px; border: none; background: transparent; color: var(--twr-text-muted); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; padding: 0; }
.rp-setup-error { font-size: 0.95rem; margin: 0.15rem 0 0 0.25rem; }
.rp-setup-fromcal { font-size: 0.9rem; line-height: 1.1; color: var(--twr-text-muted); margin: 0.05rem 0 0 0.35rem; }   /* the small "from your calendar" cue under a calendar row: the row line above stays one line */
.rp-setup-rest { display: flex; justify-content: space-between; align-items: center; margin: 0 0 0.6rem; padding: 0.35rem 0.75rem; border-radius: 10px; background: rgba(21, 128, 61, 0.07); border-left: 5px solid var(--rp-green); color: var(--twr-text-muted); font-style: italic; }
.rp-setup-start-wrap { position: sticky; bottom: 0; z-index: 1020; padding: 0.6rem 0; background: var(--twr-bg); }
.rp-phone .rp-setup-start-wrap { bottom: calc(3.2rem + env(safe-area-inset-bottom)); }   /* sits right on the slim bottom bar (50 px) with no gap */
.rp-setup-hint { font-size: 0.95rem; text-align: center; color: var(--rp-muted); margin-bottom: 0.4rem; }
.rp-score-link { color: var(--rp-brand); font-weight: 600; min-height: 48px; }

.rp-setup-moves { display: flex; justify-content: flex-end; gap: 0.35rem; margin: 0.1rem 0 0; }
.rp-setup-move { width: 48px; height: 48px; border: 1px solid var(--bs-border-color, #ccc); border-radius: 10px; background: transparent; color: var(--twr-text); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; padding: 0; }
.rp-setup-move:disabled { opacity: 0.35; }
.rp-setup-resttitle { display: flex; align-items: center; min-height: 48px; }
.rp-setup-costcell { display: flex; align-items: center; gap: 0.15rem; }
.rp-setup-plus, .rp-setup-cost-rest { color: var(--rp-green); font-weight: 800; }
.rp-setup-plus { font-size: 1.2rem; }
.rp-setup-restup { min-height: 48px; margin: 0 0.5rem; font-style: normal; white-space: nowrap; }
.rp-setup-rest { gap: 0.25rem; }
.rp-act-icon { padding: 0; width: 48px; justify-content: center; }

/* ── New Day row grid areas (the compact one-line layout further down sets the columns; at 320 px the name still gets about 150 px) ── */
.rp-setup-line > .rp-setup-title, .rp-setup-line > .rp-setup-resttitle { grid-area: t; }
.rp-setup-line > .rp-setup-cost, .rp-setup-line > .rp-setup-costcell { grid-area: c; }
.rp-setup-line > .rp-setup-gas { grid-area: g; }
.rp-setup-line > .rp-setup-remove { grid-area: x; }
.rp-setup-line { grid-template-areas: "t c g x"; grid-template-columns: minmax(0, 1fr) 4.6rem minmax(3.6rem, auto) 48px; }
.rp-setup-gas { white-space: nowrap; min-width: 3.6rem; }
.rp-row-top { grid-template-columns: 48px 1fr auto minmax(3.6rem, auto); }
.rp-after { white-space: nowrap; min-width: 3.6rem; }

/* ── The focused box is never covered by the bars, and the bars step aside while typing ── */
html { scroll-padding-bottom: 13rem; }
.rp-setup-row, .rp-setup-row input, .rp-card input, .rp-card textarea { scroll-margin-bottom: 13rem; }
.rp-typing .rp-bottom-nav, .rp-typing .rp-fab-wrap { display: none !important; }
.rp-typing .rp-phone .rp-setup-start-wrap { bottom: 0; }   /* the nav is hidden: the sticky Start bar stays and drops to the bottom edge, riding above the keyboard */

/* The close buttons keep their look but get a 48 px touch area. */
.btn-close { position: relative; }
.btn-close::after { content: ""; position: absolute; inset: -16px; }

/* ══ Compact layout (Tim, production phone use): the whole day fits one screen ═══════════════════════════════════
   A slim top bar, a one-line date switcher, a one-row gas card, ONE line per task (tick, Tomorrow and Notes glyphs, the
   title on a single line, its cost and the gas left), a round Add button, a slim bottom bar. Later rules win over the
   roomier ones above. Tap areas stay 36 px or more. */
.rp-topbar { padding: 0.2rem 0.6rem; gap: 0.4rem; }
.rp-topbar-icon { width: 24px; height: 24px; }
.rp-brand { font-size: 1.1rem; }
.rp-day { padding: 0.35rem 0.5rem 0.75rem; }
.rp-day.rp-phone { padding-bottom: calc(7.5rem + env(safe-area-inset-bottom)); }   /* clears the round + button (it reaches ~110 px up) so the last row's gas number is never under it */
.rp-card { padding: 0.5rem 0.65rem; margin-bottom: 0.4rem; border-radius: 10px; }

/* date switcher: one slim line */
.rp-datebar { gap: 0.25rem; margin-bottom: 0.35rem; }
.rp-nav-btn { width: 36px; height: 36px; flex: 0 0 36px; font-size: 1rem; }
.rp-datelabel { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.1rem 0.45rem; }
.rp-date-main { font-size: 0.98rem; margin: 0; font-weight: 700; line-height: 1.2; }
.rp-today-btn { min-height: 36px; min-width: 0; margin: 0; padding: 0 0.7rem; font-size: 0.9rem; }

/* the gas card: one row */
.rp-tank { display: flex; align-items: center; gap: 0.6rem; text-align: left; padding: 0.3rem 0.65rem; }
.rp-tank-number { flex: 0 0 auto; min-width: 3.3rem; font-size: 2.3rem; line-height: 1; }
.rp-tank-info { flex: 1 1 auto; min-width: 0; }
.rp-tank-label { font-size: 0.8rem; line-height: 1.2; }
.rp-tank-sub { font-size: 0.8rem; line-height: 1.2; }
.rp-tank-proj { font-size: 0.9rem; }
.rp-score-link { flex: 0 1 6.2rem; min-height: 36px; padding: 0 0.2rem; font-size: 0.78rem; line-height: 1.15; text-align: right; }
.rp-outofgas { margin-bottom: 0.4rem; padding: 0.35rem 0.6rem; font-size: 1rem; }

/* one line per task */
.rp-list { margin: 0 0 0.4rem; border-radius: 10px; }
.rp-row { padding: 0 0.3rem; }
.rp-row-top { grid-template-columns: 36px 36px 36px minmax(0, 1fr) auto minmax(2.7rem, auto); gap: 0 3px; min-height: 42px; align-items: center; }
.rp-tick { width: 36px; height: 36px; font-size: 1.45rem; }
.rp-glyph { width: 36px; height: 36px; border: none; background: transparent; color: var(--rp-brand); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; }
.rp-glyph:disabled { opacity: 0.45; }
.rp-glyph-gap { width: 36px; height: 36px; }
.rp-title { min-height: 36px; padding: 0 0.15rem; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; display: block; line-height: 36px; }
.rp-title-static { display: block; line-height: 36px; font-size: 0.9rem; }
.rp-rest-tag { font-size: 0.65rem; padding: 0 0.3rem; margin-right: 0.3rem; line-height: 1.2; }
.rp-cost { font-size: 0.9rem; }
.rp-after { font-size: 1.05rem; min-width: 2.7rem; white-space: nowrap; }
.rp-why { margin: 0 0 0.35rem; font-size: 0.9rem; }

/* Day notes: one slim row that opens on tap */
.rp-notes-card { padding: 0.15rem 0.5rem; }
.rp-notes-toggle { display: flex; align-items: center; gap: 0.45rem; width: 100%; min-height: 40px; border: none; background: transparent; color: var(--twr-text); font-size: 0.95rem; text-align: left; padding: 0; }
.rp-notes-toggle i:first-child { color: var(--rp-brand); font-size: 1.15rem; }
.rp-notes-label { font-weight: 600; }
.rp-notes-peek { color: var(--twr-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }

/* the Add button: a round + above the bottom bar, bottom right */
.rp-fab-wrap { justify-content: flex-end; padding-right: 0.75rem; bottom: calc(3.6rem + env(safe-area-inset-bottom)); }
.rp-fab { width: 52px; height: 52px; min-height: 52px; padding: 0; border-radius: 50%; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; }

/* the bottom bar, slimmer */
.rp-bottom-nav { padding-top: 0; padding-bottom: env(safe-area-inset-bottom); }
.rp-bottom-nav-link { min-height: 50px; padding: 0.15rem 0.4rem; font-size: 0.78rem; gap: 0; }
.rp-bottom-nav-link i { font-size: 1.3rem; }
.rp-bottom-nav .container-fluid { padding: 0; }

/* New Day: one line per row [name][cost][gas][more]; Move up / Move down / Remove open from the one "more" button */
.rp-start-label { font-size: 1rem; margin-bottom: 0.35rem; }
.rp-score-input { font-size: 1.6rem; min-height: 48px; }
.rp-start .rp-big-btn, .rp-setup-start-wrap .rp-big-btn { min-height: 40px; padding: 0.25rem 0.8rem; font-size: 0.95rem; }
.rp-setup-start-wrap .rp-big-btn { min-height: 44px; font-size: 1.05rem; }
.rp-setup-start-wrap { padding: 0.3rem 0; }
.rp-setup-list { margin: 0.3rem 0 0.4rem; }
.rp-setup-row { margin-bottom: 0.25rem; }
.rp-setup-line > .rp-setup-more { grid-area: m; }
.rp-setup-line { grid-template-areas: "t c g m"; grid-template-columns: minmax(0, 1fr) 3.9rem minmax(2.6rem, auto) 36px; gap: 0.25rem; }
.rp-setup-line .rp-input { min-height: 40px; font-size: 1rem; padding: 0.2rem 0.5rem; }
.rp-setup-cost { padding-left: 0.2rem; padding-right: 0.2rem; }
.rp-setup-gas { font-size: 1.1rem; min-width: 2.6rem; }
.rp-setup-more { width: 36px; height: 36px; border: none; background: transparent; color: var(--twr-text-muted); font-size: 1.3rem; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; }
.rp-setup-moves { display: none; }
.rp-setup-moves.rp-open { display: flex; justify-content: flex-end; gap: 8px; margin: 0.1rem 0 0.2rem; }
.rp-setup-move, .rp-setup-moves .rp-setup-remove { width: 40px; height: 40px; border: 1px solid var(--bs-border-color, #ccc); border-radius: 8px; background: transparent; color: var(--twr-text); display: flex; align-items: center; justify-content: center; padding: 0; }
.rp-setup-rest { padding: 0.15rem 0.5rem; margin-bottom: 0.25rem; font-size: 0.9rem; }
.rp-setup-restup { min-height: 36px; padding: 0 0.6rem; margin: 0 0.3rem; font-size: 0.85rem; }
/* the phone app has no Notes glyph: the title takes its place */
.rp-nonotes .rp-row-top { grid-template-columns: 36px 36px minmax(0, 1fr) auto minmax(2.7rem, auto); }
.rp-nonotes .rp-row-top { min-height: 45px; }
.rp-nonotes .rp-title { font-size: 1.05rem; }
.rp-nonotes .rp-after { font-size: 1.15rem; }
.rp-nonotes .rp-cost { font-size: 0.95rem; }
/* New Day: the score block takes less room so more of the list shows */
.rp-start-label { font-size: 0.9rem; margin-bottom: 0.25rem; line-height: 1.25; }
.rp-score-input { font-size: 1.4rem; min-height: 44px; }
.rp-start .mt-3 { margin-top: 0.5rem !important; }
.rp-start .mb-3 { margin-bottom: 0.5rem !important; }
.rp-start .rp-tank-sub { margin: 0.1rem 0 0; }
/* Short phones (about 740 px tall): rows are a little slimmer so a normal day (about 12 tasks) ends above the round Add button */
@media (max-height: 760px) {
    .rp-nonotes .rp-row-top { min-height: 40px; }
    .rp-nonotes .rp-tick, .rp-nonotes .rp-glyph { height: 34px; }
}

/* ══ Touch areas of 44 px or more without growing the rows ══════════════════════════════════════════════════════
   The tick, the Tomorrow and Notes glyphs, the date arrows, the Today button and the New Day "more" button keep their slim
   look; an invisible ::after reaches 4 px past each edge (36 + 8 = 44 px). The gaps between neighbours are 8 px, so two
   touch areas meet but never overlap, and the one-line rows keep their height (a normal day of about 12 tasks still fits a 375 x 812 phone). */
.rp-tick, .rp-glyph, .rp-nav-btn, .rp-setup-more, .rp-today-btn { position: relative; }
.rp-tick::after, .rp-glyph::after, .rp-nav-btn::after, .rp-setup-more::after, .rp-today-btn::after { content: ""; position: absolute; inset: -4px; }
.rp-row-top { gap: 0 8px; }
.rp-datebar { gap: 8px; }
@media (max-height: 760px) {
    .rp-nonotes .rp-tick::after, .rp-nonotes .rp-glyph::after { inset: -3px -4px; }   /* the slimmer 34 px buttons reach 40 px: exactly the row pitch, so the areas of two rows meet and do not overlap */
}

/* Large text (a phone set to a big font) or a long title: the title wraps onto a second line instead of ending in "..." */
@media (max-width: 420px) {
    .rp-title { white-space: normal; overflow: hidden; text-overflow: clip; height: auto; line-height: 1.25; min-height: 36px; max-height: 2.9em; padding-top: 0.2rem; padding-bottom: 0.2rem; }
}

/* The "put RedPen on your home screen" help is for the browser; inside the installed app it is hidden */
@media (display-mode: standalone) {
    .rp-install-help { display: none; }
}
