@font-face {
    font-family: "Jost";
    src: url("fonts/jost-latin-ext.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Playfair Display";
    src: url("fonts/playfair-display-latin-ext.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --canvas: #f6f2ec;
    --surface: #ffffff;
    --surface-soft: #f1ebe3;
    --ink: #1a1b1a;
    --muted: #6f746f;
    --line: #e2dbd1;
    --pine: #53624e;
    --pine-dark: #333632;
    --pine-soft: #edf0eb;
    --amber: #8a704c;
    --amber-soft: #f5eee4;
    --gold: #b99d75;
    --gold-hover: #ab916c;
    --cream: #f1ebe3;
    --red: #9e3c37;
    --red-soft: #fff0ef;
    --blue: #536b79;
    --blue-soft: #edf2f4;
    --shadow: 0 20px 55px rgba(51, 54, 50, .11);
    font-family: "Jost", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
a { color: var(--pine); }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 72%, white); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 10000; top: .75rem; left: .75rem; padding: .7rem .9rem; border-radius: .55rem; color: #fff; background: var(--pine-dark); text-decoration: none; transform: translateY(-180%); transition: transform .15s ease; }
.skip-link:focus { transform: translateY(0); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.55rem, 2.7vw, 2rem); font-weight: 500; letter-spacing: -.025em; }
h2 { margin-bottom: .35rem; font-family: "Playfair Display", Georgia, serif; font-size: 1.08rem; font-weight: 600; }
small { color: var(--muted); }
code { font-size: .75rem; }

.app-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 1.45rem 1rem; background: var(--pine); color: #fff; display: flex; flex-direction: column; gap: 1.5rem; border-right: 1px solid rgba(255,255,255,.1); }
.brand { min-height: 4.35rem; display: flex; align-items: center; gap: .7rem; padding: 0 .38rem 1.05rem; color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.18); }
.brand-logo { width: 6.7rem; height: auto; display: block; flex: 0 0 auto; }
.brand-product { min-width: 0; padding-left: .68rem; border-left: 1px solid rgba(255,255,255,.24); }
.brand-product strong, .brand-product small { display: block; }
.brand-product strong { color: #fff; font-family: "Playfair Display", Georgia, serif; font-size: .96rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.brand-product small { margin-top: .18rem; color: rgba(255,255,255,.67); font-size: .58rem; line-height: 1.2; }
.navigation { display: grid; gap: .25rem; }
.navigation a { position: relative; padding: .72rem .78rem .72rem .92rem; border-radius: .18rem; color: rgba(255,255,255,.72); text-decoration: none; font-size: .84rem; letter-spacing: .01em; }
.navigation a:hover, .navigation a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.09); }
.navigation a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: .6rem; bottom: .6rem; width: 2px; background: var(--gold); }
.mobile-menu-toggle { display: none; }
.sidebar-user { margin-top: auto; padding: .65rem .45rem 0; border-top: 1px solid rgba(255,255,255,.13); display: flex; align-items: center; gap: .65rem; }
.avatar { width: 2rem; height: 2rem; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--avatar-ink, #fff); background: var(--avatar-bg, rgba(255,255,255,.14)); font-size: .68rem; font-weight: 650; letter-spacing: .025em; }
.sidebar-user-copy { flex: 1; min-width: 0; }
.sidebar-user-copy { color: inherit; text-decoration: none; }
.sidebar-user-copy strong, .sidebar-user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy strong { font-size: .78rem; }
.sidebar-user-copy small { margin-top: .12rem; color: rgba(255,255,255,.6); font-size: .67rem; }
.icon-button { width: 2.5rem; height: 2.5rem; appearance: none; border: 0; border-radius: 50%; color: rgba(255,255,255,.7); background: transparent; cursor: pointer; padding: .35rem; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.09); }

.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: relative; min-height: 4.65rem; padding: .85rem 1.7rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); }
.topbar > .topbar-title { flex: 1; min-width: 0; }
.topbar strong, .topbar small { display: block; }
.topbar strong { font-family: "Playfair Display", Georgia, serif; font-size: 1rem; font-weight: 600; }
.topbar small { margin-top: .15rem; font-size: .72rem; }
.context-indicator { max-width: 260px; padding: .42rem .7rem; display: grid; gap: .08rem; border: 1px solid var(--line); border-radius: .62rem; color: var(--ink); background: var(--surface-soft); text-decoration: none; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.context-indicator:hover { border-color: #c9bda9; background: #f6f1e9; transform: translateY(-1px); }
.context-indicator small { margin: 0; font-size: .58rem; text-transform: uppercase; letter-spacing: .04em; }
.context-indicator strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.mode-badge, .tag { display: inline-flex; align-items: center; gap: .4rem; width: fit-content; padding: .35rem .55rem; border: 1px solid #cfc4b6; border-radius: 999px; background: var(--surface); color: #4f554f; font-size: .68rem; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.tag::before { width: .38rem; height: .38rem; display: none; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.tag-confirmed { padding: .4rem .68rem; border-color: var(--pine); color: #fff; background: var(--pine); box-shadow: 0 4px 12px rgba(83,98,78,.2); font-weight: 700; letter-spacing: .035em; }
.tag-confirmed::before, .tag-important::before, .tag-action::before, .tag-warning::before { display: block; }
.tag-important { border-color: #99423d; color: #fff; background: #99423d; font-weight: 700; }
.tag-action { border-color: var(--gold); color: #fff; background: var(--gold); font-weight: 650; }
.tag-warning { border-color: #c8b28f; color: #674f30; background: var(--amber-soft); font-weight: 600; }
.tag-neutral { border-color: #cfc4b6; color: #62665f; background: var(--surface); }
.mode-badge i { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.mode-analyze_only { color: var(--amber); background: var(--amber-soft); }
.mode-apply { color: var(--blue); background: var(--blue-soft); }
.mode-auto_apply { color: var(--red); background: var(--red-soft); }
.page-content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 1.7rem; flex: 1; }
.app-footer { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 1.7rem 1.4rem; color: var(--muted); font-size: .67rem; text-align: center; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.3rem; }
.page-heading p { margin-bottom: 0; color: var(--muted); font-size: .83rem; }

.button { min-height: 2.5rem; appearance: none; border: 1px solid var(--line); border-radius: .62rem; padding: .58rem .78rem; background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.button:hover { border-color: #bfcac1; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(51,54,50,.07); }
.button:active { transform: translateY(0); box-shadow: none; }
.button-primary { border-color: var(--gold); background: var(--gold); color: #fff; }
.button-primary:hover { border-color: var(--gold-hover); background: var(--gold-hover); }
.button-small { min-height: 2.25rem; padding: .42rem .58rem; font-size: .73rem; }
.button-full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.button-primary:disabled { border-color: #c9c2b8; color: #777b76; background: #e9e5df; }

.notice { margin-bottom: 1rem; padding: .8rem .9rem; border-radius: .7rem; font-size: .8rem; }
.notice-success { color: var(--pine); background: var(--pine-soft); }
.notice-error { color: var(--red); background: var(--red-soft); }
.worker-health { margin-bottom: 1rem; padding: .78rem .9rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.worker-health-dot { width: .65rem; height: .65rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 .28rem color-mix(in srgb, currentColor 13%, transparent); }
.worker-health strong, .worker-health small { display: block; }
.worker-health strong { font-size: .75rem; }
.worker-health small { margin-top: .15rem; font-size: .66rem; line-height: 1.4; }
.worker-health-healthy { border-color: #b9c8ba; color: var(--pine); background: var(--pine-soft); }
.worker-health-warning { border-color: #d8c5a7; color: var(--amber); background: var(--amber-soft); }
.worker-health-error { border-color: #ddb0ad; color: var(--red); background: var(--red-soft); }
.worker-health-tag { color: inherit; border-color: currentColor; background: rgba(255,255,255,.72); font-weight: 700; }
.sync-source-list { margin-top: .55rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .4rem; }
.sync-source { padding: .42rem .5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .08rem .45rem; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); border-radius: .55rem; background: rgba(255,255,255,.58); color: var(--ink); }
.sync-source b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; }
.sync-source em { align-self: start; padding: .08rem .32rem; border-radius: 99px; background: var(--pine-soft); color: var(--pine); font-size: .57rem; font-style: normal; font-weight: 750; white-space: nowrap; }
.sync-source small { grid-column: 1 / -1; color: var(--muted); font-size: .58rem; }
.sync-source-fallback { border-color: #d8c5a7; background: #fffaf1; }
.sync-source-fallback em { background: var(--amber-soft); color: var(--amber); }
.status-matrix-inline { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.status-matrix-inline > span { min-width: 7rem; padding: .32rem .48rem; display: grid !important; gap: .08rem; border-left: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.status-matrix-inline small, .status-matrix-inline b { display: block; margin: 0 !important; line-height: 1.25; }
.status-matrix-inline small { color: var(--muted); font-size: .55rem; font-weight: 500; text-transform: uppercase; letter-spacing: .045em; }
.status-matrix-inline b { color: var(--ink); font-size: .68rem; font-weight: 650; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.application-mode-bar { margin: 0 0 1rem; padding: .78rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.application-mode-bar > div { min-width: 0; }
.application-mode-bar strong, .application-mode-bar span { display: block; }
.application-mode-bar strong { font-size: .75rem; }
.application-mode-bar > div span { margin-top: .16rem; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.application-mode-bar.is-locked { border-color: #d9d0c4; background: #f7f3ed; }
.application-mode-bar.is-ready { border-color: #b9c8ba; background: var(--pine-soft); }
.stat, .panel, .property-card, .rule-card { border: 1px solid var(--line); border-radius: .78rem; background: var(--surface); box-shadow: 0 8px 24px rgba(51,54,50,.035); }
.stat { padding: 1rem; }
.stat span, .stat strong, .stat small { display: block; }
.stat span { color: var(--muted); font-size: .75rem; }
.stat strong { margin-top: .55rem; color: var(--pine-dark); font-family: "Playfair Display", Georgia, serif; font-size: 1.72rem; font-weight: 500; line-height: 1; }
.stat small { margin-top: .45rem; font-size: .68rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 1rem; }
.panel { padding: 1.05rem; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .85rem; }
.panel-heading h2 { margin-bottom: 0; }
.panel-heading a, .panel-heading span { color: var(--muted); font-size: .73rem; }
.signal-list { display: grid; gap: .58rem; }
.signal-row { padding: .72rem; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; border-radius: .7rem; background: var(--surface-soft); }
.signal-icon { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: .55rem; color: var(--amber); background: var(--amber-soft); font-weight: 700; }
.signal-row strong, .signal-row small { display: block; }
.signal-row strong { font-size: .78rem; }
.signal-row small { margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.tag-high, .tag-medium, .tag-priority-medium { border-color: #c8b28f; color: #674f30; background: var(--amber-soft); }
.tag-low, .tag-priority-low { border-color: #b8c8d0; color: #3e5867; background: var(--blue-soft); }
.tag-priority-high { border-color: #99423d; color: #fff; background: #99423d; font-weight: 700; }
.tag-priority-high::before, .tag-priority-medium::before { display: block; }
.property-list { display: grid; gap: .85rem; }
.property-list p { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; font-size: .73rem; }
.property-list-identity { min-width: 0; display: flex; align-items: center; gap: .48rem; }
.property-identity-badge { width: 1.8rem; height: 1.8rem; min-width: 1.8rem; min-height: 1.8rem; padding: 0; display: inline-grid; place-items: center; flex: 0 0 auto; aspect-ratio: 1; border: 1px solid transparent; border-radius: 50%; font-size: .6rem; font-weight: 800; letter-spacing: .035em; line-height: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.property-tone-coral { border-color: #e4ada5; color: #6f302d; background: #f4d5d0; }
.property-tone-sky { border-color: #b8d5e4; color: #31576d; background: #dcecf4; }
.property-tone-amber { border-color: #e5c477; color: #6a4b20; background: #f6e2b3; }
.property-tone-sage { border-color: #b8c9b4; color: #3f583b; background: #dce8d9; }
.property-tone-lavender { border-color: #cbbdde; color: #59466f; background: #e8e0f2; }
.property-tone-sand { border-color: #d6c6ad; color: #62513a; background: #eee3d1; }
.property-tone-neutral { border-color: #cbc4b9; color: #555c55; background: #ebe8e2; }
.progress { appearance: none; display: block; width: 100%; height: .42rem; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-soft); }
.progress::-webkit-progress-bar { background: var(--surface-soft); }
.progress::-webkit-progress-value { border-radius: 99px; background: var(--pine); }
.progress::-moz-progress-bar { border-radius: 99px; background: var(--pine); }
.safety-note { margin-top: 1rem; padding: .8rem; border-radius: .68rem; color: var(--blue); background: var(--blue-soft); font-size: .72rem; line-height: 1.45; }
.safety-note strong { display: block; margin-bottom: .18rem; }
.safety-note.wide strong { display: inline; }
.empty-state { padding: 2.4rem 1rem; text-align: center; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--ink); margin-bottom: .3rem; }
.empty-state span { font-size: .78rem; }

.mode-form, .inline-filter { display: flex; align-items: flex-end; gap: .55rem; flex-wrap: wrap; }
.mode-form label, .inline-filter label { display: grid; gap: .3rem; color: var(--muted); font-size: .7rem; }
.mode-form select, .inline-filter select, .stacked-form select, .stacked-form input, .stacked-form textarea, .auth-form input { min-height: 2.65rem; border: 1px solid var(--line); border-radius: .55rem; padding: .58rem .65rem; color: var(--ink); background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.mode-form select:hover, .inline-filter select:hover, .stacked-form select:hover, .stacked-form input:hover, .stacked-form textarea:hover, .auth-form input:hover { border-color: #c9bda9; }
.mode-form select:focus, .inline-filter select:focus, .stacked-form select:focus, .stacked-form input:focus, .stacked-form textarea:focus, .auth-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,157,117,.14); }
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 4.8rem; }
.password-field > button { position: absolute; top: 50%; right: .35rem; min-width: 4rem; min-height: 2rem; padding: .3rem .55rem; border: 0; border-radius: .42rem; color: var(--pine); background: transparent; cursor: pointer; font-size: .68rem; font-weight: 650; transform: translateY(-50%); }
.password-field > button:hover { background: var(--pine-soft); }
.stacked-form textarea { resize: vertical; font: inherit; line-height: 1.45; }
.auto-confirm { display: flex !important; grid-template-columns: auto 1fr; align-items: center; max-width: 180px; }
.auto-confirm[hidden] { display: none !important; }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .78rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: .74rem; }
th { color: var(--muted); font-weight: 600; background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: .2rem; line-height: 1.35; }
.reason-cell { min-width: 190px; max-width: 300px; line-height: 1.4; }
.row-actions { display: flex; gap: .35rem; }
.apply-control { display: grid; gap: .25rem; justify-items: start; }
.apply-control small { margin: 0; color: var(--muted); font-size: .61rem; }

.rule-list { display: grid; gap: .65rem; }
.rule-card { padding: .9rem; display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; gap: .9rem; }
.rule-priority { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: .68rem; color: var(--pine); background: var(--pine-soft); font-size: .75rem; font-weight: 650; }
.rule-card h2 { margin-bottom: .2rem; }
.rule-card p { margin-bottom: .48rem; color: var(--muted); font-size: .74rem; }
.rule-meta { display: flex; flex-wrap: wrap; gap: .38rem; }
.rule-meta > span { padding: .25rem .42rem; border: 1px solid #d2c7b9; border-radius: .35rem; color: #4f554f; background: var(--surface); font-size: .65rem; }
.rule-actions { display: grid; justify-items: end; gap: .45rem; }
.rule-disabled { opacity: 1; border-style: dashed; }

.stat-highlight { border-color: #d9c6aa; background: linear-gradient(145deg, #fbf7f1, #fff); }
.stat-highlight strong { color: var(--amber); }
.gap-panel { margin-bottom: 1rem; }
.gap-list { display: grid; gap: .72rem; }
.gap-card { padding: .85rem; display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(280px, .78fr); gap: 1rem; align-items: start; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface-soft); }
.gap-date-stack { display: grid; gap: .45rem; }
.gap-date { width: 3.3rem; height: 3.3rem; display: grid; place-items: center; align-content: center; border-radius: .75rem; color: var(--pine); background: var(--pine-soft); }
.gap-date span, .gap-date small { display: block; line-height: 1; }
.gap-date span { font-size: 1.25rem; font-weight: 700; }
.gap-date small { margin-top: .25rem; font-size: .62rem; text-transform: uppercase; }
.gap-room-photo { width: min(100%, 32rem); height: auto; aspect-ratio: 42 / 23; margin-top: .8rem; display: block; border: 1px solid rgba(83,98,78,.16); border-radius: .78rem; object-fit: cover; box-shadow: 0 8px 20px rgba(51,54,50,.14); }
.gap-title { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.gap-room-heading { min-width: 0; display: inline-flex; align-items: center; gap: .48rem; }
.gap-room-number { color: var(--ink); font-size: .88rem; font-weight: 750; letter-spacing: -.015em; line-height: 1.25; white-space: nowrap; }
.gap-room-title-separator { width: .3rem; height: .3rem; flex: 0 0 .3rem; border-radius: 50%; background: var(--ink); }
.gap-room-type-name { font-size: .88rem; line-height: 1.25; }
.gap-copy p { margin: .3rem 0 .22rem; color: var(--muted); font-size: .72rem; }
.gap-copy > small { display: block; line-height: 1.4; }
.mitigation-box { padding: .72rem; border-radius: .68rem; background: var(--surface); }
.mitigation-box > strong { display: block; color: var(--pine); font-size: .72rem; }
.mitigation-box ul { margin: .42rem 0 .5rem; padding-left: 1.1rem; color: var(--ink); font-size: .69rem; line-height: 1.45; }
.mitigation-box > span { color: var(--muted); font-size: .64rem; }
.commercial-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.commercial-heading > strong { color: var(--pine); font-size: .76rem; }
.pricing-summary-status { padding: .28rem .48rem; border: 1px solid #c7d0c3; border-radius: 999px; color: var(--pine); background: var(--pine-soft); font-size: .55rem; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.pricing-summary-status.is-action { border-color: var(--discount-accent, var(--gold)); color: #fff; background: var(--discount-accent, var(--gold)); }
.discount-indicator { display: flex; align-items: center; gap: .32rem; }
.discount-level-0 { --discount-accent: rgb(184,147,90); --discount-soft: rgb(251,247,239); --discount-glow: rgba(184,147,90,.080); }
.discount-level-1 { --discount-accent: rgb(177,132,82); --discount-soft: rgb(250,243,235); --discount-glow: rgba(177,132,82,.105); }
.discount-level-2 { --discount-accent: rgb(171,121,76); --discount-soft: rgb(250,239,232); --discount-glow: rgba(171,121,76,.126); }
.discount-level-3 { --discount-accent: rgb(165,110,70); --discount-soft: rgb(249,236,229); --discount-glow: rgba(165,110,70,.145); }
.discount-level-4 { --discount-accent: rgb(160,99,64); --discount-soft: rgb(249,233,226); --discount-glow: rgba(160,99,64,.163); }
.discount-level-5 { --discount-accent: rgb(155,89,59); --discount-soft: rgb(248,230,223); --discount-glow: rgba(155,89,59,.180); }
.discount-level-6 { --discount-accent: rgb(150,80,54); --discount-soft: rgb(248,228,220); --discount-glow: rgba(150,80,54,.197); }
.discount-level-7 { --discount-accent: rgb(146,70,49); --discount-soft: rgb(247,225,218); --discount-glow: rgba(146,70,49,.213); }
.discount-level-8 { --discount-accent: rgb(141,61,44); --discount-soft: rgb(247,222,215); --discount-glow: rgba(141,61,44,.229); }
.discount-level-9 { --discount-accent: rgb(136,52,39); --discount-soft: rgb(246,220,212); --discount-glow: rgba(136,52,39,.245); }
.discount-level-10 { --discount-accent: rgb(132,43,34); --discount-soft: rgb(246,217,210); --discount-glow: rgba(132,43,34,.260); }
.discount-badge { min-width: 6rem; padding: .38rem .5rem; display: grid; place-items: center; gap: .12rem; border: 1px solid var(--line); border-radius: .55rem; color: var(--muted); background: var(--surface-soft); text-align: center; }
.discount-badge small { margin: 0; font-size: .42rem; font-weight: 700; letter-spacing: .045em; line-height: 1.15; text-transform: uppercase; }
.discount-badge b { font-family: "Playfair Display", Georgia, serif; font-size: 1rem; font-weight: 500; line-height: 1.1; }
.discount-badge.needs-action { border-color: var(--discount-accent, var(--gold)); color: #fff; background: var(--discount-accent, var(--gold)); box-shadow: 0 .28rem .9rem var(--discount-glow, rgba(184,147,90,.14)); }
.discount-badge.needs-action small, .discount-badge.needs-action b { color: #fff; opacity: 1; }
.promotion-days { margin-top: .6rem; display: grid; gap: .35rem; }
.promotion-day { padding: .52rem .55rem; display: grid; grid-template-columns: 2.7rem minmax(10rem, .8fr) minmax(0, 1.2fr); align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: .48rem; background: var(--surface-soft); }
.promotion-day.needs-action { border-color: var(--discount-accent, #d2b88f); background: var(--discount-soft, #fbf5ec); box-shadow: inset .2rem 0 0 var(--discount-accent, var(--gold)); }
.promotion-date { align-self: start; padding-top: .08rem; font-size: .65rem; font-weight: 700; }
.promotion-recommendation { display: grid; gap: .08rem; }
.promotion-recommendation strong { color: var(--ink); font-size: .68rem; line-height: 1.25; }
.promotion-recommendation small { color: var(--muted); font-size: .56rem; line-height: 1.3; }
.promotion-day.needs-action .promotion-recommendation strong { color: var(--discount-accent, var(--amber)); }
.promotion-components { display: flex; align-items: center; flex-wrap: wrap; gap: .22rem; }
.promotion-components b { padding: .2rem .32rem; border-radius: .3rem; color: var(--pine); background: var(--pine-soft); font-size: .55rem; font-weight: 700; line-height: 1.25; }
.promotion-components small { margin-right: .04rem; color: var(--muted); font-size: .52rem; font-weight: 650; }
.discount-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: .28rem; }
.discount-comparison > span { min-width: 5.8rem; padding: .28rem .34rem; display: grid; gap: .05rem; border: 1px solid #ddd3c7; border-radius: .38rem; background: rgba(255,255,255,.68); }
.discount-comparison small { color: var(--muted); font-size: .46rem; font-weight: 650; line-height: 1.15; }
.discount-comparison b { color: var(--ink); font-size: .68rem; }
.discount-decision { grid-column: 2 / -1; margin: 0; padding-top: .05rem; color: var(--muted); font-size: .57rem; line-height: 1.35; }
.discount-decision.is-action { color: var(--discount-accent, var(--amber)); font-weight: 650; }
.discount-decision.is-unchanged::before { content: "✓ "; color: var(--pine); font-weight: 800; }
.promotion-days > small { font-size: .58rem; }
.commercial-empty { margin: .6rem 0 0; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.extension-option { margin-top: .6rem; padding: .55rem .6rem; display: grid; gap: .16rem; border-left: 3px solid var(--discount-accent, var(--gold)); background: var(--discount-soft, #f8f4ee); }
.extension-heading { display: flex; align-items: center; gap: .25rem; }
.extension-option strong { color: var(--discount-accent, var(--amber)); font-size: .65rem; }
.extension-option span { color: var(--muted); font-size: .6rem; line-height: 1.4; }
.extension-option .extension-rule-note { margin-top: .18rem; color: var(--ink); font-size: .56rem; line-height: 1.4; }
.extension-option .extension-rule-note b { color: var(--ink); font-size: inherit; }
.restriction-summary { margin: .5rem 0; color: var(--ink); font-size: .62rem; line-height: 1.4; }
.restriction-summary b { color: var(--pine); }
.optimization-overview { padding-bottom: .55rem; display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; border-bottom: 1px solid var(--line); }
.optimization-overview strong { color: var(--pine); font-size: .74rem; }
.optimization-overview small { color: var(--muted); font-size: .55rem; line-height: 1.3; text-align: right; }
.optimization-zones { margin-top: .55rem; display: grid; gap: .48rem; }
.optimization-zone { padding: .58rem; display: grid; gap: .46rem; border: 1px solid var(--line); border-radius: .58rem; background: var(--surface-soft); }
.optimization-zone.has-action { border-color: var(--discount-accent, #d2b88f); background: var(--discount-soft, #fbf5ec); box-shadow: inset .2rem 0 0 var(--discount-accent, var(--gold)); }
.optimization-zone header { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.optimization-zone header div { display: grid; gap: .06rem; }
.optimization-zone header strong { color: var(--ink); font-size: .69rem; }
.optimization-zone header small { color: var(--muted); font-size: .51rem; }
.optimization-zone header > span { padding: .22rem .38rem; border: 1px solid #c7d0c3; border-radius: 999px; color: var(--pine); background: var(--pine-soft); font-size: .49rem; font-weight: 750; line-height: 1.1; white-space: nowrap; }
.optimization-zone.has-action header > span { border-color: var(--discount-accent, var(--gold)); color: #fff; background: var(--discount-accent, var(--gold)); }
.zone-states { display: grid; grid-template-columns: 1fr 1fr; gap: .34rem; }
.zone-states > div { min-width: 0; padding: .4rem .44rem; display: grid; align-content: start; gap: .1rem; border: 1px solid #ded5ca; border-radius: .42rem; background: rgba(255,255,255,.72); }
.zone-states > div:last-child { border-color: var(--discount-accent, #d7c8b3); }
.zone-states small { color: var(--muted); font-size: .48rem; font-weight: 650; }
.zone-states strong { color: var(--ink); font-size: .64rem; line-height: 1.3; overflow-wrap: anywhere; }
.optimization-zone.has-action .zone-states > div:last-child strong { color: var(--discount-accent, var(--amber)); }
.optimization-zone p { margin: 0; color: var(--muted); font-size: .56rem; line-height: 1.38; }
.zone-facts { display: flex; gap: .35rem; flex-wrap: wrap; }
.zone-facts > span { min-width: 7rem; padding-left: .4rem; display: grid; gap: .06rem; border-left: 2px solid var(--discount-accent, var(--line)); }
.zone-facts small { color: var(--muted); font-size: .48rem; text-transform: uppercase; letter-spacing: .035em; }
.zone-facts strong { color: var(--ink); font-size: .57rem; line-height: 1.3; }
.zone-action-days { display: flex; flex-wrap: wrap; gap: .25rem; }
.zone-action-days span { padding: .22rem .32rem; border-radius: .32rem; color: var(--discount-accent, var(--amber)); background: rgba(255,255,255,.68); font-size: .53rem; }
.zone-action-days b { color: var(--ink); }
.optimization-zone > .button { justify-self: start; }
.verification-source { display: block; margin-top: .55rem; }
.ui-tooltip { position: relative; vertical-align: middle; }
span.ui-tooltip { display: inline-flex; flex: 0 0 auto; }
.ui-tooltip-trigger { position: relative; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; color: var(--pine); background: transparent; font-size: 0; cursor: help; }
.ui-tooltip-trigger::before { content: ""; position: absolute; top: 50%; left: 50%; width: 1.15rem; height: 1.15rem; border: 1px solid #b7aa99; border-radius: 50%; background: rgba(255,255,255,.72); transform: translate(-50%, -50%); transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.ui-tooltip-trigger::after { content: "i"; position: absolute; top: 50%; left: 50%; font-family: Georgia, serif; font-size: .68rem; font-style: italic; font-weight: 700; line-height: 1; transform: translate(-50%, -53%); }
.ui-tooltip-trigger:hover, .ui-tooltip-trigger:focus-visible, .ui-tooltip.is-open .ui-tooltip-trigger { color: #fff; outline: none; }
.ui-tooltip-trigger:hover::before, .ui-tooltip-trigger:focus-visible::before, .ui-tooltip.is-open .ui-tooltip-trigger::before { border-color: var(--pine); background: var(--pine); transform: translate(-50%, -50%) scale(1.04); }
.ui-tooltip-content { position: absolute; z-index: 80; top: calc(100% + .48rem); left: 50%; width: max-content; min-width: 13.5rem; max-width: min(18rem, calc(100vw - 2rem)); padding: .65rem .72rem; border: 1px solid #d8cec1; border-radius: .56rem; color: var(--ink); background: #fffdf9; box-shadow: 0 .7rem 1.8rem rgba(39,52,43,.16); font-size: .64rem; font-style: normal; font-weight: 400; letter-spacing: 0; line-height: 1.45; text-align: left; text-transform: none; opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -.2rem); transition: opacity .14s ease, transform .14s ease, visibility .14s ease; }
.ui-tooltip.is-open .ui-tooltip-content { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
.ui-tooltip.tooltip-above .ui-tooltip-content { top: auto; bottom: calc(100% + .48rem); transform: translate(-50%, .2rem); }
.ui-tooltip.tooltip-above.is-open .ui-tooltip-content { transform: translate(-50%, 0); }
.ui-tooltip.align-left .ui-tooltip-content { right: auto; left: 0; transform: translate(0, 0); }
.ui-tooltip.align-right .ui-tooltip-content { right: 0; left: auto; transform: translate(0, 0); }
.ui-hint-trigger { appearance: none; margin: 0; cursor: help; }
.ui-hint-trigger:not(.tag):not(.interval-marker) { padding: 0; border: 0; border-bottom: 1px dotted color-mix(in srgb, currentColor 45%, transparent); border-radius: 0; color: inherit; background: transparent; font: inherit; line-height: inherit; }
.ui-hint-trigger.tag, .ui-hint-trigger.interval-marker { font-family: inherit; line-height: 1.2; }
.ui-hint-trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.field-label-with-help { display: inline-flex; align-items: center; gap: .25rem; }
.disabled-control-tooltip { display: inline-flex; }
.proposed-discount-heading { display: inline-block; color: var(--discount-accent, var(--amber)); }
.proposed-discount-line { margin-top: .28rem; padding: .25rem .35rem; border-left: 3px solid var(--discount-accent, var(--gold)); border-radius: 0 .32rem .32rem 0; background: var(--discount-soft, var(--surface-soft)); }
.proposed-discount-line b { color: var(--discount-accent, var(--amber)); }
.suggestion-actions { margin-top: .65rem; padding-top: .58rem; display: flex; align-items: center; gap: .55rem; border-top: 1px solid var(--line); }
.suggestion-actions form { margin: 0; }
.suggestion-actions small { color: var(--muted); font-size: .61rem; line-height: 1.3; }
.dashboard-secondary { margin-top: 0; }

.rule-builder-panel { margin-bottom: 1.3rem; padding: 1.15rem; }
.inline-create-panel[hidden] { display: none; }
.rule-builder-guide { margin: .2rem 0 1rem; padding: .7rem .8rem; display: flex; align-items: center; justify-content: center; gap: .7rem; border: 1px solid var(--line); border-radius: .72rem; color: var(--muted); background: var(--surface-soft); }
.rule-builder-guide span { display: inline-flex; align-items: center; gap: .38rem; font-size: .68rem; font-weight: 650; }
.rule-builder-guide span b { width: 1.35rem; height: 1.35rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--pine); font-size: .62rem; }
.rule-builder-guide i { color: var(--gold); font-style: normal; }
.rule-builder-form { display: grid; grid-template-columns: 1.15fr .9fr; gap: .9rem; }
.form-section { padding: .85rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface-soft); }
.form-section-wide { grid-column: 1 / -1; }
.form-section h3 { margin: 0 0 .75rem; font-size: .78rem; }
.rule-form-intro { background: var(--surface); }
.rule-section-title { margin-bottom: .78rem; display: flex; align-items: flex-start; gap: .62rem; }
.rule-section-title > span { width: 1.7rem; height: 1.7rem; flex: 0 0 1.7rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--pine); font-size: .7rem; font-weight: 700; }
.rule-section-title > div { min-width: 0; }
.rule-section-title h3 { margin: 0 0 .16rem; font-size: .85rem; }
.rule-section-title p { margin: 0; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.rule-section-title-intro { padding-left: .15rem; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.form-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, .trigger-grid label { display: grid; gap: .3rem; color: var(--muted); font-size: .68rem; }
.form-grid input, .form-grid select, .form-grid textarea, .trigger-grid input, .trigger-grid select { width: 100%; border: 1px solid var(--line); border-radius: .55rem; padding: .56rem .62rem; color: var(--ink); background: var(--surface); resize: vertical; }
.form-grid small { font-size: .6rem; }
.field-wide { grid-column: span 2; }
.weekday-picker, .action-picker, .builder-toggles { display: flex; gap: .55rem; flex-wrap: wrap; }
.weekday-picker { margin-top: .75rem; }
.weekday-picker strong { width: 100%; color: var(--muted); font-size: .65rem; }
.weekday-picker label, .action-picker label, .builder-toggles label { display: inline-flex; align-items: center; gap: .32rem; color: var(--muted); font-size: .66rem; }
.trigger-grid { margin-top: .75rem; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.action-picker { margin-top: .8rem; display: grid; gap: .55rem; }
.property-scope-picker { margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.property-scope-picker legend { padding: 0 .25rem; font-size: .68rem; font-weight: 700; color: var(--ink); }
.property-scope-picker label { display: flex; align-items: flex-start; gap: .45rem; color: var(--ink); font-size: .72rem; }
.property-scope-picker input { width: auto; margin-top: .12rem; flex: 0 0 auto; }
.property-scope-all { padding-bottom: .65rem; margin-bottom: .65rem; border-bottom: 1px solid var(--line); font-weight: 700; }
.property-scope-options { display: grid; gap: .5rem; }
.property-scope-picker small { display: block; margin-top: .65rem; color: var(--muted); }
.rule-state-toggles { margin-top: .75rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.advanced-settings { color: var(--muted); }
.advanced-settings summary { color: var(--ink); cursor: pointer; font-size: .72rem; font-weight: 650; }
.advanced-settings > p { margin: .5rem 0 .75rem; font-size: .65rem; }
.builder-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.rules-section-heading { margin: 1.2rem 0 .65rem; display: flex; justify-content: space-between; align-items: center; }
.rules-section-heading h2 { margin: 0; }
.rules-section-heading small { display: block; margin-top: .18rem; color: var(--muted); font-size: .64rem; }
.rules-section-heading span { color: var(--muted); font-size: .7rem; }
.rules-heading-actions { display: flex; align-items: center; gap: .6rem; }
.rules-heading-actions > span { color: var(--muted); font-size: .68rem; }
.rule-inactive-toggle { margin: 0; }
.rule-inactive-toggle label { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-size: .68rem; cursor: pointer; }
.rule-inactive-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 2.2rem; height: 1.22rem; padding: .12rem; display: inline-flex; align-items: center; flex: 0 0 auto; border: 1px solid #c9c0b4; border-radius: 999px; background: #ddd8d1; transition: border-color .16s ease, background .16s ease; }
.switch-track i { width: .86rem; height: .86rem; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(39,45,39,.22); transition: transform .16s ease; }
.rule-inactive-toggle input:checked + .switch-track { border-color: var(--pine); background: var(--pine); }
.rule-inactive-toggle input:checked + .switch-track i { transform: translateX(.96rem); }
.rule-inactive-toggle input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 2px; }
.property-filter-module { margin: 1.1rem 0 .75rem; padding: .8rem; display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: center; gap: .7rem; border: 1px solid var(--line); border-radius: .78rem; background: var(--surface); }
.property-filter-label { color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; }
.property-filter-options { min-width: 0; display: flex; gap: .45rem; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; touch-action: pan-x; }
.property-filter-options::-webkit-scrollbar { display: none; }
.property-filter-options form { flex: 0 0 auto; margin: 0; }
.property-filter-chip { height: 2.5rem; min-height: 2.5rem; padding: .42rem .64rem; display: inline-flex; flex: 0 0 auto; align-items: center; gap: .42rem; border: 1px solid #d6cabb; border-radius: 999px; color: var(--ink); background: var(--surface); font: inherit; font-size: .68rem; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; }
.property-filter-chip .property-identity-badge { width: 1.55rem; height: 1.55rem; min-width: 1.55rem; min-height: 1.55rem; padding: 0; border-radius: 50%; font-size: .5rem; }
.property-filter-count, .property-filter-state { min-width: 1.25rem; min-height: 1.25rem; padding: .12rem .3rem; display: inline-grid; place-items: center; border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: .58rem; text-align: center; }
.property-filter-chip:hover, .property-filter-chip:focus-visible { border-color: var(--pine); outline: none; }
.property-filter-chip.is-active { border-color: var(--pine); color: #fff; background: var(--pine); }
.property-filter-chip.is-active .property-filter-count, .property-filter-chip.is-active .property-filter-state { color: var(--pine); background: #fff; }
.property-filter-chip.is-unsynced:not(.is-active) { border-style: dashed; color: var(--muted); background: #faf8f5; }
.property-filter-chip.is-unsynced:not(.is-active) .property-filter-state { color: var(--amber); background: var(--amber-soft); }
.rule-filter-chips { min-width: 0; display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; }
.rule-filter-chips { margin: 0; }
.rule-filter-chips::-webkit-scrollbar { display: none; }
.rule-filter-chip { min-height: 2.25rem; padding: .48rem .64rem; display: inline-flex; flex: 0 0 auto; align-items: center; gap: .42rem; border: 1px solid #d6cabb; border-radius: 999px; color: var(--ink); background: var(--surface); font: inherit; font-size: .68rem; text-decoration: none; cursor: pointer; }
.rule-filter-chip .property-identity-badge { width: 1.55rem; height: 1.55rem; min-width: 1.55rem; min-height: 1.55rem; padding: 0; border-radius: 50%; font-size: .5rem; }
.rule-filter-count { min-width: 1.25rem; padding: .12rem .3rem; border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: .58rem; text-align: center; }
.rule-filter-chip:hover, .rule-filter-chip:focus-visible { border-color: var(--pine); outline: none; }
.rule-filter-chip.is-active { border-color: var(--pine); color: #fff; background: var(--pine); }
.rule-filter-chip.is-active .rule-filter-count { color: var(--pine); background: #fff; }
.proposal-extension-panel { margin-top: .75rem; }
.proposal-section-heading { margin-bottom: .8rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.proposal-section-heading h2 { margin: 0; }
.proposal-section-heading p { margin: .2rem 0 0; color: var(--muted); font-size: .68rem; }
.proposal-section-heading > span { color: var(--muted); font-size: .68rem; }
.proposal-extension-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; }
.proposal-extension-card { padding: .85rem; display: grid; gap: .72rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface-soft); }
.proposal-extension-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .65rem; }
.proposal-extension-card-head .property-identity-badge { width: 2rem; height: 2rem; min-width: 2rem; min-height: 2rem; border-radius: 50%; }
.proposal-extension-card-head strong, .proposal-extension-card-head small { display: block; }
.proposal-extension-card-head small { margin-top: .12rem; color: var(--muted); font-size: .62rem; }
.proposal-extension-period { padding: .62rem .7rem; display: flex; align-items: center; gap: .55rem; border-radius: .55rem; background: var(--surface); font-size: .7rem; }
.proposal-extension-period b { color: var(--gold-deep); }
.proposal-extension-summary { display: grid; gap: .18rem; }
.proposal-extension-summary strong { font-size: .76rem; }
.proposal-extension-summary span { color: var(--muted); font-size: .64rem; line-height: 1.45; }
.proposal-extension-card > .button { justify-self: start; }
.proposal-scope-note { margin: 0; padding: .8rem 1rem 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.proposal-room-identity { display: block; margin-top: .32rem; color: var(--ink); }
.proposal-rate-plan-summary { display: block; margin-top: .38rem; color: var(--pine); }
.proposal-rate-plan-details { margin-top: .2rem; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.proposal-rate-plan-details summary { width: fit-content; color: var(--pine); cursor: pointer; text-decoration: underline; text-underline-offset: .12rem; }
.proposal-rate-plan-details span { display: block; margin-top: .22rem; max-width: 24rem; }
.rule-order-toolbar { margin-bottom: .7rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: .65rem; background: rgba(255,255,255,.48); }
.rule-order-form { min-width: 0; padding: .52rem .68rem; display: flex; align-items: center; gap: .5rem; }
.rule-order-form + .rule-order-form { border-left: 1px solid var(--line); }
.rule-order-form strong { color: var(--pine); font-size: .62rem; }
.rule-order-form span { margin-right: auto; overflow: hidden; color: var(--muted); font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.rule-order-form:not(.is-dirty) .button { display: none; }
.rule-order-form.is-dirty { background: #f5ede0; box-shadow: inset 0 0 0 1px var(--gold); }
.human-rule-list { display: grid; gap: .75rem; }
.policy-builder-panel { margin-bottom: 1rem; }
.policy-builder-form { display: grid; gap: .8rem; }
.policy-enabled-field { padding: .65rem .72rem; display: flex; align-items: center; gap: .48rem; border: 1px solid var(--line); border-radius: .58rem; background: var(--surface-soft); }
.rule-policy-header { margin-top: .55rem; padding: 1rem; scroll-margin-top: 5.5rem; display: grid; grid-template-columns: 2.35rem minmax(0, 1fr) auto; align-items: start; gap: .85rem; border: 1px solid #b9c5b5; border-left: 4px solid var(--pine); border-radius: .78rem; background: linear-gradient(135deg, #edf2eb, #f8f5ef); }
.rule-policy-header[data-policy-expanded="false"] { cursor: pointer; }
.rule-policy-header:first-child { margin-top: 0; }
.rule-policy-header.is-disabled { border-color: var(--line); border-left-color: #b8b4ad; background: var(--surface-soft); opacity: .72; }
.rule-policy-order-column { display: grid; justify-items: center; gap: .32rem; }
.rule-policy-index { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--pine); font-size: .72rem; font-weight: 700; line-height: 1; }
.rule-policy-drag-handle { width: 2.25rem; min-height: 1.7rem; padding: .38rem .42rem; display: grid; gap: 3px; border: 0; border-radius: .42rem; color: var(--muted); background: transparent; cursor: grab; }
.rule-policy-drag-handle span { width: 1.1rem; height: 2px; display: block; justify-self: center; border-radius: 2px; background: currentColor; }
.rule-policy-drag-handle:hover, .rule-policy-drag-handle:focus-visible { color: var(--pine); background: var(--pine-soft); outline: none; }
.rule-policy-header.is-dragging { opacity: .45; }
.rule-policy-header.is-drag-target { box-shadow: 0 0 0 2px var(--gold); }
.rule-policy-header.is-disabled .rule-policy-index { background: #8a8c87; }
.rule-policy-copy { min-width: 0; }
.rule-policy-copy > small { display: block; margin-bottom: .15rem; color: var(--amber); font-size: .56rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.rule-policy-copy h2 { margin: 0; font-size: 1.12rem; }
.rule-policy-copy > p { margin: .32rem 0 0; color: var(--ink); font-size: .72rem; line-height: 1.5; }
.rule-policy-copy details { margin-top: .55rem; }
.rule-policy-copy summary { color: var(--pine); cursor: pointer; font-size: .64rem; font-weight: 700; }
.rule-policy-details { margin-top: .45rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: .55rem; background: rgba(255,255,255,.72); }
.rule-policy-details p { margin: 0; color: var(--muted); font-size: .64rem; line-height: 1.5; }
.rule-policy-details p + p { margin-top: .35rem; }
.rule-policy-details strong { color: var(--ink); }
.rule-policy-side { min-width: 10.5rem; display: grid; justify-items: end; gap: .45rem; }
.rule-policy-scope-label { color: var(--muted); font-size: .54rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rule-policy-side form { margin: 0; }
.rule-policy-move-buttons { display: flex; gap: .35rem; }
.rule-policy-admin-row { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.rule-policy-move-buttons .button { min-width: 2rem; padding-inline: .48rem; font-size: .82rem; line-height: 1; }
.rule-policy-more { position: relative; }
.rule-policy-more > summary { width: 2rem; height: 2rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: .5rem; color: var(--muted); background: rgba(255,255,255,.72); cursor: pointer; font-size: .72rem; font-weight: 800; letter-spacing: .08em; list-style: none; }
.rule-policy-more > summary::-webkit-details-marker { display: none; }
.rule-policy-more[open] > summary { color: var(--pine); border-color: #aebca9; background: #fff; }
.rule-policy-more > div { position: absolute; z-index: 20; top: calc(100% + .3rem); right: 0; min-width: 9rem; padding: .4rem; border: 1px solid var(--line); border-radius: .55rem; background: #fff; box-shadow: 0 10px 24px rgba(36,43,33,.14); }
.rule-policy-more > div .button { width: 100%; white-space: nowrap; }
.rule-policy-toggle { min-width: 7.7rem; display: inline-flex; align-items: center; justify-content: center; gap: .48rem; color: var(--pine); border-color: #aebca9; background: rgba(255,255,255,.8); }
.rule-policy-toggle::after { width: .48rem; height: .48rem; content: ''; display: block; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-.12rem) rotate(45deg); transition: transform .18s ease; }
.rule-policy-toggle[aria-expanded="true"]::after { transform: translateY(.12rem) rotate(225deg); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.human-rule-card[hidden] { display: none !important; }
.rule-policy-side .rule-property-chips { margin: 0; justify-content: flex-end; }
.rule-policy-header + .human-rule-card { margin-top: -.2rem; }
.human-rule-card[data-rule-policy-id] { margin-left: 1.2rem; border-left: 3px solid #d5ddcf; }
.human-rule-card { align-items: start; }
.human-rule-card .rule-actions { min-width: 0; max-width: 100%; }
.human-rule-card .rule-actions > .ui-hint { max-width: 100%; }
.human-rule-card .rule-actions > .ui-hint .ui-hint-trigger { max-width: 100%; white-space: normal; text-align: center; }
.human-rule-card .rule-actions > .ui-hint .ui-tooltip-content { right: 0; left: auto; transform: translate(0, -.2rem); }
.human-rule-card .rule-actions > .ui-hint.is-open .ui-tooltip-content { transform: translate(0, 0); }
.human-rule-card .rule-actions > .ui-hint.tooltip-above .ui-tooltip-content { transform: translate(0, .2rem); }
.human-rule-card .rule-actions > .ui-hint.tooltip-above.is-open .ui-tooltip-content { transform: translate(0, 0); }
.human-rule-card.is-dragging { opacity: .45; }
.human-rule-card.is-drag-target { box-shadow: 0 0 0 2px var(--gold); }
.rule-order-column { display: grid; justify-items: center; gap: .38rem; }
.human-rule-card .rule-priority { width: 2.25rem; height: 2.25rem; color: var(--muted); background: var(--surface-soft); font-size: .62rem; }
.human-rule-copy { min-width: 0; }
.human-rule-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.human-rule-heading h2 { margin: 0; }
.human-rule-copy > p { margin: .35rem 0 .7rem; font-size: .72rem; line-height: 1.45; }
.human-rule-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.human-rule-summary section { padding: .62rem; border: 1px solid var(--line); border-radius: .58rem; background: var(--surface-soft); }
.human-rule-summary small { display: block; margin-bottom: .24rem; color: var(--pine); font-size: .58rem; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.human-rule-summary strong { display: block; color: var(--ink); font-size: .66rem; font-weight: 550; line-height: 1.45; }
.rule-property-chips { margin-top: .48rem; display: flex; flex-wrap: wrap; gap: .28rem; }
.rule-property-chip { max-width: 100%; padding: .2rem .4rem .2rem .22rem; display: inline-flex; align-items: center; gap: .34rem; border: 1px solid #bdc8b9; border-radius: 999px; overflow-wrap: anywhere; color: #3f503b; background: #fff; font-size: .58rem; font-weight: 650; line-height: 1.25; }
.rule-property-chip .property-identity-badge { width: 1.5rem; height: 1.5rem; min-width: 1.5rem; min-height: 1.5rem; padding: 0; border-radius: 50%; font-size: .49rem; }
.rule-property-chip.is-global { border-color: var(--pine); color: #fff; background: var(--pine); text-transform: uppercase; letter-spacing: .035em; }
.rule-property-chip.is-inactive { border-style: dashed; color: var(--muted); background: var(--surface); }
.rule-property-chip.is-unassigned { border-color: #d8c5a7; color: var(--amber); background: var(--amber-soft); }
.human-rule-card .rule-meta { margin-top: .6rem; }
.rule-authorship { margin-top: .58rem; display: flex; flex-wrap: wrap; gap: .28rem .85rem; color: var(--muted); font-size: .61rem; }
.rule-authorship strong { color: var(--ink); font-weight: 650; }
.rule-authorship-editor { margin: 0 0 .8rem; padding: .58rem .65rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface-soft); }
.rule-history { margin-top: .65rem; border-top: 1px solid var(--line); padding-top: .55rem; }
.rule-history summary { color: var(--pine); cursor: pointer; font-size: .65rem; font-weight: 700; }
.rule-history > p { margin: .5rem 0 0; font-size: .64rem; }
.rule-history ol { margin: .55rem 0 0; padding: 0; display: grid; gap: .45rem; list-style: none; }
.rule-history li { padding: .5rem .55rem; border-left: 3px solid #c8b28f; background: var(--surface-soft); }
.rule-history li > div { display: flex; justify-content: space-between; align-items: baseline; gap: .7rem; }
.rule-history li strong { font-size: .64rem; }
.rule-history li span { color: var(--muted); font-size: .58rem; text-align: right; }
.rule-history li p { margin: .2rem 0 0; color: var(--muted); font-size: .61rem; }
.rule-drag-handle { width: 2.25rem; min-height: 1.7rem; padding: .38rem .42rem; display: grid; gap: 3px; border: 0; border-radius: .42rem; color: var(--muted); background: transparent; cursor: grab; }
.rule-drag-handle span { width: 1.1rem; height: 2px; display: block; justify-self: center; border-radius: 2px; background: currentColor; }
.rule-drag-handle:hover, .rule-drag-handle:focus-visible { color: var(--pine); background: var(--pine-soft); outline: none; }
.rule-drag-handle:active { cursor: grabbing; }
.list-result-summary { padding: .55rem .75rem; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface-soft); font-size: .64rem; }
.pagination { padding: .75rem; display: flex; align-items: center; justify-content: center; gap: .65rem; border-top: 1px solid var(--line); }
.pagination-pages { display: flex; align-items: center; gap: .3rem; }
.pagination-page { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); font-size: .68rem; font-weight: 700; text-decoration: none; }
.pagination-page:hover, .pagination-page:focus-visible { border-color: var(--pine); outline: none; }
.pagination-page.is-active { border-color: var(--pine); color: #fff; background: var(--pine); }
.pagination .is-disabled { pointer-events: none; opacity: .45; }
.resource-not-found { min-height: 18rem; display: grid; place-content: center; justify-items: center; gap: .6rem; text-align: center; }
.resource-not-found .button { margin-top: .5rem; }
.rule-move-buttons { display: flex; gap: .35rem; }
.rule-business-status { border-color: transparent; }
.status-confirmed { color: #334532; background: #dfe9dc; }
.status-shadow { color: #715a34; background: #f2e4c9; }
.status-blocked { color: #7d4038; background: #f2dcd7; }
.status-legacy_candidate { color: #5d6060; background: #e6e7e5; }
.status-archived { color: #5d6060; background: #e6e7e5; }

.users-grid { grid-template-columns: minmax(0, 1.25fr) minmax(250px, .45fr); }
.stacked-form { display: grid; gap: .75rem; }
.stacked-form label { display: grid; gap: .3rem; color: var(--muted); font-size: .72rem; }
.stacked-form label small { font-size: .65rem; }
.user-list { display: grid; gap: .65rem; }
.user-card { padding: .78rem; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface-soft); }
.user-avatar { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .7rem; color: var(--avatar-ink, var(--pine)); background: var(--avatar-bg, var(--pine-soft)); font-size: .78rem; font-weight: 700; letter-spacing: .025em; }
.avatar-tone-0 { --avatar-bg: #dfe7dc; --avatar-ink: #40503c; }
.avatar-tone-1 { --avatar-bg: #eee2d0; --avatar-ink: #755e3f; }
.avatar-tone-2 { --avatar-bg: #eadbd3; --avatar-ink: #765248; }
.avatar-tone-3 { --avatar-bg: #dce5e6; --avatar-ink: #496065; }
.avatar-tone-4 { --avatar-bg: #e5e3cf; --avatar-ink: #62613e; }
.avatar-tone-5 { --avatar-bg: #e9dfd6; --avatar-ink: #6f594a; }
.avatar-tone-6 { --avatar-bg: #dce1e8; --avatar-ink: #4b586d; }
.avatar-tone-7 { --avatar-bg: #eadde1; --avatar-ink: #704f5a; }
.user-copy { min-width: 0; }
.user-title { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.user-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.user-copy > small { display: block; margin-top: .16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.user-access-badge { padding: .19rem .42rem; border: 1px solid #d2c7b9; border-radius: 999px; color: #4f554f; background: var(--surface); font-size: .55rem; font-weight: 700; letter-spacing: .025em; }
.user-access-badge.is-super-admin { border-color: #b9c5b5; color: #354730; background: var(--pine-soft); }
.user-meta { margin-top: .55rem; display: flex; flex-wrap: wrap; gap: .4rem .85rem; }
.user-meta .user-fact { min-width: 8rem; display: grid; gap: .08rem; }
.user-fact small { color: var(--muted); font-size: .53rem; text-transform: uppercase; letter-spacing: .055em; }
.user-fact strong { color: var(--ink); font-size: .62rem; font-weight: 650; }
.user-fact-properties { min-width: min(22rem, 100%) !important; }
.user-actions { display: grid; justify-items: end; gap: .45rem; }
.user-suspended { opacity: 1; border-style: dashed; }
.users-grid-inline { grid-template-columns: 1fr; }
.user-card.is-editing { border-color: #cbb58f; background: #f8f3eb; box-shadow: 0 0 0 2px rgba(185,157,117,.11); }
.user-card.is-editing .button { border-color: var(--gold); color: #fff; background: var(--gold); }
.user-inline-editor { position: static; margin: -.12rem 0 .4rem 3.35rem; border-color: #d9c8ad; background: #fbf8f3; box-shadow: none; }
.user-inline-editor .panel-heading { padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.user-inline-editor .panel-heading > div span { display: block; margin-top: .16rem; color: var(--muted); font-size: .66rem; }
.tag-active { border-color: #b9c5b5; color: #3f503b; background: var(--pine-soft); }
.tag-suspended { border-color: #dfbbb8; color: #84302c; background: var(--red-soft); }
.user-editor { align-self: start; position: sticky; top: 1rem; }
.user-new-editor { position: static; margin-bottom: .9rem; }
.user-protected-field { padding: .72rem .78rem; display: grid; gap: .15rem; border: 1px solid #cbd5c8; border-radius: .58rem; background: var(--pine-soft); }
.user-protected-field small { color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .055em; }
.user-protected-field strong { color: var(--pine-dark); font-size: .76rem; }
.user-protected-field span { color: var(--muted); font-size: .64rem; }
.role-permission-panel { margin-top: 1rem; overflow: hidden; }
.role-permission-panel > .section-title { padding: 1rem 1rem .8rem; }
.role-permission-panel .section-title p { max-width: 54rem; }
.permission-matrix-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.permission-matrix { width: 100%; min-width: 48rem; border-collapse: collapse; }
.permission-matrix th, .permission-matrix td { padding: .66rem .8rem; border-bottom: 1px solid var(--line); text-align: center; }
.permission-matrix thead th { position: sticky; top: 0; z-index: 1; color: var(--ink); background: var(--surface); font-size: .7rem; }
.permission-matrix thead th:first-child, .permission-matrix tbody th { width: 35%; text-align: left; }
.permission-matrix thead th:first-child { left: 0; z-index: 3; }
.permission-matrix tbody tr:not(.permission-group-row) > th { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: .35rem 0 .65rem rgba(51,54,50,.035); }
.permission-matrix tbody th strong, .permission-matrix tbody th small { display: block; }
.permission-matrix tbody th strong { color: var(--ink); font-size: .72rem; }
.permission-matrix tbody th small { margin-top: .1rem; color: var(--muted); font-size: .57rem; font-weight: 400; }
.permission-matrix .permission-group-row th { padding: .48rem .8rem; color: var(--pine); background: var(--sage-soft); font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; }
.permission-check { position: relative; width: 1.55rem; height: 1.55rem; display: inline-grid; place-items: center; cursor: pointer; }
.permission-check input { position: absolute; opacity: 0; }
.permission-check > span[aria-hidden] { width: 1.2rem; height: 1.2rem; border: 1px solid var(--line-strong); border-radius: .35rem; background: var(--surface); transition: .15s ease; }
.permission-check input:checked + span { border-color: var(--pine); background: var(--pine); box-shadow: inset 0 0 0 3px var(--pine); }
.permission-check input:checked + span::after { content: '✓'; display: grid; place-items: center; color: #fff; font-size: .72rem; line-height: 1.1rem; }
.permission-check input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.permission-matrix-actions { padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.permission-matrix-actions p { margin: 0; color: var(--muted); font-size: .68rem; }
.permission-scroll-hint { display: none; }
.role-super-admin-note { margin-bottom: 1rem; padding: .8rem .9rem; display: flex; align-items: center; gap: .75rem; border: 1px solid #becabb; border-radius: .75rem; background: var(--pine-soft); }
.role-super-admin-mark { width: 2.45rem; height: 2.45rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--pine); font-size: .66rem; font-weight: 750; letter-spacing: .04em; }
.role-super-admin-note strong { display: block; color: var(--pine-dark); font-size: .76rem; }
.role-super-admin-note p { margin: .12rem 0 0; color: var(--muted); font-size: .66rem; }
.users-panel { margin-top: .25rem; }
.property-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.property-card { padding: 1rem; min-width: 0; }
.property-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.property-card-top > .ui-tooltip .ui-tooltip-content { right: 0; left: auto; transform: translate(0, -.2rem); }
.property-card-top > .ui-tooltip.is-open .ui-tooltip-content { transform: translate(0, 0); }
.property-symbol { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: .7rem; color: var(--pine); background: var(--pine-soft); }
.property-card h2 { font-size: .95rem; }
.property-card > a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
.property-card dl { margin: 1rem 0 0; display: grid; gap: .6rem; }
.property-card dl div { display: flex; justify-content: space-between; gap: .75rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.property-card dt, .property-card dd { margin: 0; font-size: .7rem; }
.property-card dt { color: var(--muted); }
.property-identity-badge-large { width: 2.7rem; height: 2.7rem; min-width: 2.7rem; min-height: 2.7rem; font-size: .72rem; }
.property-identity-editor { margin: .85rem 0; padding: .75rem; display: grid; gap: .7rem; border: 1px solid var(--line); border-radius: .68rem; background: var(--surface-soft); }
.property-identity-fields { display: grid; grid-template-columns: minmax(5.5rem, .35fr) minmax(0, 1fr); align-items: end; gap: .7rem; }
.property-identity-fields > label { display: grid; gap: .3rem; color: var(--muted); font-size: .62rem; }
.property-identity-fields input[type="text"] { width: 100%; padding: .48rem .55rem; border: 1px solid var(--line); border-radius: .5rem; color: var(--ink); background: #fff; text-transform: uppercase; }
.property-identity-fields fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.property-identity-fields legend { margin-bottom: .3rem; color: var(--muted); font-size: .62rem; }
.property-tone-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.property-tone-option { position: relative; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.property-tone-option input { position: absolute; opacity: 0; pointer-events: none; }
.property-tone-option > span { width: 1.75rem; height: 1.75rem; display: block; border: 1px solid rgba(45,45,40,.14); border-radius: 50%; background: currentColor; transition: border-color .16s ease; }
.property-tone-option small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.property-tone-option input:checked + span { border: 2px solid var(--pine); }
.property-tone-option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }
.property-tone-option.property-tone-coral { color: #e4ada5; }
.property-tone-option.property-tone-sky { color: #b8d5e4; }
.property-tone-option.property-tone-amber { color: #e5c477; }
.property-tone-option.property-tone-sage { color: #b8c9b4; }
.property-tone-option.property-tone-lavender { color: #cbbdde; }
.property-tone-option.property-tone-sand { color: #d6c6ad; }
.property-identity-editor > .button { justify-self: start; }
.property-unconnected { background: #fbf9f6; }
.property-unconnected > small { display: block; min-height: 2.6rem; color: var(--muted); font-size: .7rem; line-height: 1.45; }

.calendar-heading { align-items: center; }
.calendar-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; flex-wrap: wrap; }
.calendar-focus-toggle { min-height: 2.45rem; padding: .52rem .78rem; font-size: .8rem; }
.calendar-range-switch { display: inline-flex; padding: .2rem; border: 1px solid var(--line); border-radius: .68rem; background: var(--surface); }
.calendar-range-switch a { padding: .48rem .72rem; border-radius: .48rem; color: var(--muted); text-decoration: none; font-size: .72rem; }
.calendar-range-switch a[aria-current="page"] { color: #fff; background: var(--pine); }
.calendar-summary { margin-bottom: .85rem; display: grid; grid-template-columns: repeat(3, minmax(100px, auto)) 1fr; gap: .55rem; align-items: center; }
.calendar-summary > div { padding: .65rem .75rem; display: flex; align-items: baseline; gap: .42rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.calendar-summary strong { color: var(--pine); font-family: "Playfair Display", Georgia, serif; font-size: 1.2rem; font-weight: 600; }
.calendar-summary span { color: var(--muted); font-size: .67rem; }
.calendar-summary > small { justify-self: end; text-align: right; font-size: .66rem; }
.smart-calendar-panel { padding: 0; overflow: hidden; }
.calendar-legend { padding: .75rem .9rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); background: #fbfaf8; overflow-x: auto; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: .34rem; flex: 0 0 auto; color: var(--muted); font-size: .65rem; }
.calendar-legend i { width: .7rem; height: .7rem; border: 1px solid var(--line); border-radius: .2rem; }
.legend-reserved { border-color: var(--pine) !important; background: var(--pine); }
.legend-available { background: var(--pine-soft); }
.legend-gap { border-color: var(--amber) !important; background: #d7b26f; }
.legend-gap-2d { border-color: #80917b !important; background: #c9d7c4; }
.legend-commercial { border-color: #879783 !important; background: #eef2ec; box-shadow: inset 0 -3px 0 #6c8067; }
.legend-action { border-color: #a96d43 !important; background: #a96d43; box-shadow: 0 0 0 3px rgba(169,109,67,.12); }
.legend-blocked { border-color: #b56a64 !important; background: repeating-linear-gradient(135deg, #f4d8d5 0 4px, #fff0ef 4px 8px); }
.smart-calendar-scroll { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; scrollbar-color: #b9b2a8 transparent; }
.smart-calendar { min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--surface); }
.smart-calendar th, .smart-calendar td { border-right: 1px solid #e9e3da; border-bottom: 1px solid #e9e3da; }
.smart-calendar thead th { position: sticky; top: 0; z-index: 11; width: 68px; height: 3rem; color: var(--muted); background: #fbfaf8; text-align: center; }
.smart-calendar thead th > span, .smart-calendar thead th > small { display: block; }
.smart-calendar thead th > span { color: var(--ink); font-size: .82rem; }
.smart-calendar thead th > small { margin-top: .14rem; font-size: .57rem; text-transform: uppercase; }
.smart-calendar .calendar-room-heading { position: sticky; top: 0; left: 0; z-index: 13; width: 240px; min-width: 240px; padding: 0 .8rem; text-align: left; }
.smart-calendar thead .is-saturday { background-color: #f8f3ec; }
.smart-calendar thead .is-sunday { border-right-color: rgba(83,98,78,.28); background-color: #f1f4ef; }
.smart-calendar thead .is-today { box-shadow: inset 0 3px 0 var(--gold); }
.calendar-room-group-label { position: sticky; left: 0; z-index: 10; width: 240px; min-width: 240px; height: 2rem; padding: .3rem .65rem; color: var(--pine-dark); background: #eef2ec; text-align: left; box-shadow: 5px 0 10px rgba(51,54,50,.035); }
.calendar-room-group-label strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "Playfair Display", Georgia, serif; font-size: .72rem; font-weight: 650; }
.calendar-group-spacer { height: 2rem; padding: 0; color: #64765f; background: #eef5eb; text-align: center; }
.calendar-availability-count { position: relative; z-index: 3; width: 100%; height: 100%; padding: 0; border: 0; color: inherit; background: transparent; cursor: help; font-size: .62rem; font-weight: 650; }
.calendar-availability-count:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.calendar-room-label { position: sticky; left: 0; z-index: 10; width: 240px; min-width: 240px; height: 2.75rem; padding: .28rem .5rem; background: var(--surface); text-align: left; box-shadow: 5px 0 10px rgba(51,54,50,.035); }
.calendar-room-label > img, .calendar-room-placeholder { width: 2.15rem; height: 2.15rem; margin-right: .45rem; display: inline-grid; place-items: center; border-radius: .45rem; object-fit: cover; background: var(--pine-soft); vertical-align: middle; }
.calendar-room-label > span:last-child { width: calc(100% - 2.85rem); display: inline-block; vertical-align: middle; }
.calendar-room-label strong, .calendar-room-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-room-label strong { font-size: .7rem; }
.calendar-room-label small { margin-top: .12rem; font-weight: 400; font-size: .57rem; }
.calendar-night { position: relative; width: 68px; min-width: 68px; height: 2.75rem; padding: 3px; text-align: center; background: #fafaf8; }
.calendar-night > span, .calendar-night > a { position: relative; z-index: 3; width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: .04rem; border-radius: .28rem; text-decoration: none; }
.calendar-occupancy { position: absolute; z-index: 2; top: 5px; bottom: 5px; display: block; border-radius: 0; background: var(--pine); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); pointer-events: none; }
.calendar-occupancy.occupancy-left { left: -1px; width: calc(50% + 1px); border-radius: .3rem 0 0 .3rem; }
.calendar-occupancy.occupancy-right { right: -1px; width: calc(50% + 1px); border-radius: 0 .3rem .3rem 0; }
.calendar-occupancy.occupancy-full { right: -1px; left: -1px; }
.calendar-night.has-reservation-segments > span,
.calendar-night.has-reservation-segments > a { background: transparent; }
.calendar-night.has-reservation-segments.status-available { background: var(--pine-soft); }
.calendar-night.has-reservation-segments.status-blocked { background: repeating-linear-gradient(135deg, #f4d8d5 0 5px, #fff0ef 5px 10px); }
.calendar-night.has-reservation-segments.status-unavailable { background: #f1efeb; }
.calendar-night.has-reservation-segments.is-gap { background: #e2c187; }
.calendar-night.has-reservation-segments.is-gap.is-gap-2d { background: #c9d7c4; }
.calendar-night.is-weekend, .calendar-group-spacer.is-weekend { position: relative; }
.calendar-night.is-weekend::after, .calendar-group-spacer.is-weekend::after { position: absolute; z-index: 2; inset: 0; content: ""; pointer-events: none; }
.calendar-night.is-saturday::after, .calendar-group-spacer.is-saturday::after { background: rgba(185,157,117,.07); }
.calendar-night.is-sunday, .calendar-group-spacer.is-sunday { border-right-color: rgba(83,98,78,.28); }
.calendar-night.is-sunday::after, .calendar-group-spacer.is-sunday::after { background: rgba(83,98,78,.075); }
.calendar-night.status-reserved > span { background: transparent; }
.calendar-night.status-available > span { color: transparent; background: transparent; font-size: 1rem; }
.calendar-night.status-blocked > span { background: repeating-linear-gradient(135deg, #f4d8d5 0 5px, #fff0ef 5px 10px); }
.calendar-night.status-unavailable > span { background: #f1efeb; }
.calendar-night.is-interval > a { align-content: center; gap: .08rem; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.calendar-night.is-gap > a { border: 1px solid #b88d4d; color: #5e4324; background: #e2c187; }
.calendar-night.is-gap.is-gap-2d > a { border-color: #80917b; color: #354730; background: #c9d7c4; }
.calendar-night.is-gap-2d.is-interval-start { position: relative; z-index: 4; }
.smart-calendar tbody tr:has(td.ui-tooltip.is-open) { position: relative; z-index: 120; }
.smart-calendar td.ui-tooltip.is-open { position: relative; z-index: 121; }
.smart-calendar td.ui-tooltip.is-open > .ui-tooltip-content { z-index: 122; }
.calendar-night.is-interval b { font-size: .57rem; letter-spacing: .04em; }
.calendar-night.is-interval small { color: inherit; font-size: .52rem; }
.calendar-night.has-suggestion > a { border: 1px solid #a9b5a5; color: #354730; background: #eef2ec; box-shadow: inset 0 -3px 0 rgba(83,98,78,.22); }
.calendar-night.has-action > a { box-shadow: inset 0 -3px 0 #a96d43, 0 0 0 1px rgba(169,109,67,.22); }
.calendar-night.has-reservation-segments > span:not(.ui-tooltip-content),
.calendar-night.has-reservation-segments > a { background: transparent !important; }
.calendar-night > a[data-calendar-timeline],
.calendar-night > a.calendar-timeline-ribbon { --calendar-timeline-span: 1; position: absolute; z-index: 7; top: 9px; bottom: 9px; left: 50%; width: calc(var(--calendar-timeline-span) * 100%); height: auto; padding: 0 .15rem; display: flex; align-items: center; justify-content: center; border: 1px solid #a9b5a5; border-radius: 999px; color: #354730; background: #eef2ec !important; box-shadow: 0 2px 5px rgba(51,54,50,.12); white-space: nowrap; overflow: hidden; }
.calendar-night.is-gap > a[data-calendar-timeline] { border-color: #b88d4d; color: #5e4324; background: #e2c187 !important; }
.calendar-night.has-action > a[data-calendar-timeline] { box-shadow: inset 0 -3px 0 #a96d43, 0 2px 5px rgba(51,54,50,.14); }
.calendar-night.calendar-timeline-origin { z-index: 7; }
.calendar-night.calendar-timeline-continuation > a[data-calendar-timeline] { visibility: hidden; pointer-events: none; }
.calendar-timeline-label { max-width: 100%; overflow: hidden; font-size: .75rem; font-weight: 750; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.calendar-night.has-reservation-segments.is-interval .calendar-rule-codes,
.calendar-night.has-reservation-segments.is-interval .calendar-discount-change,
.calendar-night.has-reservation-segments.is-interval .calendar-active-discount { display: none; }
td.calendar-night > span.calendar-cell-tooltip { position: fixed; z-index: 100; width: max-content; min-width: 13.5rem; max-width: min(22rem, calc(100vw - 2rem)); height: auto; padding: .65rem .72rem; display: block; place-items: initial; align-content: initial; border: 1px solid #d8cec1; border-radius: .56rem; color: var(--ink); background: #fffdf9; box-shadow: 0 .7rem 1.8rem rgba(39,52,43,.16); font-size: .64rem; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; }
td.calendar-group-spacer > span.calendar-group-tooltip { position: fixed; z-index: 100; width: max-content; min-width: 13.5rem; max-width: min(22rem, calc(100vw - 2rem)); height: auto; padding: .65rem .72rem; display: block; border: 1px solid #d8cec1; border-radius: .56rem; color: var(--ink); background: #fffdf9; box-shadow: 0 .7rem 1.8rem rgba(39,52,43,.16); font-size: .64rem; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; }
.optimization-heading-hint { color: var(--ink); font-size: .69rem; font-weight: 700; }
.disabled-control-tooltip:focus-visible { border-radius: .35rem; outline: 2px solid var(--gold); outline-offset: 2px; }
.calendar-interval-code { display: inline-flex; align-items: baseline; gap: .18rem; font-size: .55rem; letter-spacing: .04em; }
.calendar-interval-code small { font-size: .46rem; font-weight: 750; letter-spacing: 0; opacity: .78; }
.calendar-rule-codes { max-width: 100%; overflow: hidden; color: #465b41 !important; font-size: .43rem !important; font-weight: 750; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.calendar-discount-change, .calendar-active-discount { font-size: .45rem !important; line-height: 1; }
.calendar-action-flags { position: absolute !important; right: 1px; bottom: 1px; width: auto !important; height: auto !important; display: flex !important; gap: 1px; }
.calendar-action-flags i { min-width: .76rem; height: .68rem; padding: 0 .1rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .16rem; color: #fff; background: #a96d43; font-size: .37rem; font-style: normal; font-weight: 750; line-height: 1; }
.interval-marker { font-weight: 750; letter-spacing: .045em; }
.interval-marker-gap { border-color: #b88d4d; color: #5e4324; background: #f3e2c3; }
.interval-marker-gap.interval-marker-gap-2d { border-color: #80917b; color: #354730; background: #dfe9dc; }
.calendar-empty .empty-state { max-width: 600px; margin: 0 auto; }
.flow-list { margin: 0; padding: 0; list-style: none; }
.flow-list li { padding: .72rem 0; display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); gap: .7rem; align-items: center; border-bottom: 1px solid var(--line); }
.flow-list li:last-child { border-bottom: 0; }
.flow-list li > span { width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; color: var(--pine); background: var(--pine-soft); font-size: .7rem; }
.flow-list strong, .flow-list small { display: block; }
.flow-list strong { font-size: .76rem; }
.flow-list small { margin-top: .16rem; font-size: .67rem; }
.account-details { margin: 0; display: grid; gap: .75rem; }
.account-details div { padding-bottom: .7rem; display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.account-details div:last-child { padding-bottom: 0; border-bottom: 0; }
.account-details dt, .account-details dd { margin: 0; font-size: .75rem; }
.account-details dt { color: var(--muted); }

.heading-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.mail-transport-status { margin-bottom: 1rem; padding: .78rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: .85rem; border: 1px solid var(--line); border-radius: .75rem; font-size: .72rem; }
.mail-transport-status strong { white-space: nowrap; }
.mail-transport-status span { color: var(--muted); }
.mail-transport-status .status-matrix-inline { flex: 1; }
.mail-transport-status .status-matrix-inline b { color: var(--ink); }
.mail-transport-copy { min-width: 0; display: flex; align-items: center; gap: .7rem; flex: 1; }
.mail-transport-settings { flex: 0 0 auto; }
.mail-ready { color: var(--pine); background: var(--pine-soft); }
.mail-preview { color: var(--amber); background: var(--amber-soft); }
.communication-composer { margin-bottom: 1rem; }
.communication-composer .panel-heading > div span { display: block; margin-top: .2rem; color: var(--muted); font-size: .7rem; }
.offer-prefill-note { margin-bottom: .85rem; padding: .65rem .75rem; display: flex; align-items: center; gap: .7rem; border: 1px solid #d8c9b3; border-radius: .58rem; background: var(--amber-soft); }
.offer-prefill-note > img { width: 78px; height: 58px; flex: 0 0 auto; display: block; object-fit: cover; border-radius: .42rem; }
.offer-prefill-note > div { min-width: 0; display: grid; gap: .12rem; }
.offer-prefill-note strong { color: var(--amber); font-size: .68rem; }
.offer-prefill-note span { color: var(--muted); font-size: .6rem; line-height: 1.4; }
.extension-policy-preview { margin-bottom: .9rem; padding: .85rem; border: 1px solid var(--line); border-radius: .72rem; background: var(--surface-soft); }
.extension-policy-heading { margin-bottom: .65rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.extension-policy-heading span { color: var(--muted); font-size: .66rem; }
.extension-policy-heading strong { color: var(--pine); font-size: .68rem; }
.extension-policy-options { display: grid; grid-template-columns: 1fr 1.25fr; gap: .55rem; }
.extension-policy-options article { padding: .7rem; display: grid; gap: .2rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); }
.extension-policy-options article.is-primary { border-color: #b99d75; box-shadow: inset 3px 0 0 #b99d75; }
.extension-policy-options span { color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .055em; }
.extension-policy-options strong { font-size: .78rem; }
.extension-policy-options em { color: var(--pine); font-size: .65rem; font-style: normal; font-weight: 650; }
.extension-policy-preview > p { margin: .62rem 0 0; color: var(--muted); font-size: .62rem; line-height: 1.5; }
.communication-form { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.communication-form .builder-footer { grid-column: 1 / -1; }
.checkbox-card { min-height: 2.6rem; padding: .55rem .65rem; display: flex !important; flex-direction: row !important; align-items: center; gap: .45rem !important; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
.checkbox-card input { width: auto !important; }
.safety-inline { color: var(--muted); font-size: .7rem; }
.recipient-picker, .notification-preferences { margin: .8rem 0 0; padding: .8rem; border: 1px solid var(--line); border-radius: .65rem; }
.recipient-picker legend, .notification-preferences legend { padding: 0 .35rem; color: var(--muted); font-size: .68rem; }
.recipient-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.recipient-picker label { padding: .55rem; display: flex; align-items: center; gap: .5rem; border-radius: .5rem; background: var(--surface); }
.recipient-picker label span, .recipient-picker label strong, .recipient-picker label small { display: block; min-width: 0; }
.recipient-picker label strong { font-size: .7rem; }
.recipient-picker label small { margin-top: .12rem; overflow: hidden; text-overflow: ellipsis; font-size: .61rem; }
.notification-preferences { display: grid; gap: .5rem; }
.notification-preferences label { display: flex; flex-direction: row; align-items: center; gap: .45rem; }
.notification-preferences input { width: auto; }
.user-property-assignments { margin: .8rem 0 0; padding: .8rem; border: 1px solid var(--line); border-radius: .65rem; }
.user-property-assignments legend { padding: 0 .35rem; color: var(--muted); font-size: .68rem; }
.user-property-assignments > p { margin: 0 0 .65rem; color: var(--muted); font-size: .65rem; line-height: 1.45; }
.user-property-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.user-property-option { min-height: 3rem; padding: .55rem .62rem; display: grid !important; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: .48rem !important; border: 1px solid var(--line); border-radius: .58rem; background: var(--surface); color: var(--ink) !important; cursor: pointer; }
.user-property-option:has(input:checked) { border-color: #aebca9; background: var(--pine-soft); }
.user-property-option input { width: auto !important; margin: 0; }
.user-property-option strong { min-width: 0; font-size: .65rem; line-height: 1.25; }
.notification-preference-row, .toggle-with-help { display: flex; align-items: center; gap: .25rem; }
.notification-preference-row label, .toggle-with-help label { margin: 0; }
.communication-stats { margin-top: 1rem; }
.communication-toolbar { padding: .85rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.communication-toolbar h2 { margin: 0; }
.communication-type-filters { margin: 0; padding: .72rem .85rem; border-bottom: 1px solid var(--line); }
.proposal-type-filters { margin-top: .75rem; }
.message-subject { min-width: 260px; }
.message-subject a { color: var(--ink); font-weight: 650; }
.tag-customer { color: var(--pine); background: var(--pine-soft); }
.tag-internal { color: var(--blue); background: var(--blue-soft); }
.tag-status-draft, .tag-status-approved { color: var(--amber); background: var(--amber-soft); }
.tag-status-queued, .tag-status-sending { color: var(--blue); background: var(--blue-soft); }
.tag-status-sent { color: var(--pine); background: var(--pine-soft); }
.tag-status-failed, .tag-status-cancelled { color: var(--red); background: var(--red-soft); }
.tag-status-blocked { color: #7b4b2d; background: #f6eadf; }
.templates-section { margin-top: 1.3rem; }
.template-grid { display: grid; gap: .65rem; }
.templates-section h2 { font-family: "Jost", ui-sans-serif, system-ui, sans-serif; font-weight: 650; letter-spacing: -.012em; }
.template-message-icon svg { width: 1.18rem; height: 1.18rem; display: block; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.template-editor { margin-top: .9rem; }
.template-editor code { font-size: .68rem; }
.communication-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .55fr); gap: 1rem; align-items: start; }
.message-preview-panel { padding: 0; overflow: hidden; }
.email-envelope { padding: .9rem 1rem; display: grid; gap: .5rem; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.email-envelope div { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: .6rem; }
.email-envelope span { color: var(--muted); font-size: .66rem; }
.email-envelope strong { overflow-wrap: anywhere; font-size: .72rem; }
.email-preview { width: 100%; min-height: 680px; display: block; border: 0; background: #f3f7f4; }
.text-preview { padding: .8rem 1rem; border-top: 1px solid var(--line); }
.text-preview summary { cursor: pointer; color: var(--muted); font-size: .7rem; }
.text-preview pre { margin: .8rem 0 0; padding: .8rem; overflow: auto; border-radius: .55rem; white-space: pre-wrap; background: var(--surface-soft); font: .7rem/1.5 ui-monospace, monospace; }
.message-control-panel { position: sticky; top: 1rem; }
.message-metadata { margin: 0; display: grid; gap: .55rem; }
.message-metadata div { padding-bottom: .55rem; display: flex; justify-content: space-between; gap: .7rem; border-bottom: 1px solid var(--line); }
.message-metadata dt, .message-metadata dd { margin: 0; font-size: .69rem; }
.message-metadata dt { color: var(--muted); }
.message-metadata dd { text-align: right; }
.offer-summary { margin-top: .8rem; padding: .75rem; display: grid; gap: .25rem; border-radius: .65rem; color: var(--pine); background: var(--pine-soft); }
.offer-summary strong { margin-bottom: .2rem; }
.offer-summary span { font-size: .68rem; }
.offer-review-card { margin-top: .85rem; padding: .78rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-soft); }
.offer-review-heading, .offer-review-option-top, .offer-review-expiry { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.offer-review-heading > div { display: grid; gap: .12rem; }
.offer-review-heading > div > span { color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; }
.offer-review-heading > div > strong { font-size: .78rem; }
.offer-review-options { margin-top: .65rem; display: grid; gap: .48rem; }
.offer-review-option { padding: .65rem; border: 1px solid var(--line); border-radius: .58rem; background: var(--surface); }
.offer-review-option.is-primary { border-color: #b99d75; box-shadow: inset 3px 0 0 #b99d75; }
.offer-review-option-top strong { font-size: .7rem; }
.offer-review-option-top span { padding: .18rem .35rem; border-radius: 999px; color: #fff; background: var(--pine); font-size: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.offer-review-discount { margin-top: .35rem; color: var(--pine); font-family: Georgia, serif; font-size: 1.02rem; }
.offer-review-option small { display: block; margin-top: .18rem; color: var(--muted); font-size: .6rem; }
.offer-review-help { margin: .65rem 0 0; color: var(--muted); font-size: .61rem; line-height: 1.5; }
.offer-review-expiry { margin-top: .65rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.offer-review-expiry span, .offer-review-expiry strong { font-size: .62rem; }
.offer-review-expiry span { color: var(--muted); }
.message-actions { margin-top: .85rem; display: grid; gap: .5rem; }
.message-schedule summary { cursor: pointer; list-style: none; }
.message-schedule form { display: grid; gap: .65rem; margin-top: .65rem; }
.message-schedule label { display: grid; gap: .35rem; }

.back-link { display: inline-block; margin-bottom: .35rem; color: var(--muted); font-size: .7rem; }
.intervention-heading { align-items: center; }
.intervention-review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .34fr); gap: 1rem; align-items: start; }
.intervention-main { display: grid; gap: 1rem; }
.decision-reason { margin: 0; font-size: .88rem; line-height: 1.65; }
.decision-meta { margin: 1rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.decision-meta div { padding: .7rem; border-radius: .6rem; background: var(--surface-soft); }
.decision-meta dt, .state-card dt { color: var(--muted); font-size: .62rem; }
.decision-meta dd, .state-card dd { margin: .2rem 0 0; font-size: .72rem; font-weight: 650; }
.state-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.state-card { border-top: 4px solid #b8aaa0; }
.state-after { border-top-color: var(--pine); background: #fbfdfb; }
.state-eyebrow { color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.state-card h2 { margin: .35rem 0 .85rem; font-size: 1rem; }
.state-card dl { margin: 0; display: grid; gap: .45rem; }
.state-card dl div { padding: .62rem .7rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
.verification-panel > p { margin: 0; color: var(--muted); line-height: 1.6; }
.verification-message { margin-top: .75rem; padding: .7rem; border-radius: .55rem; background: var(--surface-soft); font-size: .7rem; }
.review-timeline article { padding: .75rem 0; border-top: 1px solid var(--line); }
.review-timeline article > div { display: flex; justify-content: space-between; gap: 1rem; }
.review-timeline article span { color: var(--muted); font-size: .64rem; }
.review-timeline article p { margin: .4rem 0 0; font-size: .74rem; line-height: 1.55; }
.intervention-actions { position: sticky; top: 1rem; display: grid; gap: .75rem; }
.intervention-actions > h2 { margin: 0; }
.intervention-actions > p { margin: 0 0 .15rem; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.intervention-actions form { display: grid; gap: .4rem; }
.intervention-actions form small { color: var(--muted); font-size: .6rem; line-height: 1.45; }
.challenge-form { padding: .75rem; border: 1px solid #d9b2aa; border-radius: .65rem; background: var(--red-soft); }
.challenge-form label { display: grid; gap: .35rem; color: var(--red); font-size: .67rem; font-weight: 650; }
.challenge-form textarea { width: 100%; padding: .58rem .65rem; resize: vertical; border: 1px solid #d9b2aa; border-radius: .5rem; color: var(--ink); background: #fff; font: inherit; line-height: 1.45; }
.button-danger { border-color: #a66a55; color: #8f513f; background: #fff; }
.button-danger:hover { border-color: #8f513f; background: #fbefeb; }
.action-divider { position: relative; margin: .2rem 0; text-align: center; }
.action-divider::before { position: absolute; inset: 50% 0 auto; height: 1px; background: var(--line); content: ""; }
.action-divider span { position: relative; padding: 0 .5rem; color: var(--muted); background: var(--surface); font-size: .58rem; text-transform: uppercase; letter-spacing: .05em; }
.safety-callout { padding: .75rem; display: grid; gap: .28rem; border-radius: .65rem; background: var(--amber-soft); }
.safety-callout strong { color: #674f30; font-size: .68rem; }
.safety-callout span { color: #675f54; font-size: .62rem; line-height: 1.5; }
.history-heading p { margin-top: .2rem; color: var(--muted); font-size: .75rem; }
.history-intervention-panel { margin-bottom: 1rem; padding: 1rem; }
.history-section-heading { margin-bottom: .8rem; padding: 0; }
.history-section-heading > div { min-width: 0; }
.history-section-heading h2 { margin: 0; }
.history-section-heading p { margin: .18rem 0 0; color: var(--muted); font-size: .68rem; }
.history-section-heading > span { min-width: 2rem; height: 2rem; padding: 0 .55rem; display: inline-grid; place-items: center; border-radius: 999px; color: var(--pine); background: var(--pine-soft); font-size: .68rem; font-weight: 700; }
.history-intervention-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; }
.history-intervention-card { min-width: 0; padding: .85rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; border: 1px solid var(--line); border-radius: .78rem; background: var(--surface-soft); }
.history-intervention-card > header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.history-intervention-card > header .tag { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.history-property { min-width: 0; display: inline-flex; align-items: center; gap: .45rem; }
.history-property > strong { overflow: hidden; color: var(--muted); font-size: .66rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.history-intervention-main { min-width: 0; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); align-items: center; gap: .6rem; }
.history-intervention-main > div { min-width: 0; }
.history-intervention-id { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: .62rem; color: var(--pine); background: var(--pine-soft); font-size: .68rem; font-weight: 750; }
.history-intervention-main a { color: var(--ink); }
.history-intervention-main strong { font-size: .82rem; }
.history-intervention-main small { display: block; margin-top: .18rem; color: var(--muted); font-size: .62rem; }
.history-intervention-meta { margin: 0; display: grid; grid-template-columns: 1fr .75fr 1.2fr; gap: .5rem; }
.history-intervention-meta > div { min-width: 0; padding-top: .55rem; border-top: 1px solid var(--line); }
.history-intervention-meta dt { margin-bottom: .16rem; color: var(--muted); font-size: .55rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.history-intervention-meta dd { margin: 0; overflow-wrap: anywhere; font-size: .66rem; line-height: 1.35; }
.history-audit-panel { margin-bottom: 1rem; }
.history-audit-panel > .history-section-heading { margin: 0; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.history-audit-table code { font-size: .6rem; white-space: nowrap; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: var(--canvas); }
.auth-shell { width: min(1100px, 100%); min-height: 660px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); overflow: hidden; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); box-shadow: var(--shadow); }
.auth-story { position: relative; padding: 3.2rem; color: #fff; background: linear-gradient(145deg, #53624e, #3d473a); display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; overflow: hidden; }
.auth-story::after { content: ""; position: absolute; width: 23rem; height: 23rem; right: -11rem; bottom: -12rem; border: 1px solid rgba(185,157,117,.42); border-radius: 50%; box-shadow: 0 0 0 4rem rgba(185,157,117,.05), 0 0 0 8rem rgba(185,157,117,.04); pointer-events: none; }
.auth-story > * { position: relative; z-index: 1; }
.auth-story .brand { width: fit-content; padding: 0 0 1rem; }
.brand-logo-auth { width: 8.2rem; }
.auth-story h1 { max-width: 470px; font-size: clamp(2.15rem, 4vw, 3.15rem); font-weight: 500; line-height: 1.08; }
.auth-story p { max-width: 470px; color: rgba(255,255,255,.72); line-height: 1.6; }
.auth-story ul { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; color: rgba(255,255,255,.84); font-size: .8rem; }
.auth-story li::before { content: ""; width: .42rem; height: .42rem; margin-right: .62rem; display: inline-block; border-radius: 50%; background: var(--gold); vertical-align: .08rem; }
.auth-form-wrap { padding: 2rem; display: grid; place-items: center; }
.auth-form { width: min(100%, 350px); }
.auth-form h2 { margin-bottom: .35rem; font-size: 1.45rem; }
.auth-form > p { margin-bottom: 1.25rem; color: var(--muted); font-size: .8rem; }
.auth-form label { display: grid; gap: .38rem; margin-top: .85rem; color: var(--muted); font-size: .72rem; }
.auth-form .button { margin-top: 1rem; }
.security-note { display: block; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); line-height: 1.5; font-size: .67rem; }
.auth-centered { background: linear-gradient(145deg, #53624e, #3d473a); }
.auth-form-card, .error-card { padding: 2rem; border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow); }
.auth-card-logo { width: 8.4rem; height: auto; display: block; margin: 0 auto 1.4rem; }
.otp-input { text-align: center; font-size: 1.3rem !important; letter-spacing: .35rem; }
.error-card { width: min(430px, 100%); text-align: center; }
.error-card > strong { display: block; color: var(--pine); font-size: 3rem; }
.error-card h1 { margin: .5rem 0 1.2rem; }

@media (max-width: 980px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid, .users-grid { grid-template-columns: 1fr; }
    .property-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gap-card { grid-template-columns: 3.5rem minmax(0, 1fr); }
    .gap-room-photo { width: min(100%, 32rem); height: auto; }
    .mitigation-box { grid-column: 2; }
    .rule-builder-form { grid-template-columns: 1fr; }
    .form-section-wide, .builder-footer { grid-column: 1; }
    .human-rule-summary { grid-template-columns: 1fr; }
    .user-editor { position: static; }
    .communication-detail-grid { grid-template-columns: 1fr; }
    .message-control-panel { position: static; }
    .intervention-review-grid { grid-template-columns: 1fr; }
    .intervention-actions { position: static; }
    .history-intervention-list { grid-template-columns: 1fr; }
}

@media (max-width: 740px) {
    :root { font-size: 16px; }
    .state-comparison, .decision-meta { grid-template-columns: 1fr; }
    .review-timeline article > div { align-items: flex-start; flex-direction: column; gap: .2rem; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { padding: .8rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 .75rem; }
    .brand { min-width: 0; padding: 0; }
    .brand { min-height: 3.15rem; padding-bottom: .7rem; }
    .brand-logo { width: 5.8rem; }
    .brand-product { padding-left: .55rem; }
    .brand-product strong { font-size: .78rem; }
    .brand-product small { display: none; }
    .mobile-menu-toggle { min-height: 2.6rem; padding: .5rem .7rem; display: inline-flex; align-items: center; gap: .5rem; border: 1px solid rgba(255,255,255,.18); border-radius: .65rem; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; font-size: .8rem; }
    .mobile-menu-icon { width: 1rem; display: grid; gap: 3px; }
    .mobile-menu-icon i { display: block; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
    .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-icon i:first-child { transform: translateY(4.5px) rotate(45deg); }
    .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-icon i:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-icon i:last-child { transform: translateY(-4.5px) rotate(-45deg); }
    .navigation { display: none; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; margin-top: .8rem; padding: .75rem 0 0; border-top: 1px solid rgba(255,255,255,.13); }
    .sidebar.mobile-menu-open .navigation { display: grid; }
    .navigation a { min-height: 2.75rem; padding: .75rem; display: flex; align-items: center; white-space: normal; font-size: .84rem; }
    .sidebar-user { display: none; grid-column: 1 / -1; margin-top: .7rem; padding: .75rem 0 0; }
    .sidebar.mobile-menu-open .sidebar-user { display: flex; }
    .sidebar-user-copy strong { font-size: .82rem; }
    .sidebar-user-copy small { font-size: .7rem; }
    .topbar { min-height: 3.7rem; padding: .75rem 1rem; gap: .62rem; }
    .topbar > div:first-child { display: none; }
    .topbar strong { font-size: .83rem; }
    .topbar small { display: none; }
    .header-refresh-button { min-height: 2.55rem; padding: .3rem .44rem; gap: .32rem; }
    .header-refresh-button::after { content: "Sync"; font-size: .66rem; font-weight: 750; }
    .header-refresh-copy { display: none; }
    .header-refresh .advance-refresh-orbit { width: 27px; height: 27px; }
    .header-refresh-popover { position: fixed; top: 4.2rem; right: 1rem; left: 1rem; width: auto; }
    .header-refresh-popover::before { right: auto; left: 29px; }
    .context-indicator { max-width: 38vw; margin-left: auto; padding: .38rem .55rem; }
    .context-indicator small { display: block; font-size: .52rem; }
    .context-indicator strong { font-size: .66rem; }
    .mode-badge { font-size: .65rem; }
    .page-content { padding: 1.15rem 1rem 2rem; }
    .app-footer { padding: 0 1rem 1.2rem; font-size: .65rem; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .rules-section-heading { align-items: flex-start; flex-direction: column; gap: .6rem; }
    .rules-heading-actions { width: 100%; justify-content: space-between; }
    .property-filter-module { padding: .7rem 0 .65rem; grid-template-columns: 1fr; gap: .5rem; overflow: hidden; }
    .property-filter-label { padding: 0 .75rem; }
    .property-filter-options { padding: .05rem .75rem .35rem; }
    .property-filter-chip { height: 2.6rem; min-height: 2.6rem; }
    .proposal-extension-grid { grid-template-columns: 1fr; }
    .page-heading p { font-size: .88rem; line-height: 1.45; }
    .property-cards { grid-template-columns: 1fr; gap: .85rem; }
    .property-card { padding: 1.05rem; border-radius: 1rem; }
    .property-card h2 { font-size: 1rem; }
    .property-card > a { white-space: normal; overflow-wrap: anywhere; font-size: .78rem; line-height: 1.4; }
    .property-card dt, .property-card dd { font-size: .78rem; }
    .property-card dl div { padding-top: .7rem; }
    .gap-card { padding: .8rem; grid-template-columns: 3.2rem minmax(0, 1fr); align-items: start; }
    .gap-date { width: 3rem; height: 3rem; }
    .gap-room-photo { width: 100%; height: auto; }
    .calendar-heading { gap: .7rem; }
    .calendar-range-switch { width: 100%; }
    .calendar-range-switch a { flex: 1; text-align: center; }
    .calendar-summary { grid-template-columns: repeat(3, 1fr); }
    .calendar-summary > div { padding: .55rem; align-items: center; flex-direction: column; gap: .05rem; text-align: center; }
    .calendar-summary > small { grid-column: 1 / -1; justify-self: start; text-align: left; }
    .smart-calendar-panel { margin-right: -1rem; margin-left: -1rem; border-radius: 0; }
    .smart-calendar .calendar-room-heading, .calendar-room-label, .calendar-room-group-label { width: 132px; min-width: 132px; }
    .smart-calendar thead th, .calendar-night { width: 52px; min-width: 52px; }
    .calendar-room-label { padding: .3rem .4rem; }
    .calendar-room-label > img, .calendar-room-placeholder { width: 2.15rem; height: 2.15rem; margin-right: .3rem; }
    .calendar-room-label > span:last-child { width: calc(100% - 2.75rem); }
    .calendar-room-label strong { font-size: .64rem; }
    .calendar-room-label small { font-size: .52rem; }
    .mitigation-box { grid-column: 1 / -1; }
    .commercial-heading { align-items: flex-start; }
    .promotion-day { grid-template-columns: 2.7rem minmax(0, 1fr); }
    .promotion-components { grid-column: 2; }
    .optimization-overview { align-items: flex-start; flex-direction: column; gap: .15rem; }
    .optimization-overview small { text-align: left; }
    .optimization-zone > .button { width: 100%; }
    .ui-tooltip-content, .ui-tooltip.tooltip-above .ui-tooltip-content, .ui-tooltip.align-left .ui-tooltip-content, .ui-tooltip.align-right .ui-tooltip-content { position: fixed; top: auto; right: 1rem; bottom: 1rem; left: 1rem; width: auto; min-width: 0; max-width: none; transform: translateY(.35rem); }
    .ui-tooltip.is-open .ui-tooltip-content, .ui-tooltip.tooltip-above.is-open .ui-tooltip-content { transform: translateY(0); }
    .application-mode-bar { align-items: flex-start; }
    .suggestion-actions { align-items: stretch; flex-direction: column; }
    .suggestion-actions .button, .suggestion-actions form { width: 100%; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .field-wide { grid-column: 1 / -1; }
    .rule-builder-guide { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
    .rule-builder-guide::-webkit-scrollbar { display: none; }
    .rule-builder-guide span { flex: 0 0 auto; }
    .builder-footer { align-items: stretch; flex-direction: column; }
    .builder-footer .button { width: 100%; }
    .rule-order-form { align-items: stretch; flex-direction: column; }
    .rule-order-form span { margin-right: 0; }
    .rule-order-form .button { width: 100%; }
    .auth-body { padding: 0; display: block; }
    .auth-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
    .auth-story { padding: 2rem 1.4rem; gap: 1.7rem; }
    .auth-story .brand { padding-bottom: .8rem; }
    .brand-logo-auth { width: 7.4rem; }
    .auth-story .brand-product small { display: block; }
    .auth-story h1 { font-size: 2.25rem; }
    .auth-form-wrap { padding: 2.2rem 1.4rem; }
    .communication-form { grid-template-columns: 1fr; }
    .extension-policy-options { grid-template-columns: 1fr; }
    .communication-form .builder-footer { grid-column: 1; }
    .recipient-picker { grid-template-columns: 1fr 1fr; }
    .communication-toolbar { align-items: stretch; flex-direction: column; }
    .communication-toolbar .inline-filter { width: 100%; }
    .email-preview { min-height: 560px; }
    .proposal-table-wrap { overflow: visible; }
    .proposal-table, .proposal-table tbody, .proposal-table tr, .proposal-table td { display: block; width: 100%; }
    .proposal-table thead { display: none; }
    .proposal-table tbody { padding: .75rem; }
    .proposal-table tr { margin-bottom: .8rem; overflow: hidden; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); box-shadow: 0 5px 14px rgba(39, 49, 37, .045); }
    .proposal-table tr:last-child { margin-bottom: 0; }
    .proposal-table td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: .78rem; line-height: 1.4; }
    .proposal-table td:last-child { border-bottom: 0; }
    .proposal-table td::before { content: attr(data-label); display: block; margin-bottom: .28rem; color: var(--muted); font-size: .6rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
    .proposal-table td strong { font-size: .84rem; }
    .proposal-table td small { color: var(--muted); font-size: .7rem; }
    .proposal-table .reason-cell { min-width: 0; max-width: none; }
    .proposal-table .row-actions { align-items: stretch; }
    .proposal-table .row-actions form, .proposal-table .row-actions .button { flex: 1; width: 100%; }
    .history-intervention-panel { padding: .8rem; }
    .history-intervention-meta { grid-template-columns: 1fr 1fr; }
    .history-intervention-meta > div:last-child { grid-column: 1 / -1; }
    .history-audit-wrap { overflow: visible; }
    .history-audit-table, .history-audit-table tbody, .history-audit-table tr, .history-audit-table td { display: block; width: 100%; }
    .history-audit-table thead { display: none; }
    .history-audit-table tbody { padding: .75rem; }
    .history-audit-table tr { margin-bottom: .7rem; overflow: hidden; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
    .history-audit-table tr:last-child { margin-bottom: 0; }
    .history-audit-table td { padding: .62rem .75rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: .72rem; }
    .history-audit-table td:last-child { border-bottom: 0; }
    .history-audit-table td::before { content: attr(data-label); display: block; margin-bottom: .2rem; color: var(--muted); font-size: .54rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
    .history-audit-table code { white-space: normal; }
}

@media (max-width: 640px) {
    .ui-tooltip-trigger { width: 2.75rem; height: 2.75rem; }
    .rule-drag-handle { width: 2.75rem; min-height: 2.75rem; }
    .pagination { justify-content: space-between; gap: .4rem; }
    .pagination-pages { gap: .18rem; }
    .pagination-page { width: 2.35rem; height: 2.35rem; }
    .stats-grid, .property-cards { grid-template-columns: 1fr; }
    .property-identity-fields { grid-template-columns: 1fr; }
    .property-identity-editor > .button { width: 100%; }
    .stat { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .25rem 1rem; align-items: center; }
    .stat strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
    .signal-row { grid-template-columns: 2.25rem minmax(0, 1fr); }
    .signal-row .tag { grid-column: 2; }
    .rule-card { grid-template-columns: 2.8rem minmax(0, 1fr); align-items: start; }
    .rule-actions { grid-column: 2; justify-items: start; }
    .human-rule-heading { align-items: flex-start; flex-direction: column; }
    .human-rule-summary { grid-column: 1 / -1; }
    .rule-policy-header { grid-template-columns: 2.35rem minmax(0, 1fr); }
    .rule-policy-side { grid-column: 2; min-width: 0; width: 100%; justify-items: start; }
    .rule-policy-side .rule-property-chips { justify-content: flex-start; }
    .rule-order-toolbar { grid-template-columns: 1fr; }
    .rule-order-form + .rule-order-form { border-top: 1px solid var(--line); border-left: 0; }
    .rule-policy-admin-row { justify-content: flex-start; flex-wrap: wrap; }
    .human-rule-card[data-rule-policy-id] { margin-left: .35rem; }
    .human-rule-card .rule-actions { width: 100%; }
    .human-rule-card .rule-actions form, .human-rule-card .rule-actions .button { width: 100%; }
    .rule-drag-handle { display: grid; }
    .rule-move-buttons { width: 100%; }
    .rule-move-buttons .button { flex: 1; }
    .rule-history li > div { align-items: flex-start; flex-direction: column; gap: .15rem; }
    .rule-history li span { text-align: left; }
    .mode-form { width: 100%; align-items: stretch; }
    .mode-form label, .mode-form select, .mode-form .button { width: 100%; }
    .form-grid, .form-grid-compact, .trigger-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: 1; }
    .weekday-picker { display: grid; grid-template-columns: 1fr 1fr; }
    .weekday-picker strong { grid-column: 1 / -1; }
    .user-card { grid-template-columns: 2.6rem minmax(0, 1fr); align-items: start; }
    .user-inline-editor { margin: -.1rem 0 .5rem; }
    .user-actions { grid-column: 2; display: flex; align-items: center; justify-content: space-between; }
    .user-actions .button { min-height: 2.3rem; }
    .user-meta { display: grid; grid-template-columns: 1fr; }
    .user-property-grid { grid-template-columns: 1fr; }
    .mail-transport-status { align-items: flex-start; flex-direction: column; }
    .mail-transport-copy { width: 100%; align-items: flex-start; flex-direction: column; }
    .mail-transport-settings { width: 100%; }
    .status-matrix-inline { width: 100%; }
    .status-matrix-inline > span { min-width: 0; flex: 1 1 7rem; }
    .worker-health { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
    .worker-health-tag { grid-column: 2; }
    .sync-source-list { grid-template-columns: 1fr; }
    .recipient-picker { grid-template-columns: 1fr; }
    .email-envelope div { grid-template-columns: 1fr; gap: .15rem; }
}

/* Email delivery profiles */
.email-settings-intro { margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface-soft); }
.email-settings-intro strong { color: var(--pine); font-size: .76rem; }
.email-settings-intro p { margin: .25rem 0 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.email-profile-list { display: grid; gap: 1rem; }
.email-profile-card { padding: 1rem; scroll-margin-top: 1rem; }
.automation-property-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin: .95rem 0; }
.automation-property-picker .property-filter-chip { font-size: .76rem; }
.automation-property-master { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding: .8rem; border: 1px solid var(--pine); border-radius: .7rem; background: var(--sage-soft); }
.automation-property-master strong { margin-right: auto; }
.automation-property-master input[type="text"], .automation-matrix-control input[type="text"] { min-height: 2.2rem; width: 9.5rem; padding: .42rem .55rem; border: 1px solid var(--line-strong); border-radius: .5rem; background: var(--surface); }
.automation-toggle { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; font-weight: 700; }
.automation-toggle input { width: 1rem; height: 1rem; accent-color: var(--pine); }
.automation-matrix-head, .automation-matrix-row { display: grid; grid-template-columns: minmax(11rem, 1fr) minmax(17rem, 20rem) minmax(12rem, 14rem); align-items: center; gap: .75rem; }
.automation-matrix-head { margin-top: 1rem; padding: .45rem .75rem; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.automation-matrix-group { margin-bottom: .65rem; border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; }
.automation-matrix-row { min-height: 3.8rem; padding: .55rem .75rem; border-top: 1px solid var(--line); background: var(--surface); }
.automation-matrix-row:first-child { border-top: 0; }
.automation-matrix-category { background: var(--sage-soft); }
.automation-matrix-category strong { display: flex; align-items: baseline; gap: .45rem; }
.automation-matrix-category small { color: var(--muted); font-weight: 400; }
.automation-type-label { font-weight: 600; }
.automation-matrix-control { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.automation-email-controls { display: grid; gap: .65rem; min-width: 0; }
.automation-email-controls label { max-width: 100%; }
.automation-email-controls select { width: 100%; }
.automation-matrix-control input[type="text"] { flex: 1 1 7rem; min-width: 7rem; }
.automation-matrix-control .button { min-height: 2.2rem; padding: .4rem .65rem; }
.automation-channel-unavailable { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.automation-channel-unavailable input { width: 1rem; height: 1rem; flex: 0 0 auto; }
.automation-switch-note { margin: .8rem 0 0; color: var(--muted); }
.whatsapp-template-statuses { display: grid; gap: .45rem; margin-top: .85rem; }
.whatsapp-template-statuses > div { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: .5rem; }
.whatsapp-template-statuses strong { margin-right: auto; }
.whatsapp-template-statuses code, #whatsapp-profile .email-profile-footer code { overflow-wrap: anywhere; font-size: .7rem; }
.whatsapp-test-panel { margin-top: .85rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .6rem; }
.whatsapp-test-panel summary { cursor: pointer; font-weight: 700; }
.whatsapp-test-panel p { color: var(--muted); }
@media (max-width: 900px) {
    .automation-matrix-head { display: none; }
    .automation-matrix-row { grid-template-columns: 1fr; gap: .45rem; padding: .75rem; }
    .automation-matrix-control::before { content: "Email"; min-width: 5.5rem; color: var(--muted); font-size: .72rem; font-weight: 700; }
    .automation-channel-unavailable::before { content: "WhatsApp"; min-width: 5.5rem; color: var(--muted); font-weight: 700; }
}
.email-profile-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.email-profile-heading h2 { margin: .16rem 0 .22rem; font-size: 1.2rem; }
.email-profile-heading p { margin: 0; color: var(--muted); font-size: .68rem; }
.email-profile-state { display: grid; justify-items: end; gap: .3rem; }
.email-profile-state small { color: var(--muted); font-size: .58rem; }
.email-profile-form { padding-top: .9rem; }
.email-profile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.email-profile-grid label { font-weight: 700; }
.email-profile-grid label small { font-weight: 400; }
.email-profile-footer { margin-top: .85rem; display: flex; align-items: center; justify-content: flex-end; gap: .65rem; }
.email-profile-test { margin-top: .85rem; padding-top: .8rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); }
.email-profile-test > div { display: grid; gap: .15rem; }
.email-profile-test strong { font-size: .7rem; }
.email-profile-test span { color: var(--muted); font-size: .62rem; }

@media (max-width: 900px) {
    .email-profile-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .email-profile-heading, .email-profile-test { align-items: stretch; flex-direction: column; }
    .email-profile-state { justify-items: start; }
    .email-profile-grid { grid-template-columns: 1fr; }
    .email-profile-footer { align-items: stretch; flex-direction: column; }
    .email-profile-footer .button, .email-profile-test .button { width: 100%; }
}

/* Reporting */
.report-page-heading { align-items: flex-end; gap: 1rem; }
.report-periods, .report-tabs { display: flex; align-items: center; gap: .3rem; padding: .28rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.report-periods a, .report-periods button, .report-tabs a { min-height: 2.25rem; padding: .55rem .78rem; border: 0; border-radius: .55rem; color: var(--muted); background: transparent; font: inherit; font-size: .76rem; text-decoration: none; cursor: pointer; }
.report-periods a[aria-current="page"], .report-tabs a[aria-current="page"] { color: #fff; background: var(--pine); }
.report-periods button[aria-expanded="true"] { color: var(--pine); background: var(--sage-soft); }
.report-custom-period { margin: -.25rem 0 1rem auto; padding: .7rem; display: flex; width: max-content; align-items: end; gap: .65rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.report-custom-period[hidden] { display: none; }
.report-custom-period label { display: grid; gap: .25rem; color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.report-custom-period input { min-height: 2.35rem; padding: .45rem .6rem; border: 1px solid var(--line-strong); border-radius: .55rem; background: var(--surface); }
.report-tabs { width: max-content; margin: 1rem 0; }
.report-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; margin-bottom: .9rem; }
.report-kpi { min-height: 8.5rem; padding: 1rem; display: flex; flex-direction: column; justify-content: space-between; }
.report-kpi > span { color: var(--muted); font-size: .74rem; }
.report-kpi strong { color: var(--ink); font-family: var(--font-display); font-size: clamp(1.55rem, 2.2vw, 2.35rem); font-weight: 500; line-height: 1; }
.report-kpi small { color: var(--muted); font-size: .64rem; line-height: 1.35; }
.report-kpi-accent { border-color: rgba(80, 101, 77, .4); background: var(--sage-soft); }
.report-kpi-date { font-family: var(--font-body) !important; font-size: .92rem !important; line-height: 1.3 !important; }
.report-chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17rem, .7fr); gap: .85rem; margin-bottom: .9rem; }
.report-chart-grid-balanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-chart-card { padding: 1rem; }
.report-insights { padding: 1rem; }
.report-insights header h2 { margin: 0; font-size: 1.05rem; }
.report-insights header p { margin: .2rem 0 .75rem; color: var(--muted); font-size: .7rem; }
.report-insight-list { display: grid; gap: .55rem; }
.report-insight { padding: .7rem .75rem; border-left: 3px solid var(--line-strong); border-radius: .15rem .6rem .6rem .15rem; background: var(--surface-soft); }
.report-insight strong { display: block; font-size: .72rem; }
.report-insight p { margin: .2rem 0 0; color: var(--muted); font-size: .65rem; line-height: 1.45; }
.report-insight > small { margin-top: .45rem; padding-top: .4rem; display: block; border-top: 1px solid rgba(77,88,75,.12); color: var(--muted); font-size: .55rem; line-height: 1.4; }
.report-insight-positive { border-left-color: var(--pine); background: var(--sage-soft); }
.report-insight-attention { border-left-color: var(--gold); background: #f8f0e4; }
.report-chart-card > header { margin-bottom: .75rem; }
.report-chart-card h2 { margin: 0; font-size: 1.05rem; }
.report-chart-card header p { margin: .2rem 0 0; color: var(--muted); font-size: .7rem; }
.report-chart { min-height: 17rem; }
.report-chart-viewport { width: 100%; overflow-x: hidden; overscroll-behavior-inline: contain; touch-action: pan-x pan-y pinch-zoom; }
.report-line-chart svg { display: block; width: 100%; max-width: none; height: auto; overflow: visible; }
.report-chart-controls { display: none; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .55rem; }
.report-chart-pan-hint { color: var(--muted); font-size: .62rem; }
.report-chart-zoom-toggle { margin-left: auto; white-space: nowrap; }
.report-line-chart-tall { min-height: 21rem; }
.report-chart-gridline { stroke: rgba(86, 92, 82, .13); stroke-width: 1; }
.report-chart-axis { fill: var(--muted); font-family: var(--font-body); font-size: 12px; }
.report-chart-point { cursor: help; stroke: var(--surface); stroke-width: 2; }
.report-chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem 1rem; color: var(--muted); font-size: .66rem; }
.report-chart-legend span, .report-donut-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.report-chart-legend i, .report-donut-legend i { width: .55rem; height: .55rem; display: inline-block; border-radius: 50%; }
.report-donut-chart { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(8rem, .8fr); align-items: center; }
.report-donut-chart svg { width: 100%; max-width: 14rem; margin: auto; }
.report-donut-value { fill: var(--ink); font-family: var(--font-display); font-size: 35px; }
.report-donut-label { fill: var(--muted); font-size: 13px; }
.report-donut-legend { display: grid; gap: .5rem; font-size: .7rem; }
.report-donut-legend > div { display: flex; justify-content: space-between; gap: .5rem; }
.report-chart-empty { min-height: 16rem; display: grid; place-content: center; gap: .25rem; text-align: center; color: var(--muted); }
.report-chart-empty strong { color: var(--ink); }
.report-table-panel { margin-bottom: .9rem; overflow: hidden; }
.report-table-panel .section-title { padding: 1rem; }
.report-table-panel table { width: 100%; }
.report-property { display: inline-flex; align-items: center; gap: .55rem; }
.report-property .property-identity-badge { flex: 0 0 auto; }
.report-source-note { margin-top: .75rem; padding: .8rem 1rem; display: flex; gap: .7rem; border-left: 3px solid var(--gold); color: var(--muted); background: rgba(189, 155, 103, .08); font-size: .7rem; line-height: 1.5; }
.report-source-note strong { flex: 0 0 auto; color: var(--ink); }
.report-tone-pine { background: #50654d; }.report-tone-gold { background: #bd9b67; }.report-tone-blue { background: #6d91a6; }
.report-tone-coral { background: #bd756d; }.report-tone-sand { background: #d8cdb9; }.report-tone-amber { background: #d1a84d; }
.report-tone-sage { background: #91a48c; }.report-tone-lavender { background: #988cac; }.report-tone-sky { background: #79a9bc; }.report-tone-neutral { background: #7b8078; }

@media (max-width: 1100px) {
    .report-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-chart-grid { grid-template-columns: 1fr; }
    .report-donut-chart { grid-template-columns: minmax(10rem, .55fr) minmax(12rem, .45fr); }
}

@media (max-width: 760px) {
    .permission-scroll-hint { margin: 0; padding: .55rem .8rem; display: block; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface-soft); font-size: .61rem; text-align: right; }
    .permission-matrix-wrap { overscroll-behavior-inline: contain; touch-action: pan-x pan-y pinch-zoom; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
    .permission-matrix-wrap::-webkit-scrollbar { height: .32rem; }
    .permission-matrix-wrap::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--gold); }
    .permission-matrix { width: max-content; min-width: 48rem; }
    .permission-matrix thead th:first-child, .permission-matrix tbody th { width: 15rem; min-width: 15rem; }
    .permission-matrix thead th:not(:first-child), .permission-matrix tbody td { min-width: 8rem; }
    .permission-matrix thead th:first-child, .permission-matrix tbody tr:not(.permission-group-row) > th { position: static; left: auto; z-index: auto; box-shadow: none; }
    .report-page-heading { align-items: stretch; }
    .report-periods { width: 100%; overflow-x: auto; scrollbar-width: none; }
    .report-periods::-webkit-scrollbar { display: none; }
    .report-periods a, .report-periods button { flex: 0 0 auto; }
    .report-custom-period { width: 100%; margin-top: -.35rem; display: grid; grid-template-columns: 1fr 1fr; }
    .report-custom-period .button { grid-column: 1 / -1; width: 100%; }
    .report-kpis { grid-template-columns: 1fr 1fr; }
    .report-kpi { min-height: 7.25rem; }
    .report-donut-chart { grid-template-columns: 1fr; }
    .report-donut-chart svg { max-width: 12rem; }
    .report-source-note { align-items: flex-start; flex-direction: column; gap: .2rem; }
    .report-chart { min-height: 0; }
    .report-line-chart-tall { min-height: 0; }
    .report-chart-controls { display: flex; }
    .report-line-chart.is-detailed .report-chart-viewport { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
    .report-line-chart.is-detailed .report-chart-viewport::-webkit-scrollbar { height: .28rem; }
    .report-line-chart.is-detailed .report-chart-viewport::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--gold); }
    .report-line-chart.is-detailed .report-chart-viewport svg { width: var(--report-chart-detail-width); }
    .report-line-chart:not(.is-detailed) .report-chart-pan-hint { visibility: hidden; }
}

@media (max-width: 480px) {
    .report-kpis { grid-template-columns: 1fr; }
    .report-kpi { min-height: 6.7rem; }
    .report-custom-period { grid-template-columns: 1fr; }
    .report-custom-period .button { grid-column: 1; }
    .report-tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
    .report-tabs::-webkit-scrollbar { display: none; }
    .report-tabs a { flex: 0 0 auto; text-align: center; }
    .permission-matrix-actions { align-items: stretch; flex-direction: column; }
    .permission-matrix-actions .button { width: 100%; }
}

/* SMS management */
.communications-heading p, .sms-heading p { margin: .25rem 0 0; color: var(--muted); }
.communication-channel-nav { margin: 0; padding: .22rem; display: flex; width: max-content; max-width: 100%; gap: .2rem; overflow-x: auto; border: 1px solid var(--line); border-radius: .8rem; background: rgba(255,255,255,.7); scrollbar-width: none; }
.communication-channel-nav-heading { flex: 0 0 auto; align-self: center; }
.communication-channel-nav::-webkit-scrollbar { display: none; }
.communication-channel-nav a { min-width: 5.75rem; padding: .55rem .9rem; border-radius: .62rem; color: var(--muted); font-size: .7rem; font-weight: 700; text-align: center; text-decoration: none; white-space: nowrap; }
.communication-channel-nav a:hover { color: var(--pine); background: var(--surface-soft); }
.communication-channel-nav a[aria-current="page"] { color: #fff; background: var(--pine); box-shadow: 0 .2rem .55rem rgba(53,72,51,.14); }
.context-back-link { margin: -.25rem 0 .9rem; display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .7rem; font-weight: 700; text-decoration: none; }
.context-back-link:hover { color: var(--pine); }
.sms-provider-panel { margin-bottom: .9rem; padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: linear-gradient(135deg, rgba(80,101,77,.08), rgba(255,255,255,.72)); }
.sms-provider-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sms-provider-summary h2 { margin: .15rem 0 0; font-size: 1.15rem; }
.sms-provider-state { padding: .48rem .72rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--pine); background: var(--surface); font-size: .68rem; font-weight: 700; }
.sms-safety-grid { margin-top: .85rem; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .55rem; }
.sms-safety-grid article { padding: .7rem; border: 1px solid rgba(80,101,77,.14); border-radius: .65rem; background: rgba(255,255,255,.76); }
.sms-safety-grid small, .sms-safety-grid strong { display: block; }
.sms-safety-grid small { margin-bottom: .18rem; color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .045em; }
.sms-safety-grid strong { font-size: .72rem; }
.sms-provider-note { max-width: 68rem; margin: .75rem 0 0; color: var(--muted); font-size: .66rem; line-height: 1.55; }
.sms-settings-disclosure { margin-top: .75rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.sms-settings-disclosure summary { width: max-content; color: var(--pine); font-size: .7rem; font-weight: 700; cursor: pointer; }
.sms-settings-form { margin-top: .75rem; display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: end; gap: .65rem; }
.sms-settings-form label:not(.checkbox-card) { display: grid; gap: .25rem; color: var(--muted); font-size: .64rem; font-weight: 700; }
.sms-settings-form input, .sms-settings-form select { min-height: 2.55rem; padding: .55rem .65rem; border: 1px solid var(--line-strong); border-radius: .55rem; background: var(--surface); }
.sms-settings-form label small { color: var(--muted); font-size: .56rem; font-weight: 400; }
.sms-stats { margin-bottom: .9rem; }
.sms-history-panel { margin-bottom: 1rem; padding: 1rem; }
.sms-history-panel .panel-heading p, .sms-template-editor .panel-heading p, .rules-section-heading p { margin: .18rem 0 0; color: var(--muted); font-size: .66rem; }
.sms-status-filters { margin: .7rem 0; }
.sms-history-list { min-width: 0; display: grid; gap: .55rem; }
.sms-history-item { min-width: 0; width: 100%; padding: .8rem; display: grid; grid-template-columns: minmax(17rem,1.4fr) minmax(8rem,.55fr) auto; gap: .55rem 1rem; align-items: center; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.sms-history-item > * { min-width: 0; }
.sms-history-identity { min-width: 0; display: flex; align-items: center; gap: .6rem; }
.sms-history-identity > div { min-width: 0; }
.sms-history-identity strong, .sms-history-identity small, .sms-history-recipient small, .sms-history-recipient strong, .sms-history-state small { display: block; }
.sms-history-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.sms-history-identity small, .sms-history-recipient small, .sms-history-state small { margin-top: .14rem; color: var(--muted); font-size: .58rem; }
.sms-history-recipient { min-width: 0; }
.sms-history-recipient strong { overflow-wrap: anywhere; font-size: .7rem; }
.sms-history-state { justify-self: end; text-align: right; }
.sms-history-preview { grid-column: 1 / -1; margin: 0; padding-top: .55rem; overflow-wrap: anywhere; border-top: 1px solid var(--line); color: var(--muted); font-size: .66rem; line-height: 1.5; }
.sms-history-error { grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; color: #9b483f; font-size: .62rem; }
.sms-template-list { display: grid; gap: .6rem; }
.sms-template-card { padding: .85rem; display: grid; grid-template-columns: minmax(0,1.4fr) auto auto; align-items: center; gap: .7rem 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.sms-template-card.is-disabled { opacity: .65; }
.sms-template-copy h3 { margin: .12rem 0; font-size: .86rem; }
.sms-template-copy p { margin: 0; color: var(--muted); font-size: .64rem; }
.sms-template-metrics { display: flex; flex-wrap: wrap; gap: .3rem; }
.sms-template-metrics span { padding: .35rem .48rem; border-radius: .42rem; color: var(--muted); background: var(--surface-soft); font-size: .58rem; }
.sms-template-actions { display: flex; align-items: center; gap: .45rem; }
.sms-template-editor { margin-top: .8rem; padding: 1rem; }
.sms-editor-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.sms-editor-meta span { padding: .65rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface-soft); }
.sms-editor-meta small, .sms-editor-meta strong { display: block; }
.sms-editor-meta small { margin-bottom: .2rem; color: var(--muted); font-size: .57rem; text-transform: uppercase; letter-spacing: .04em; }
.sms-editor-meta strong { overflow-wrap: anywhere; font-size: .65rem; }

@media (max-width: 900px) {
    .sms-safety-grid { grid-template-columns: 1fr 1fr; }
    .sms-settings-form { grid-template-columns: 1fr 1fr; }
    .sms-history-item { grid-template-columns: minmax(0,1fr) auto; }
    .sms-history-recipient { grid-column: 1; }
    .sms-history-state { grid-column: 2; grid-row: 1 / span 2; }
    .sms-template-card { grid-template-columns: minmax(0,1fr) auto; }
    .sms-template-metrics { grid-column: 1; }
    .sms-template-actions { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 640px) {
    .communication-channel-nav-heading { width: 100%; align-self: stretch; }
    .communication-channel-nav-heading a { min-width: 0; flex: 1; }
    .context-back-link { margin-top: -.15rem; }
    .sms-provider-summary { align-items: flex-start; }
    .sms-safety-grid, .sms-settings-form, .sms-editor-meta { grid-template-columns: 1fr; }
    .sms-settings-form .button { width: 100%; }
    .sms-history-item { grid-template-columns: minmax(0,1fr); align-items: start; }
    .sms-history-recipient, .sms-history-state { grid-column: 1; grid-row: auto; justify-self: start; text-align: left; }
    .sms-history-preview, .sms-history-error { grid-column: 1; }
    .sms-template-card { grid-template-columns: 1fr; }
    .sms-template-metrics, .sms-template-actions { grid-column: 1; grid-row: auto; }
    .sms-template-actions { justify-content: space-between; }
}

/* Calendar focus mode keeps the operational controls and gives the grid the full tab. */
body.calendar-page:not(.calendar-focus) .page-content,
body.calendar-page:not(.calendar-focus) .app-footer { max-width: none; }
body.calendar-page:not(.calendar-focus) .page-content { padding-right: 1rem; padding-left: 1rem; }
body.calendar-focus { min-width: 960px; background: var(--surface-soft); }
.calendar-focus .app-shell { min-height: 100vh; display: block; }
.calendar-focus .sidebar,
.calendar-focus .topbar,
.calendar-focus .app-footer { display: none; }
.calendar-focus .main-area { min-width: 0; min-height: 100vh; display: block; }
.calendar-focus .page-content { max-width: none; padding: .7rem .9rem; }
.calendar-focus .page-heading { margin-bottom: .35rem; }
.calendar-focus .page-heading h1 { font-size: 1.55rem; }
.calendar-focus .property-filter-module { margin: .35rem 0 .45rem; padding: .45rem .6rem; }
.calendar-focus .property-filter-chip { height: 2.15rem; min-height: 2.15rem; padding: .3rem .55rem; }
.calendar-focus .property-filter-chip .property-identity-badge { width: 1.4rem; height: 1.4rem; min-width: 1.4rem; min-height: 1.4rem; }
.calendar-focus .calendar-summary { display: none; }
.calendar-focus .calendar-legend { padding: .45rem .65rem; gap: .8rem; }
.calendar-focus .smart-calendar-scroll { max-height: calc(100vh - 9.6rem); }
.calendar-focus .smart-calendar thead th { height: 1.8rem; padding-right: .25rem; padding-left: .25rem; line-height: 1; }
.calendar-focus .smart-calendar thead th > span,
.calendar-focus .smart-calendar thead th > small { display: inline; margin: 0; font-size: .75rem !important; }
.calendar-focus .smart-calendar thead th > small::before { content: " "; }
.calendar-focus .smart-calendar tbody tr:has(> .calendar-room-group-label) { display: none; }
.calendar-focus .calendar-room-group-label,
.calendar-focus .calendar-group-spacer { height: 1.45rem; padding-top: .12rem; padding-bottom: .12rem; }
.calendar-focus .calendar-room-label,
.calendar-focus .calendar-night { height: 1.65rem; }
.calendar-focus .calendar-room-label { padding-top: .1rem; padding-bottom: .1rem; }
.calendar-focus .calendar-room-label > img,
.calendar-focus .calendar-room-placeholder { display: none; }
.calendar-focus .calendar-room-label > span:last-child { width: 100%; }
.calendar-focus .calendar-room-label small { display: none; }
.calendar-focus .calendar-discount-change,
.calendar-focus .calendar-active-discount,
.calendar-focus .calendar-night.is-interval .calendar-rule-codes { display: none; }
.calendar-focus .calendar-night > a[data-calendar-timeline] { top: 5px; bottom: 5px; }

/* Readability floor for operational copy. Compact calendar codes remain separate. */
.app-shell .brand-product small,
.app-shell .sidebar-user-copy small,
.app-shell .topbar small,
.app-shell .context-indicator small,
.app-shell .context-indicator strong,
.app-shell .mode-badge,
.app-shell .tag,
.app-shell .app-footer,
.app-shell .button-small,
.app-shell .worker-health small,
.app-shell .status-matrix-inline small,
.app-shell .status-matrix-inline b,
.app-shell .application-mode-bar > div span,
.app-shell .stat small,
.app-shell .panel-heading a,
.app-shell .panel-heading span,
.app-shell .signal-row small,
.app-shell .property-list p,
.app-shell .safety-note,
.app-shell .mode-form label,
.app-shell .inline-filter label,
.app-shell .password-field > button,
.app-shell th,
.app-shell td,
.app-shell .apply-control small,
.app-shell .rule-card p,
.app-shell .rule-meta > span,
.app-shell .gap-date small,
.app-shell .gap-copy p,
.app-shell .mitigation-box > strong,
.app-shell .mitigation-box ul,
.app-shell .mitigation-box > span,
.app-shell .pricing-summary-status,
.app-shell .promotion-date,
.app-shell .promotion-recommendation strong,
.app-shell .promotion-recommendation small,
.app-shell .promotion-components b,
.app-shell .promotion-components small,
.app-shell .discount-comparison small,
.app-shell .discount-comparison b,
.app-shell .discount-decision,
.app-shell .promotion-days > small,
.app-shell .commercial-empty,
.app-shell .extension-option strong,
.app-shell .extension-option span,
.app-shell .extension-option .extension-rule-note,
.app-shell .restriction-summary,
.app-shell .optimization-overview small,
.app-shell .optimization-zone header strong,
.app-shell .optimization-zone header small,
.app-shell .optimization-zone header > span,
.app-shell .zone-states small,
.app-shell .zone-states strong,
.app-shell .optimization-zone p,
.app-shell .zone-facts small,
.app-shell .zone-facts strong,
.app-shell .zone-action-days span,
.app-shell .ui-tooltip-content,
.app-shell .suggestion-actions small,
.app-shell .rule-builder-guide span,
.app-shell .form-section h3,
.app-shell .rule-section-title > span,
.app-shell .rule-section-title p,
.app-shell .form-grid label,
.app-shell .trigger-grid label,
.app-shell .form-grid small,
.app-shell .weekday-picker strong,
.app-shell .weekday-picker label,
.app-shell .action-picker label,
.app-shell .builder-toggles label,
.app-shell .property-scope-picker legend,
.app-shell .property-scope-picker label,
.app-shell .advanced-settings summary,
.app-shell .advanced-settings > p,
.app-shell .rules-section-heading small,
.app-shell .rules-section-heading span,
.app-shell .rules-heading-actions > span,
.app-shell .rule-inactive-toggle label,
.app-shell .property-filter-label,
.app-shell .property-filter-chip,
.app-shell .property-filter-count,
.app-shell .property-filter-state,
.app-shell .rule-filter-chip,
.app-shell .rule-filter-count,
.app-shell .proposal-section-heading p,
.app-shell .proposal-section-heading > span,
.app-shell .proposal-extension-card-head small,
.app-shell .proposal-extension-period,
.app-shell .proposal-extension-summary span,
.app-shell .rule-order-form strong,
.app-shell .rule-order-form span,
.app-shell .rule-policy-copy > small,
.app-shell .rule-policy-copy > p,
.app-shell .rule-policy-copy summary,
.app-shell .rule-policy-details p,
.app-shell .calendar-range-switch a,
.app-shell .calendar-summary span,
.app-shell .calendar-summary > small,
.app-shell .calendar-legend > span,
.app-shell .smart-calendar thead th > small,
.app-shell .calendar-room-group-label strong,
.app-shell .calendar-availability-count,
.app-shell .calendar-room-label strong,
.app-shell .calendar-room-label small,
.app-shell td.calendar-night > span.calendar-cell-tooltip,
.app-shell td.calendar-group-spacer > span.calendar-group-tooltip,
.app-shell .calendar-help,
.app-shell .flow-list small,
.app-shell .account-details dt,
.app-shell .account-details dd,
.app-shell .mail-transport-status,
.app-shell .communication-composer .panel-heading > div span,
.app-shell .offer-prefill-note strong,
.app-shell .offer-prefill-note span,
.app-shell .extension-policy-heading span,
.app-shell .extension-policy-heading strong,
.app-shell .extension-policy-options span,
.app-shell .email-settings-intro p,
.app-shell .email-profile-heading p,
.app-shell .email-profile-state small,
.app-shell .email-profile-test strong,
.app-shell .email-profile-test span,
.app-shell .report-custom-period label,
.app-shell .report-kpi small,
.app-shell .report-insights header p,
.app-shell .report-insight strong,
.app-shell .report-insight p,
.app-shell .report-insight > small,
.app-shell .report-chart-card header p,
.app-shell .report-chart-pan-hint,
.app-shell .report-chart-legend,
.app-shell .report-source-note,
.app-shell .communication-channel-nav a,
.app-shell .context-back-link,
.app-shell .sms-provider-state,
.app-shell .sms-safety-grid small,
.app-shell .sms-safety-grid strong,
.app-shell .sms-provider-note,
.app-shell .sms-settings-disclosure summary,
.app-shell .sms-settings-form label:not(.checkbox-card),
.app-shell .sms-settings-form label small,
.app-shell .sms-history-panel .panel-heading p,
.app-shell .sms-template-editor .panel-heading p,
.app-shell .sms-history-identity small,
.app-shell .sms-history-recipient small,
.app-shell .sms-history-state small,
.app-shell .sms-history-recipient strong,
.app-shell .sms-history-preview,
.app-shell .sms-history-error,
.app-shell .sms-template-copy p,
.app-shell .sms-template-metrics span,
.app-shell .sms-editor-meta small,
.app-shell .sms-editor-meta strong { font-size: .8rem !important; }

/* Calendar codes stay compact, but remain readable on a normal laptop. */
.calendar-night.is-interval b,
.calendar-night.is-interval small,
.calendar-interval-code,
.calendar-interval-code small,
.calendar-rule-codes,
.calendar-discount-change,
.calendar-active-discount { font-size: .78rem !important; }
.calendar-action-flags i { font-size: .68rem !important; }

/* Remaining application surfaces covered by the same 12.8px reading floor. */
.app-shell .action-divider span,
.app-shell .application-mode-bar strong,
.app-shell .auth-form label,
.app-shell .avatar,
.app-shell .back-link,
.app-shell .brand-product strong,
.app-shell .challenge-form label,
.app-shell .commercial-heading > strong,
.app-shell .decision-meta dt,
.app-shell .decision-meta dd,
.app-shell .state-card dt,
.app-shell .state-card dd,
.app-shell .discount-badge small,
.app-shell .email-envelope span,
.app-shell .email-envelope strong,
.app-shell .email-settings-intro strong,
.app-shell .empty-state span,
.app-shell .extension-policy-options em,
.app-shell .extension-policy-options strong,
.app-shell .extension-policy-preview > p,
.app-shell .flow-list li > span,
.app-shell .flow-list strong,
.app-shell .history-audit-table code,
.app-shell .history-audit-table td,
.app-shell .history-heading p,
.app-shell .history-intervention-id,
.app-shell .history-intervention-main small,
.app-shell .history-intervention-meta dt,
.app-shell .history-intervention-meta dd,
.app-shell .history-property > strong,
.app-shell .history-section-heading > span,
.app-shell .history-section-heading p,
.app-shell .human-rule-card .rule-priority,
.app-shell .human-rule-copy > p,
.app-shell .human-rule-summary small,
.app-shell .human-rule-summary strong,
.app-shell .intervention-actions > p,
.app-shell .intervention-actions form small,
.app-shell .list-result-summary,
.app-shell .message-metadata dt,
.app-shell .message-metadata dd,
.app-shell .offer-review-expiry span,
.app-shell .offer-review-expiry strong,
.app-shell .offer-review-heading > div > span,
.app-shell .offer-review-heading > div > strong,
.app-shell .offer-review-help,
.app-shell .offer-review-option small,
.app-shell .offer-review-option-top span,
.app-shell .offer-review-option-top strong,
.app-shell .offer-summary span,
.app-shell .optimization-heading-hint,
.app-shell .optimization-overview strong,
.app-shell .pagination-page,
.app-shell .permission-matrix .permission-group-row th,
.app-shell .permission-matrix tbody th small,
.app-shell .permission-matrix tbody th strong,
.app-shell .permission-matrix thead th,
.app-shell .permission-matrix-actions p,
.app-shell .permission-scroll-hint,
.app-shell .property-card > a,
.app-shell .property-card dt,
.app-shell .property-card dd,
.app-shell .property-filter-chip .property-identity-badge,
.app-shell .property-identity-badge,
.app-shell .property-identity-badge-large,
.app-shell .property-identity-fields > label,
.app-shell .property-identity-fields legend,
.app-shell .property-unconnected > small,
.app-shell .proposal-extension-summary strong,
.app-shell .proposal-table td,
.app-shell .proposal-table td small,
.app-shell .recipient-picker label small,
.app-shell .recipient-picker label strong,
.app-shell .recipient-picker legend,
.app-shell .notification-preferences legend,
.app-shell .report-donut-legend,
.app-shell .report-kpi > span,
.app-shell .report-periods a,
.app-shell .report-periods button,
.app-shell .report-tabs a,
.app-shell .review-timeline article p,
.app-shell .review-timeline article span,
.app-shell .role-super-admin-mark,
.app-shell .role-super-admin-note p,
.app-shell .role-super-admin-note strong,
.app-shell .rule-authorship,
.app-shell .rule-builder-guide span b,
.app-shell .rule-filter-chip .property-identity-badge,
.app-shell .rule-history > p,
.app-shell .rule-history li p,
.app-shell .rule-history li span,
.app-shell .rule-history li strong,
.app-shell .rule-history summary,
.app-shell .rule-policy-index,
.app-shell .rule-policy-more > summary,
.app-shell .rule-policy-scope-label,
.app-shell .rule-priority,
.app-shell .rule-property-chip,
.app-shell .rule-property-chip .property-identity-badge,
.app-shell .safety-callout span,
.app-shell .safety-callout strong,
.app-shell .safety-inline,
.app-shell .security-note,
.app-shell .sidebar-user-copy strong,
.app-shell .signal-row strong,
.app-shell .sms-history-identity strong,
.app-shell .stacked-form label,
.app-shell .stacked-form label small,
.app-shell .stat span,
.app-shell .state-eyebrow,
.app-shell .template-editor code,
.app-shell .text-preview summary,
.app-shell .user-access-badge,
.app-shell .user-avatar,
.app-shell .user-copy > small,
.app-shell .user-fact small,
.app-shell .user-fact strong,
.app-shell .user-inline-editor .panel-heading > div span,
.app-shell .user-property-assignments > p,
.app-shell .user-property-assignments legend,
.app-shell .user-property-option strong,
.app-shell .user-protected-field small,
.app-shell .user-protected-field span,
.app-shell .user-protected-field strong,
.app-shell .verification-message,
.app-shell .worker-health strong { font-size: .8rem !important; }

.advance-report-panel { margin-bottom: 22px; overflow: hidden; }
.collection-policy-panel { margin-bottom: 18px; padding: 22px; }
.collection-policy-panel > .section-title { margin-bottom: 16px; }
.collection-policy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.collection-policy-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfaf7; }
.collection-policy-identity { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.collection-policy-form { display: grid; gap: 10px; }
.collection-policy-form label { display: grid; grid-template-columns: 1fr 76px; align-items: center; gap: 7px; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.collection-policy-form label input[type="number"] { min-width: 0; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.collection-policy-form .collection-policy-toggle { display: flex; align-items: center; gap: 9px; }
.collection-policy-form .collection-policy-toggle input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--pine); }
.collection-policy-form label small { grid-column: 1 / -1; }
.collection-policy-result { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; background: #eef3ec; }
.collection-policy-result span { color: var(--muted); font-size: .85rem; }
.collection-policy-result strong { color: var(--pine); font-size: .95rem; }
.collection-report { margin-bottom: 22px; overflow: hidden; }
.collection-kpis .report-kpi-alert { border-color: rgba(151, 62, 48, .3); background: linear-gradient(145deg, #fff 0%, #f9eeeb 100%); }
.collection-kpis .report-kpi-alert strong { color: #8b3f32; }
.collection-report-heading { align-items: flex-end; gap: 24px; }
.collection-report-heading p { margin: 5px 0 0; color: var(--muted); }
.collection-visible-count { flex: 0 0 auto; color: var(--muted); font-size: .83rem; white-space: nowrap; }
.collection-visible-count strong { color: var(--pine); font-size: 1.15rem; }
.collection-filters { position: relative; z-index: 5; display: grid; grid-template-columns: minmax(210px, 1.45fr) repeat(4, minmax(130px, 1fr)) auto; align-items: end; gap: 12px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.collection-filters label { display: grid; gap: 5px; color: var(--muted); font-size: .9rem; font-weight: 650; }
.collection-filters input[type="search"] { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.collection-multiselect { position: relative; min-width: 0; }
.collection-multiselect > summary { display: grid; align-content: center; min-height: 42px; padding: 6px 30px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; list-style: none; }
.collection-multiselect > summary::-webkit-details-marker { display: none; }
.collection-multiselect > summary::after { position: absolute; top: 17px; right: 11px; width: 7px; height: 7px; border-right: 1.5px solid var(--pine); border-bottom: 1.5px solid var(--pine); transform: rotate(45deg); content: ""; }
.collection-multiselect[open] > summary { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(79, 99, 77, .1); }
.collection-multiselect[open] > summary::after { top: 20px; transform: rotate(225deg); }
.collection-multiselect summary span { color: var(--muted); font-size: .82rem; font-weight: 650; line-height: 1; }
.collection-multiselect summary strong { margin-top: 3px; overflow: hidden; color: var(--ink); font-size: .9rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.collection-multiselect-options { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: max(100%, 205px); max-height: 250px; padding: 7px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 14px 32px rgba(43, 55, 42, .16); }
.collection-multiselect-options label { display: flex; grid: none; align-items: center; gap: 9px; padding: 8px; border-radius: 7px; color: var(--ink); cursor: pointer; font-size: .9rem; font-weight: 550; }
.collection-multiselect-options label:hover { background: var(--surface-soft); }
.collection-multiselect-options input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--pine); }
.collection-filter-apply { min-height: 42px; padding-inline: 18px; }
.collection-table-wrap { border: 1px solid var(--line); border-radius: 12px; }
.collection-table { min-width: 1080px; }
.collection-table thead th { position: sticky; z-index: 2; top: 0; background: #f4f1ea; }
.collection-table td { vertical-align: top; }
.collection-table td > small { display: block; margin-top: 4px; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.collection-table tr.is-attention td { background: #fff5f2; }
.collection-table tr.is-attention:hover td { background: #fdece7; }
.collection-status,
.collection-policy { display: inline-flex; align-items: center; width: fit-content; min-height: 27px; padding: 4px 8px; border-radius: 999px; font-size: .73rem; font-weight: 750; line-height: 1.15; white-space: nowrap; }
.collection-status-paid { color: var(--pine); background: #e8f0e6; }
.collection-status-partial { color: #76581e; background: #f6edda; }
.collection-status-unpaid { color: #6e706c; background: #efefec; }
.collection-status-attention { color: #853c30; background: #f6ddd7; }
.collection-policy-flexible { color: #365c74; background: #e5eef4; }
.collection-policy-non_refundable { color: var(--pine); background: #e8f0e6; }
.collection-policy-needs_classification { color: #76581e; background: #f6edda; }
.sync-settings-panel { grid-column: 1 / -1; }
.sync-settings-panel .panel-heading { align-items: center; gap: 16px; }
.sync-settings-panel .panel-heading p { margin: 4px 0 0; color: var(--muted); }
.sync-settings-form { display: flex; align-items: end; gap: 12px; margin-top: 16px; }
.sync-settings-form label { display: grid; gap: 6px; min-width: 230px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.sync-settings-form input { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.sync-settings-form label small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.sync-settings-note, .sync-settings-readonly { margin: 14px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
@media (max-width: 640px) {
    .sync-settings-form { align-items: stretch; flex-direction: column; }
    .sync-settings-form label { min-width: 0; }
}
.collection-ticket { width: fit-content; padding: 2px 7px; border-radius: 999px; color: #76581e !important; background: #f6edda; font-weight: 700; }
.collection-attention { width: fit-content; padding: 2px 7px; border-radius: 999px; color: #853c30 !important; background: #f6ddd7; font-weight: 750; }
.collection-property { display: flex !important; align-items: center; gap: 6px; }
.collection-property .property-identity-badge { flex: 0 0 auto; width: 1.45rem; height: 1.45rem; font-size: .62rem; }
.collection-comment-action { width: 52px; text-align: center; }
.collection-comment-toggle,
.collection-comment-close { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(79, 99, 77, .23); border-radius: 50%; background: #fff; color: var(--pine); cursor: pointer; font-family: inherit; font-size: 1.05rem; font-weight: 700; line-height: 1; }
.collection-comment-toggle:hover,
.collection-comment-toggle[aria-expanded="true"],
.collection-comment-close:hover { border-color: var(--pine); background: #eef3ec; }
.collection-comment-toggle b { position: absolute; top: -5px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--gold); color: #fff; font-size: .62rem; line-height: 17px; }
.collection-comment-row td { padding: 0 !important; background: #f5f3ed !important; }
.collection-comments { padding: 16px 18px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.collection-comments > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.collection-comments > header > div { display: grid; gap: 2px; }
.collection-comments > header small { color: var(--muted); }
.collection-comment-close { border-radius: 8px; font-size: 1.25rem; }
.collection-comment-list { display: grid; gap: 8px; margin-top: 12px; }
.collection-comment-list article { padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.collection-comment-list p { margin: 0; color: var(--ink); font-size: .82rem; line-height: 1.5; }
.collection-comment-list small { display: block; margin-top: 5px; color: var(--muted); font-size: .7rem; }
.collection-comments-empty { margin: 11px 0 0; color: var(--muted); font-size: .78rem; }
.collection-comment-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 13px; }
.collection-comment-form label { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; font-weight: 650; }
.collection-comment-form textarea { width: 100%; min-height: 76px; resize: vertical; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; line-height: 1.4; }
.collection-comment-form textarea:focus { border-color: var(--pine); outline: 3px solid rgba(79, 99, 77, .1); }
.collection-filter-empty { margin-top: 14px; }
.collection-report-meta span:first-child { max-width: 860px; }
.header-refresh { position: relative; flex: 0 0 auto; min-width: 0; }
.header-refresh form { margin: 0; }
.header-refresh-button { min-height: 2.7rem; padding: .34rem .62rem .34rem .46rem; display: inline-flex; align-items: center; gap: .58rem; border: 1px solid rgba(79, 99, 77, .22); border-radius: .72rem; color: var(--pine); background: linear-gradient(120deg, #fbfaf7, #eef3eb); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.header-refresh-button:hover { border-color: rgba(79, 99, 77, .46); box-shadow: 0 5px 15px rgba(43, 55, 42, .09); transform: translateY(-1px); }
.header-refresh-button:disabled { cursor: wait; opacity: .78; transform: none; }
.header-refresh-copy { display: grid; gap: 1px; text-align: left; }
.header-refresh-copy strong { font-family: inherit; font-size: .75rem; font-weight: 750; }
.header-refresh-copy small { margin: 0; color: var(--muted); font-size: .63rem; }
.header-refresh-popover { position: absolute; z-index: 80; top: calc(100% + 10px); right: 0; width: min(690px, calc(100vw - 2rem)); padding: 17px 18px; border: 1px solid rgba(79, 99, 77, .22); border-radius: 14px; background: #fbfaf7; box-shadow: 0 18px 46px rgba(35, 43, 34, .18); }
.header-refresh-popover::before { position: absolute; top: -7px; right: 24px; width: 12px; height: 12px; border-top: 1px solid rgba(79, 99, 77, .22); border-left: 1px solid rgba(79, 99, 77, .22); background: #fbfaf7; transform: rotate(45deg); content: ""; }
.advance-refresh-console { margin: 0 0 18px; padding: 16px 18px; border: 1px solid rgba(79, 99, 77, .2); border-radius: 14px; background: linear-gradient(120deg, #f7f5ef 0%, #eef3eb 100%); box-shadow: 0 8px 24px rgba(43, 55, 42, .06); }
.advance-refresh-topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.advance-refresh-title { display: flex; align-items: center; gap: 12px; }
.advance-refresh-title > div { display: grid; gap: 3px; }
.advance-refresh-title strong { color: var(--pine); font-size: .98rem; }
.advance-refresh-title small { color: var(--muted); font-size: .79rem; }
.advance-refresh-orbit { position: relative; flex: 0 0 32px; width: 32px; height: 32px; aspect-ratio: 1 / 1; box-sizing: border-box; border: 2px solid rgba(79, 99, 77, .22); border-radius: 50%; }
.advance-refresh-orbit::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--pine); opacity: .92; }
.advance-refresh-orbit i { position: absolute; width: 7px; height: 7px; top: -3px; left: 10px; border-radius: 50%; background: #bd9f70; box-shadow: 0 0 0 3px #f7f5ef; }
[data-advance-refresh].is-running .advance-refresh-orbit { animation: advance-refresh-spin 1.35s linear infinite; }
@keyframes advance-refresh-spin { to { transform: rotate(360deg); } }
.advance-refresh-button { min-width: 154px; justify-content: center; }
.advance-refresh-button span { font-size: 1.15rem; line-height: 1; }
.advance-refresh-button:disabled { cursor: wait; opacity: .7; }
.advance-refresh-progress { margin-top: 15px; padding-top: 14px; border-top: 1px solid rgba(79, 99, 77, .16); }
.advance-refresh-message { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; font-size: .83rem; }
.advance-refresh-message strong { color: var(--pine); }
.advance-refresh-message span { color: var(--pine); font-weight: 800; font-variant-numeric: tabular-nums; }
.advance-refresh-track { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(79, 99, 77, .13); }
.advance-refresh-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #bd9f70, var(--pine)); transition: width .45s ease; }
.advance-refresh-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 11px 0 0; padding: 0; list-style: none; }
.advance-refresh-steps li { position: relative; padding-top: 13px; color: #8a8f87; font-size: .69rem; line-height: 1.25; }
.advance-refresh-steps li::before { content: ""; position: absolute; top: 0; left: 1px; width: 7px; height: 7px; border-radius: 50%; background: #d6d9d2; box-shadow: 0 0 0 3px rgba(214, 217, 210, .32); }
.advance-refresh-steps li.is-active { color: var(--pine); font-weight: 700; }
.advance-refresh-steps li.is-active::before { background: #bd9f70; box-shadow: 0 0 0 3px rgba(189, 159, 112, .2); }
.advance-refresh-steps li.is-done { color: var(--pine); }
.advance-refresh-steps li.is-done::before { background: var(--pine); }
.advance-refresh-properties { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.advance-refresh-property { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(79, 99, 77, .14); border-radius: 99px; background: rgba(255,255,255,.62); color: var(--muted); font-size: .7rem; }
.advance-refresh-property.is-completed { color: var(--pine); border-color: rgba(79, 99, 77, .28); }
.advance-refresh-property.is-failed { color: #8b3f32; border-color: rgba(139, 63, 50, .28); }
.advance-refresh-error { margin: 12px 0 0; color: #8b3f32; font-size: .8rem; }
.advance-report-heading { align-items: flex-end; gap: 24px; }
.advance-report-heading p { margin: 5px 0 0; color: var(--muted); }
.advance-report-totals { display: flex; align-items: flex-end; gap: 18px; }
.advance-report-total { display: grid; justify-items: end; gap: 2px; text-align: right; white-space: nowrap; }
.advance-report-total + .advance-report-total { padding-left: 18px; border-left: 1px solid var(--line); }
.advance-report-total span,
.advance-report-total small { color: var(--muted); font-size: .8rem; }
.advance-report-total strong { color: var(--pine); font: 700 1.45rem/1.1 Georgia, serif; }
.advance-month-list { display: grid; gap: 10px; margin-top: 18px; }
.advance-month { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.advance-month summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 17px; list-style: none; background: #f8f6f1; }
.advance-month summary::-webkit-details-marker { display: none; }
.advance-month summary::before { content: "+"; color: var(--pine); font-weight: 800; font-size: 1.1rem; }
.advance-month[open] summary::before { content: "−"; }
.advance-month summary > span { display: grid; gap: 3px; margin-right: auto; }
.advance-month summary small { color: var(--muted); }
.advance-month summary b { color: var(--pine); font-size: 1rem; white-space: nowrap; }
.advance-month-financials { display: grid; grid-template-columns: repeat(3, minmax(118px, auto)); gap: 18px; margin-left: auto; text-align: right; }
.advance-month-financials b { display: grid; gap: 2px; }
.advance-month-financials b + b { padding-left: 18px; border-left: 1px solid var(--line); }
.advance-month-financials small { font-size: .72rem; font-weight: 500; }
.advance-month-empty { padding: 20px 17px; color: var(--muted); }
.advance-report-table td small { display: block; margin-top: 3px; color: var(--muted); }
.advance-report-table td:nth-last-child(-n+3),
.advance-report-table th:nth-last-child(-n+3) { text-align: right; white-space: nowrap; }
.advance-report-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; color: var(--muted); font-size: .8rem; }
.virtual-balance-panel { margin-bottom: 22px; }
.virtual-balance-heading { align-items: flex-end; gap: 24px; }
.virtual-balance-heading p { margin: 5px 0 0; color: var(--muted); }
.virtual-balance-summary { display: flex; gap: 22px; }
.virtual-balance-summary span { display: grid; gap: 3px; color: var(--muted); font-size: .8rem; text-align: right; }
.virtual-balance-summary strong { color: var(--pine); font: 700 1.15rem/1.1 Georgia, serif; white-space: nowrap; }
.virtual-balance-pyn-links { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.virtual-balance-pyn-links > div:first-child { display: grid; gap: 3px; }
.virtual-balance-pyn-links small { color: var(--muted); font-size: .78rem; }
.virtual-balance-pyn-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.virtual-balance-pyn-actions .button { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.virtual-balance-pyn-actions .property-identity-badge { width: 1.45rem; height: 1.45rem; font-size: .62rem; }
.virtual-balance-create { margin-top: 18px; }
.virtual-balance-create > summary { width: fit-content; list-style: none; cursor: pointer; }
.virtual-balance-create > summary::-webkit-details-marker { display: none; }
.virtual-balance-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.virtual-balance-form label { display: grid; gap: 6px; color: var(--muted); font-size: .8rem; }
.virtual-balance-form input,
.virtual-balance-form select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.virtual-balance-form-wide { grid-column: span 3; }
.virtual-balance-form-actions { display: flex; align-items: end; justify-content: flex-end; }
.virtual-balance-list { display: grid; gap: 14px; margin-top: 18px; }
.virtual-balance-card { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.virtual-balance-card.is-cancelled { opacity: .7; }
.virtual-balance-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.virtual-balance-card-head h3 { margin: 8px 0 0; font-size: 1rem; }
.virtual-balance-card-head h3 small { color: var(--muted); font: 500 .78rem/1.2 Jost, sans-serif; }
.virtual-balance-card-head p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.virtual-balance-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.virtual-balance-amounts span { display: grid; gap: 3px; padding: 11px 13px; background: #faf8f4; color: var(--muted); font-size: .76rem; }
.virtual-balance-amounts strong { color: var(--ink); font-size: .92rem; }
.virtual-allocation-create { margin-top: 13px; }
.virtual-allocation-create > summary { width: fit-content; cursor: pointer; color: var(--pine); font-weight: 700; }
.virtual-allocation-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.virtual-allocation-rule { display: block; margin-top: 8px; color: var(--muted); }
.virtual-allocation-table { margin-top: 14px; }
.virtual-allocation-table td small { display: block; margin-top: 3px; color: var(--muted); }
.virtual-allocation-amount-form { display: flex; align-items: center; gap: 7px; }
.virtual-allocation-amount-form input { width: 105px; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; }
.virtual-allocation-actions { min-width: 170px; }
.virtual-allocation-actions form { display: inline-block; margin: 2px 3px 2px 0; }
.virtual-balance-cancel { margin-top: 12px; text-align: right; }
@media (max-width: 900px) {
  .collection-policy-grid { grid-template-columns: 1fr; }
  .collection-policy-form label { grid-template-columns: 1fr 88px; }
  .collection-report-heading { align-items: flex-start; }
  .collection-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-filter-wide { grid-column: 1 / -1; }
  .collection-filter-apply { justify-self: stretch; }
  .advance-refresh-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .advance-report-heading { align-items: flex-start; }
  .advance-report-totals { width: 100%; align-items: stretch; }
  .advance-report-total { flex: 1; }
  .advance-report-total { justify-items: start; text-align: left; }
  .advance-report-meta { flex-direction: column; }
  .advance-month summary { align-items: flex-start; flex-wrap: wrap; }
  .advance-month-financials { width: 100%; grid-template-columns: repeat(3, 1fr); margin-left: 28px; text-align: left; }
  .virtual-balance-heading { align-items: flex-start; }
  .virtual-balance-pyn-links { align-items: flex-start; flex-direction: column; }
  .virtual-balance-pyn-actions { justify-content: flex-start; }
  .virtual-balance-summary { width: 100%; }
  .virtual-balance-summary span { flex: 1; text-align: left; }
  .virtual-balance-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-balance-form-wide { grid-column: span 1; }
  .virtual-allocation-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .collection-filters { grid-template-columns: 1fr; }
  .collection-filter-wide { grid-column: auto; }
  .collection-multiselect-options { position: static; min-width: 0; margin-top: 5px; box-shadow: none; }
  .collection-comments { position: sticky; left: 0; box-sizing: border-box; width: calc(100vw - 64px); max-width: calc(100vw - 64px); }
  .collection-comment-form { grid-template-columns: 1fr; }
  .collection-comment-form .button { justify-self: stretch; }
  .collection-report-meta { gap: 8px; }
  .advance-refresh-topline { align-items: stretch; flex-direction: column; }
  .advance-refresh-button { width: 100%; }
  .advance-refresh-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advance-report-totals { flex-direction: column; }
  .advance-report-total + .advance-report-total { padding-top: 12px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .advance-month-financials { grid-template-columns: 1fr; gap: 8px; }
  .advance-month-financials b + b { padding-top: 8px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .virtual-balance-summary { flex-direction: column; gap: 10px; }
  .virtual-balance-form,
  .virtual-allocation-form { grid-template-columns: 1fr; }
  .virtual-balance-amounts { grid-template-columns: 1fr; }
  .virtual-balance-card-head { flex-direction: column; }
}

/* The global refresh action must stay usable in the shared mobile header. */
@media (max-width: 740px) {
  .topbar { gap: .45rem; overflow: visible; }
  .header-refresh-button { width: auto; min-width: 0; min-height: 2.55rem; padding: .3rem .44rem; gap: .32rem; }
  .header-refresh-button::after { content: "Sync"; font-size: .66rem; font-weight: 750; }
  .header-refresh-copy { display: none !important; }
  .header-refresh .advance-refresh-orbit { flex-basis: 27px; width: 27px; height: 27px; }
  .header-refresh-popover { position: absolute; top: calc(100% + 10px); right: auto; left: 0; width: calc(100vw - 2rem); }
  .header-refresh-popover::before { right: auto; left: 29px; }
  .context-indicator { flex: 1 1 auto; max-width: 100px; margin-left: 0; }
  .mode-badge { flex: 0 0 auto; padding: .35rem .45rem; font-size: .58rem; }
}
