/*
 * Report a problem: the sheet and the "Report this" bar (public/js/jashchar-report.js; docs/architecture/support.md).
 * The theme's tokens only, so light and dark both read (docs/architecture/theme.md); the second value of each is the
 * driver page's own token (jashchar/driver/app), which sets both modes itself.
 * A phone: a sheet from the bottom, one column, 46 px buttons, above the app's bottom bar. A tablet or a computer: a
 * panel in the middle, 560 px at most.
 */
.jr-overlay, .jr-bar {
    --jr-surface: var(--j-surface, var(--d-card));
    --jr-soft: var(--j-surface-2, var(--d-soft));
    --jr-text: var(--j-text, var(--d-text));
    --jr-muted: var(--j-muted, var(--d-muted));
    --jr-border: var(--j-border, var(--d-line));
    --jr-btn: var(--j-btn, var(--d-brand));
    --jr-btn-text: var(--j-btn-text, var(--d-brand-ink));
    --jr-bad: var(--j-bad, var(--d-bad));
    --jr-bad-soft: var(--j-bad-soft, var(--d-bad-bg));
    --jr-ok: var(--j-ok, var(--d-ok));
    --jr-focus: var(--j-focus, var(--d-brand));
}
.jr-overlay[hidden], .jr-bar[hidden], .jr-overlay [hidden] { display: none !important; }
html.jr-open, html.jr-open body { overflow: hidden; }

.jr-overlay {
    position: fixed; inset: 0; z-index: 10050; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(15, 23, 42, .5); -webkit-tap-highlight-color: transparent;
}
.jr-panel {
    width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
    background: var(--jr-surface); color: var(--jr-text); border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, .25); font-size: 15px; line-height: 1.45;
}
html.jashchar-app .jr-panel { padding-bottom: env(safe-area-inset-bottom); }
.jr-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; }
.jr-head h2 { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--jr-text); }
.jr-x { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--jr-muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.jr-x:hover { background: var(--jr-soft); color: var(--jr-text); }
.jr-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 16px 8px; overscroll-behavior: contain; }
.jr-q { margin: 0 0 8px; font-weight: 700; color: var(--jr-text); }

.jr-kinds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 12px; }
.jr-kind {
    display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 14px; width: 100%;
    border: 2px solid var(--jr-border); border-radius: 12px; background: var(--jr-surface); color: var(--jr-text);
    font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.jr-kind i { width: 22px; text-align: center; font-size: 1.1rem; color: var(--jr-muted); }
@media (hover: hover) { .jr-kind:hover { border-color: var(--jr-btn); } }
/* The chosen one: the button colour's edge, a soft fill and a tick, so it reads without colour too. */
.jr-kind.is-on { border-color: var(--jr-btn); background: var(--jr-soft); box-shadow: inset 0 0 0 1px var(--jr-btn); position: relative; }
.jr-kind.is-on i { color: var(--jr-text); }
.jr-kind.is-on::after {
    content: "✓"; position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800;
    background: var(--jr-btn); color: var(--jr-btn-text);
}
.jr-kind:focus-visible, .jr-btn:focus-visible, .jr-x:focus-visible, .jr-overlay textarea:focus, .jr-overlay input:focus {
    outline: 3px solid var(--jr-focus); outline-offset: 1px;
}

.jr-help { border: 1px solid var(--jr-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--jr-soft); }
.jr-help-head { color: var(--jr-text); margin-bottom: 4px; }
.jr-help-title { font-weight: 700; color: var(--jr-text); margin-bottom: 4px; }
.jr-help-text { white-space: pre-line; color: var(--jr-text); font-size: .92rem; max-height: 220px; overflow-y: auto; margin-bottom: 10px; }

.jr-label { display: block; font-weight: 700; margin: 6px 0 4px; color: var(--jr-text); }
.jr-opt { font-weight: 400; color: var(--jr-muted); }
.jr-overlay textarea, .jr-overlay input[type="text"] {
    width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px;
    border: 1.5px solid var(--jr-border); background: var(--jr-surface); color: var(--jr-text); resize: vertical;
}
.jr-overlay textarea::placeholder, .jr-overlay input::placeholder { color: var(--jr-muted); opacity: 1; }
.jr-expected { margin-top: 4px; }

.jr-shot { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0 8px; }
.jr-shot-box {
    flex: 0 0 96px; width: 96px; height: 120px; border: 1px solid var(--jr-border); border-radius: 10px; overflow: hidden;
    background: var(--jr-soft); display: flex; align-items: center; justify-content: center; text-align: center;
}
.jr-shot-box img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.jr-shot-box.is-off img { opacity: .25; filter: grayscale(1); }
.jr-shot-wait { font-size: .78rem; color: var(--jr-muted); padding: 6px; }
.jr-shot-side { flex: 1; min-width: 0; }
.jr-shot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.jr-note { display: block; color: var(--jr-muted); font-size: .8rem; }

.jr-steps { margin: 8px 0 4px; border: 1px solid var(--jr-border); border-radius: 10px; padding: 0 12px; }
.jr-steps summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; color: var(--jr-text); }
.jr-steps textarea { margin-bottom: 10px; font-size: 14px; }
.jr-err { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--jr-bad-soft); color: var(--jr-bad); font-weight: 600; }

.jr-done { text-align: center; padding: 18px 8px 10px; }
.jr-done > i { font-size: 2.6rem; color: var(--jr-ok); }
.jr-done h3 { margin: 10px 0 6px; font-size: 1.2rem; font-weight: 700; color: var(--jr-text); }
.jr-done p { margin: 0; color: var(--jr-text); }

.jr-foot { display: flex; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--jr-border); }
.jr-foot .jr-btn { flex: 1 1 0; }
.jr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 8px 14px;
    border: 1.5px solid var(--jr-border); border-radius: 12px; background: var(--jr-surface); color: var(--jr-text);
    font: inherit; font-weight: 700; text-decoration: none !important; cursor: pointer; white-space: nowrap;
}
.jr-shot-actions .jr-btn { min-height: 40px; padding: 6px 12px; font-size: .9rem; font-weight: 600; }
.jr-btn:hover { border-color: var(--jr-btn); color: var(--jr-text); }
.jr-btn.jr-main { background: var(--jr-btn); border-color: var(--jr-btn); color: var(--jr-btn-text); }
.jr-btn.jr-main:hover { color: var(--jr-btn-text); filter: brightness(1.05); }
.jr-btn:disabled { opacity: .6; cursor: default; }

@media (min-width: 577px) {
    .jr-overlay { align-items: center; padding: 16px; }
    .jr-panel { max-width: 560px; border-radius: 18px; box-shadow: 0 16px 48px rgba(15, 23, 42, .3); }
    .jr-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .jr-kind { flex-direction: column; justify-content: center; text-align: center; gap: 6px; min-height: 86px; }
    .jr-foot { justify-content: flex-end; }
    .jr-foot .jr-btn { flex: 0 0 auto; min-width: 120px; }
}

/* The bar: 20 seconds, in the middle at the bottom; in the app above the bottom bar; on a phone's browser above JASH. */
.jr-bar {
    position: fixed; z-index: 10040; left: 50%; transform: translateX(-50%); bottom: 16px;
    width: min(520px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
    background: var(--jr-surface); color: var(--jr-text); border: 1.5px solid var(--jr-bad); border-radius: 14px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .25); font-size: 15px;
}
.jr-bar > i { color: var(--jr-bad); font-size: 1.15rem; }
.jr-bar > span { flex: 1; min-width: 0; font-weight: 600; }
.jr-bar-go {
    min-height: 42px; padding: 6px 14px; border-radius: 10px; border: 0; background: var(--jr-btn); color: var(--jr-btn-text);
    font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.jr-bar-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--jr-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
@media (max-width: 576px) { .jr-bar { bottom: 92px; } }
html.jashchar-app .jr-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
@media print { .jr-overlay, .jr-bar { display: none !important; } }

/* While the menu is open on a phone, the cards that float at the bottom (the "Get alerts on this phone" offer,
   public/js/jashchar-push.js, and this bar) stand aside: they covered the menu's last items, Report a problem among
   them, so a tap on it landed on the card (the owner, 2026-10-20, on Collect Fees). */
body.sidebar-open #jpush-bar, body.sidebar-open .jr-bar { display: none !important; }
