/* ───────────────────────── TENDMORY DEMO — APP CSS ───────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Libre+Franklin:wght@400;450;500;600;700&family=Space+Mono:wght@400;700&display=swap");

:root {
    --font-body: "Libre Franklin", system-ui, -apple-system, sans-serif;
    --font-mono: "Libre Franklin", system-ui, -apple-system, sans-serif;
    --font-display: "Libre Franklin", system-ui, -apple-system, sans-serif;
    --accent: #9a6e3a;
    --paper: #f4f2ec;
    --paper-2: #e9e7df;
    --card: #ffffff;
    --ink: #23261f;
    --muted: #5c5e52;
    --faint: #8c8a7c;
    --line: #e3dfd6;
    --brand: #33523f;
    --brand-2: #3e5f4a;
    --brand-deep: #1c2a21;
    --on-brand: #f1ebdc;
    --ok: #3e7c54;
    --warn: #b07a2e;
    --hold: #9a4438;
    --info: #2b5573;
    --radius: 14px;
    --shadow:
        0 1px 2px rgba(40, 35, 20, 0.05),
        0 18px 50px -24px rgba(40, 35, 20, 0.34);
    --shadow-sm:
        0 1px 2px rgba(40, 35, 20, 0.06),
        0 6px 18px -10px rgba(40, 35, 20, 0.28);
}
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    background: #f4f2ec;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.12;
}
p {
    margin: 0;
}
button {
    font-family: inherit;
    cursor: pointer;
}
.mono {
    font-family: var(--font-mono);
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--ink) 16%, transparent);
    border-radius: 10px;
    border: 3px solid var(--paper);
}

/* ───── APP LAYOUT ───── */
.app {
    display: grid;
    grid-template-columns: 248px 1fr;
    height: 100vh;
    width: 100vw;
}
.sidebar {
    background: var(--brand-deep);
    color: var(--on-brand);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    gap: 6px;
    overflow: hidden;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 16px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 21px;
    color: #fbf8f1;
    letter-spacing: -0.02em;
}
.brand .mark {
    width: 26px;
    height: 28px;
    flex: none;
    overflow: visible;
}
.brand .mark .leaf-a {
    fill: #c9a86a;
}
.brand .mark .leaf-b {
    fill: #e0cb9e;
}
.brand .mark .seed {
    fill: #c9a86a;
}

.switcher {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.switch-lbl {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(244, 239, 226, 0.4);
    padding: 0 8px 6px;
}
.switch {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(244, 239, 226, 0.72);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    width: 100%;
    transition: 0.16s;
}
.switch .ic {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: rgba(244, 239, 226, 0.08);
    flex: none;
    font-size: 14px;
}
.switch:hover {
    background: rgba(244, 239, 226, 0.06);
    color: #fbf8f1;
}
.switch.on {
    background: rgba(201, 168, 106, 0.14);
    border-color: rgba(201, 168, 106, 0.4);
    color: #fbf8f1;
}
.switch.on .ic {
    background: #c9a86a;
    color: var(--brand-deep);
}
.switch small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(244, 239, 226, 0.45);
    font-family: var(--font-body);
    letter-spacing: 0;
}
.switch .chev {
    margin-left: auto;
    color: rgba(244, 239, 226, 0.5);
    font-size: 12px;
    flex: none;
}
.org-menu {
    margin-top: 6px;
    background: rgba(244, 239, 226, 0.06);
    border: 1px solid rgba(244, 239, 226, 0.12);
    border-radius: 10px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.org-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: rgba(244, 239, 226, 0.78);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.org-opt:hover {
    background: rgba(244, 239, 226, 0.08);
    color: #fbf8f1;
}
.org-opt.on {
    color: #fbf8f1;
}
.org-opt .od {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex: none;
}
.org-opt small {
    display: block;
    font-size: 10.5px;
    font-weight: 400;
    color: rgba(244, 239, 226, 0.45);
}
.org-opt .chk {
    margin-left: auto;
    color: #c9a86a;
    font-size: 13px;
}
.org-add {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    margin-top: 2px;
    color: rgba(244, 239, 226, 0.6);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}
.org-add:hover {
    color: #fbf8f1;
}

.nav-sec {
    margin-top: 6px;
    border-top: 1px solid rgba(244, 239, 226, 0.1);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 11px;
    border-radius: 8px;
    color: rgba(244, 239, 226, 0.66);
    font-size: 13.5px;
    font-weight: 500;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    transition: 0.14s;
}
.nav-item:hover {
    background: rgba(244, 239, 226, 0.06);
    color: #fbf8f1;
}
.nav-item.on {
    background: rgba(244, 239, 226, 0.1);
    color: #fbf8f1;
}
.nav-item .ni {
    width: 16px;
    text-align: center;
    opacity: 0.8;
}
.nav-item .badge {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    background: #c9a86a;
    color: var(--brand-deep);
    border-radius: 999px;
    padding: 1px 7px;
    font-weight: 700;
}
.nav-burger {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper);
    color: var(--ink);
    font-size: 17px;
    cursor: pointer;
    flex: none;
    align-items: center;
    justify-content: center;
}
.ic-svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.14em;
    display: inline-block;
    flex: none;
}
.ni-svg {
    width: 18px;
    height: 18px;
    display: block;
    flex: none;
}
.nav-item .ni .ni-svg {
    width: 17px;
    height: 17px;
}
.switch .ic .ni-svg {
    width: 18px;
    height: 18px;
}
.nav-backdrop {
    display: none;
}

.side-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(244, 239, 226, 0.1);
}
.sync-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 9px;
    background: rgba(62, 124, 84, 0.16);
    border: 1px solid rgba(62, 124, 84, 0.34);
    font-size: 12px;
    color: #cfe5d5;
}
.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6fd08c;
    box-shadow: 0 0 0 0 rgba(111, 208, 140, 0.6);
    animation: pulse 2.2s infinite;
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(111, 208, 140, 0.5);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(111, 208, 140, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(111, 208, 140, 0);
    }
}
.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 6px 2px;
}
.user-row .av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: repeating-linear-gradient(
        135deg,
        #4a6b54 0 5px,
        #3b5a47 5px 10px
    );
    flex: none;
    border: 1px solid rgba(244, 239, 226, 0.2);
}
.user-row .nm {
    font-size: 12.5px;
    color: #fbf8f1;
    font-weight: 600;
}
.user-row .rl {
    font-size: 11px;
    color: rgba(244, 239, 226, 0.5);
}

/* ───── MAIN ───── */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}
.topbar {
    height: 62px;
    flex: none;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}
.topbar .crumb {
    font-size: 13px;
    color: var(--faint);
}
.topbar .crumb b {
    color: var(--ink);
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 17px;
}
.search {
    margin-left: 8px;
    flex: 1;
    max-width: 420px;
    position: relative;
}
.search input {
    width: 100%;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 12px 10px 34px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    letter-spacing: 0;
    text-overflow: ellipsis;
}
.search input::placeholder {
    color: var(--muted);
    opacity: 1;
}
.search input:focus {
    outline: none;
    border-color: var(--brand);
}
.search .si {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faint);
}
.topbar .right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}
.tb-btn:hover {
    border-color: var(--ink);
}
.tb-btn.primary {
    background: var(--brand);
    color: var(--on-brand);
    border-color: var(--brand);
}
.tb-btn.primary:hover {
    background: var(--brand-deep);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 26px 28px 60px;
    position: relative;
}
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.page-head h1 {
    font-size: 27px;
}
.page-head .sub {
    color: var(--muted);
    font-size: 14px;
    margin-top: 5px;
}
.eyebrow {
    font-family: var(--font-body);
    font-size: 11.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-weight: 700;
}

/* ───── AI INSIGHTS ───── */
.ai-band {
    background: linear-gradient(
        120deg,
        color-mix(in oklab, var(--brand) 9%, var(--card)),
        var(--card)
    );
    border: 1px solid color-mix(in oklab, var(--brand) 22%, var(--line));
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.ai-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.ai-spark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #f1ebdc;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 15px;
}
.ai-head b {
    font-size: 15px;
    font-family: var(--font-display);
    font-weight: 600;
}
.ai-head .tag {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
    background: color-mix(in oklab, var(--brand) 12%, var(--paper));
    border: 1px solid color-mix(in oklab, var(--brand) 26%, transparent);
    padding: 3px 8px;
    border-radius: 999px;
}
.ai-head .upd {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--faint);
}
.ai-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 900px) {
    .ai-grid {
        grid-template-columns: 1fr;
    }
}
.ai-card {
    display: flex;
    gap: 11px;
    padding: 13px 14px;
    border-radius: 11px;
    background: var(--paper);
    border: 1px solid var(--line);
}
.ai-card .ai-ic {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 13px;
}
.ai-card .ai-t {
    font-size: 13.5px;
    line-height: 1.45;
}
.ai-card .ai-t b {
    font-weight: 700;
}
.ai-card .ai-act {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--accent);
    margin-top: 6px;
    cursor: pointer;
    display: inline-block;
}
.ai-card .ai-act:hover {
    text-decoration: underline;
}

/* ───── EDIT RECORD FORM ───── */
.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}
.edit-grid .full {
    grid-column: 1/3;
}
.edit-pencil {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    background: color-mix(in oklab, var(--brand) 8%, var(--paper));
    border: 1px solid color-mix(in oklab, var(--brand) 24%, var(--line));
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
}
.edit-pencil:hover {
    background: color-mix(in oklab, var(--brand) 14%, var(--paper));
}

/* ───── MODERATION QUEUE ───── */
.mod-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(
        120deg,
        color-mix(in oklab, var(--info) 10%, var(--card)),
        var(--card)
    );
    border: 1px solid color-mix(in oklab, var(--info) 24%, var(--line));
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
}
.mod-intro .mi {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--info);
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 19px;
}
.mod-intro h3 {
    font-size: 17px;
}
.mod-intro p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}
.mod-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}
.mod-flow .fstep {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
}
.mod-flow .farr {
    color: var(--faint);
    font-size: 12px;
}
.mod-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    align-items: flex-start;
}
.mod-card.leaving {
    opacity: 0;
    transform: translateX(20px);
    transition: 0.32s;
}
.mod-thumb {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    flex: none;
    border: 1px solid var(--line);
    overflow: hidden;
    background: repeating-linear-gradient(
        135deg,
        color-mix(in oklab, var(--brand) 14%, var(--paper)) 0 8px,
        color-mix(in oklab, var(--brand) 7%, var(--paper)) 8px 16px
    );
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 22px;
}
.mod-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mod-main {
    flex: 1;
    min-width: 0;
}
.mod-top {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.mod-type {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.mod-type.photo {
    background: color-mix(in oklab, var(--brand) 13%, var(--paper));
    color: var(--brand);
}
.mod-type.fact {
    background: color-mix(in oklab, var(--accent) 14%, var(--paper));
    color: var(--accent);
}
.mod-type.tribute {
    background: color-mix(in oklab, var(--info) 13%, var(--paper));
    color: var(--info);
}
.mod-for {
    font-weight: 600;
    font-size: 14px;
}
.mod-for span {
    color: var(--faint);
    font-weight: 400;
    font-family: var(--font-mono);
    font-size: 11.5px;
}
.mod-when {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--faint);
}
.mod-note {
    font-size: 13.5px;
    color: #34372e;
    line-height: 1.5;
}
.mod-by {
    font-size: 12px;
    color: var(--muted);
    margin-top: 7px;
}
.mod-by b {
    color: var(--ink);
    font-weight: 600;
}
.mod-acts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: none;
}
.mod-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--line);
    cursor: pointer;
    white-space: nowrap;
    background: var(--paper);
    color: var(--ink);
    transition: 0.14s;
}
.mod-btn.approve {
    background: var(--brand);
    color: var(--on-brand);
    border-color: var(--brand);
}
.mod-btn.approve:hover {
    background: var(--brand-deep);
}
.mod-btn.reject:hover {
    border-color: var(--hold);
    color: var(--hold);
}
.mod-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--faint);
}
.mod-empty .me {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: color-mix(in oklab, var(--ok) 14%, var(--paper));
    color: var(--ok);
    display: grid;
    place-items: center;
    font-size: 26px;
    margin: 0 auto 12px;
}

/* ───── RECORD DOCUMENTS ───── */
.doc-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    margin-bottom: 8px;
}
.doc-ic {
    width: 34px;
    height: 40px;
    border-radius: 6px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 15px;
    background: color-mix(in oklab, var(--info) 12%, var(--paper));
    color: var(--info);
    border: 1px solid color-mix(in oklab, var(--info) 22%, transparent);
}
.doc-meta {
    flex: 1;
    min-width: 0;
}
.doc-meta .dn {
    font-weight: 600;
    font-size: 13.5px;
}
.doc-meta .dm {
    font-size: 11.5px;
    color: var(--faint);
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
}
.doc-stat {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
    flex: none;
}
.doc-stat.verified {
    background: color-mix(in oklab, var(--ok) 14%, var(--paper));
    color: var(--ok);
}
.doc-stat.uploaded {
    background: color-mix(in oklab, var(--brand) 12%, var(--paper));
    color: var(--brand);
}
.doc-up {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px;
    border: 1.5px dashed color-mix(in oklab, var(--brand) 34%, var(--line));
    border-radius: 10px;
    background: color-mix(in oklab, var(--brand) 4%, var(--paper));
    color: var(--brand);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: 0.15s;
}
.doc-up:hover {
    background: color-mix(in oklab, var(--brand) 9%, var(--paper));
    border-color: var(--brand);
}
.rec-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.rec-photo {
    aspect-ratio: 1;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--paper-2);
    position: relative;
}
.rec-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rec-photo.add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    border-style: dashed;
    border-color: color-mix(in oklab, var(--brand) 34%, var(--line));
    background: color-mix(in oklab, var(--brand) 4%, var(--paper));
    color: var(--brand);
    font-size: 20px;
    font-weight: 600;
}
.rec-photo.add span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.rec-photo.add:hover {
    background: color-mix(in oklab, var(--brand) 9%, var(--paper));
    border-color: var(--brand);
}
.doc-dl {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: 0.14s;
}
.doc-dl:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: color-mix(in oklab, var(--brand) 7%, var(--paper));
}

/* ───── REPORTS ───── */
.rep-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 980px) {
    .rep-grid {
        grid-template-columns: 1fr;
    }
}
.rep-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}
.rep-card .rh {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.rep-card .rc-ic {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 17px;
}
.rep-card h3 {
    font-size: 17px;
}
.rep-card .rc-d {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 3px;
}
.rep-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 78px;
    margin: 6px 0 14px;
}
.rep-bars .b {
    flex: 1;
    background: color-mix(in oklab, var(--brand) 22%, var(--paper));
    border: 1px solid color-mix(in oklab, var(--brand) 30%, var(--paper));
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 6px;
}
.rep-bars .b.hot {
    background: var(--brand);
    border-color: var(--brand);
}
.rep-bars .b span {
    position: absolute;
    bottom: -17px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 8.5px;
    color: var(--faint);
    white-space: nowrap;
}
.rep-readout {
    display: flex;
    gap: 20px;
    margin: 4px 0 14px;
}
.rep-readout .ro b {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -0.02em;
    display: block;
}
.rep-readout .ro span {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}
.rep-actions {
    display: flex;
    gap: 9px;
    margin-top: auto;
    padding-top: 6px;
}
.rep-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}
.rep-btn:hover {
    border-color: var(--ink);
}
.rep-btn.solid {
    background: var(--brand);
    color: var(--on-brand);
    border-color: var(--brand);
}
.rep-btn.solid:hover {
    background: var(--brand-deep);
}
.donut {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    flex: none;
}

/* ───── REPORTS: AI CHAT + CUSTOM BUILDER ───── */
.rep-tabs {
    display: inline-flex;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 18px;
}
.rep-tabs button {
    border: 0;
    background: transparent;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.rep-tabs button.on {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.ai-chat {
    display: flex;
    flex-direction: column;
    height: min(560px, 68vh);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.ai-chat-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(
        120deg,
        color-mix(in oklab, var(--brand) 9%, var(--card)),
        var(--card)
    );
}
.ai-chat-head .sp {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #f1ebdc;
    display: grid;
    place-items: center;
    flex: none;
}
.ai-chat-head b {
    font-size: 15px;
}
.ai-chat-head .tag {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
    background: color-mix(in oklab, var(--brand) 12%, var(--paper));
    border: 1px solid color-mix(in oklab, var(--brand) 26%, transparent);
    padding: 3px 8px;
    border-radius: 999px;
}
.ai-log {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ai-msg {
    display: flex;
    gap: 11px;
    max-width: 88%;
}
.ai-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.ai-av {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 13px;
}
.ai-msg.bot .ai-av {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #f1ebdc;
}
.ai-msg.user .ai-av {
    background: var(--paper-2);
    color: var(--muted);
}
.ai-bubble {
    padding: 11px 14px;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.55;
}
.ai-msg.bot .ai-bubble {
    background: var(--paper);
    border: 1px solid var(--line);
    border-top-left-radius: 4px;
}
.ai-msg.user .ai-bubble {
    background: var(--brand);
    color: var(--on-brand);
    border-top-right-radius: 4px;
}
.ai-bubble .mini-tbl {
    margin-top: 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
    background: var(--card);
}
.ai-bubble .mini-tbl .r {
    display: flex;
    justify-content: space-between;
    padding: 7px 11px;
    font-size: 12.5px;
    border-top: 1px solid var(--line);
}
.ai-bubble .mini-tbl .r:first-child {
    border-top: 0;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
    background: var(--paper);
}
.ai-bubble .mini-tbl .r b {
    font-weight: 600;
}
.ai-bubble .gen-link {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
}
.ai-typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}
.ai-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--faint);
    animation: blink 1.2s infinite;
}
.ai-typing i:nth-child(2) {
    animation-delay: 0.2s;
}
.ai-typing i:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes blink {
    0%,
    60%,
    100% {
        opacity: 0.25;
    }
    30% {
        opacity: 1;
    }
}
.ai-suggest {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 18px 12px;
}
.ai-suggest button {
    font-size: 12.5px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--muted);
    cursor: pointer;
    font-weight: 500;
}
.ai-suggest button:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.ai-input {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
}
.ai-input input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
}
.ai-input input:focus {
    outline: none;
    border-color: var(--brand);
}
.ai-input button {
    padding: 11px 18px;
    border-radius: 10px;
    border: 0;
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* custom builder */
.build-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 980px) {
    .build-grid {
        grid-template-columns: 1fr;
    }
}
.field-pick {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
}
.fpick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    transition: 0.14s;
}
.fpick:hover {
    border-color: var(--brand);
}
.fpick.on {
    background: color-mix(in oklab, var(--brand) 8%, var(--paper));
    border-color: var(--brand);
    color: var(--brand);
    font-weight: 600;
}
.fpick .cbx {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--line);
    flex: none;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
}
.fpick.on .cbx {
    background: var(--brand);
    border-color: var(--brand);
}
.build-side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.build-prev {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.build-prev .pv-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.build-prev .pv-chip {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 7px;
    color: var(--muted);
}

/* ───── CARE LOG: tracking + crew reports ───── */
.task {
    cursor: pointer;
}
.task:hover {
    background: color-mix(in oklab, var(--brand) 4%, var(--paper));
}
.tk-stat {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 700;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 26px;
    line-height: 1;
    text-align: center;
    justify-self: start;
    box-sizing: border-box;
}
.tk-stat.tk-open {
    background: var(--paper-2);
    color: var(--faint);
}
.tk-stat.tk-progress {
    background: color-mix(in oklab, var(--warn) 14%, var(--paper));
    color: var(--warn);
}
.tk-stat.tk-done {
    background: color-mix(in oklab, var(--ok) 15%, var(--paper));
    color: var(--ok);
}
.tk-prio {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    transform: translateY(-1px);
    margin-left: 7px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 5px;
    background: color-mix(in oklab, var(--hold) 13%, var(--paper));
    color: var(--hold);
    font-weight: 700;
}
.tk-rep {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    transform: translateY(-1px);
    margin-left: 7px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 5px;
    background: color-mix(in oklab, var(--brand) 11%, var(--paper));
    color: var(--brand);
    font-weight: 700;
}
.task .tn {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
}
.task .tn .tnt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.report-box {
    background: color-mix(in oklab, var(--ok) 6%, var(--paper));
    border: 1px solid color-mix(in oklab, var(--ok) 26%, var(--line));
    border-radius: 12px;
    padding: 15px;
}
.report-box .rb-h {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 11px;
}
.report-box .rb-h .ic {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ok);
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 14px;
}
.report-box .rb-h b {
    font-size: 14px;
}
.report-box .rb-h span {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--muted);
}
.report-box .rb-note {
    font-size: 13.5px;
    color: #34372e;
    line-height: 1.5;
}
.report-box .rb-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}
.report-box .rb-ph {
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    position: relative;
}
.report-box .rb-ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.report-box .rb-ph .lbl {
    position: absolute;
    left: 6px;
    bottom: 6px;
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(28, 42, 33, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 5px;
}
.report-box .rb-meta {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
}
.report-box .rb-meta b {
    color: var(--ink);
}

/* ───── CARDS / STATS ───── */
.grid {
    display: grid;
    gap: 16px;
}
.stat-row {
    grid-template-columns: repeat(4, 1fr);
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.stat {
    padding: 16px 18px;
}
.stat .k {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
}
.stat .v {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 600;
    margin-top: 6px;
    letter-spacing: -0.02em;
}
.stat .d {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}
.stat .v {
    white-space: nowrap;
}
.stat .v .u {
    font-size: 15px;
    color: var(--muted);
    font-weight: 600;
    margin-left: 1px;
}

/* form fields (sale modal) */
.flbl {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
    display: block;
    margin-bottom: 6px;
}
.finp {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper);
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--ink);
}
.finp:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--card);
}
.spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ───── DASHBOARD ───── */
.dash-hero {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}
.dash-crest {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: var(--brand-deep);
    color: #c9a86a;
    display: grid;
    place-items: center;
    font-size: 26px;
    flex: none;
    border: 1px solid var(--line);
}
.dash-hero h1 {
    font-size: 28px;
}
.dash-hero .loc {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.dash-hero .loc span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dash-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 1100px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}
.occ-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}
.occ-row:last-child {
    border-bottom: none;
}
.occ-row .on {
    font-weight: 600;
    font-size: 13.5px;
    width: 150px;
    flex: none;
}
.occ-row .ot {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
    width: 78px;
    text-align: right;
    flex: none;
}
.occ-bar {
    flex: 1;
    height: 9px;
    border-radius: 999px;
    background: var(--paper-2);
    overflow: hidden;
    border: 1px solid var(--line);
}
.occ-bar > i {
    display: block;
    height: 100%;
}
.feed .fr {
    display: flex;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}
.feed .fr:last-child {
    border-bottom: none;
}
.feed .fdot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 5px;
    flex: none;
}
.feed .ft {
    font-size: 13.5px;
}
.feed .ft b {
    font-weight: 600;
}
.feed .fm {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--faint);
    margin-top: 2px;
}
.todo-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.todo-row:last-child {
    border-bottom: none;
}
.todo-row .ti2 {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 14px;
}
.todo-row .tt2 {
    font-weight: 600;
    font-size: 13.5px;
}
.todo-row .tm2 {
    font-size: 11.5px;
    color: var(--muted);
}
.todo-row .tgo {
    margin-left: auto;
    color: var(--faint);
    font-size: 16px;
}
.switch {
    cursor: pointer;
}
.vet-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(
        120deg,
        color-mix(in oklab, var(--accent) 14%, var(--card)),
        var(--card)
    );
    border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line));
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-top: 18px;
}
.vet-banner .vi {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 19px;
}

/* pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--paper);
}
.pill .pd {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.pill.occupied {
    color: var(--brand);
    border-color: color-mix(in oklab, var(--brand) 30%, transparent);
}
.pill.available {
    color: var(--ok);
}
.pill.reserved {
    color: var(--warn);
    border-color: color-mix(in oklab, var(--warn) 30%, transparent);
}
.pill.hold {
    color: var(--hold);
    border-color: color-mix(in oklab, var(--hold) 30%, transparent);
}
.pill.vet {
    color: var(--accent);
    border-color: color-mix(in oklab, var(--accent) 40%, transparent);
    background: color-mix(in oklab, var(--accent) 8%, var(--paper));
}

/* ───── EMPTY STATE (cemetery pre-import) ───── */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 62vh;
    gap: 8px;
}
.empty .ill {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: color-mix(in oklab, var(--brand) 8%, var(--paper));
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--brand);
    margin-bottom: 14px;
}
.empty h2 {
    font-size: 26px;
}
.empty p {
    color: var(--muted);
    max-width: 430px;
    margin-top: 8px;
    font-size: 14.5px;
}
.empty .btns {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
    justify-content: center;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: 0.16s;
}
.btn.primary {
    background: var(--brand);
    color: var(--on-brand);
}
.btn.primary:hover {
    background: var(--brand-deep);
}
.btn.ghost {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line);
}
.btn.ghost:hover {
    border-color: var(--ink);
}
.btn.gold {
    background: var(--accent);
    color: #fff;
}
.btn.gold:hover {
    filter: brightness(0.94);
}

/* ───── MODAL / IMPORT ───── */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 42, 33, 0.42);
    backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    z-index: 60;
    padding: 24px;
}
.modal {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    width: min(560px, 100%);
    overflow: hidden;
    animation: pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.modal-h {
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
}
.modal-h h3 {
    font-size: 19px;
}
.modal-h .x {
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--faint);
    font-size: 20px;
    line-height: 1;
}
.modal-b {
    padding: 22px;
}
.dropzone {
    border: 1.5px dashed color-mix(in oklab, var(--brand) 36%, var(--line));
    border-radius: 14px;
    background: color-mix(in oklab, var(--brand) 5%, var(--paper));
    padding: 30px 20px;
    text-align: center;
    transition: 0.18s;
    cursor: pointer;
}
.dropzone:hover {
    background: color-mix(in oklab, var(--brand) 9%, var(--paper));
    border-color: var(--brand);
}
.dropzone .dzi {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    color: var(--brand);
}
.dropzone b {
    font-size: 15px;
}
.dropzone span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 5px;
}
.dz-sample {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: color-mix(in oklab, var(--accent) 9%, var(--paper));
    border: 1px solid color-mix(in oklab, var(--accent) 26%, transparent);
    border-radius: 8px;
    padding: 6px 11px;
}

.import-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--paper);
    margin-bottom: 14px;
}
.import-row .fi {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: color-mix(in oklab, var(--ok) 14%, var(--paper));
    color: var(--ok);
    display: grid;
    place-items: center;
    flex: none;
}
.import-row .fn {
    font-weight: 600;
    font-size: 13.5px;
}
.import-row .fm {
    font-size: 11.5px;
    color: var(--faint);
    font-family: var(--font-mono);
}
.colmap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px 12px;
    align-items: center;
    margin: 6px 0 18px;
    font-size: 12.5px;
}
.colmap .src {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 6px 9px;
}
.colmap .arr {
    color: var(--faint);
}
.colmap .dst {
    font-weight: 600;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 6px;
}
.colmap .chk {
    color: var(--ok);
}
.progress {
    height: 9px;
    border-radius: 999px;
    background: var(--paper-2);
    overflow: hidden;
    border: 1px solid var(--line);
}
.progress > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    width: 0;
    transition: width 0.2s linear;
}
.prog-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 9px;
}

/* ───── TWO-PANE (map / records) ───── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.seg {
    display: inline-flex;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 3px;
}
.seg button {
    border: 0;
    background: transparent;
    padding: 6px 13px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}
.seg button.on {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--paper);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}
.chip:hover {
    border-color: var(--ink);
    color: var(--ink);
}
.chip.on {
    background: color-mix(in oklab, var(--accent) 12%, var(--paper));
    border-color: var(--accent);
    color: var(--accent);
}
.chip .sw {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}
.spacer {
    margin-left: auto;
}

.split {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 1180px) {
    .split {
        grid-template-columns: 1fr;
    }
}

/* MAP */
.map {
    position: relative;
    background: linear-gradient(160deg, #eae7d8, #e3e5d2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 520px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.map .paths {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.map-legend {
    position: absolute;
    left: 16px;
    bottom: 14px;
    display: flex;
    gap: 14px;
    background: rgba(251, 248, 241, 0.92);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--muted);
    flex-wrap: wrap;
    max-width: calc(100% - 32px);
}
.map-legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    vertical-align: 0;
}
.sec-label {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
}
.plot-dot {
    position: absolute;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition:
        transform 0.12s,
        box-shadow 0.12s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.plot-dot:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 5;
}
.plot-dot.sel {
    transform: translate(-50%, -50%) scale(1.7);
    box-shadow:
        0 0 0 3px var(--card),
        0 0 0 5px var(--accent);
    z-index: 6;
}
.plot-dot.vet::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: 0.9;
}
.plot-dot.dim {
    opacity: 0.18;
}
.map.boundary .plot-dot {
    border-radius: 3px;
}

/* parcel (rectangle) view */
.parcel-sec {
    position: absolute;
    display: grid;
    gap: 2px;
}
.parcel {
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition:
        outline 0.1s,
        transform 0.1s;
    min-height: 7px;
}
.parcel:hover {
    outline: 2px solid var(--ink);
    z-index: 5;
    transform: scale(1.04);
}
.parcel.sel {
    outline: 3px solid var(--accent);
    outline-offset: 1px;
    z-index: 6;
}
.parcel.dim {
    opacity: 0.16;
    pointer-events: none;
}
.parcel.vetring {
    box-shadow: inset 0 0 0 2px var(--accent);
}
.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 3px;
}
.view-toggle button {
    border: 0;
    background: transparent;
    padding: 7px 13px;
    border-radius: 7px;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.view-toggle button.on {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.setup-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--faint);
    font-family: var(--font-mono);
}

/* document templates */
.tpl-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (max-width: 860px) {
    .tpl-grid {
        grid-template-columns: 1fr;
    }
}
.tpl-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}
.tpl-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.tpl-ic {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    flex: none;
    display: grid;
    place-items: center;
    background: color-mix(in oklab, var(--info) 12%, var(--paper));
    color: var(--info);
    font-size: 17px;
}
.tpl-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.2;
}
.tpl-meta {
    font-size: 12px;
    color: var(--faint);
    margin-top: 3px;
    font-family: var(--font-mono);
}
.tpl-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.tpl-chip {
    font-size: 11.5px;
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    color: var(--muted);
}
.tpl-chip.edit {
    background: color-mix(in oklab, var(--brand) 9%, var(--paper));
    border-color: color-mix(in oklab, var(--brand) 26%, var(--line));
    color: var(--brand);
    font-weight: 600;
}
.tpl-chip .ec {
    margin-right: 4px;
}
.tpl-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.tpl-preview {
    height: 120px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--paper);
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    margin-bottom: 6px;
}
.tpl-preview .pg {
    width: 92px;
    height: 104px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    padding: 11px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tpl-preview .pg .ln {
    height: 4px;
    border-radius: 2px;
    background: var(--line);
}
.tpl-preview .pg .w60 {
    width: 60%;
}
.tpl-preview .pg .w90 {
    width: 90%;
}
.tpl-preview .pg .w80 {
    width: 80%;
}
.tpl-preview .pg .w40 {
    width: 40%;
}
.tpl-preview .pg .sig {
    margin-top: auto;
    width: 54%;
    height: 11px;
    border-bottom: 1.5px solid var(--brand);
}
.tpl-preview .pv-tag {
    position: absolute;
    right: 9px;
    bottom: 8px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
}
.edit-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-size: 13.5px;
    font-weight: 500;
}
.toggle {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    position: relative;
    transition: 0.16s;
    flex: none;
}
.toggle i {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: 0.16s;
}
.toggle.on {
    background: var(--brand);
    border-color: var(--brand);
}
.toggle.on i {
    left: 17px;
}

/* settings */
.set-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 820px) {
    .set-grid {
        grid-template-columns: 1fr;
    }
}
.set-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: sticky;
    top: 74px;
}
.set-nav button {
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 13px;
    border-radius: 9px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}
.set-nav button.on {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.set-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.set-panel h2 {
    font-size: 19px;
    margin-bottom: 4px;
}
.set-panel .sub {
    color: var(--muted);
    font-size: 13.5px;
    margin-bottom: 20px;
}
.set-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.set-row.full {
    grid-template-columns: 1fr;
}
.set-field label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
    display: block;
    margin-bottom: 6px;
}
.swatch-row {
    display: flex;
    gap: 9px;
}
.swatch {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}
.swatch.on {
    border-color: var(--ink);
}
.swatch.on::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
}
.hours-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    font-size: 14px;
}
.hours-row:first-child {
    border-top: none;
}
.hours-row .day {
    width: 90px;
    font-weight: 600;
}
.sec-edit {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    margin-bottom: 9px;
    background: var(--paper);
}
.sec-edit .dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: none;
}
.sec-edit .nm {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}
.sec-edit .sz {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sec-edit .sz input {
    width: 54px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    font-family: var(--font-body);
    font-size: 13px;
    text-align: center;
}
.sec-edit .sz span {
    font-size: 12px;
    color: var(--faint);
    font-family: var(--font-mono);
}
.brand-prev {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
}
.brand-prev .bp-head {
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.brand-prev .bp-head .bp-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
}
.brand-prev .bp-body {
    padding: 16px;
    background: var(--paper);
    font-size: 13px;
    color: var(--muted);
}

/* RECORD DRAWER */
.rec-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 0;
}
.rec-cover {
    height: 96px;
    background: repeating-linear-gradient(
        135deg,
        color-mix(in oklab, var(--brand) 20%, var(--paper)) 0 8px,
        color-mix(in oklab, var(--brand) 10%, var(--paper)) 8px 16px
    );
    position: relative;
}
.rec-port {
    position: absolute;
    left: 18px;
    bottom: -26px;
    width: 64px;
    height: 64px;
    border-radius: 13px;
    border: 3px solid var(--card);
    background: repeating-linear-gradient(
        135deg,
        #7e9485 0 6px,
        #6d8576 6px 12px
    );
}
.rec-b {
    padding: 34px 18px 18px;
}
.rec-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
}
.rec-dates {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
}
.rec-tags {
    display: flex;
    gap: 6px;
    margin-top: 11px;
    flex-wrap: wrap;
}
.rec-rows {
    margin-top: 15px;
    border-top: 1px solid var(--line);
}
.rec-rows .r {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.rec-rows .r span {
    color: var(--faint);
}
.rec-rows .r b {
    font-weight: 600;
}
.fam {
    display: flex;
    gap: -6px;
    margin-top: 13px;
    align-items: center;
}
.fam .fa {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--card);
    background: repeating-linear-gradient(
        135deg,
        #8a9d8f 0 5px,
        #76897c 5px 10px
    );
    margin-left: -8px;
}
.fam .fa:first-child {
    margin-left: 0;
}
.fam .fm {
    margin-left: 10px;
    font-size: 12px;
    color: var(--muted);
}
.rec-empty {
    padding: 30px 18px;
    text-align: center;
    color: var(--faint);
    font-size: 13px;
}
.rec-empty .ph {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1px dashed var(--line);
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
}

/* ───── TABLE ───── */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.tbl th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 400;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
}
.tbl td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
}
.tbl tr {
    cursor: pointer;
}
.tbl tbody tr:hover {
    background: color-mix(in oklab, var(--brand) 4%, var(--paper));
}
.tbl tr.sel {
    background: color-mix(in oklab, var(--accent) 9%, var(--paper));
}
.tbl .nm {
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 15px;
}
.tbl .sub {
    font-size: 11.5px;
    color: var(--faint);
}

/* ───── CARE LOG ───── */
.care-promo {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(
        120deg,
        color-mix(in oklab, var(--accent) 14%, var(--card)),
        var(--card)
    );
    border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line));
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.care-promo .ci {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
}
.care-promo h3 {
    font-size: 18px;
}
.care-promo p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}
.task {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 116px 158px;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}
.task .cb {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--line);
    flex: none;
}
.task.done .cb {
    background: var(--ok);
    border-color: var(--ok);
}
.task.done .tn {
    text-decoration: line-through;
    color: var(--faint);
}
.task .tn {
    font-weight: 600;
    font-size: 14px;
}
.task .tm {
    font-size: 12px;
    color: var(--muted);
}
.task .asn {
    margin: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    font-size: 12px;
    color: var(--muted);
}
.task .asn .asn-n {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.task .asn .av {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: repeating-linear-gradient(
        135deg,
        #8a9d8f 0 5px,
        #76897c 5px 10px
    );
}

/* ───── SCHEDULE / INTERMENTS CALENDAR ───── */
.arr-banner {
    display: flex;
    align-items: center;
    gap: 13px;
    background: var(--brand-deep);
    color: var(--on-brand);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 16px;
}
.arr-banner .ic {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(201, 168, 106, 0.18);
    color: #e8cf9e;
    display: grid;
    place-items: center;
    flex: none;
}
.arr-banner b {
    color: #fbf8f1;
    font-size: 15px;
}
.arr-banner p {
    color: rgba(244, 239, 226, 0.7);
    font-size: 12.5px;
    margin-top: 2px;
}
.arr-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    border: 1px solid color-mix(in oklab, var(--info) 26%, var(--line));
    border-left: 3px solid var(--info);
    border-radius: 12px;
    background: color-mix(in oklab, var(--info) 5%, var(--card));
    box-shadow: var(--shadow-sm);
    margin-bottom: 11px;
}
.arr-card.leaving {
    opacity: 0;
    transform: translateX(18px);
    transition: 0.3s;
}
.arr-src {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex: none;
    display: grid;
    place-items: center;
    background: color-mix(in oklab, var(--info) 14%, var(--paper));
    color: var(--info);
    font-size: 18px;
}
.arr-main {
    flex: 1;
    min-width: 0;
}
.arr-top {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}
.arr-when {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: color-mix(in oklab, var(--hold) 13%, var(--paper));
    color: var(--hold);
}
.arr-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
}
.arr-meta {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 4px;
}
.arr-from {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--info);
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.arr-acts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: none;
}

.cal {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cal-day {
    border-right: 1px solid var(--line);
    min-height: 300px;
}
.cal-day:last-child {
    border-right: none;
}
.cal-dh {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    position: sticky;
    top: 0;
    background: var(--paper);
}
.cal-dh .dow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}
.cal-dh .dnum {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    margin-top: 2px;
}
.cal-day.today .cal-dh {
    background: color-mix(in oklab, var(--brand) 10%, var(--paper));
}
.cal-day.today .cal-dh .dow {
    color: var(--brand);
}
.cal-day.tomorrow .cal-dh {
    background: color-mix(in oklab, var(--accent) 11%, var(--paper));
}
.cal-day.tomorrow .cal-dh .dow {
    color: var(--accent);
}
.cal-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.cal-ev {
    border-radius: 9px;
    padding: 9px 10px;
    background: color-mix(in oklab, var(--brand) 9%, var(--paper));
    border: 1px solid color-mix(in oklab, var(--brand) 22%, var(--line));
    border-left: 3px solid var(--brand);
    cursor: pointer;
    transition: 0.14s;
}
.cal-ev:hover {
    background: color-mix(in oklab, var(--brand) 14%, var(--paper));
}
.cal-ev.urn {
    border-left-color: var(--info);
    background: color-mix(in oklab, var(--info) 8%, var(--paper));
    border-color: color-mix(in oklab, var(--info) 22%, var(--line));
}
.cal-ev .et {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    font-weight: 700;
}
.cal-ev .en {
    font-weight: 600;
    font-size: 13px;
    margin-top: 3px;
    line-height: 1.25;
}
.cal-ev .ep {
    font-size: 11px;
    color: var(--faint);
    margin-top: 3px;
}
.cal-ev .esync {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--info);
    margin-top: 6px;
}
.cal-empty {
    padding: 14px 8px;
    text-align: center;
    font-size: 11px;
    color: var(--faint);
}
@media (max-width: 1100px) {
    .cal-grid {
        grid-template-columns: repeat(7, minmax(120px, 1fr));
        overflow-x: auto;
    }
}

/* ───── KANBAN (funeral) ───── */
.board {
    display: grid;
    grid-template-columns: repeat(5, minmax(214px, 1fr));
    gap: 14px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 10px;
}
.col {
    background: color-mix(in oklab, var(--brand) 4%, var(--paper));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    min-height: 200px;
}
.col-h {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
    padding: 0 3px;
}
.col-h .ct {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.col-h .cc {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faint);
}
.col-h .cdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.kcard {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 9px;
    cursor: pointer;
    transition: 0.14s;
}
.kcard:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}
.kcard .kn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
}
.kcard .kd {
    font-size: 11.5px;
    color: var(--faint);
    margin-top: 1px;
}
.kcard .kmeta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    flex-wrap: wrap;
}
.tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--paper-2);
    color: var(--muted);
}
.tag.cre {
    background: color-mix(in oklab, var(--hold) 14%, var(--paper));
    color: var(--hold);
}
.tag.bur {
    background: color-mix(in oklab, var(--brand) 14%, var(--paper));
    color: var(--brand);
}
.tag.syn {
    background: color-mix(in oklab, var(--ok) 16%, var(--paper));
    color: var(--ok);
}
.kcard .kbar {
    height: 4px;
    border-radius: 999px;
    background: var(--paper-2);
    margin-top: 10px;
    overflow: hidden;
}
.kcard .kbar > i {
    display: block;
    height: 100%;
    background: var(--brand);
}

/* drawer (case / generic right sheet) */
.sheet {
    position: fixed;
    top: 62px;
    right: 0;
    bottom: 0;
    width: min(440px, 92%);
    background: var(--card);
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 60px -30px rgba(28, 42, 33, 0.5);
    z-index: 55;
    display: flex;
    flex-direction: column;
    animation: slidein 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slidein {
    from {
        transform: translateX(100%);
    }
    to {
        transform: none;
    }
}
.sheet-h {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.sheet-h .x {
    margin-left: auto;
    background: none;
    border: 0;
    font-size: 20px;
    color: var(--faint);
    line-height: 1;
}
.sheet-b {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}
.sheet-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
}
.timeline {
    position: relative;
    margin: 6px 0 4px;
    padding-left: 22px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--line);
}
.tl {
    position: relative;
    padding: 0 0 16px;
}
.tl::before {
    content: "";
    position: absolute;
    left: -19px;
    top: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--line);
}
.tl.done::before {
    background: var(--ok);
    border-color: var(--ok);
}
.tl.now::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 24%, transparent);
}
.tl .tlt {
    font-weight: 600;
    font-size: 13.5px;
}
.tl .tld {
    font-size: 11.5px;
    color: var(--faint);
    font-family: var(--font-mono);
}

/* ───── CREMATORY ───── */
.retorts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.retort {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.retort .rh {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.retort .rt {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
}
.st-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 700;
}
.st-pill .sd {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.st-cremating {
    background: color-mix(in oklab, var(--hold) 14%, var(--paper));
    color: var(--hold);
}
.st-cremating .sd {
    animation: pulse2 1.4s infinite;
}
@keyframes pulse2 {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}
.st-cooling {
    background: color-mix(in oklab, var(--info) 14%, var(--paper));
    color: var(--info);
}
.st-idle {
    background: var(--paper-2);
    color: var(--faint);
}
.retort .case-nm {
    margin-top: 14px;
    font-weight: 600;
    font-size: 14px;
}
.retort .case-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faint);
}
.retort .rbar {
    height: 7px;
    border-radius: 999px;
    background: var(--paper-2);
    margin-top: 12px;
    overflow: hidden;
}
.retort .rbar > i {
    display: block;
    height: 100%;
    border-radius: 999px;
}
.retort .rtime {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    margin-top: 7px;
}

.rooms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.room {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 16px;
    box-shadow: var(--shadow-sm);
}
.room .rmh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 11px;
}
.room .rmh b {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
}
.room .rmh span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faint);
}
.shelf {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}
.slot {
    aspect-ratio: 1;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--paper);
    cursor: pointer;
    transition: 0.12s;
    position: relative;
}
.slot.full {
    background: color-mix(in oklab, var(--brand) 28%, var(--card));
    border-color: color-mix(in oklab, var(--brand) 34%, var(--card));
}
.slot.ready {
    background: color-mix(in oklab, var(--accent) 40%, var(--card));
    border-color: var(--accent);
}
.slot:hover {
    transform: scale(1.18);
    z-index: 3;
    box-shadow: var(--shadow-sm);
}
.room-legend {
    display: flex;
    gap: 14px;
    margin-top: 11px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
}
.room-legend i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
    vertical-align: 0;
    border: 1px solid var(--line);
}

.queue .qr {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}
.queue .qn {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
    width: 30px;
}
.queue .qnm {
    font-weight: 600;
    font-size: 14px;
}
.queue .qsub {
    font-size: 11.5px;
    color: var(--faint);
}
.queue .qright {
    margin-left: auto;
    text-align: right;
    font-size: 12px;
    color: var(--muted);
}

/* section title */
.sec-h {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 13px;
}
.sec-h h3 {
    font-size: 18px;
}
.sec-h .ln {
    flex: 1;
    height: 1px;
    background: var(--line);
}
.sec-h .cnt {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faint);
}

/* ───── SYNC TOAST ───── */
.toasts {
    position: fixed;
    right: 22px;
    bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 90;
    max-width: 380px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--brand-deep);
    color: var(--on-brand);
    border: 1px solid rgba(201, 168, 106, 0.34);
    border-radius: 13px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
    animation: toastin 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes toastin {
    from {
        opacity: 0;
        transform: translateX(20px) translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.toast.out {
    animation: toastout 0.3s forwards;
}
@keyframes toastout {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}
.toast .ti {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(201, 168, 106, 0.18);
    color: #e8cf9e;
    display: grid;
    place-items: center;
    flex: none;
}
.toast .tt {
    font-weight: 700;
    font-size: 13px;
    color: #fbf8f1;
}
.toast .ts {
    font-size: 12px;
    color: rgba(244, 239, 226, 0.72);
    margin-top: 2px;
}
.toast .tlabel {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c9a86a;
    margin-bottom: 4px;
}

/* helper */
.muted {
    color: var(--muted);
}
.center {
    text-align: center;
}
.fade-in {
    animation: fadein 0.4s ease both;
}
@keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.demo-tip {
    position: fixed;
    left: 262px;
    bottom: 18px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 9px 13px;
    box-shadow: var(--shadow);
    font-size: 12.5px;
    max-width: 330px;
}
.demo-tip .dt {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
    animation: pulse2 1.6s infinite;
}
.demo-tip b {
    color: var(--accent);
}
.demo-tip button {
    margin-left: 6px;
    background: none;
    border: 0;
    color: var(--faint);
    font-size: 15px;
}

/* ───────────────────────── MOBILE ───────────────────────── */
@media (max-width: 920px) {
    .app {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 264px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: 18px 0 50px -20px rgba(0, 0, 0, 0.5);
    }
    .sidebar.open {
        transform: none;
    }
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 24, 18, 0.45);
        backdrop-filter: blur(2px);
        z-index: 150;
    }
    .nav-burger {
        display: inline-flex;
    }
    .topbar {
        height: 58px;
        padding: 0 14px;
        gap: 10px;
    }
    .topbar .crumb {
        display: none;
    }
    .search {
        margin-left: 0;
        max-width: none;
    }
    .topbar .right .tb-btn {
        padding: 9px 12px;
    }
    .topbar .right .tb-btn span,
    .topbar .right .tb-btn {
        font-size: 12.5px;
    }
    .content {
        padding: 18px 15px 80px;
    }
    .demo-tip {
        left: 14px;
        right: 14px;
        bottom: 14px;
        max-width: none;
    }

    /* page header stacks */
    .page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .page-head .btn,
    .page-head > div:last-child {
        width: 100%;
    }
    .page-head > div:last-child {
        display: flex;
        gap: 10px;
    }
    .page-head > div:last-child .btn {
        flex: 1;
        justify-content: center;
    }
    .page-head h1 {
        font-size: 23px;
    }

    /* grids collapse */
    .stat-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .steps,
    .values,
    .ws-feats,
    .rep-grid,
    .rooms,
    .retorts,
    .ai-grid,
    .field-pick,
    .build-grid,
    .dash-grid,
    .quote-grid {
        grid-template-columns: 1fr !important;
    }
    .split {
        grid-template-columns: 1fr;
    }
    .board {
        grid-auto-flow: column;
        grid-template-columns: none;
    }

    /* tables scroll horizontally */
    .card > .tbl,
    .tbl {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .tbl thead,
    .tbl tbody,
    .tbl tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    /* drawers & modals full width */
    .sheet {
        top: 0;
        width: 100%;
    }
    .modal {
        width: 100% !important;
    }
    .overlay {
        padding: 0;
        align-items: flex-end;
    }
    .modal {
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
        overflow-y: auto;
    }

    /* map height */
    .map {
        min-height: 380px;
    }
    .toolbar {
        gap: 8px;
    }
    .toolbar .seg {
        flex-wrap: wrap;
    }

    /* task rows: drop the status column, keep avatar */
    .task {
        grid-template-columns: 20px minmax(0, 1fr) auto;
        gap: 11px;
        padding: 12px 14px;
    }
    .task .tk-stat {
        display: none;
    }
    .task .asn {
        min-width: 0;
    }
    .task .asn .asn-n {
        display: none;
    }

    /* calendar: horizontal scroll with comfy day columns */
    .cal-grid {
        grid-template-columns: repeat(7, 160px);
        overflow-x: auto;
    }

    /* reports tabs scroll */
    .rep-tabs {
        width: 100%;
        overflow-x: auto;
    }

    /* onboarding / signin single column */
    .signin {
        grid-template-columns: 1fr;
    }
    .signin .left {
        display: none;
    }
    .ob-form,
    .signin .form {
        width: 100%;
    }
}
@media (max-width: 560px) {
    .stat-row {
        grid-template-columns: 1fr;
    }
    .ai-chat {
        height: 72vh;
    }
    .cta,
    .workspace {
        border-radius: 20px;
    }
}
