:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-soft: #f3f7f5;
  --border-control: #789286;
  --border-subtle: #d6e3dd;
  --focus: #075940;
  --success-soft: #e3f3e9;
  --success-ink: #236042;
  --motion-control: 160ms;
  --ink: #102923;
  --muted: #5c716b;
  --paper: #edf5f2;
  --white: rgba(255,255,255,.92);
  --line: rgba(255,255,255,.74);
  --green: #0f755e;
  --green-soft: rgba(218,244,234,.68);
  --amber: #e6b75d;
  --status-pending-ink: #674600;
  --status-pending-soft: #fff3cd;
  --status-pending-solid: #edbc40;
  --status-pending-halo: rgba(216,163,24,.2);
  --status-approved-ink: #17643e;
  --status-approved-soft: #e7f5ed;
  --status-approved-solid: #207847;
  --status-approved-halo: rgba(32,120,71,.16);
  --status-completed-ink: #235ba1;
  --status-completed-soft: #eaf2ff;
  --status-completed-solid: #2863ad;
  --status-completed-halo: rgba(40,99,173,.18);
  --status-error-ink: #a72d3c;
  --status-error-soft: #fdecef;
  --status-error-solid: #b93646;
  --status-error-halo: rgba(185,54,70,.16);
  --glass: rgba(255,255,255,.48);
  --glass-strong: rgba(255,255,255,.68);
  --glass-line: rgba(255,255,255,.76);
  --glass-shadow: 0 20px 60px rgba(34,75,64,.13), inset 0 1px 0 rgba(255,255,255,.82);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; background: radial-gradient(circle at 10% 8%, rgba(79,219,180,.34), transparent 28%), radial-gradient(circle at 88% 4%, rgba(123,177,255,.3), transparent 30%), radial-gradient(circle at 55% 92%, rgba(255,205,122,.23), transparent 34%), linear-gradient(135deg, #edf7f3 0%, #f7f4ef 48%, #e8f1f8 100%); background-attachment: fixed; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.skip-link { padding: 9px 13px; position: fixed; top: 8px; left: 8px; z-index: 2000; color: white; background: var(--ink); border-radius: 8px; text-decoration: none; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.ui-icon { width: 18px; height: 18px; display: block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-spinner { animation: icon-spin .8s linear infinite; }
.icon-spinner circle { stroke-dasharray: 36 14; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
body > header { height: 70px; padding: 0 max(24px, calc((100% - 1180px) / 2)); position: sticky; top: 0; z-index: 900; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.82); background: rgba(247,252,250,.78); box-shadow: 0 10px 35px rgba(42,85,73,.06), inset 0 1px 0 rgba(255,255,255,.92); -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%); }
.brand { color: var(--ink); font-size: 1.15rem; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.brand span { color: var(--green); }
.runtime { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.runtime i { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.runtime.ready i { background: #40a57d; box-shadow: 0 0 0 4px #dff2e8; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.user-role { max-width: 170px; padding: 7px 10px; overflow: hidden; color: var(--green); background: #e0f1e9; border-radius: 999px; font-size: .73rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { padding: 8px 11px; color: var(--ink); background: transparent; border: 1px solid #aac7bb; border-radius: 9px; font-size: .74rem; font-weight: 700; }
.logout-button:hover { background: white; }
.demo-role-wrap { display: grid; gap: 3px; color: #825711; font-size: .62rem; font-weight: 800; }
.demo-role-wrap select { max-width: 130px; padding: 4px; color: var(--ink); background: #fff8e8; border: 1px solid #ddc791; border-radius: 6px; font-size: .7rem; }
.auth-screen { min-height: calc(100dvh - 70px); padding: 48px 20px; display: grid; place-items: center; }
.auth-card { width: min(100%, 450px); padding: 36px; background: var(--white); border: 1px solid var(--glass-line); border-radius: 24px; box-shadow: var(--glass-shadow); }
.auth-mark { width: 48px; height: 48px; margin-bottom: 24px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 14px; font-size: 1.6rem; font-weight: 800; }
.auth-card h1 { font-size: 2.25rem; }
.auth-description, .auth-help { color: var(--muted); line-height: 1.6; }
.auth-description { margin: 16px 0 24px; font-size: .9rem; }
.auth-help { margin: 24px 0 0; font-size: .74rem; }
.login-hints { margin-top: 22px; padding-top: 20px; border-top: 1px solid #dce7e1; }
.login-hints-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.login-hints-heading h2 { margin: 0; font-size: .9rem; }
.login-hints-heading span { padding: 4px 7px; color: #825711; background: #fff5dd; border-radius: 6px; font-size: .65rem; }
.login-hints-description, .login-hints-status { color: var(--muted); font-size: .72rem; line-height: 1.5; }
.login-hints-description { margin: 9px 0 12px; }
.login-hints-status { margin: 10px 0 0; }
.login-hints-status:empty { display: none; }
.login-hint-accounts { display: grid; gap: 10px; }
.login-hint-account { display: grid; gap: 8px; padding: 12px; background: #f3f8f5; border: 1px solid #dce7e1; border-radius: 12px; }
.login-hint-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.login-hint-heading strong { font-size: .76rem; }
.login-hint-field { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.login-hint-field span { color: var(--muted); font-size: .67rem; }
.login-hint-field input { width: 100%; min-width: 0; padding: 7px; color: var(--ink); background: white; border: 1px solid #dce7e1; border-radius: 6px; font-family: Consolas, monospace; font-size: .75rem; }
.login-hint-copy, .login-hint-fill { padding: 7px 8px; color: var(--green); background: white; border: 1px solid #bbcec6; border-radius: 6px; font-size: .66rem; font-weight: 700; }
.login-hint-copy:focus-visible, .login-hint-fill:focus-visible, .login-hint-field input:focus-visible { outline: 3px solid rgba(23,107,87,.24); outline-offset: 2px; }
.auth-loading { margin: 22px 0; color: var(--green); font-size: .87rem; }
.auth-error { padding: 12px; color: #8f3027; background: #fff0ed; border: 1px solid #e8b7b0; border-radius: 10px; font-size: .84rem; line-height: 1.5; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 8px; font-size: .8rem; font-weight: 750; }
.login-form input { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--ink); background: white; border: 1px solid #bbcec6; border-radius: 10px; }
.login-form input:focus-visible, .auth-submit:focus-visible, .logout-button:focus-visible, .auth-retry:focus-visible { outline: 3px solid rgba(23,107,87,.24); outline-offset: 2px; }
.auth-submit { min-height: 46px; margin-top: 4px; color: white; background: var(--green); border: 0; border-radius: 10px; font-weight: 800; }
.auth-submit:disabled, .logout-button:disabled { opacity: .6; cursor: wait; }
.auth-retry { padding: 10px 13px; color: var(--green); background: white; border: 1px solid #aac7bb; border-radius: 9px; font-weight: 700; }
.reset-app { padding: 8px 11px; color: #8d3b2e; background: rgba(255,248,245,.8); border: 1px solid #e9c8bd; border-radius: 9px; font-size: .72rem; font-weight: 750; }
.reset-app:hover { background: #fce9e2; }
.reset-app:disabled { opacity: .5; cursor: wait; }
.management-notice { padding: 8px 11px; color: #0d5747; background: #dff4eb; border: 1px solid #9dcfba; border-radius: 9px; font-size: .72rem; font-weight: 800; }
.management-notice[hidden] { display: none; }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 90px; }
.hero { max-width: 820px; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: .7rem; font-weight: 800; letter-spacing: .13em; }
h1 { margin: 0; max-width: 760px; font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif; font-size: clamp(2.35rem, 5vw, 4rem); font-weight: 760; line-height: 1.04; letter-spacing: -.04em; }
.hero > p:not(.eyebrow) { max-width: 670px; margin: 18px 0 0; color: var(--muted); font-size: 1.04rem; line-height: 1.65; }
.hero-actions { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions button { min-height: 46px; padding: 0 17px; border-radius: 11px; font-weight: 800; }
.primary-action { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 12px; color: white; background: linear-gradient(120deg, #0f604d, #1b8b6d, #0f604d); background-size: 200% 100%; border: 1px solid #146651; box-shadow: 0 10px 26px rgba(23,107,87,.24); transition: transform .2s ease, box-shadow .2s ease; animation: action-gradient 4s ease-in-out infinite; }
.primary-action::after { content: ""; width: 34%; position: absolute; top: -40%; bottom: -40%; left: -46%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); transform: skewX(-20deg); animation: action-shine 3.8s ease-in-out infinite; }
.primary-action span { position: relative; z-index: 1; font-size: 1.1rem; transition: transform .2s ease; }
.primary-action:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(23,107,87,.31); }
.primary-action:hover span { transform: translateX(4px); }
.secondary-action { color: var(--ink); background: var(--white); border: 1px solid var(--line); }
.secondary-action:hover:not(:disabled) { color: var(--green); border-color: #9fc2b6; }
.demo-badge { margin-left: 8px; padding: 3px 7px; color: #825711; background: #fff1d8; border-radius: 999px; font-size: .62rem; font-weight: 850; text-transform: uppercase; }
.secondary-action:disabled, .tabs button:disabled { color: var(--muted); background: #edf1ed; border-color: #c7d3cd; cursor: not-allowed; }
.language-note { margin-top: 15px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .74rem; }
.language-note span { color: var(--green); font-size: 1rem; }
.tabs { margin: 34px 0 14px; display: flex; gap: 6px; }
.tabs button { min-height: 42px; padding: 10px 16px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; font-weight: 650; }
.tabs button.active { color: var(--white); background: var(--ink); }
.tabs button > span { margin-left: 4px; padding: 2px 5px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: .56rem; font-weight: 850; text-transform: uppercase; }
.tabs button.active > span { color: var(--ink); background: white; }
.tabs button:disabled > span { color: #825711; background: #fff1d8; }
.tabs button:focus-visible, .hero-actions button:focus-visible, .start-chat-button:focus-visible, .service-action:focus-visible { outline: 3px solid rgba(23,107,87,.22); outline-offset: 2px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 55px rgba(21,39,35,.07); overflow: hidden; }
.tab-panel { display: none; }
.tab-panel.active { display: grid; }
h2 { margin: 0; font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif; font-size: 1.72rem; font-weight: 740; line-height: 1.16; letter-spacing: -.025em; }
#agent { min-height: 420px; }
.assistant-home { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.45fr); }
.start-card { padding: 32px; color: white; background: var(--ink); }
.start-badge { display: inline-flex; padding: 5px 8px; color: #cbe6dc; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; font-size: .62rem; font-weight: 850; letter-spacing: .1em; }
.start-card h2 { margin-top: 16px; color: white; }
.start-card > p { margin: 10px 0 0; color: rgba(255,255,255,.72); font-size: .88rem; line-height: 1.65; }
.start-chat-button { width: 100%; min-height: 49px; margin-top: 20px; padding: 0 14px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; color: #0b4e3f; background: linear-gradient(135deg, #ffffff, #e7f7f0); border: 1px solid rgba(255,255,255,.72); border-radius: 12px; box-shadow: 0 9px 24px rgba(0,0,0,.18); font-weight: 850; transition: color .2s ease, transform .2s ease, box-shadow .2s ease; }
.start-chat-button::after { content: ""; width: 30%; position: absolute; top: -60%; bottom: -60%; left: -42%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent); transform: skewX(-20deg); animation: action-shine 4.2s 1s ease-in-out infinite; }
.start-chat-button .ui-icon { position: relative; z-index: 1; transition: transform .2s ease; }
.start-chat-button:hover { color: #073b30; transform: translateY(-2px); box-shadow: 0 13px 30px rgba(0,0,0,.24); }
.start-chat-button:hover .ui-icon { transform: translateY(-1px) rotate(-4deg) scale(1.08); }
.start-steps { margin-top: 25px; display: grid; gap: 14px; }
.start-steps > div { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.start-steps > div > span { width: 28px; height: 28px; display: grid; place-items: center; color: #c9e8dc; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.13); border-radius: 50%; font-size: .68rem; font-weight: 850; }
.start-steps p { margin: 1px 0 0; display: grid; gap: 3px; }
.start-steps strong { font-size: .78rem; }
.start-steps small { color: rgba(255,255,255,.62); font-size: .68rem; line-height: 1.4; }
.services-card { min-width: 0; padding: 32px; background: #f3f5f0; }
.services-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.services-heading .eyebrow { margin-bottom: 6px; }
.services-heading > small { color: var(--muted); font-size: .7rem; }
.quick-actions { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.service-action { width: 100%; min-height: 68px; padding: 11px 12px; display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 12px; transition: color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; animation: service-enter .42s cubic-bezier(.2,.75,.25,1) backwards; }
.service-action:hover { color: var(--green); border-color: #9fc2b6; box-shadow: 0 7px 18px rgba(23,107,87,.09); transform: translateY(-1px); }
.service-action > span { width: 31px; height: 31px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 9px; font-size: .63rem; font-weight: 850; transition: color .18s ease, background .18s ease, transform .18s ease; }
.service-action:hover > span { color: white; background: var(--green); transform: scale(1.07) rotate(-3deg); }
.service-action p { min-width: 0; margin: 0; display: grid; gap: 3px; }
.service-action strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.service-action small { overflow: hidden; color: var(--muted); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-shell { min-width: 0; display: grid; grid-template-rows: 1fr auto; }
.chat-thread { min-height: 0; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr); }
.chat-history { min-height: 0; overflow: auto; padding: 12px 14px 16px; display: grid; align-content: start; gap: 8px; background: #f3f7f5; }
.chat-history[hidden] { display: none; }
.chat-history-bar strong { font-size: .9rem; }
.chat-history-note, .chat-history-confirm p { margin: 0; color: #5d746b; font-size: .78rem; line-height: 1.45; }
.chat-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat-history-list button { width: 100%; min-height: 44px; padding: 8px 10px; display: grid; gap: 2px; text-align: left; color: var(--ink); background: white; border: 1px solid var(--border-control); border-radius: 12px; }
.chat-history-list button[aria-current="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.chat-history-list small { color: #5d746b; font-size: .75rem; }
.chat-history-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-history-actions button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-control); border-radius: 10px; background: white; color: var(--ink); }
#chat-history-delete-confirm { color: #8d2f2f; border-color: #e4c4c4; }
#chat-clear-history { color: #8d2f2f; }
.chat-launcher { min-width: 176px; min-height: 58px; padding: 9px 18px 9px 9px; position: fixed; right: 24px; bottom: 24px; z-index: 1000; isolation: isolate; overflow: visible; display: flex; align-items: center; gap: 10px; color: white; background: linear-gradient(135deg, rgba(255,255,255,.32) 0%, rgba(64,203,165,.62) 30%, rgba(8,126,99,.78) 62%, rgba(5,82,67,.84) 100%); border: 1px solid rgba(255,255,255,.48); border-radius: 999px; box-shadow: 0 18px 44px rgba(8,75,60,.3), inset 0 1px 1px rgba(255,255,255,.72), inset 0 -12px 22px rgba(0,66,52,.18); -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%); font-weight: 800; transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, filter .22s ease; animation: launcher-breathe 2.7s ease-in-out infinite; }
.chat-launcher::before { content: ""; position: absolute; inset: 1px; z-index: 0; border-radius: inherit; background: radial-gradient(ellipse at 28% -20%, rgba(255,255,255,.9), transparent 45%), linear-gradient(180deg, rgba(255,255,255,.18), transparent 48%); opacity: .72; pointer-events: none; }
.chat-launcher::after { content: ""; position: absolute; inset: -9px; z-index: -2; border-radius: inherit; background: rgba(49,210,168,.22); filter: blur(10px); opacity: .7; pointer-events: none; }
.fab-running-border { width: calc(100% + 4px); height: calc(100% + 4px); position: absolute; inset: -2px; z-index: 3; overflow: visible; pointer-events: none; }
.fab-running-border rect { fill: none; vector-effect: non-scaling-stroke; }
.fab-border-base { stroke: rgba(255,255,255,.78); stroke-width: 1.6; }
.fab-border-runner { stroke: #ffe08a; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 16 84; filter: drop-shadow(0 0 3px rgba(255,218,110,1)); will-change: stroke-dashoffset; animation: fab-border-travel 1.8s linear infinite !important; animation-play-state: running !important; }
.fab-border-runner-glow { stroke: rgba(255,239,184,.62); stroke-width: 7; stroke-dasharray: 23 77; filter: blur(2.4px) drop-shadow(0 0 5px rgba(255,214,99,.72)); }
.fab-border-spark { stroke: #fffdf0; stroke-width: 4.2; stroke-dasharray: 2 98; filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 7px #ffd15d); }
.chat-launcher:hover { filter: saturate(1.12) brightness(1.04); transform: translateY(-4px) scale(1.025); box-shadow: 0 23px 52px rgba(7,79,62,.36), inset 0 1px 1px rgba(255,255,255,.78), inset 0 -12px 22px rgba(0,66,52,.16); }
.chat-launcher:active { transform: translateY(-1px) scale(.98); }
.chat-launcher-icon { width: 40px; height: 40px; position: relative; z-index: 1; display: grid; place-items: center; color: var(--green); background: rgba(255,255,255,.86); border: 1px solid rgba(255,255,255,.92); border-radius: 50%; box-shadow: 0 5px 16px rgba(0,54,42,.18), inset 0 1px 1px white; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 1.08rem; animation: launcher-spark 2.2s ease-in-out infinite; }
.chat-launcher-copy { position: relative; z-index: 1; display: grid; gap: 1px; text-align: left; line-height: 1.1; }
.chat-launcher-copy strong { color: white; font-size: .9rem; letter-spacing: -.01em; text-shadow: 0 1px 5px rgba(0,45,35,.24); }
.chat-launcher-copy small { color: rgba(255,255,255,.76); font-size: .61rem; font-weight: 650; }
.chat-launcher[aria-expanded="true"] { animation: none; }
.service-action:nth-child(2) { animation-delay: .04s; }
.service-action:nth-child(3) { animation-delay: .08s; }
.service-action:nth-child(4) { animation-delay: .12s; }
.service-action:nth-child(5) { animation-delay: .16s; }
.service-action:nth-child(6) { animation-delay: .2s; }
.service-action:nth-child(7) { animation-delay: .24s; }
.service-action:nth-child(8) { animation-delay: .28s; }
@keyframes service-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes action-gradient { 0%, 100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
@keyframes action-shine { 0%, 60% { left: -46%; } 86%, 100% { left: 118%; } }
@keyframes launcher-gradient { 0%, 100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
@keyframes launcher-breathe { 0%, 100% { box-shadow: 0 14px 38px rgba(13,77,62,.38), 0 0 0 0 rgba(32,145,115,.26); } 50% { box-shadow: 0 18px 44px rgba(13,77,62,.45), 0 0 0 7px rgba(32,145,115,.08); } }
@keyframes fab-border-travel { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -100; } }
@keyframes launcher-ring { 0% { opacity: .65; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.16); } }
@keyframes launcher-spark { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } }
.chat-widget { width: min(470px, calc(100vw - 32px)); height: min(690px, calc(100vh - 112px)); position: fixed; right: 24px; bottom: 84px; z-index: 999; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; visibility: hidden; opacity: 0; transform: translateY(16px) scale(.97); transform-origin: bottom right; background: var(--white); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 26px 80px rgba(21,39,35,.24); pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility .18s; }
.chat-widget.open { visibility: visible; opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.chat-widget-header { padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: white; background: var(--ink); }
.chat-widget-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-widget-identity > div { min-width: 0; display: grid; gap: 2px; }
.chat-widget-identity small { overflow: hidden; color: rgba(255,255,255,.7); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget-logo { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--ink); background: white; border-radius: 10px; font-weight: 900; }
.chat-widget-actions { display: flex; align-items: center; gap: 7px; }
.chat-expand, .chat-close { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; display: grid; place-items: center; color: white; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; line-height: 1; }
.chat-expand { font-size: 1rem; }
.chat-expand .ui-icon { width: 17px; height: 17px; stroke-width: 2; }
.chat-expand .collapse-icon { display: none; }
.chat-close { font-size: 1.35rem; }
.chat-expand:hover, .chat-close:hover { background: rgba(255,255,255,.2); }
.chat-widget .chat-shell { min-height: 0; overflow: hidden; }
.chat-widget .messages { min-height: 0; max-height: none; padding: 20px; }
.messages { max-height: 540px; padding: 28px; overflow-y: auto; }
.message { margin-bottom: 24px; display: flex; gap: 12px; }
.message.user { justify-content: flex-end; }
.message.user > div { max-width: 75%; padding: 12px 16px; color: white; background: var(--green); border-radius: 16px 16px 4px 16px; }
.message.assistant > div:last-child { min-width: 0; }
.sent-attachments { margin-bottom: 8px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.sent-attachments figure { width: min(210px, 100%); margin: 0; overflow: hidden; background: rgba(255,255,255,.12); border-radius: 10px; }
.sent-attachments img { width: 100%; max-height: 180px; display: block; object-fit: cover; }
.sent-attachments figcaption { padding: 5px 8px; overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.sent-file { max-width: 100%; padding: 6px 9px; overflow: hidden; background: rgba(255,255,255,.14); border-radius: 7px; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.message p { margin: 5px 0 0; line-height: 1.55; white-space: pre-wrap; }
.markdown-body.streaming:empty::after,
.markdown-body.streaming > :last-child::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -.16em;
  background: var(--green);
  border-radius: 2px;
  animation: stream-cursor .8s steps(1, end) infinite;
}
@keyframes stream-cursor {
  50% { opacity: 0; }
}
.markdown-body { margin-top: 6px; line-height: 1.6; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 10px; white-space: normal; }
.answer-text-line { display: block; }
.answer-reveal-line.visible { animation: answer-line-reveal .42s cubic-bezier(.2,.75,.25,1) both; }
@keyframes answer-line-reveal {
  from { opacity: 0; filter: blur(2px); transform: translateY(9px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 16px 0 7px;
  font-family: inherit;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: normal;
}
.markdown-body h1 { font-size: 1.25rem; }
.markdown-body h2 { font-size: 1.15rem; }
.markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1rem; }
.markdown-body ul, .markdown-body ol { margin: 7px 0 12px; padding-left: 22px; }
.markdown-body li { margin: 4px 0; padding-left: 2px; }
.markdown-body blockquote { margin: 10px 0; padding: 7px 12px; color: var(--muted); border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 0 8px 8px 0; }
.markdown-body code { padding: 2px 5px; color: #8b3a2b; background: #f1eee8; border-radius: 5px; font-family: "SFMono-Regular", Consolas, monospace; font-size: .88em; }
.markdown-body pre { margin: 10px 0; padding: 12px 14px; overflow-x: auto; color: #eef5f1; background: var(--ink); border-radius: 10px; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; white-space: pre; }
.typing-message > div:last-child { min-width: 0; }
.typing-indicator { width: min(300px, calc(100vw - 125px)); max-width: 100%; min-height: 62px; margin-top: 7px; padding: 10px 12px; position: relative; display: flex; align-items: center; gap: 10px; overflow: hidden; color: var(--muted); background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 13px; box-shadow: 0 8px 24px rgba(20,39,35,.05); font-size: .82rem; }
.thinking-orbit { width: 32px; height: 32px; position: relative; flex: 0 0 auto; display: grid; place-items: center; background: var(--surface-soft); border: 1px solid var(--border-subtle); border-radius: 50%; }
.thinking-orbit::before { content: ""; width: 22px; height: 22px; position: absolute; border: 2px solid transparent; border-top-color: var(--green); border-right-color: var(--border-control); border-radius: 50%; animation: thinking-orbit 1.15s linear infinite; }
.thinking-orbit i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px var(--green-soft); animation: thinking-core 1.15s ease-in-out infinite; }
.typing-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.typing-copy small { color: var(--muted); font-size: .75rem; line-height: 1.45; overflow-wrap: anywhere; }
.typing-step { color: var(--ink); font-weight: 750; line-height: 1.45; overflow-wrap: anywhere; }
.typing-step.changing { animation: typing-step-change .3s ease both; }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.typing-dots i { width: 4px; height: 4px; background: var(--green); border-radius: 50%; animation: typing-bounce 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
.typing-scan { height: 2px; position: absolute; right: 0; bottom: 0; left: 0; overflow: hidden; background: var(--border-subtle); }
.typing-scan::after { content: ""; width: 45%; height: 100%; position: absolute; left: -45%; background: linear-gradient(90deg, transparent, var(--green), transparent); animation: typing-scan 1.7s ease-in-out infinite; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes thinking-orbit { to { transform: rotate(360deg); } }
@keyframes thinking-core { 50% { opacity: .55; transform: scale(.72); } }
@keyframes typing-step-change {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes typing-scan { 55%, 100% { left: 100%; } }
.avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 11px; font-weight: 800; }
.trace { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.trace span { padding: 5px 8px; color: var(--green); background: var(--green-soft); border-radius: 7px; font-size: .7rem; }
.citation { margin-top: 7px; color: var(--muted); font-size: .76rem; }
.chat-starters { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chat-starters button { padding: 7px 9px; color: var(--green); background: var(--green-soft); border: 1px solid transparent; border-radius: 9px; font-size: .68rem; font-weight: 750; }
.chat-starters button:hover { border-color: #9fc2b6; }
.message-actions { margin-top: 9px; }
.speak-button { min-height: 31px; padding: 5px 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; font-weight: 700; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.speak-button .ui-icon { width: 15px; height: 15px; }
.speak-button:hover { color: var(--green); border-color: #a9c5bc; background: var(--green-soft); transform: translateY(-1px); }
.speak-button.speaking { color: var(--green); border-color: #a9c5bc; background: var(--green-soft); }
.speak-button:focus-visible, .attach-button:focus-visible, .mic-button:focus-visible { outline: 3px solid rgba(23,107,87,.2); outline-offset: 2px; }
.composer { padding: 14px 18px 16px; display: grid; gap: 7px; border-top: 1px solid var(--line); }
.composer-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.composer input { min-width: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.composer input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.composer-row > button, .section-heading button, .decision { padding: 11px 17px; color: white; background: var(--green); border: 0; border-radius: 10px; font-weight: 700; }
.composer input:disabled { color: var(--muted); background: #f3f4f1; }
.composer-row > button:disabled { cursor: wait; opacity: .55; }
.attach-button { width: 43px; height: 43px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.attach-button:hover { color: var(--green); background: var(--green-soft); border-color: #a9c5bc; transform: translateY(-1px); }
.attach-button.disabled { cursor: wait; opacity: .5; pointer-events: none; }
.mic-button { width: 43px; height: 43px; padding: 0 !important; display: grid; place-items: center; color: var(--muted) !important; background: transparent !important; border: 1px solid var(--line) !important; border-radius: 11px; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.mic-button:hover:not(:disabled) { color: var(--green) !important; background: var(--green-soft) !important; border-color: #a9c5bc !important; transform: translateY(-1px); }
.mic-button:disabled { cursor: not-allowed; color: #9ca7a3 !important; background: #f1f3ef !important; opacity: .62; }
.mic-button.listening { color: white !important; background: #b5433d !important; border-color: #b5433d !important; animation: mic-pulse 1.2s ease-in-out infinite; }
.mic-button.unsupported { cursor: not-allowed; filter: grayscale(1); opacity: .45; }
@keyframes mic-pulse {
  50% { box-shadow: 0 0 0 6px rgba(181,67,61,.16); }
}
.attachment-preview { display: none; flex-wrap: wrap; gap: 7px; }
.attachment-preview.visible { display: flex; }
.attachment-chip { max-width: 100%; padding: 5px 7px; display: flex; align-items: center; gap: 6px; color: var(--ink); background: #eef1ec; border: 1px solid var(--line); border-radius: 8px; font-size: .72rem; }
.attachment-chip > span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip img { width: 25px; height: 25px; object-fit: cover; border-radius: 5px; }
.attachment-chip button { width: 20px; height: 20px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 1rem; line-height: 1; }
.attachment-chip button:hover { color: #9d342d; background: #f7dfdc; }
.attachment-error { color: #9d342d; font-size: .76rem; }
.attachment-help { color: var(--muted); font-size: .66rem; }
.composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.test-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.auto-tts-toggle { padding: 5px 9px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: .66rem; }
.auto-tts-toggle.enabled { color: var(--green); background: var(--green-soft); border-color: var(--green); }
.auto-tts-toggle:disabled { cursor: not-allowed; opacity: .55; }
.speech-status { min-height: 1em; color: var(--green); font-size: .7rem; }
@media (max-width: 640px) {
  .composer-meta { align-items: flex-start; flex-direction: column; }
  .test-controls { justify-content: flex-start; }
}
.sr-only { width: 1px; height: 1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#progress, #tickets, #household, #regulations, #management { padding: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.management-heading { align-items: flex-end; }
.management-heading .eyebrow { margin-bottom: 7px; }
.section-description { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.refresh-button { min-width: 116px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.refresh-button > span { font-size: 1.2rem; font-weight: 400; line-height: .8; }
.refresh-button:disabled { cursor: wait; opacity: .65; }
.refresh-spinner { animation: icon-spin .8s linear infinite; }
.request-stats { margin-top: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.request-stat { min-width: 0; padding: 13px 12px; display: grid; gap: 3px; text-align: left; color: var(--ink); background: #f5f7f3; border: 1px solid var(--line); border-radius: 12px; transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.request-stat:hover { border-color: #a9c9bd; box-shadow: 0 5px 15px rgba(23,107,87,.08); transform: translateY(-1px); }
.request-stat.active { color: var(--green); background: var(--green-soft); border-color: #99c3b4; box-shadow: inset 0 0 0 1px rgba(23,107,87,.06); }
.request-stat:focus-visible { outline: 3px solid rgba(23,107,87,.2); outline-offset: 2px; }
.request-stat strong { font-size: 1.35rem; line-height: 1; }
.request-stat span { overflow: hidden; color: var(--muted); font-size: .68rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.request-stat.active span { color: var(--green); }
.request-toolbar { margin-top: 18px; padding: 13px; display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(170px, .75fr) minmax(170px, .75fr) auto; gap: 10px; align-items: end; background: #f7f8f5; border: 1px solid var(--line); border-radius: 14px; }
.request-toolbar > label:not(.request-search) { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 750; }
.request-toolbar select, .request-search input { width: 100%; min-width: 0; height: 41px; padding: 0 36px 0 12px; color: var(--ink); background-color: var(--white); border: 1px solid var(--line); border-radius: 10px; outline: none; }
.request-toolbar select:focus, .request-search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,87,.1); }
.request-search { height: 41px; position: relative; display: flex; align-items: center; }
.request-search .ui-icon { width: 17px; height: 17px; position: absolute; left: 12px; z-index: 1; color: var(--muted); pointer-events: none; }
.request-search input { padding: 0 34px 0 38px; }
.request-search input::-webkit-search-cancel-button { cursor: pointer; }
.clear-filters { height: 41px; padding: 0 12px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 9px; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.clear-filters:hover:not(:disabled) { color: var(--green); background: var(--green-soft); }
.clear-filters:disabled { cursor: default; opacity: .38; }
.request-results-heading { margin-top: 22px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.request-results-heading strong { font-size: .95rem; }
.request-results-heading span { overflow: hidden; color: var(--muted); font-size: .72rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.progress-summary { margin-top: 24px; padding: 16px 17px; background: #f5f7f3; border: 1px solid var(--line); border-radius: 13px; }
.progress-copy-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-copy-row p { margin: 0; color: var(--muted); font-size: .82rem; }
.progress-copy-row p strong { color: var(--ink); font-size: 1rem; }
.progress-copy-row p span { font-size: .72rem; }
.progress-copy-row > span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .66rem; }
.progress-copy-row > span i { width: 8px; height: 8px; margin-left: 6px; background: var(--green); border-radius: 50%; }
.progress-copy-row > span i:nth-of-type(2) { background: #a9b6b1; }
.progress-bar { height: 9px; margin-top: 12px; overflow: hidden; background: #e1e7e2; border-radius: 999px; }
.progress-bar span { display: block; width: 0; height: 100%; background: var(--green); transition: width .3s ease; }
.task-list { margin-top: 22px; display: grid; gap: 12px; container-type: inline-size; }
.task { padding: 18px; display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(160px, 200px); gap: 16px; align-items: start; border: 1px solid var(--line); border-radius: 13px; }
.task.completed { background: #f5faf7; border-color: #c6ddd4; }
.task-marker { width: 34px; height: 34px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 10px; font-size: .72rem; font-weight: 850; }
.task.completed .task-marker { color: white; background: var(--green); border-radius: 50%; }
.task-copy { min-width: 0; }
.task-copy > strong { display: block; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.task-copy small { display: block; margin-top: 8px; color: var(--muted); font-size: .8125rem; line-height: 1.6; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.task-meta .badge { flex: 0 0 auto; white-space: nowrap; font-size: .75rem; font-weight: 600; }
.task-side { display: grid; align-items: start; gap: 8px; min-width: 0; }
.task-side > button { min-height: 44px; width: 100%; padding: 10px 14px; font-size: .8125rem; line-height: 1.4; }
.task-side:empty { display: none; }
.task-side > small { text-align: center; }
.task-help { padding: 7px 9px; color: var(--green); background: transparent; border: 1px solid #a9c9bd; border-radius: 8px; font-size: .68rem; font-weight: 750; }
.task-help:hover { background: var(--green-soft); }
.badge { padding: 6px 9px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: .7rem; font-weight: 800; }
.regulations-section { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.ticket-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #e8ebe7; }
.ticket-chat-action, .remove-person, .cancel-ticket { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; border-radius: 12px; padding: 11px 14px; cursor: pointer; font: inherit; font-size: .8125rem; font-weight: 650; line-height: 1.45; }
.ticket-actions > button { width: 136px; min-width: 136px; }
.ticket-chat-action { border: 1px solid var(--button-outline); background: var(--button-soft); color: var(--green); }
.ticket-chat-action:hover:not(:disabled) { background: var(--button-soft-hover); }
.a2ui-surface { margin-top: 14px; }
.a2ui-card { padding: 16px; background: var(--surface-soft); border: 1px solid var(--border-subtle); border-radius: 16px; }
.a2ui-column { display: grid; gap: 9px; }
.a2ui-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.a2ui-text { margin: 0; color: var(--ink); font-size: .9rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.a2ui-divider { width: 100%; margin: 1px 0; border: 0; border-top: 1px solid #dcebe5; }
.a2ui-button { min-height: 44px; padding: 10px 14px; color: var(--green); background: var(--surface); border: 1px solid var(--border-control); border-radius: 10px; font-size: .875rem; font-weight: 650; transition: background var(--motion-control), border-color var(--motion-control); }
.a2ui-button:hover { color: #0b4e3f; background: var(--green-soft); border-color: var(--green); }
.a2ui-procedure { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 16px; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 14px; gap: 16px; align-items: center; }
.a2ui-procedure-copy { min-width: 0; gap: 4px; }
.a2ui-title { color: var(--green); font-weight: 750; }
.a2ui-muted { color: var(--muted); font-size: .8125rem; }
.a2ui-procedure .a2ui-button { flex-shrink: 0; white-space: nowrap; }
.a2ui-button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
@media (max-width: 480px) {
  .a2ui-procedure { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .a2ui-procedure .a2ui-button { justify-self: start; min-height: 44px; }
}
.remove-person { margin: 0; border: 1px solid var(--status-error-solid); background: var(--status-error-soft); color: var(--status-error-ink); }
.regulations-section h3 { margin: 0; font-size: 1.5rem; }
.regulations-section > p { color: var(--muted); font-size: .78rem; }
.regulation-item { margin-top: 9px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); min-width: 0; }
.regulation-item summary, .ticket-timeline summary { cursor: pointer; font-weight: 750; }
.regulation-item summary small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.regulation-body { color: var(--ink); font-size: .82rem; line-height: 1.65; }
.regulation-body h4 { margin: 18px 0 5px; font-size: .94rem; }
.regulation-body p { margin: 0 0 10px; white-space: pre-line; }
.resident-ticket { align-self: start; }
.ticket-next-step { margin: 14px 0 0; padding: 11px 13px; color: var(--ink); background: var(--green-soft); border-radius: 9px; font-size: .78rem; line-height: 1.5; }
.ticket-next-step strong { color: var(--green); }
.ticket-timeline { margin-top: 16px; color: var(--muted); font-size: .76rem; }
.ticket-timeline ol { margin: 12px 0 0; padding: 0; list-style: none; }
.ticket-timeline li { position: relative; padding: 0 0 18px 40px; line-height: 1.5; }
.ticket-timeline li:last-child { padding-bottom: 0; }
.ticket-timeline li::before { content: "✓"; position: absolute; z-index: 1; top: 0; left: 0; width: 24px; height: 24px; display: grid; place-items: center; color: white; background: var(--green); border: 2px solid var(--green); border-radius: 50%; font-size: 14px; font-weight: 800; line-height: 1; }
.ticket-timeline li:not(:last-child)::after { content: ""; position: absolute; top: 24px; bottom: 0; left: 11px; width: 2px; background: var(--green); }
.ticket-timeline li.current::before { box-shadow: 0 0 0 3px #dff2e8; }
.ticket-timeline-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-height: 24px; }
.ticket-timeline-heading strong { color: var(--ink); font-size: .78rem; }
.ticket-timeline li.current .ticket-timeline-heading strong { color: var(--green); }
.ticket-timeline li p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cancel-ticket { margin: 0; color: var(--status-error-ink); background: var(--status-error-soft); border: 1px solid var(--status-error-solid); }
:is(.cancel-ticket,.remove-person):hover:not(:disabled) { box-shadow: inset 0 0 0 1px currentColor; }
:is(.ticket-chat-action,.cancel-ticket,.remove-person):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
:is(.ticket-chat-action,.cancel-ticket,.remove-person):disabled { opacity: .55; cursor: not-allowed; }
.household-summary { margin-top: 22px; padding: 15px 18px; display: flex; justify-content: space-between; gap: 10px; background: var(--green-soft); border-radius: 13px; }
.household-summary span { color: var(--muted); font-size: .76rem; }
.household-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.household-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.56); }
.household-card h3 { margin: 0 0 14px; font-size: 1rem; }
.household-big-number { margin: 0 0 8px; color: var(--green); font-size: 2rem; font-weight: 850; }
.household-big-number small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.household-big-number.internet-state { font-size: 1.15rem; }
.household-hint { color: var(--muted); font-size: .76rem; line-height: 1.55; }
.household-list { margin: 12px 0; padding: 0; list-style: none; }
.household-list li { padding: 9px 0; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); font-size: .78rem; }
.household-list li span { color: var(--muted); text-align: right; }
.household-chat-action { padding: 8px 11px; color: var(--green); background: var(--green-soft); border: 1px solid #a9c9bd; border-radius: 8px; font-size: .73rem; font-weight: 750; }
.vehicle-card { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.vehicle-card > strong, .vehicle-card > small { display: block; }
.vehicle-card > small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.vehicle-card p { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }
.vehicle-card.status-border-pending, .vehicle-card.status-border-submitted { border-left: 3px solid #c58b18; padding-left: 10px; }
.vehicle-card.status-border-approved { border-left: 3px solid #2f8f65; padding-left: 10px; }
.vehicle-card.status-border-completed { border-left: 3px solid #3f85d8; padding-left: 10px; }
.vehicle-card.status-border-rejected { border-left: 3px solid #b54747; padding-left: 10px; }
.delivery-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.delivery-actions button, .delivery-bulk-delete { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); color: var(--ink); font-weight: 700; }
.delivery-actions .delivery-delete, .delivery-bulk-delete { color: #a33d3d; border-color: #e1aaaa; }
.delivery-ticket-actions { margin-top: 12px; }
.delivery-history { margin-top: 12px; }
.delivery-history ol { padding-left: 20px; }
.delivery-history li { margin: 8px 0; }
.delivery-history time { margin-left: 8px; color: var(--muted); font-size: .78rem; }
.ticket-delivery-dialog { max-width: 560px; width: min(92vw, 560px); }
.ticket-delivery-dialog dl { display: grid; grid-template-columns: minmax(100px, .6fr) 1fr; gap: 8px 16px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.ticket-delivery-dialog dt { color: var(--muted); }
.ticket-delivery-dialog dd { margin: 0; font-weight: 750; }
.ticket-delivery-dialog input { width: 100%; min-height: 42px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.ticket-delivery-dialog fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ticket-delivery-dialog fieldset label { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.ticket-delivery-dialog input[type="radio"] { width: 20px; min-height: 20px; flex-shrink: 0; margin-top: 2px; }
.ticket-delivery-dialog button:focus-visible, .delivery-actions button:focus-visible { outline: 3px solid #2474ba; outline-offset: 3px; }
.regulation-item summary { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.regulation-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; color: var(--muted); }
.regulation-meta span, .regulation-meta small { padding: 3px 8px; border-radius: 999px; background: #f4f7f5; font-size: .72rem; }
.regulation-read-status { color: var(--green); }
@media (max-width: 520px) { .regulation-item summary { align-items: flex-start; flex-direction: column; } .regulation-meta { justify-content: flex-start; } .ticket-delivery-dialog dl { grid-template-columns: 1fr; gap: 4px; } }
.resident-profile { margin-top: 12px; font-size: .76rem; }
.resident-profile summary { cursor: pointer; color: var(--green); font-weight: 750; }
.task-loading { min-height: 140px; display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--muted); }
.task-loading i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: typing-bounce 1.2s ease-in-out infinite; }
.task-loading i:nth-child(2) { animation-delay: .15s; }
.task-loading i:nth-child(3) { animation-delay: .3s; }
.task-loading span { margin-left: 5px; font-size: .8rem; }
.request-list { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.request-card { min-width: 0; padding: 16px; position: relative; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 22px rgba(20,39,35,.035); }
.request-card::before { content: ""; width: 3px; position: absolute; top: 0; bottom: 0; left: 0; background: #b8c4bf; }
.request-card.status-border-submitted::before, .request-card.status-border-in_review::before { background: var(--status-pending-solid); }
.request-card.status-border-needs_info::before, .request-card.status-border-rejected::before { background: var(--status-error-solid); }
.request-card.status-border-approved::before { background: var(--status-approved-solid); }
.request-card.status-border-completed::before { background: var(--status-completed-solid); }
.request-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.request-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.request-identity > div { min-width: 0; display: grid; gap: 2px; }
.request-identity strong { overflow: hidden; font-size: .86rem; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.request-type-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 10px; }
.request-type-icon .ui-icon { width: 19px; height: 19px; }
.request-kind { overflow: hidden; color: var(--muted); font-size: .68rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.request-status { padding: 5px 8px; flex: 0 0 auto; color: var(--muted); background: #eceee9; border-radius: 999px; font-size: .65rem; font-weight: 800; }
.request-status.status-submitted, .request-status.status-in_review { color: var(--status-pending-ink); background: var(--status-pending-soft); }
.request-status.status-needs_info, .request-status.status-rejected { color: var(--status-error-ink); background: var(--status-error-soft); }
.request-status.status-approved { color: var(--status-approved-ink); background: var(--status-approved-soft); }
.request-status.status-completed { color: white; background: var(--status-completed-solid); }
.request-meta { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .7rem; }
.request-meta strong { color: var(--ink); }
.request-details { margin: 13px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.request-details > div { min-width: 0; padding: 8px 9px; background: #f6f7f4; border-radius: 8px; }
.request-details dt { color: var(--muted); font-size: .62rem; font-weight: 700; }
.request-details dd { margin: 2px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: .74rem; font-weight: 650; }
.request-card-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e8ebe7; }
.request-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.decision { padding: 8px 11px; font-size: .72rem; }
.decision.secondary { color: var(--ink); background: #eceee9; }
.decision.warning { color: #684406; background: #f3dfb6; }
.decision.danger { color: #8c2d27; background: #f5d9d6; }
.no-actions { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .7rem; }
.no-actions i { width: 18px; height: 18px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; font-style: normal; font-weight: 900; }
.empty-state { padding: 40px 24px; grid-column: 1 / -1; display: grid; justify-items: center; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.empty-state > span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; font-size: 1.35rem; }
.empty-state strong { margin-top: 10px; color: var(--ink); }
.empty-state p { margin: 4px 0 14px; font-size: .78rem; }
.empty-state button { padding: 8px 12px; color: var(--green); background: transparent; border: 1px solid #a9c9bd; border-radius: 9px; font-size: .72rem; font-weight: 750; }
.request-loading { min-height: 160px; grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--muted); }
.request-loading i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: typing-bounce 1.2s ease-in-out infinite; }
.request-loading i:nth-child(2) { animation-delay: .15s; }
.request-loading i:nth-child(3) { animation-delay: .3s; }
.request-loading span { margin-left: 5px; font-size: .8rem; }
.error { color: #9d342d; }
.decision-dialog { width: min(470px, calc(100% - 28px)); padding: 0; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 28px 90px rgba(20,39,35,.3); }
.decision-dialog::backdrop { background: rgba(14,29,25,.52); backdrop-filter: blur(3px); }
.decision-dialog form { padding: 24px; }
.dialog-heading { display: flex; align-items: center; gap: 12px; }
.dialog-heading > div { min-width: 0; }
.dialog-heading small { display: block; margin-bottom: 3px; color: var(--green); font-size: .62rem; font-weight: 850; letter-spacing: .1em; }
.dialog-heading h2 { font-size: 1.5rem; }
.dialog-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--green); border-radius: 12px; font-size: 1.1rem; font-weight: 850; }
.dialog-copy { margin: 16px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.decision-reason-wrap { margin-top: 17px; display: grid; gap: 7px; color: var(--ink); font-size: .75rem; font-weight: 750; }
.decision-reason-wrap[hidden] { display: none; }
.decision-reason-wrap textarea { width: 100%; min-height: 105px; padding: 11px 12px; resize: vertical; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-weight: 400; line-height: 1.5; outline: none; }
.decision-reason-wrap textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,87,.1); }
.field-error { min-height: 1em; margin-top: 7px; display: block; color: #9d342d; font-size: .68rem; font-weight: 650; }
.field-error:empty { display: none; }
.dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions button { min-height: 44px; padding: 0 14px; border-radius: 9px; font-weight: 750; }
#decision-cancel { min-height: 44px; color: #fff; background: #b93646; border: 1px solid #b93646; }
#decision-cancel:hover:not(:disabled) { background: #9f2939; border-color: #9f2939; }
#decision-cancel:active:not(:disabled) { background: #8b2232; }
#decision-cancel:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#decision-cancel:disabled { cursor: wait; opacity: .55; }
#decision-confirm { color: white; background: var(--green); border: 1px solid var(--green); }
#decision-confirm:hover:not(:disabled) { background: #105c4a; }
#decision-confirm.danger { background: #a94039; border-color: #a94039; }
#decision-confirm.danger:hover:not(:disabled) { background: #8f332d; }
#decision-confirm:disabled { cursor: wait; opacity: .65; }

/* Restrained iOS-inspired Liquid Glass theme */
.runtime { padding: 6px 10px; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9); border-radius: 999px; box-shadow: 0 6px 18px rgba(32,72,61,.06); }
.language-note { width: fit-content; padding: 0; background: transparent; border: 0; box-shadow: none; }
.primary-action,
.composer-row > button,
.section-heading button,
.decision:not(.secondary):not(.warning):not(.danger),
#decision-confirm { background: linear-gradient(145deg, #159071, #08725a); border: 1px solid rgba(255,255,255,.42); box-shadow: 0 9px 22px rgba(8,112,88,.2), inset 0 1px 0 rgba(255,255,255,.34); }
.secondary-action,
.start-chat-button,
.task-help,
.empty-state button { background: rgba(255,255,255,.88); border-color: rgba(255,255,255,.96); box-shadow: 0 7px 20px rgba(33,73,62,.08), inset 0 1px 0 white; }

/* Make the AI entry points the primary visual path. */
.hero-actions .primary-action {
  min-height: 56px;
  padding: 7px 15px 7px 8px;
  gap: 10px;
  background: linear-gradient(120deg, #075b49 0%, #109978 46%, #08715a 100%);
  background-size: 210% 100%;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 16px;
  box-shadow: 0 13px 30px rgba(7,112,86,.28), 0 0 0 4px rgba(39,199,155,.08), inset 0 1px 0 rgba(255,255,255,.32);
  animation: action-gradient 4s ease-in-out infinite, ai-cta-pulse 2.8s ease-in-out infinite;
}
.ai-cta-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #08715a;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(0,62,47,.2), inset 0 1px 0 white;
  font-size: 1rem !important;
}
.ai-cta-label { font-size: .9rem !important; letter-spacing: -.01em; }
.ai-cta-arrow { margin-left: 2px; font-size: 1.05rem !important; }
.primary-action:hover .ai-cta-label { transform: none; }
.primary-action:hover .ai-cta-mark { transform: rotate(7deg) scale(1.06); }
.primary-action:hover .ai-cta-arrow { transform: translateX(4px); }
.secondary-action { min-height: 48px !important; color: #435b54; background: rgba(255,255,255,.72); box-shadow: none; }
.start-chat-button {
  min-height: 68px;
  padding: 8px 10px;
  justify-content: flex-start;
  gap: 11px;
  color: #073f32;
  background: linear-gradient(135deg, #f7fffc 0%, #c9f7e7 52%, #91e7ca 100%);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 16px;
  box-shadow: 0 13px 30px rgba(0,24,18,.28), 0 0 0 4px rgba(87,224,183,.1), inset 0 1px 0 white;
}
.start-chat-button .ui-icon {
  width: 40px;
  height: 40px;
  padding: 9px;
  flex: 0 0 auto;
  color: white;
  background: linear-gradient(145deg, #149675, #08715a);
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(7,104,80,.24);
}
.start-chat-copy { min-width: 0; position: relative; z-index: 1; display: grid; gap: 2px; text-align: left; }
.start-chat-copy strong { color: #073f32; font-size: .79rem; line-height: 1.2; }
.start-chat-copy small { color: #3e685d; font-size: .62rem; font-weight: 650; }
.start-chat-arrow { width: 27px; height: 27px; margin-left: auto; position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 auto; color: white; background: #0d8065; border-radius: 50%; font-size: .9rem; transition: transform .2s ease; }
.start-chat-button:hover { color: #052f26; background: linear-gradient(135deg, #fff 0%, #d5fbed 48%, #9beccf 100%); box-shadow: 0 17px 36px rgba(0,24,18,.32), 0 0 0 5px rgba(87,224,183,.13); }
.start-chat-button:hover .start-chat-arrow { transform: translateX(3px); }
#tab-agent.active { background: linear-gradient(135deg, #0f5848, #0b7b61); box-shadow: 0 7px 18px rgba(9,102,79,.24), 0 0 0 3px rgba(26,160,124,.08); }
#tab-agent > span { color: #075a47; background: #c9f5e5; }
.chat-launcher {
  min-width: 198px;
  background: linear-gradient(135deg, #28b58d 0%, #0c8668 46%, #075b49 100%);
  border-color: rgba(255,255,255,.7);
  box-shadow: 0 18px 44px rgba(5,94,72,.36), 0 0 0 5px rgba(61,216,174,.12), inset 0 1px 1px rgba(255,255,255,.48);
}
.chat-launcher-copy strong { font-size: .94rem; }
.chat-launcher-copy small { color: rgba(255,255,255,.86); font-size: .6rem; }
@keyframes ai-cta-pulse {
  0%, 100% { box-shadow: 0 13px 30px rgba(7,112,86,.26), 0 0 0 4px rgba(39,199,155,.07), inset 0 1px 0 rgba(255,255,255,.32); }
  50% { box-shadow: 0 16px 35px rgba(7,112,86,.33), 0 0 0 7px rgba(39,199,155,.11), inset 0 1px 0 rgba(255,255,255,.38); }
}
.tabs { width: fit-content; padding: 4px; background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.92); border-radius: 16px; box-shadow: 0 10px 28px rgba(35,77,65,.08), inset 0 1px 0 white; -webkit-backdrop-filter: blur(20px) saturate(145%); backdrop-filter: blur(20px) saturate(145%); }
.tabs button { border-radius: 12px; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.tabs button:hover { color: var(--green); background: rgba(255,255,255,.7); }
.tabs button.active { color: white; background: #123f35; border-color: transparent; box-shadow: 0 6px 15px rgba(18,63,53,.18); }
.panel { background: rgba(255,255,255,.84); border-color: rgba(255,255,255,.94); box-shadow: 0 22px 60px rgba(30,69,58,.1), inset 0 1px 0 white; -webkit-backdrop-filter: blur(28px) saturate(145%); backdrop-filter: blur(28px) saturate(145%); }
.start-card { background: linear-gradient(145deg, #123d34 0%, #174f42 100%); border-right: 1px solid rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.start-badge,
.start-steps > div > span { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.services-card { background: rgba(247,250,248,.78); }
.service-action,
.request-stat,
.progress-summary,
.task,
.request-card,
.request-toolbar,
.request-details > div,
.typing-indicator,
.attachment-chip,
.empty-state { background: rgba(255,255,255,.94); border-color: #e1e9e5; box-shadow: 0 5px 18px rgba(35,76,65,.05); }
.service-action:hover,
.request-stat:hover,
.task:hover,
.request-card:hover { background: white; border-color: #c9dcd4; box-shadow: 0 10px 26px rgba(26,91,72,.09); }
.service-action > span,
.task-marker,
.request-type-icon,
.empty-state > span,
.trace span,
.badge,
.chat-starters button { background: #e8f5f0; border: 1px solid #d9ece4; box-shadow: none; }
.request-stat.active,
.task.completed { background: #ecf8f3; border-color: #b9dccf; }
.request-toolbar select,
.request-search input,
.composer input,
.decision-reason-wrap textarea { background: rgba(255,255,255,.96); border-color: #d7e2dd; box-shadow: inset 0 1px 2px rgba(28,66,55,.04); }
.progress-bar { background: #e3ebe7; box-shadow: inset 0 1px 3px rgba(41,76,66,.1); }
.progress-bar span { background: linear-gradient(90deg, #0d7059, #31b28a); box-shadow: 0 0 10px rgba(42,181,143,.25); }
.chat-widget { width: min(430px, calc(100vw - 32px)); height: min(650px, calc(100vh - 112px)); background: rgba(250,252,251,.97); border-color: rgba(255,255,255,.98); border-radius: 26px; box-shadow: 0 28px 80px rgba(18,54,45,.24), 0 0 0 1px rgba(32,88,72,.07), inset 0 1px 0 white; -webkit-backdrop-filter: blur(30px) saturate(140%); backdrop-filter: blur(30px) saturate(140%); }
.chat-widget.expanded { width: min(960px, calc(100vw - 48px)); height: calc(100dvh - 48px); right: 24px; bottom: 24px; z-index: 1001; border-radius: 30px; box-shadow: 0 34px 110px rgba(13,47,39,.32), 0 0 0 1px rgba(255,255,255,.76), inset 0 1px 0 white; }
body.chat-expanded { overflow: hidden; }
body.chat-expanded::after { content: ""; position: fixed; inset: 0; z-index: 998; background: rgba(18,47,39,.16); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.chat-widget-header { padding: 14px 15px; background: #123d34; border-bottom: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.chat-widget-logo { background: white; border: 0; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.chat-expand, .chat-close { color: white; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.chat-expand:hover, .chat-close:hover { background: rgba(255,255,255,.18); }
.chat-widget.expanded .chat-expand .expand-icon { display: none; }
.chat-widget.expanded .chat-expand .collapse-icon { display: block; }
.chat-widget .messages { padding: 18px 16px 24px; background: #f3f7f5; scrollbar-color: #a9bcb5 transparent; }
.chat-widget .message { align-items: flex-end; margin-bottom: 16px; gap: 9px; }
.chat-widget .message.user { padding-left: 64px; }
.chat-widget .message.user > div { width: fit-content; max-width: 100%; padding: 11px 14px; color: white; background: #128166; border: 0; border-radius: 18px 18px 5px 18px; box-shadow: 0 7px 18px rgba(10,112,88,.18); }
.chat-widget .message.assistant { align-items: flex-start; padding-right: 30px; }
.chat-widget .avatar { width: 32px; height: 32px; margin-top: 2px; color: white; background: #123d34; border: 0; border-radius: 10px; box-shadow: 0 5px 14px rgba(17,61,51,.14); font-size: .76rem; }
.chat-widget .message.assistant > div:last-child { max-width: calc(100% - 41px); padding: 11px 13px; color: var(--ink); background: white; border: 1px solid #dfe9e5; border-radius: 5px 18px 18px 18px; box-shadow: 0 6px 18px rgba(28,69,58,.07); }
.chat-widget .message.assistant > div:last-child > strong { display: block; margin-bottom: 4px; color: #174b3e; font-size: .75rem; }
.chat-widget .message.assistant .markdown-body { margin-top: 0; line-height: 1.55; }
.chat-widget .message.assistant .markdown-body p { color: #213f37; }
.chat-widget .message.assistant.typing-message > div:last-child { padding: 0; background: transparent; border: 0; box-shadow: none; }
.chat-widget .message.assistant.typing-message > div:last-child > strong { margin: 0 0 5px 2px; }
.chat-widget .typing-indicator { background: var(--surface); border-color: var(--border-subtle); }
.chat-widget .chat-starters { margin-top: 10px; }
.chat-widget .chat-starters button { color: #0d7059; background: #e8f5f0; border-color: #d9ece4; }
.chat-widget .message-actions { margin-top: 9px; }
.chat-widget .speak-button { background: #f7faf9; border-color: #dce7e2 !important; box-shadow: none; }
.chat-widget.expanded .messages { padding: 26px clamp(24px, 5vw, 64px) 34px; }
.chat-widget.expanded .message.user { padding-left: min(28%, 250px); }
.chat-widget.expanded .message.assistant { padding-right: min(20%, 180px); }
.chat-widget.expanded .message.assistant > div:last-child { width: fit-content; max-width: min(720px, calc(100% - 41px)); }
.chat-widget.expanded .composer { padding-right: clamp(24px, 5vw, 64px); padding-left: clamp(24px, 5vw, 64px); }
.composer { padding: 14px 16px 13px; gap: 9px; background: #fff; border-top: 1px solid #dce7e2; box-shadow: 0 -10px 28px rgba(27,67,56,.07); -webkit-backdrop-filter: none; backdrop-filter: none; }
.composer-row { gap: 8px; }
.composer input { min-height: 46px; padding: 0 14px; color: #173a31; background: #fff; border: 1.5px solid #a9beb6; border-radius: 13px; box-shadow: 0 2px 8px rgba(24,65,54,.04); font-size: .86rem; }
.composer input::placeholder { color: #71817c; opacity: 1; }
.composer input:focus { border-color: #0b8567; box-shadow: 0 0 0 3px rgba(15,133,104,.12), 0 3px 10px rgba(24,65,54,.06); }
.composer-row > button[type="submit"] { min-width: 62px; min-height: 46px; padding: 0 16px; color: white; background: #0e7d63; border: 1px solid #096b54; border-radius: 13px; box-shadow: 0 6px 15px rgba(9,105,82,.2), inset 0 1px 0 rgba(255,255,255,.2); font-size: .86rem; }
.composer-row > button[type="submit"]:hover:not(:disabled) { background: #096c56; transform: translateY(-1px); }
.attach-button,
.mic-button { width: 46px; height: 46px; color: #42635a !important; background: #f4f8f6 !important; border: 1px solid #cfddd7 !important; border-radius: 13px; box-shadow: none; }
.attach-button:hover,
.mic-button:hover:not(:disabled) { color: #08745b !important; background: #e7f4ef !important; border-color: #9fc7b8 !important; }
.mic-button:disabled { color: #a5b0ac !important; background: #f6f8f7 !important; border-color: #e2e8e5 !important; opacity: 1; }
.composer-meta { min-height: 24px; }
.attachment-help { color: #5f716b; font-size: .68rem; font-weight: 550; }
.auto-tts-toggle { min-height: 44px; padding: 5px 9px; color: #526861; background: #f4f7f6; border: 1px solid #d7e2dd; box-shadow: none; font-weight: 650; }
.auto-tts-toggle.enabled { color: #075f4b; background: #e3f3ed; border-color: #add3c5; }
.speech-status { color: #176b57; font-weight: 650; }
.decision-dialog { background: rgba(250,252,251,.97); border-color: rgba(255,255,255,.98); box-shadow: 0 30px 90px rgba(16,55,45,.26), inset 0 1px 0 white; -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.decision-dialog::backdrop { background: rgba(16,42,35,.32); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
@media (max-width: 980px) {
  .assistant-home { grid-template-columns: 1fr; }
  .start-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .request-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .request-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-search { grid-column: 1 / -1; }
  .clear-filters { justify-self: start; }
  .request-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body > header { height: 62px; padding: 0 14px; }
  .brand { font-size: 1rem; }
  .runtime { font-size: .7rem; }
  .header-actions { gap: 7px; }
  .user-role { max-width: 112px; padding: 6px 8px; font-size: .65rem; }
  .logout-button { padding: 7px; font-size: .65rem; }
  .auth-screen { min-height: calc(100dvh - 62px); padding: 26px 14px; }
  .auth-card { padding: 28px 23px; }
  .demo-role-wrap { font-size: .56rem; }
  .demo-role-wrap select { max-width: 92px; font-size: .62rem; }
  .header-actions .runtime { display: none; }
  .reset-app { padding: 7px; font-size: .64rem; }
  main { width: min(100% - 24px, 600px); padding-top: 30px; }
  .hero > p:not(.eyebrow) { font-size: .94rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions button { width: 100%; }
  .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; }
  .start-card, .services-card { padding: 24px 20px; }
  .start-steps { grid-template-columns: 1fr; }
  .services-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .chat-launcher { right: 12px; bottom: 12px; }
  .chat-widget { width: auto; height: min(680px, calc(100dvh - 88px)); right: 10px; bottom: 74px; left: 10px; border-radius: 18px; }
  .chat-widget.expanded { width: auto; height: 100dvh; inset: 0; border-radius: 0; }
  .chat-widget.expanded .messages { padding: 18px 14px 24px; }
  .chat-widget.expanded .message.user { padding-left: 44px; }
  .chat-widget.expanded .message.assistant { padding-right: 18px; }
  .chat-widget.expanded .composer { padding-right: 12px; padding-left: 12px; }
  .chat-widget .messages { min-height: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  #progress, #tickets, #household, #regulations, #management { padding: 22px 18px; }
  .management-notice { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .household-grid { grid-template-columns: 1fr; }
  .household-summary { flex-direction: column; }
  .request-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-toolbar { grid-template-columns: 1fr; }
  .request-search { grid-column: auto; }
  .request-toolbar > label, .request-toolbar select { width: 100%; }
  .request-results-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .request-results-heading span { max-width: 100%; text-align: left; }
  .progress-copy-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .task { grid-template-columns: 36px minmax(0, 1fr); align-items: start; }
  .task-side { grid-column: 1 / -1; display: flex; justify-content: flex-start; flex-wrap: wrap; }
  .task-side > button { flex: 1 1 160px; }
  .request-details { grid-template-columns: 1fr; }
  .request-actions { justify-content: flex-start; }
  .quick-actions { grid-template-columns: 1fr; }
  .decision-dialog form { padding: 20px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-enabled) :is(.primary-action, .service-action, .chat-launcher, .chat-launcher-icon, .chat-widget), html:not(.motion-enabled) :is(.primary-action, .start-chat-button)::after { animation: none; transition: none; }
  html:not(.motion-enabled) .fab-border-runner { animation: none !important; }
  html:not(.motion-enabled) .icon-spinner { animation-duration: 1.5s; }
  html:not(.motion-enabled) :is(.typing-dots i, .request-loading i, .task-loading i, .thinking-orbit i, .typing-step.changing), html:not(.motion-enabled) .thinking-orbit::before, html:not(.motion-enabled) .typing-scan::after { animation: none; opacity: .7; }
  html:not(.motion-enabled) .markdown-body.streaming:empty::after,
  html:not(.motion-enabled) .markdown-body.streaming > :last-child::after { animation: none; }
}

body { background-attachment: scroll; }
body > header, .tabs, .panel, .chat-widget, .chat-launcher, .chat-launcher-icon, .auth-card, .decision-dialog, .decision-dialog::backdrop, body.chat-expanded::after { -webkit-backdrop-filter: none; backdrop-filter: none; }
body > header { background: #f7faf8; }
.panel, .auth-card { background: var(--surface); border-color: var(--border-subtle); }
.tabs { background: var(--surface); border-color: var(--border-subtle); }
.primary-action, .primary-action::after, .start-chat-button::after, .chat-launcher, .chat-launcher::after, .chat-launcher-icon { animation: none; }
.hero-actions .primary-action { animation: none; background: var(--green); }
.chat-launcher { background: var(--green); }
.chat-launcher::before, .chat-launcher::after { display: none; }
.fab-running-border { display: none; }
.fab-border-runner { animation: none !important; }
.service-action { animation: none; }
button, input, select, a { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.login-form input:focus-visible, .auth-submit:focus-visible, .logout-button:focus-visible, .auth-retry:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.login-form input { border-color: var(--border-control); }
button:disabled { cursor: not-allowed; opacity: .55; }
button:active:not(:disabled) { filter: brightness(.93); }
.service-action { position: relative; padding-right: 34px; border-color: var(--border-subtle); background: var(--surface); }
.service-action::after { content: '→'; position: absolute; right: 12px; color: var(--green); }
.service-action strong { white-space: normal; font-size: .9rem; }
.service-action small { white-space: normal; font-size: .8125rem; line-height: 1.5; }
.services-heading { gap: 16px; flex-wrap: wrap; }
.browse-procedures, .procedure-retry, .procedure-empty button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--green); border-radius: 10px; background: var(--green); color: white; font-size: .875rem; font-weight: 650; }
.browse-procedures { display: inline-flex; align-items: center; gap: 12px; }
.chat-widget { grid-template-rows: auto auto minmax(0, 1fr); width: min(480px, calc(100vw - 32px)); height: min(740px, calc(100dvh - 112px)); background: var(--surface); border-color: var(--border-subtle); }
.chat-widget.expanded { width: min(1040px, calc(100vw - 48px)); }
body.chat-expanded::after { background: rgba(16,41,35,.42); }
.chat-widget-header { padding-top: max(12px, env(safe-area-inset-top)); }
.chat-widget-identity small { color: #d6e8e0; font-size: .75rem; }
.chat-expand, .chat-close { width: 44px; height: 44px; }
.chat-toolbar { padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--border-subtle); }
.chat-toolbar button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; color: var(--green); background: var(--surface); border: 1px solid var(--border-control); border-radius: 10px; font-size: .875rem; font-weight: 650; }
.chat-toolbar button:first-child { color: white; background: var(--green); border-color: var(--green); }
.chat-toolbar button:hover { background: var(--surface-soft); }
.chat-toolbar button:first-child:hover, .a2ui-button.a2ui-primary:hover { color: white; background: var(--focus); }
.chat-widget .message.assistant { padding-right: 0; }
.chat-widget .message.assistant > div:last-child { min-width: 0; width: 100%; }
.chat-widget .message.assistant .markdown-body { font-size: .9375rem; line-height: 1.65; overflow-wrap: anywhere; }
.chat-widget .message.assistant > div:last-child > strong { font-size: .8125rem; }
.chat-widget .chat-starters button, .chat-widget .speak-button { min-height: 44px; font-size: .8125rem; }
.chat-widget .chat-starters button { border-color: var(--border-control); }
.a2ui-button.a2ui-primary { color: white; background: var(--green); border-color: var(--green); }
.a2ui-actions { gap: 8px; }
.chat-widget .a2ui-card:not(:has(.a2ui-procedure)) { padding: 0; border: 0; border-radius: 0; background: transparent; }
.a2ui-surface > .a2ui-actions + .a2ui-actions { margin-top: 8px; }
.a2ui-procedure-copy { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: start; }
.a2ui-procedure-copy .a2ui-title, .a2ui-procedure-copy .a2ui-muted { grid-column: 1 / -1; }
.a2ui-requirement, .a2ui-status { padding: 3px 8px; border-radius: 6px; font-size: .75rem; line-height: 1.5; width: fit-content; }
.chat-widget:not(.expanded) .a2ui-surface { container: compact-procedures / inline-size; }
.chat-widget:not(.expanded) .a2ui-card:has(.a2ui-procedure) { padding: 0; border: 0; background: transparent; }
.chat-widget:not(.expanded) .a2ui-procedure { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 12px; }
.chat-widget:not(.expanded) .a2ui-procedure-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chat-widget:not(.expanded) .a2ui-procedure-copy .a2ui-title,
.chat-widget:not(.expanded) .a2ui-procedure-copy .a2ui-muted { flex: 0 0 100%; margin: 0; }
.chat-widget:not(.expanded) .a2ui-requirement,
.chat-widget:not(.expanded) .a2ui-status { display: inline-flex; align-items: center; flex: 0 0 auto; box-sizing: border-box; min-height: 30px; margin: 0; padding: 4px 8px; white-space: nowrap; }
.chat-widget:not(.expanded) .a2ui-status { border: 1px solid transparent; }
.chat-widget:not(.expanded) .a2ui-procedure > .a2ui-button { justify-self: stretch; align-self: stretch; width: 100%; min-height: 48px; }
@container compact-procedures (max-width: 190px) {
  .chat-widget:not(.expanded) .a2ui-procedure > .a2ui-button { min-height: 64px; }
}
.a2ui-requirement { color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border-subtle); }
.a2ui-status { color: var(--success-ink); background: var(--success-soft); }
.a2ui-procedure[data-status='needs_info'] .a2ui-status, .a2ui-procedure[data-status='rejected'] .a2ui-status { color: var(--status-error-ink); background: var(--status-error-soft); }
.composer-label { font-size: .8125rem; font-weight: 650; }
.composer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.composer-row { min-width: 0; }
.composer-row input { min-width: 0; font-size: 1rem; }
.composer-row button[type='submit'] { min-height: 44px; min-width: 56px; max-width: 104px; font-size: .875rem; }
.attach-button, .mic-button { width: 44px; height: 44px; flex-shrink: 0; }
.attachment-help { font-size: .75rem; }
.procedure-picker { min-height: 0; overflow-y: auto; padding: 24px; scroll-padding: 16px; background: var(--surface-soft); }
.choosing-procedure .chat-shell { grid-template-rows: minmax(0, 1fr); }
.picker-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.picker-heading h2 { margin: 6px 0 0; font-size: clamp(1.25rem, 3vw, 1.65rem); letter-spacing: -.03em; }
.picker-back { min-height: 44px; padding: 10px 14px; display: flex; gap: 8px; white-space: nowrap; font-size: .875rem; color: var(--green); background: var(--surface); border: 1px solid var(--border-control); border-radius: 10px; }
.picker-description { max-width: 620px; color: var(--muted); line-height: 1.6; font-size: .9375rem; }
.picker-search { display: grid; gap: 8px; margin: 20px 0 12px; font-size: .875rem; font-weight: 650; }
.picker-search input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border-control); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 1rem; }
.picker-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-filters button { min-height: 44px; padding: 10px 14px; background: var(--surface); color: var(--muted); border: 1px solid var(--border-control); border-radius: 24px; font-size: .875rem; }
.picker-filters button[aria-pressed='true'] { color: white; background: var(--ink); border-color: var(--ink); }
.procedure-status { margin: 16px 0; font-size: .875rem; color: var(--muted); }
.procedure-list .a2ui-card { padding: 0; border: 0; background: transparent; }
.procedure-list .a2ui-column:not(.a2ui-procedure-copy) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chat-widget:not(.expanded) .procedure-list .a2ui-column:not(.a2ui-procedure-copy) { grid-template-columns: minmax(0, 1fr); }
.procedure-list .a2ui-procedure { grid-template-columns: minmax(0, 1fr); align-content: start; }
.procedure-list .a2ui-procedure > .a2ui-button { justify-self: start; align-self: end; }
.procedure-list .a2ui-title { font-size: 1rem; line-height: 1.5; }
.procedure-empty { padding: 32px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--border-control); border-radius: 16px; }
.procedure-empty p { color: var(--muted); line-height: 1.6; }
.procedure-retry { margin-top: 8px; }
@media (max-width: 760px) {
  .chat-widget { width: auto; left: 10px; right: 10px; height: min(740px, calc(100dvh - 88px)); }
  .chat-widget.expanded { width: auto; height: 100dvh; inset: 0; }
  .procedure-picker { padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
  .procedure-list .a2ui-column:not(.a2ui-procedure-copy) { grid-template-columns: minmax(0, 1fr); }
  .picker-heading { flex-wrap: wrap; }
  .chat-toolbar { padding: 8px 12px; }
  .chat-toolbar button { flex: 1; padding: 10px 8px; }
  .chat-widget.expanded .message.assistant { padding-right: 0; }
  .chat-widget.expanded .message.assistant > div:last-child { max-width: calc(100% - 41px); }
  .a2ui-procedure { grid-template-columns: minmax(0, 1fr); }
  .a2ui-procedure .a2ui-button { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-enabled) *, html:not(.motion-enabled) *::before, html:not(.motion-enabled) *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.task-entry { min-height: 44px; padding: 10px 14px; border: 1px solid var(--green); border-radius: 10px; color: white; background: var(--green); font-size: .875rem; font-weight: 650; }
.task-side { gap: 8px; }
@container (max-width: 640px) {
  .task { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .task-side { grid-column: 1 / -1; display: flex; flex-wrap: wrap; }
  .task-side > button { flex: 1 1 160px; width: auto; }
  .task-side > small { flex-basis: 100%; text-align: left; }
}
.a2ui-procedure > .a2ui-button { white-space: normal; }
.chat-toolbar button { flex: 1; }
.resident-entry-dialog { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; overflow-y: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 20px; box-shadow: 0 20px 70px rgba(16,41,35,.25); }
.resident-entry-dialog::backdrop { background: rgba(16,41,35,.48); }
.entry-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.entry-heading h2 { margin: 6px 0 0; font-size: 1.5rem; }
.entry-heading button { width: 44px; height: 44px; flex-shrink: 0; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--border-control); border-radius: 10px; font-size: 1.5rem; }
.entry-context, .entry-notice { font-size: .875rem; line-height: 1.65; color: var(--muted); }
.entry-notice { padding: 12px 14px; color: #674612; background: #fff4df; border-radius: 10px; }
.entry-fields { display: grid; gap: 16px; margin: 20px 0; }
.entry-fields label { display: grid; gap: 8px; font-size: .875rem; font-weight: 650; }
.entry-fields input, .entry-fields select, .entry-fields textarea { width: 100%; min-height: 48px; padding: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-control); border-radius: 10px; font-size: 1rem; }
.entry-fields textarea { resize: vertical; }
.entry-review { margin: 20px 0; padding: 16px; background: var(--surface-soft); border: 1px solid var(--border-subtle); border-radius: 12px; }
.entry-review h3 { margin-top: 0; font-size: 1rem; }
.entry-review dl { display: grid; gap: 6px; margin: 0 0 20px; }
.entry-review dt { margin-top: 8px; color: var(--muted); font-size: .875rem; }
.entry-review dd { margin: 0; font-weight: 650; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.entry-consent { display: flex; align-items: start; gap: 12px; font-size: .9375rem; line-height: 1.6; }
.entry-consent input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--green); }
.entry-footer { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: 20px; }
.entry-footer button { min-height: 44px; padding: 12px 16px; color: var(--green); background: var(--surface); border: 1px solid var(--border-control); border-radius: 10px; font-size: .9375rem; font-weight: 650; }
.entry-footer button[type='submit'] { color: white; background: var(--green); border-color: var(--green); }
.entry-success { padding: 16px; color: var(--success-ink); background: var(--success-soft); border: 1px solid var(--border-control); border-radius: 12px; line-height: 1.6; }
.attachment-intent { margin: 4px 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.chat-widget .message.assistant.ticket-correction-message { display: block; padding-right: 0; }
.chat-widget .message.assistant.ticket-correction-message > .ticket-correction-card { width: 100%; max-width: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); }
.ticket-correction-dialog .ticket-correction-card { padding: 0; color: var(--ink); }
.ticket-correction-dialog .correction-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ticket-correction-dialog .correction-fields label:has(textarea), .ticket-correction-dialog .correction-fields .portal-help { grid-column: 1 / -1; }
.correction-chat-values dd { display: grid; gap: 6px; }
.correction-chat-values del { color: var(--muted); font-size: .8125rem; }
.ticket-correction-card [data-correction-chat-confirm] { background: #176044; border-color: #176044; color: #fff; font-weight: 700; }
.ticket-correction-card h3 { margin: 8px 0; font-size: 1rem; overflow-wrap: anywhere; }
.ticket-correction-card p { line-height: 1.6; font-size: .875rem; }
.correction-eyebrow { color: var(--green); font-size: .75rem; font-weight: 700; }
.request-draft-chat { min-width: 0; padding: 12px; margin: 12px 0; color: var(--ink); background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 16px; }
.request-draft-chat h3 { margin: 8px 0; font-size: 1rem; }
.request-draft-chat p { color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.request-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.request-draft-actions button { min-height: 44px; padding: 10px 12px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--border-control); border-radius: 12px; font-size: .8125rem; }
.request-draft-actions .portal-primary { color: var(--green); background: var(--green-soft); font-weight: 750; }
.request-draft-actions button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.request-draft-chat .field-error { color: var(--status-error-ink); }
.request-draft-schedule { display: grid; gap: 10px; margin: 12px 0; }
.request-draft-schedule-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); align-items: end; gap: 12px; }
.request-draft-schedule label { display: grid; grid-template-rows: 1fr auto; align-self: stretch; min-width: 0; gap: 6px; font-size: .8125rem; font-weight: 650; }
.request-draft-schedule label > span { align-self: end; }
.request-draft-schedule .time24-field { grid-template-rows: 1fr auto; align-self: stretch; gap: 6px; }
.request-draft-schedule .time24-field > label { display: block; align-self: end; }
.request-draft-missing { margin: 12px 0; padding: 12px; border-radius: 12px; background: var(--surface-soft); }
.request-draft-missing h4 { margin: 0 0 8px; font-size: .875rem; }
.request-draft-missing ul { display: grid; gap: 10px; margin: 0; padding-left: 18px; }
.request-draft-missing li strong, .request-draft-missing li span { display: block; font-size: .8125rem; line-height: 1.5; }
.request-draft-replies { display: grid; gap: 8px; margin: 12px 0; }
.request-draft-replies button { min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-control); border-radius: 12px; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: .8125rem; text-align: left; overflow-wrap: anywhere; }
.request-draft-document { display: grid; gap: 8px; margin: 12px 0; }
.request-draft-document img { display: block; width: 100%; max-height: 220px; object-fit: contain; border: 1px solid var(--border-control); border-radius: 12px; background: var(--surface-soft); }
.request-draft-document figcaption { color: var(--ink); font-size: .8125rem; line-height: 1.6; }
.request-draft-schedule input, .request-draft-schedule select { min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px; border: 1px solid var(--border-control); border-radius: 10px; color: var(--ink); background: var(--surface-soft); font: inherit; }
.request-draft-schedule input[type="date"] { width: 100%; max-width: 100%; }
.request-draft-schedule button { justify-self: start; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-control); border-radius: 10px; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: .8125rem; }
.request-draft-chat :is(input, select, button):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.request-draft-chat button:disabled { cursor: not-allowed; opacity: .55; }
.ticket-correction-card blockquote { margin: 12px 0; padding: 12px; border-left: 3px solid var(--status-error-solid); border-radius: 8px; background: var(--status-error-soft); color: var(--status-error-ink); }
.ticket-correction-card blockquote p { margin: 6px 0 0; }
.correction-fields { display: grid; gap: 14px; margin: 16px 0; }
.correction-fields label { display: grid; gap: 6px; font-size: .875rem; font-weight: 600; }
.correction-fields input, .correction-fields textarea, .correction-fields select { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #183b30; font: inherit; }
.correction-fields textarea { resize: vertical; }
.correction-fields input:focus-visible, .correction-fields textarea:focus-visible, .correction-fields select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.correction-review dd { display: grid; gap: 6px; overflow-wrap: anywhere; }
.correction-review del { color: var(--muted); font-size: .8125rem; }
.correction-review strong { color: #176044; }
.correction-consent { display: flex; gap: 10px; align-items: start; font-size: .875rem; line-height: 1.5; }
.correction-consent input { min-width: 20px; min-height: 20px; margin-top: 3px; }
.correction-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ticket-correction-card button { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #183b30; font: inherit; font-size: .8125rem; cursor: pointer; }
.ticket-correction-card button[type="submit"] { background: #176044; border-color: #176044; color: #fff; font-weight: 700; }
.ticket-correction-card button:disabled { opacity: .6; cursor: wait; }
.ticket-correction-card [hidden] { display: none; }
@media (max-width: 760px) {
  .ticket-correction-dialog .correction-fields { grid-template-columns: minmax(0, 1fr); }
  .resident-entry-dialog { padding: 20px 16px; }
  .entry-footer button { flex: 1; }
  .chat-toolbar button { flex: 1 1 130px; }
}

/* Keep the expanded assistant usable on short mobile viewports. */
.composer-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  max-height: 120px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-control);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
}

.composer-row textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

@media (max-width: 760px) {
  .chat-widget.expanded {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
  }

  .chat-widget.expanded .chat-shell {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .chat-widget.expanded .messages {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .chat-widget.expanded .composer {
    min-width: 0;
    padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  }

  .chat-widget.expanded .composer-row {
    grid-template-columns: 40px 40px minmax(0, 1fr) 56px;
    align-items: end;
  }

  .chat-widget.expanded .composer-row textarea {
    min-height: 44px;
    max-height: 96px;
    padding: 10px 12px;
  }

  .chat-widget.expanded .attach-button,
  .chat-widget.expanded .mic-button {
    width: 40px;
    height: 40px;
  }

  .chat-widget.expanded .composer-row > button[type='submit'] {
    min-width: 56px;
    width: 56px;
    padding: 0 8px;
  }
}
