/* Contractor tablet portal (/wykonawca, ContractorLayout). Primary target: tablet landscape 1180×820, also
   tablet portrait and phones. Touch targets ≥ 52 px. Tokens come from app.css (:root --tm-*); everything here
   is prefixed cp- so nothing leaks into the office app. */

.cp-root {
    --cp-paper: #F7F4EC;
    --cp-paper-2: #FAF7F0;
    --cp-card: #FFFDF8;
    --cp-ink: #1F2A1C;
    --cp-ink-soft: #4A5645;
    --cp-muted: #5F665C;
    --cp-rule: #DBD5C5;
    --cp-forest: #2D4A2B;
    --cp-forest-deep: #1F3520;
    --cp-sage: #ABBFA0;
    --cp-ochre: #B85842;  --cp-ochre-bg: #F4DDD3;  --cp-ochre-ink: #8E3F2D;
    --cp-mustard: #C89A3F; --cp-mustard-bg: #F4E8CB; --cp-mustard-ink: #7A5A17;
    --cp-olive: #7A8F5A;  --cp-olive-bg: #E5EAD3;  --cp-olive-ink: #4E5E35;
    --cp-radius: 14px;

    min-height: 100vh;
    min-height: 100dvh;
    background: var(--cp-paper);
    color: var(--cp-ink);
    font-family: var(--tm-sans);
    font-size: 17px;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

.cp-root *, .cp-root *::before, .cp-root *::after { box-sizing: border-box; }

.cp-label { font-family: var(--tm-mono); font-weight: 600; letter-spacing: 0.02em; }
.cp-latin { font-family: var(--tm-serif); font-style: italic; font-weight: 400; }
.cp-muted { color: var(--cp-muted); }
.cp-small { font-size: 14px; }

/* ---------- Buttons & inputs ---------- */

.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    font: 600 17px/1.1 var(--tm-sans);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s, border-color .15s, transform .05s;
}
.cp-btn:active:not(:disabled) { transform: translateY(1px); }
.cp-btn:focus-visible, .cp-chip:focus-visible, .cp-health-btn:focus-visible, .cp-item:focus-visible,
.cp-tabs button:focus-visible, .cp-viewswitch button:focus-visible, .cp-input:focus-visible, .cp-textarea:focus-visible {
    outline: 3px solid #078BCA;
    outline-offset: 2px;
}
.cp-btn:disabled { opacity: .45; cursor: not-allowed; }
.cp-btn-primary { background: var(--cp-forest); color: #FAF7F0; }
.cp-btn-primary:hover:not(:disabled) { background: var(--cp-forest-deep); }
.cp-btn-ghost { background: transparent; color: var(--cp-ink); border-color: var(--cp-rule); }
.cp-btn-ghost:hover:not(:disabled) { background: rgba(31, 42, 28, 0.05); border-color: var(--cp-ink-soft); }
.cp-btn-paper { background: var(--cp-card); color: var(--cp-ink); border-color: var(--cp-rule); box-shadow: 0 2px 8px rgba(31, 42, 28, .15); }
.cp-btn-danger { background: transparent; color: var(--cp-ochre-ink); border-color: #D9A898; }
.cp-btn-danger:hover:not(:disabled) { background: var(--cp-ochre-bg); }
.cp-btn-xl { min-height: 64px; font-size: 19px; }
.cp-btn-xxl { min-height: 72px; font-size: 20px; padding: 0 28px; }
.cp-btn-block { width: 100%; }

.cp-icon-btn {
    width: 52px; height: 52px; flex: none;
    border: none; background: transparent; border-radius: 12px;
    color: var(--cp-ink-soft); font-size: 20px; cursor: pointer;
}
.cp-icon-btn:hover { background: rgba(31, 42, 28, 0.06); }

.cp-form { display: flex; flex-direction: column; }
.cp-label, .cp-root label.cp-label { display: block; }
.cp-root label.cp-label {
    font: 600 15px var(--tm-sans);
    letter-spacing: 0;
    color: var(--cp-ink-soft);
    margin: 14px 0 6px;
}
.cp-root label.cp-label-gap { margin-top: 22px; }
.cp-input, .cp-textarea {
    width: 100%;
    min-height: 60px;
    padding: 0 18px;
    border: 1.5px solid var(--cp-rule);
    border-radius: 12px;
    background: var(--cp-card);
    color: var(--cp-ink);
    font: 400 20px var(--tm-sans);
}
.cp-input::placeholder, .cp-textarea::placeholder { color: #8B928A; }
.cp-input:focus, .cp-textarea:focus { border-color: var(--cp-forest); outline: none; box-shadow: 0 0 0 3px rgba(45, 74, 43, .15); }
.cp-input-mono { font-family: var(--tm-mono); letter-spacing: 0.04em; }
.cp-textarea { padding: 14px 18px; min-height: 140px; resize: vertical; font-size: 18px; line-height: 1.45; }
.cp-input-wrap { position: relative; }
.cp-input-wrap .cp-input { padding-right: 96px; }
.cp-input-action {
    position: absolute; right: 4px; top: 4px; bottom: 4px;
    min-width: 84px; border: none; border-radius: 9px;
    background: transparent; color: var(--cp-forest); font: 600 15px var(--tm-sans); cursor: pointer;
}
.cp-input-action:hover { background: rgba(45, 74, 43, .08); }
.cp-check {
    display: flex; align-items: center; gap: 12px;
    min-height: 52px; margin: 10px 0 14px;
    font-size: 16px; color: var(--cp-ink-soft); cursor: pointer;
}
.cp-check input { width: 26px; height: 26px; accent-color: var(--cp-forest); flex: none; }

/* ---------- Notices ---------- */

.cp-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 14px 18px; margin-bottom: 18px;
    border-radius: 12px; border: 1px solid var(--cp-rule);
    background: var(--cp-card); color: var(--cp-ink); font-size: 16px;
}
.cp-banner-warn { background: var(--cp-mustard-bg); border-color: #E2CB94; color: #4D3A10; }
.cp-banner-error { background: var(--cp-ochre-bg); border-color: #E0B3A3; color: #6E2F20; }
.cp-banner-btn { min-height: 44px; margin-left: auto; }
.cp-note { margin: 10px 0; color: var(--cp-muted); font-size: 15px; }
.cp-note-small { font-size: 14px; margin: 4px 0 10px; }
.cp-note-ok { color: var(--cp-olive-ink); }
.cp-loading, .cp-empty { padding: 28px 8px; color: var(--cp-muted); font-size: 16px; text-align: center; }

/* ---------- Sign-in ---------- */

.cp-login {
    display: grid;
    grid-template-columns: minmax(300px, 38%) 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}
.cp-login-brand {
    background: var(--cp-forest-deep);
    background-image: radial-gradient(circle at 20% 110%, rgba(171, 191, 160, 0.18), transparent 55%);
    color: #F3EFE3;
    padding: 44px 40px;
    display: flex; flex-direction: column;
}
.cp-login-logo { display: flex; align-items: center; gap: 12px; font: 600 20px var(--tm-sans); }
.cp-login-logo .cp-mark { color: var(--cp-forest-deep); background: #F3EFE3; }
.cp-login-eyebrow {
    margin-top: auto; padding-top: 40px;
    font: 500 13px var(--tm-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cp-sage);
}
.cp-login-title {
    margin: 14px 0 18px;
    font: 400 44px/1.1 var(--tm-serif);
    letter-spacing: -0.01em;
    color: #FAF7F0;
}
.cp-login-lead { margin: 0 0 24px; max-width: 34ch; font-size: 17px; color: #D5DCCB; line-height: 1.5; }

.cp-login-main { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; }
.cp-login-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 28px;
    align-items: start;
}
.cp-login-option { min-width: 0; }
.cp-login-h2 { margin: 0 0 4px; font: 500 26px/1.2 var(--tm-serif); color: var(--cp-ink); }
.cp-login-option > .cp-muted { margin: 0 0 14px; font-size: 15px; }
.cp-login-or {
    align-self: stretch;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: var(--cp-muted); font: 600 13px var(--tm-mono); letter-spacing: 0.12em;
}
.cp-login-or::before, .cp-login-or::after { content: ''; flex: 1; width: 1px; background: var(--cp-rule); }

.cp-qr-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    margin-bottom: 14px;
    border-radius: var(--cp-radius);
    overflow: hidden;
    background: #E8E4D4;
    border: 1.5px dashed #C9C1AC;
}
.cp-qr-live { background: #111; border-style: solid; border-color: var(--cp-forest); }
.cp-qr-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cp-qr-frame:not(.cp-qr-live) .cp-qr-video { visibility: hidden; }
.cp-qr-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #9C9483; }
.cp-qr-aim {
    position: absolute; inset: 18%;
    border: 3px solid rgba(250, 247, 240, .9);
    border-radius: 16px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .25);
}

/* ---------- Signed-in header ---------- */

.cp-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.cp-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    height: 76px; padding: 0 20px;
    background: var(--cp-paper-2);
    border-bottom: 1px solid var(--cp-rule);
}
.cp-mark {
    width: 44px; height: 44px; flex: none;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--cp-forest); color: #F3EFE3;
}
.cp-header-order { min-width: 0; flex: 1; }
.cp-header-type {
    font: 500 22px/1.15 var(--tm-serif);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-header-meta {
    font: 400 13px/1.3 var(--tm-mono); color: var(--cp-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-pill {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 0 14px;
    border-radius: 999px;
    background: var(--cp-olive-bg); color: var(--cp-olive-ink);
    font: 600 15px var(--tm-sans); white-space: nowrap;
}
.cp-header-logout { flex: none; }

/* ---------- Trees: list + map ---------- */

.cp-trees {
    flex: 1;
    display: grid;
    grid-template-columns: 560px 1fr;
    min-height: 0;
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
}
.cp-list-col {
    overflow-y: auto;
    padding: 20px 20px 32px;
    border-right: 1px solid var(--cp-rule);
    background: var(--cp-paper);
}
.cp-progress { margin-bottom: 16px; }
.cp-progress-text { font-size: 18px; margin-bottom: 8px; color: var(--cp-ink-soft); }
.cp-progress-text strong { font: 600 26px var(--tm-serif); color: var(--cp-ink); }
.cp-progress-bar { height: 10px; border-radius: 99px; background: #E6E0CF; overflow: hidden; }
.cp-progress-bar span { display: block; height: 100%; background: var(--cp-olive); border-radius: 99px; transition: width .3s; }

.cp-tabs, .cp-viewswitch {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 4px; gap: 4px; margin-bottom: 12px;
    background: #ECE7D8; border-radius: 14px;
}
.cp-tabs button, .cp-viewswitch button {
    min-height: 52px; border: none; border-radius: 11px;
    background: transparent; color: var(--cp-ink-soft);
    font: 600 16px var(--tm-sans); cursor: pointer; white-space: nowrap;
}
.cp-tabs button.cp-active, .cp-viewswitch button.cp-active {
    background: var(--cp-card); color: var(--cp-ink);
    box-shadow: 0 1px 3px rgba(31, 42, 28, .18);
}
/* Side by side on a landscape tablet: the list/map switch only exists on narrower screens (media query below). */
.cp-viewswitch { display: none; }

.cp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cp-item {
    display: flex; align-items: center; gap: 14px;
    min-height: 84px; padding: 12px 14px 12px 16px;
    border: 1px solid var(--cp-rule); border-radius: var(--cp-radius);
    background: var(--cp-card); color: inherit; text-decoration: none;
}
.cp-item:hover { border-color: var(--cp-ink-soft); }
.cp-item-selected { border-color: var(--cp-ochre); box-shadow: 0 0 0 2px var(--cp-ochre-bg); }
.cp-item-done { background: #F3F0E6; }
.cp-item-done .cp-item-main { opacity: .75; }
.cp-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cp-item-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cp-item-title .cp-label { font-size: 17px; flex: none; }
.cp-item-title .cp-latin { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-item-sub { font-size: 15px; color: var(--cp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-item-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.cp-dist { font: 600 20px var(--tm-mono); color: var(--cp-ink); }
.cp-dir { font-size: 13px; color: var(--cp-muted); }

.cp-dot { display: inline-block; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(31, 42, 28, .2); }
.cp-dot-good { background: var(--cp-olive); }
.cp-dot-observe { background: var(--cp-mustard); }
.cp-dot-bad { background: var(--cp-ochre); }
.cp-dot-none { background: #B5B5AA; }

.cp-badge {
    display: inline-flex; align-items: center;
    min-height: 28px; padding: 2px 10px;
    border-radius: 999px; font: 600 13px var(--tm-sans); white-space: nowrap;
}
.cp-badge-pending { background: var(--cp-mustard-bg); color: var(--cp-mustard-ink); }
.cp-badge-approved { background: var(--cp-olive-bg); color: var(--cp-olive-ink); }
.cp-badge-rejected { background: var(--cp-ochre-bg); color: var(--cp-ochre-ink); }

.cp-map-col { position: relative; min-height: 0; background: #E8E4D4; }
.cp-map { position: absolute; inset: 0; }
.cp-map-me { position: absolute; left: 16px; top: 16px; z-index: 2; }
.cp-map-card {
    position: absolute; left: 16px; right: 16px; bottom: 24px; z-index: 2;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 8px 12px 18px;
    border-radius: var(--cp-radius);
    background: var(--cp-card); border: 1px solid var(--cp-rule);
    box-shadow: 0 6px 24px rgba(31, 42, 28, .22);
}
.cp-map-card-text { flex: 1; min-width: 0; }
.cp-map-card-text .cp-latin { font-size: 18px; }

/* ---------- Tree card ---------- */

.cp-card-page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 24px 40px; }
.cp-back {
    display: inline-flex; align-items: center;
    min-height: 52px; padding: 0 6px; margin-left: -6px;
    color: var(--cp-forest); font: 600 17px var(--tm-sans); text-decoration: none;
}
.cp-back:hover { text-decoration: underline; }
.cp-card-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; margin-top: 8px; }
.cp-card-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-card-label .cp-label { font-size: 18px; }
.cp-card-latin { margin: 6px 0 2px; font: italic 400 40px/1.1 var(--tm-serif); color: var(--cp-ink); }
.cp-card-polish { font-size: 19px; color: var(--cp-ink-soft); }
.cp-card-where { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: 16px; color: var(--cp-muted); }
.cp-card-dist { font-family: var(--tm-mono); color: var(--cp-ink); font-weight: 600; }

.cp-task {
    margin: 22px 0;
    padding: 16px 18px;
    border-radius: var(--cp-radius);
    background: var(--cp-ochre-bg);
    border-left: 5px solid var(--cp-ochre);
}
.cp-task-title { font: 600 13px var(--tm-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cp-ochre-ink); margin-bottom: 6px; }
.cp-task-text { font-size: 18px; color: #3A1E15; white-space: pre-line; }

.cp-panel { border: 1px solid var(--cp-rule); border-radius: var(--cp-radius); background: var(--cp-card); padding: 16px 18px; }
.cp-panel-title { display: flex; align-items: center; justify-content: space-between; font: 600 15px var(--tm-sans); color: var(--cp-ink-soft); margin-bottom: 8px; }
.cp-lock { color: var(--cp-muted); flex: none; }
.cp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0; }
.cp-facts dt { font-size: 14px; color: var(--cp-muted); }
.cp-facts dd { margin: 2px 0 0; font: 600 20px var(--tm-mono); display: flex; align-items: center; gap: 8px; }
.cp-facts dd .cp-dot { width: 14px; height: 14px; }

.cp-h2 { margin: 26px 0 12px; font: 500 22px var(--tm-serif); color: var(--cp-ink); }
.cp-card-right > .cp-h2:first-child, .cp-form-left > .cp-h2:first-child, .cp-form-right > .cp-h2:first-child { margin-top: 4px; }
.cp-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cp-hist { border: 1px solid var(--cp-rule); border-radius: var(--cp-radius); padding: 14px 16px; background: var(--cp-card); }
.cp-hist-office { background: #F3F0E6; }
.cp-hist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 4px; }
.cp-hist-date { font: 600 15px var(--tm-mono); white-space: nowrap; }
.cp-hist-body { font-size: 16px; color: var(--cp-ink-soft); }
.cp-hist-who { font-weight: 600; color: var(--cp-ink); }
.cp-hist-works { margin-top: 4px; color: var(--cp-ink); }
.cp-hist-obs { margin-top: 4px; white-space: pre-line; }
.cp-hist-meta { margin-top: 4px; font-size: 14px; color: var(--cp-muted); }
.cp-review-note { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--cp-ochre-bg); color: #6E2F20; font-size: 15px; }
.cp-hist-actions { display: flex; gap: 10px; margin-top: 12px; }
.cp-hist-actions .cp-btn { flex: 1; }

/* ---------- Inspection form ---------- */

.cp-form-page { background: var(--cp-paper); }
.cp-form-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 18px;
    min-height: 76px; padding: 10px 20px;
    background: var(--cp-paper-2); border-bottom: 1px solid var(--cp-rule);
}
.cp-form-heading { min-width: 0; }
.cp-form-heading h1 { margin: 0; font: 500 24px/1.2 var(--tm-serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-form-heading h1 em { font-weight: 400; }
.cp-form-meta { font: 400 13px var(--tm-mono); color: var(--cp-muted); }
.cp-form-meta span { white-space: nowrap; }
.cp-form-grid {
    flex: 1;
    width: 100%; max-width: 1180px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 32px; padding: 20px 24px 24px;
}
.cp-health { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cp-health-wide { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cp-health-btn {
    display: flex; align-items: center; gap: 12px;
    min-height: 72px; padding: 8px 14px;
    border: 2px solid var(--cp-rule); border-radius: var(--cp-radius);
    background: var(--cp-card); color: var(--cp-ink); text-align: left; cursor: pointer;
}
.cp-health-btn .cp-dot { width: 22px; height: 22px; }
.cp-health-text { display: flex; flex-direction: column; line-height: 1.15; }
.cp-health-text strong { font-size: 19px; }
.cp-health-text small { font-size: 13px; color: var(--cp-muted); margin-top: 2px; }
.cp-health-good.cp-active { border-color: var(--cp-olive); background: var(--cp-olive-bg); }
.cp-health-observe.cp-active { border-color: var(--cp-mustard); background: var(--cp-mustard-bg); }
.cp-health-bad.cp-active { border-color: var(--cp-ochre); background: var(--cp-ochre-bg); }
.cp-health-btn.cp-active small { color: var(--cp-ink-soft); }

.cp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-chip {
    min-height: 52px; padding: 0 18px;
    border: 1.5px solid var(--cp-rule); border-radius: 999px;
    background: var(--cp-card); color: var(--cp-ink);
    font: 500 16px var(--tm-sans); cursor: pointer;
}
.cp-chip.cp-active { background: var(--cp-forest); border-color: var(--cp-forest); color: #FAF7F0; }
.cp-chip-check { margin-right: 6px; }

.cp-photos { display: grid; grid-template-columns: repeat(auto-fill, 120px); gap: 10px; }
.cp-photo-add, .cp-photo {
    position: relative;
    width: 120px; height: 120px;
    border-radius: 12px; overflow: hidden;
}
.cp-photo-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    border: 2px dashed var(--cp-forest);
    background: rgba(45, 74, 43, 0.05);
    color: var(--cp-forest); font: 600 15px var(--tm-sans);
    cursor: pointer;
}
.cp-photo-add:hover { background: rgba(45, 74, 43, 0.1); }
.cp-photo-add.cp-disabled { opacity: .45; pointer-events: none; }
.cp-photo { border: 1px solid var(--cp-rule); background: #E8E4D4; }
.cp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-photo-name { display: block; padding: 10px; font-size: 12px; word-break: break-all; color: var(--cp-ink-soft); }
.cp-photo-remove {
    position: absolute; top: 4px; right: 4px;
    width: 40px; height: 40px;
    border: none; border-radius: 50%;
    background: rgba(31, 42, 28, .75); color: #fff; font-size: 16px; cursor: pointer;
}
.cp-link-btn {
    display: inline-flex; align-items: center;
    min-height: 52px; margin-top: 4px;
    color: var(--cp-forest); font: 600 16px var(--tm-sans); text-decoration: underline; cursor: pointer;
}
.cp-info {
    margin-top: 16px; padding: 14px 16px;
    border-radius: var(--cp-radius);
    background: var(--cp-olive-bg); color: #2F3A22; font-size: 15px; line-height: 1.5;
}
.cp-form-footer {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
    padding: 12px 24px;
    background: var(--cp-paper-2); border-top: 1px solid var(--cp-rule);
}
.cp-footer-status { margin-right: auto; color: var(--cp-muted); font-size: 15px; }
.cp-footer-error { margin: 0 auto 0 0; padding: 10px 14px; }
.cp-form-footer .cp-btn-primary { min-width: 260px; }

/* MudBlazor dialogs (confirmations) inside the portal: touch-sized buttons. */
.cp-root .mud-dialog .mud-dialog-actions { gap: 8px; padding: 8px 16px 16px; }
.cp-root .mud-dialog .mud-dialog-actions .mud-button-root { min-height: 52px; padding: 0 18px; font-size: 16px; }

/* ---------- Tablet portrait & narrow ---------- */

@media (max-width: 1000px) {
    .cp-viewswitch { display: grid; margin: 10px 16px 0; }
    .cp-trees { display: flex; flex-direction: column; height: auto; }
    .cp-trees[data-view="list"] .cp-map-col { position: absolute; left: -10000px; width: 600px; height: 400px; }
    .cp-trees[data-view="map"] .cp-list-col { display: none; }
    .cp-trees[data-view="map"] .cp-map-col { flex: 1; min-height: 360px; margin-top: 10px; }
    .cp-list-col { border-right: none; padding: 14px 16px 32px; }
    .cp-login { grid-template-columns: 1fr; }
    .cp-login-brand { padding: 24px 24px 28px; }
    .cp-login-eyebrow { margin-top: 18px; padding-top: 0; }
    .cp-login-title { font-size: 34px; }
    .cp-login-lead { max-width: none; margin-bottom: 0; }
    .cp-login-main { justify-content: flex-start; padding: 24px; }
}

@media (max-width: 860px) {
    .cp-card-grid, .cp-form-grid { grid-template-columns: 1fr; gap: 20px; }
    .cp-login-options { grid-template-columns: 1fr; gap: 18px; }
    .cp-login-or { flex-direction: row; }
    .cp-login-or::before, .cp-login-or::after { width: auto; height: 1px; }
    .cp-qr-frame { aspect-ratio: 16 / 9; }
}

@media (max-width: 600px) {
    .cp-root { font-size: 16px; }
    .cp-header { gap: 10px; padding: 0 12px; height: auto; min-height: 76px; flex-wrap: wrap; }
    .cp-header .cp-mark { display: none; }
    .cp-header-type { font-size: 19px; }
    .cp-pill { order: 3; width: 100%; justify-content: center; min-height: 34px; margin-bottom: 8px; font-size: 14px; }
    .cp-header-logout { padding: 0 14px; }
    .cp-item { gap: 10px; padding: 10px 12px; }
    .cp-item-title { flex-direction: column; gap: 0; }
    .cp-dist { font-size: 17px; }
    .cp-tabs button { font-size: 14px; padding: 0 4px; }
    .cp-card-page { padding: 8px 16px 32px; }
    .cp-card-latin { font-size: 32px; }
    .cp-facts dd { font-size: 18px; }
    .cp-form-header { padding: 8px 12px; gap: 10px; }
    .cp-form-header .cp-btn { padding: 0 14px; }
    .cp-form-heading h1 { font-size: 19px; white-space: normal; }
    .cp-form-grid { padding: 16px; }
    .cp-health { grid-template-columns: 1fr; }
    .cp-photos { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .cp-photo-add, .cp-photo { width: 100%; height: auto; aspect-ratio: 1; }
    .cp-form-footer { padding: 10px 12px; flex-wrap: wrap; }
    .cp-form-footer .cp-btn-xl { flex: 1; min-height: 72px; }
    .cp-form-footer .cp-btn-primary { flex: 2; min-width: 0; padding: 0 12px; }
    .cp-footer-status, .cp-footer-error { width: 100%; margin: 0; }
    .cp-login-brand { padding: 20px 16px 22px; }
    .cp-login-title { font-size: 30px; margin: 8px 0 10px; }
    .cp-login-lead { font-size: 15px; }
    .cp-login-main { padding: 18px 16px 32px; }
    .cp-map-card { left: 8px; right: 8px; bottom: 12px; flex-wrap: wrap; }
}
